build: init
This commit is contained in:
27
build.ts
Normal file
27
build.ts
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
export interface PackageTask {
|
||||||
|
name: string;
|
||||||
|
patchPhase?: (task: PackageTask) => void;
|
||||||
|
configurePhase?: (task: PackageTask) => void;
|
||||||
|
buildPhase?: (task: PackageTask) => void;
|
||||||
|
installPhase?: (task: PackageTask) => void;
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function buildPackage(task: PackageTask) {
|
||||||
|
if (task.patchPhase) {
|
||||||
|
console.log(`${task.name}/patchPhase`);
|
||||||
|
task.patchPhase(task);
|
||||||
|
}
|
||||||
|
if (task.configurePhase) {
|
||||||
|
console.log(`${task.name}/configurePhase`);
|
||||||
|
task.configurePhase(task);
|
||||||
|
}
|
||||||
|
if (task.buildPhase) {
|
||||||
|
console.log(`${task.name}/buildPhase`);
|
||||||
|
task.buildPhase(task);
|
||||||
|
}
|
||||||
|
if (task.installPhase) {
|
||||||
|
console.log(`${task.name}/installPhase`);
|
||||||
|
task.installPhase(task);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user