@omnia/tooling 8.0.3-vnext → 8.0.4-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.
@@ -10,9 +10,10 @@ const core = tslib_1.__importStar(require("./core"));
10
10
  exports.core = core;
11
11
  const utils = tslib_1.__importStar(require("./utils"));
12
12
  exports.utils = utils;
13
+ const del_1 = tslib_1.__importDefault(require("del"));
13
14
  tslib_1.__exportStar(require("./core"), exports);
14
15
  tslib_1.__exportStar(require("./utils"), exports);
15
- const TYPESCRIPT_VERSION = '4.9.4';
16
+ const TYPESCRIPT_VERSION = '5.0.4';
16
17
  const argv = (0, minimist_1.default)(process.argv.slice(2));
17
18
  const command = argv._[0];
18
19
  const path = require('path'), semver = require("semver"), fs = require('fs'), processPath = process.cwd().replace(/\\/g, "/"), nodeSupportedVersion = '>=12.18.4';
@@ -86,9 +87,7 @@ function initTasks() {
86
87
  }
87
88
  function build(cb) {
88
89
  printLogo();
89
- if (isExtensionEnv) {
90
- console.log(chalk_1.default.cyan(`Version ${require('@omnia/tooling/package.json').version}`));
91
- }
90
+ printVersion();
92
91
  initTasks();
93
92
  triggerBuild(cb);
94
93
  }
@@ -97,9 +96,7 @@ function clean(greeting = true) {
97
96
  return new Promise((resolve, reject) => {
98
97
  if (greeting) {
99
98
  printLogo();
100
- if (isExtensionEnv) {
101
- console.log(chalk_1.default.cyan(`Version ${require('@omnia/tooling/package.json').version}`));
102
- }
99
+ printVersion();
103
100
  }
104
101
  utils.log('Cleaning...');
105
102
  initTasks();
@@ -112,9 +109,7 @@ function clean(greeting = true) {
112
109
  exports.clean = clean;
113
110
  function serve() {
114
111
  printLogo();
115
- if (isExtensionEnv) {
116
- console.log(chalk_1.default.cyan(`Version ${require('@omnia/tooling/package.json').version}`));
117
- }
112
+ printVersion();
118
113
  utils.log('Creating hosting...');
119
114
  initTasks();
120
115
  triggerServe();
@@ -138,9 +133,7 @@ Build System
138
133
  }
139
134
  function help() {
140
135
  printLogo();
141
- if (isExtensionEnv) {
142
- console.log(chalk_1.default.cyan(`Version ${require('@omnia/tooling/package.json').version}`));
143
- }
136
+ printVersion();
144
137
  console.log(chalk_1.default.cyan(`
145
138
  Usage: omniafx [command] [args] [--options]
146
139
 
@@ -153,6 +146,12 @@ Options:
153
146
  --version, -v [boolean] show version
154
147
  `));
155
148
  }
149
+ function printVersion() {
150
+ console.log(chalk_1.default.cyan(`Typescript Version: ${require('typescript/package.json').version}`));
151
+ if (isExtensionEnv) {
152
+ console.log(chalk_1.default.cyan(`Omnia Fx Version: ${require('@omnia/tooling/package.json').version}`));
153
+ }
154
+ }
156
155
  /********************* Execute ***********************/
157
156
  async function run() {
158
157
  validate();
@@ -160,6 +159,9 @@ async function run() {
160
159
  if (process.argv.length > 0 && process.argv.find(argv => argv === "--clean") !== undefined) {
161
160
  await clean(false);
162
161
  }
162
+ else if (process.argv.length > 0 && process.argv.find(argv => argv === "--package") !== undefined) {
163
+ del_1.default.sync("wwwroot/packages/temp");
164
+ }
163
165
  build();
164
166
  }
165
167
  else if (command === "serve" || argv.serve) {
@@ -22,4 +22,5 @@ declare function log(message: any, type?: LogTypes, writeToClient?: boolean): vo
22
22
  declare function logTime(message: string, start: number): void;
23
23
  declare function registerLogToClient(handler: (message: string, logType?: LogTypes) => void): void;
24
24
  declare function ensureTraillingSlash(path: string): string;
25
+ export declare function asyncForEach<T>(array: Array<T>, callback: (item: T, index?: number, items?: Array<T>) => Promise<void>): Promise<void>;
25
26
  export { ensureTraillingSlash, registerLogToClient, rewriteFile, getCurrentDateTime, timeWatch, root, isValidGuid, isNull, isNullOrEmpty, getDirectories, getGuidValue, getFileName, logTime, log, LogTypes };
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LogTypes = exports.log = exports.logTime = exports.getFileName = exports.getGuidValue = exports.getDirectories = exports.isNullOrEmpty = exports.isNull = exports.isValidGuid = exports.root = exports.timeWatch = exports.getCurrentDateTime = exports.rewriteFile = exports.registerLogToClient = exports.ensureTraillingSlash = exports.generateGuid = void 0;
3
+ exports.LogTypes = exports.log = exports.logTime = exports.getFileName = exports.getGuidValue = exports.getDirectories = exports.isNullOrEmpty = exports.isNull = exports.isValidGuid = exports.root = exports.timeWatch = exports.getCurrentDateTime = exports.rewriteFile = exports.registerLogToClient = exports.ensureTraillingSlash = exports.asyncForEach = exports.generateGuid = void 0;
4
4
  let path = require('path'), fs = require('fs'), timestamp = require('console-timestamp'), chalk = require('chalk'), _timer = {};
5
5
  let _logToClientHandler = null;
6
6
  var LogTypes;
@@ -143,7 +143,7 @@ function getFileName(source) {
143
143
  return null;
144
144
  }
145
145
  exports.getFileName = getFileName;
146
- function log(message, type, writeToClient = false) {
146
+ function log(message, type = LogTypes.HeadLine, writeToClient = false) {
147
147
  if (type === LogTypes.HeadLine) {
148
148
  console.log(timestamp('[hh:mm:ss] ') + chalk.cyan(message));
149
149
  }
@@ -176,3 +176,9 @@ function ensureTraillingSlash(path) {
176
176
  return path.replace(/\/$|$/, '/');
177
177
  }
178
178
  exports.ensureTraillingSlash = ensureTraillingSlash;
179
+ async function asyncForEach(array, callback) {
180
+ for (let index = 0; index < array.length; index++) {
181
+ await callback(array[index], index, array);
182
+ }
183
+ }
184
+ exports.asyncForEach = asyncForEach;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@omnia/tooling",
3
3
  "license": "MIT",
4
- "version": "8.0.3-vnext",
4
+ "version": "8.0.4-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,18 +26,18 @@
26
26
  },
27
27
  "main": "index.js",
28
28
  "dependencies": {
29
- "@omnia/types": "8.0.3-vnext",
29
+ "@omnia/types": "8.0.4-dev",
30
30
  "@types/node": "18.13.0",
31
- "tslib": "2.3.1",
32
- "typescript": "4.9.4",
33
- "semver": "6.3.0",
31
+ "tslib": "2.5.0",
32
+ "typescript": "5.0.4",
33
+ "semver": "7.5.3",
34
34
  "chalk": " 2.3.0",
35
35
  "chokidar": "3.5.2",
36
36
  "console-timestamp": "0.3.0",
37
37
  "minimist": "1.2.6",
38
- "globby": "6.1.0",
38
+ "globby": "13.1.4",
39
39
  "figlet": "1.5.2",
40
- "esbuild": "0.17.8",
40
+ "esbuild": "0.17.19",
41
41
  "esbuild-loader": "3.0.1"
42
42
  },
43
43
  "typings": "./index.d.ts",