@omnia/tooling 8.0.103-dev → 8.0.104-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,7 @@ import * as utils from './utils';
|
|
4
4
|
export * from "./core";
|
5
5
|
export * from "./utils";
|
6
6
|
export { core, utils };
|
7
|
+
export declare const isServing: any;
|
7
8
|
export declare function build(cb?: any): void;
|
8
9
|
export declare function clean(greeting?: boolean): Promise<void>;
|
9
10
|
export declare function serve(): void;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
2
|
'use strict';
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
exports.registerEsbuild = exports.run = exports.serve = exports.clean = exports.build = exports.utils = exports.core = void 0;
|
4
|
+
exports.registerEsbuild = exports.run = exports.serve = exports.clean = exports.build = exports.isServing = exports.utils = exports.core = void 0;
|
5
5
|
const tslib_1 = require("tslib");
|
6
6
|
const figlet_1 = tslib_1.__importDefault(require("figlet"));
|
7
7
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
@@ -17,7 +17,38 @@ const TYPESCRIPT_VERSION = '5.3.3';
|
|
17
17
|
const argv = (0, minimist_1.default)(process.argv.slice(2));
|
18
18
|
const command = argv._[0];
|
19
19
|
const path = require('path'), semver = require("semver"), fs = require('fs'), processPath = process.cwd().replace(/\\/g, "/"), nodeSupportedVersion = '>=12.18.4';
|
20
|
-
|
20
|
+
const isExtensionEnv = fs.existsSync(process.cwd() + "/node_modules/@omnia/tooling/package.json");
|
21
|
+
exports.isServing = command === "serve" || argv.serve;
|
22
|
+
function build(cb) {
|
23
|
+
printLogo();
|
24
|
+
printVersion();
|
25
|
+
initTasks();
|
26
|
+
triggerBuild(cb);
|
27
|
+
}
|
28
|
+
exports.build = build;
|
29
|
+
function clean(greeting = true) {
|
30
|
+
return new Promise((resolve, reject) => {
|
31
|
+
if (greeting) {
|
32
|
+
printLogo();
|
33
|
+
printVersion();
|
34
|
+
}
|
35
|
+
utils.log('Cleaning...');
|
36
|
+
initTasks();
|
37
|
+
triggerClean(() => {
|
38
|
+
utils.log('Done clean.');
|
39
|
+
resolve();
|
40
|
+
});
|
41
|
+
});
|
42
|
+
}
|
43
|
+
exports.clean = clean;
|
44
|
+
function serve() {
|
45
|
+
printLogo();
|
46
|
+
printVersion();
|
47
|
+
utils.log('Creating hosting...');
|
48
|
+
initTasks();
|
49
|
+
triggerServe();
|
50
|
+
}
|
51
|
+
exports.serve = serve;
|
21
52
|
function validateNodeSupportVersion() {
|
22
53
|
if (!semver.satisfies(process.version, nodeSupportedVersion)) {
|
23
54
|
throw new Error(`Your dev environment is running NodeJS version ${process.version} which does`
|
@@ -85,36 +116,6 @@ function initTasks() {
|
|
85
116
|
core.registerTSConfig();
|
86
117
|
loadTasks();
|
87
118
|
}
|
88
|
-
function build(cb) {
|
89
|
-
printLogo();
|
90
|
-
printVersion();
|
91
|
-
initTasks();
|
92
|
-
triggerBuild(cb);
|
93
|
-
}
|
94
|
-
exports.build = build;
|
95
|
-
function clean(greeting = true) {
|
96
|
-
return new Promise((resolve, reject) => {
|
97
|
-
if (greeting) {
|
98
|
-
printLogo();
|
99
|
-
printVersion();
|
100
|
-
}
|
101
|
-
utils.log('Cleaning...');
|
102
|
-
initTasks();
|
103
|
-
triggerClean(() => {
|
104
|
-
utils.log('Done clean.');
|
105
|
-
resolve();
|
106
|
-
});
|
107
|
-
});
|
108
|
-
}
|
109
|
-
exports.clean = clean;
|
110
|
-
function serve() {
|
111
|
-
printLogo();
|
112
|
-
printVersion();
|
113
|
-
utils.log('Creating hosting...');
|
114
|
-
initTasks();
|
115
|
-
triggerServe();
|
116
|
-
}
|
117
|
-
exports.serve = serve;
|
118
119
|
function handleException(err) {
|
119
120
|
console.log(err);
|
120
121
|
throw new Error("Exit, have an exception.");
|
@@ -164,7 +165,7 @@ async function run() {
|
|
164
165
|
}
|
165
166
|
build();
|
166
167
|
}
|
167
|
-
else if (
|
168
|
+
else if (exports.isServing) {
|
168
169
|
if (process.argv.length > 0 && process.argv.find(argv => argv === "--clean") !== undefined) {
|
169
170
|
await clean(false);
|
170
171
|
}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@omnia/tooling",
|
3
3
|
"license": "MIT",
|
4
|
-
"version": "8.0.
|
4
|
+
"version": "8.0.104-dev",
|
5
5
|
"description": "Provide basic stuffs extensible for omnia extension.",
|
6
6
|
"scripts": {
|
7
7
|
"test": "echo \"Error: no test specified\" && exit 1"
|
@@ -26,7 +26,7 @@
|
|
26
26
|
},
|
27
27
|
"main": "index.js",
|
28
28
|
"dependencies": {
|
29
|
-
"@omnia/types": "8.0.
|
29
|
+
"@omnia/types": "8.0.104-dev",
|
30
30
|
"@types/node": "18.13.0",
|
31
31
|
"tslib": "2.6.2",
|
32
32
|
"typescript": "5.3.3",
|
@@ -37,7 +37,7 @@
|
|
37
37
|
"minimist": "1.2.6",
|
38
38
|
"globby": "13.1.4",
|
39
39
|
"figlet": "1.5.2",
|
40
|
-
"esbuild": "0.19.
|
40
|
+
"esbuild": "0.19.11",
|
41
41
|
"esbuild-loader": "3.0.1"
|
42
42
|
},
|
43
43
|
"typings": "./index.d.ts",
|