@nizza/devkit 0.1.0-alpha.1 → 0.1.0-alpha.11
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.
- package/dist/cjs/executors/deploy/helpers.cjs +26 -0
- package/dist/cjs/executors/deploy/index.cjs +22 -0
- package/dist/cjs/executors/environments/helpers.cjs +62 -0
- package/dist/cjs/executors/environments/index.cjs +60 -0
- package/dist/cjs/executors/publish/helpers.cjs +51 -0
- package/dist/cjs/executors/publish/index.cjs +53 -0
- package/dist/cjs/executors/shared/utils.cjs +67 -0
- package/dist/cjs/executors/update-executors-file/helpers.cjs +64 -0
- package/dist/cjs/executors/update-executors-file/index.cjs +38 -0
- package/dist/cjs/executors/vtex-link/constants.cjs +9 -0
- package/dist/cjs/executors/vtex-link/helpers.cjs +206 -0
- package/dist/cjs/executors/vtex-link/index.cjs +30 -0
- package/dist/cjs/index.cjs +56 -0
- package/dist/cjs/scripts/changeset-pre-mode.cjs +41 -0
- package/dist/cjs/scripts/index.cjs +7 -0
- package/dist/cjs/shared/logger.cjs +98 -0
- package/dist/cjs/shared/utils.cjs +36 -0
- package/dist/cjs/vite-utils/config-builder/configs/app.cjs +13 -0
- package/dist/cjs/vite-utils/config-builder/configs/base.cjs +58 -0
- package/dist/cjs/vite-utils/config-builder/configs/index.cjs +36 -0
- package/dist/cjs/vite-utils/config-builder/configs/lib.cjs +57 -0
- package/dist/cjs/vite-utils/config-builder/configs/script.cjs +46 -0
- package/dist/cjs/vite-utils/config-builder/main.cjs +42 -0
- package/dist/cjs/vite-utils/config-builder/plugins.cjs +93 -0
- package/dist/cjs/vite-utils/config-builder/shared/types.cjs +33 -0
- package/dist/cjs/vite-utils/config-builder/shared/utils/helpers.cjs +115 -0
- package/dist/cjs/vite-utils/config-builder/shared/utils/projectConfig.cjs +114 -0
- package/dist/cjs/vite-utils/config-builder/shared/utils/viteCommand.cjs +59 -0
- package/dist/{src/vite/plugins/shadow-dom-inject-css/index.js → cjs/vite-utils/plugins/shadow-dom-inject-css/index.cjs} +4 -19
- package/dist/{src/vite/plugins/third-party-css-inject/main.js → cjs/vite-utils/plugins/third-party-css-inject/main.cjs} +13 -14
- package/dist/{src/vite/plugins/third-party-css-inject/utils.js → cjs/vite-utils/plugins/third-party-css-inject/utils.cjs} +9 -21
- package/dist/esm/executors/deploy/helpers.mjs +22 -0
- package/dist/esm/executors/deploy/index.mjs +20 -0
- package/dist/esm/executors/deploy/schema.json +41 -0
- package/dist/esm/executors/environments/helpers.mjs +58 -0
- package/dist/esm/executors/environments/index.mjs +58 -0
- package/dist/esm/executors/environments/schema.json +9 -0
- package/dist/esm/executors/publish/helpers.mjs +48 -0
- package/dist/esm/executors/publish/index.mjs +51 -0
- package/dist/esm/executors/publish/schema.json +19 -0
- package/dist/esm/executors/shared/utils.mjs +62 -0
- package/dist/esm/executors/update-executors-file/helpers.mjs +59 -0
- package/dist/esm/executors/update-executors-file/index.mjs +36 -0
- package/dist/esm/executors/update-executors-file/schema.json +9 -0
- package/dist/esm/executors/vtex-link/constants.mjs +5 -0
- package/dist/esm/executors/vtex-link/helpers.mjs +192 -0
- package/dist/esm/executors/vtex-link/index.mjs +28 -0
- package/dist/esm/executors/vtex-link/schema.json +25 -0
- package/dist/esm/index.mjs +12 -0
- package/dist/esm/scripts/changeset-pre-mode.mjs +39 -0
- package/dist/esm/scripts/index.mjs +1 -0
- package/dist/{src/logger.js → esm/shared/logger.mjs} +28 -39
- package/dist/esm/shared/utils.mjs +33 -0
- package/dist/esm/vite-utils/config-builder/configs/app.mjs +11 -0
- package/dist/{src/vite/config-builder/configs/base.js → esm/vite-utils/config-builder/configs/base.mjs} +23 -22
- package/dist/esm/vite-utils/config-builder/configs/index.mjs +30 -0
- package/dist/{src/vite/config-builder/configs/lib.js → esm/vite-utils/config-builder/configs/lib.mjs} +16 -18
- package/dist/esm/vite-utils/config-builder/configs/script.mjs +44 -0
- package/dist/esm/vite-utils/config-builder/main.mjs +40 -0
- package/dist/esm/vite-utils/config-builder/plugins.mjs +87 -0
- package/dist/{src/vite/config-builder/shared/types.js → esm/vite-utils/config-builder/shared/types.mjs} +2 -27
- package/dist/{src/vite/config-builder/shared/utils/helpers.d.ts → esm/vite-utils/config-builder/shared/utils/helpers.mjs} +33 -24
- package/dist/esm/vite-utils/config-builder/shared/utils/projectConfig.mjs +109 -0
- package/dist/esm/vite-utils/config-builder/shared/utils/viteCommand.mjs +56 -0
- package/dist/esm/vite-utils/plugins/shadow-dom-inject-css/index.mjs +27 -0
- package/dist/esm/vite-utils/plugins/third-party-css-inject/main.mjs +45 -0
- package/dist/esm/vite-utils/plugins/third-party-css-inject/utils.mjs +97 -0
- package/dist/index.d.ts +367 -0
- package/executors.json +29 -0
- package/package.json +52 -6
- package/dist/package.json +0 -13
- package/dist/src/executors/deploy/executor.d.ts +0 -11
- package/dist/src/executors/deploy/executor.d.ts.map +0 -1
- package/dist/src/executors/deploy/executor.js +0 -27
- package/dist/src/executors/deploy/helpers.d.ts +0 -4
- package/dist/src/executors/deploy/helpers.d.ts.map +0 -1
- package/dist/src/executors/deploy/helpers.js +0 -40
- package/dist/src/executors/environments/executor.d.ts +0 -16
- package/dist/src/executors/environments/executor.d.ts.map +0 -1
- package/dist/src/executors/environments/executor.js +0 -59
- package/dist/src/executors/environments/helpers.d.ts +0 -21
- package/dist/src/executors/environments/helpers.d.ts.map +0 -1
- package/dist/src/executors/environments/helpers.js +0 -63
- package/dist/src/executors/publish/executor.d.ts +0 -12
- package/dist/src/executors/publish/executor.d.ts.map +0 -1
- package/dist/src/executors/publish/executor.js +0 -58
- package/dist/src/executors/publish/helpers.d.ts +0 -19
- package/dist/src/executors/publish/helpers.d.ts.map +0 -1
- package/dist/src/executors/publish/helpers.js +0 -52
- package/dist/src/executors/shared/index.d.ts +0 -3
- package/dist/src/executors/shared/index.d.ts.map +0 -1
- package/dist/src/executors/shared/index.js +0 -7
- package/dist/src/executors/shared/types.d.ts +0 -4
- package/dist/src/executors/shared/types.d.ts.map +0 -1
- package/dist/src/executors/shared/types.js +0 -4
- package/dist/src/executors/shared/utils.d.ts +0 -34
- package/dist/src/executors/shared/utils.d.ts.map +0 -1
- package/dist/src/executors/shared/utils.js +0 -74
- package/dist/src/executors/update-executors-file/executor.d.ts +0 -12
- package/dist/src/executors/update-executors-file/executor.d.ts.map +0 -1
- package/dist/src/executors/update-executors-file/executor.js +0 -46
- package/dist/src/executors/update-executors-file/helpers.d.ts +0 -24
- package/dist/src/executors/update-executors-file/helpers.d.ts.map +0 -1
- package/dist/src/executors/update-executors-file/helpers.js +0 -70
- package/dist/src/executors/update-executors-file/types.d.ts +0 -14
- package/dist/src/executors/update-executors-file/types.d.ts.map +0 -1
- package/dist/src/executors/update-executors-file/types.js +0 -4
- package/dist/src/executors/vtex-link/constants.d.ts +0 -4
- package/dist/src/executors/vtex-link/constants.d.ts.map +0 -1
- package/dist/src/executors/vtex-link/constants.js +0 -24
- package/dist/src/executors/vtex-link/executor.d.ts +0 -5
- package/dist/src/executors/vtex-link/executor.d.ts.map +0 -1
- package/dist/src/executors/vtex-link/executor.js +0 -35
- package/dist/src/executors/vtex-link/helpers.d.ts +0 -77
- package/dist/src/executors/vtex-link/helpers.d.ts.map +0 -1
- package/dist/src/executors/vtex-link/helpers.js +0 -187
- package/dist/src/executors/vtex-link/types.d.ts +0 -12
- package/dist/src/executors/vtex-link/types.d.ts.map +0 -1
- package/dist/src/executors/vtex-link/types.js +0 -4
- package/dist/src/index.d.ts +0 -2
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -6
- package/dist/src/logger.d.ts +0 -34
- package/dist/src/logger.d.ts.map +0 -1
- package/dist/src/scripts/changeset-pre-mode.d.ts +0 -2
- package/dist/src/scripts/changeset-pre-mode.d.ts.map +0 -1
- package/dist/src/scripts/changeset-pre-mode.js +0 -41
- package/dist/src/shared/index.d.ts +0 -2
- package/dist/src/shared/index.d.ts.map +0 -1
- package/dist/src/shared/index.js +0 -6
- package/dist/src/shared/utils.d.ts +0 -11
- package/dist/src/shared/utils.d.ts.map +0 -1
- package/dist/src/shared/utils.js +0 -22
- package/dist/src/vite/config-builder/configs/app.d.ts +0 -4
- package/dist/src/vite/config-builder/configs/app.d.ts.map +0 -1
- package/dist/src/vite/config-builder/configs/app.js +0 -19
- package/dist/src/vite/config-builder/configs/base.d.ts +0 -4
- package/dist/src/vite/config-builder/configs/base.d.ts.map +0 -1
- package/dist/src/vite/config-builder/configs/index.d.ts +0 -7
- package/dist/src/vite/config-builder/configs/index.d.ts.map +0 -1
- package/dist/src/vite/config-builder/configs/index.js +0 -28
- package/dist/src/vite/config-builder/configs/lib.d.ts +0 -4
- package/dist/src/vite/config-builder/configs/lib.d.ts.map +0 -1
- package/dist/src/vite/config-builder/configs/script.d.ts +0 -4
- package/dist/src/vite/config-builder/configs/script.d.ts.map +0 -1
- package/dist/src/vite/config-builder/configs/script.js +0 -42
- package/dist/src/vite/config-builder/index.d.ts +0 -3
- package/dist/src/vite/config-builder/index.d.ts.map +0 -1
- package/dist/src/vite/config-builder/index.js +0 -7
- package/dist/src/vite/config-builder/main.d.ts +0 -10
- package/dist/src/vite/config-builder/main.d.ts.map +0 -1
- package/dist/src/vite/config-builder/main.js +0 -37
- package/dist/src/vite/config-builder/plugins.d.ts +0 -30
- package/dist/src/vite/config-builder/plugins.d.ts.map +0 -1
- package/dist/src/vite/config-builder/plugins.js +0 -88
- package/dist/src/vite/config-builder/shared/index.d.ts +0 -3
- package/dist/src/vite/config-builder/shared/index.d.ts.map +0 -1
- package/dist/src/vite/config-builder/shared/index.js +0 -7
- package/dist/src/vite/config-builder/shared/types.d.ts +0 -155
- package/dist/src/vite/config-builder/shared/types.d.ts.map +0 -1
- package/dist/src/vite/config-builder/shared/utils/helpers.d.ts.map +0 -1
- package/dist/src/vite/config-builder/shared/utils/helpers.js +0 -61
- package/dist/src/vite/config-builder/shared/utils/index.d.ts +0 -4
- package/dist/src/vite/config-builder/shared/utils/index.d.ts.map +0 -1
- package/dist/src/vite/config-builder/shared/utils/index.js +0 -8
- package/dist/src/vite/config-builder/shared/utils/projectConfig.d.ts +0 -60
- package/dist/src/vite/config-builder/shared/utils/projectConfig.d.ts.map +0 -1
- package/dist/src/vite/config-builder/shared/utils/projectConfig.js +0 -85
- package/dist/src/vite/config-builder/shared/utils/viteCommand.d.ts +0 -24
- package/dist/src/vite/config-builder/shared/utils/viteCommand.d.ts.map +0 -1
- package/dist/src/vite/config-builder/shared/utils/viteCommand.js +0 -54
- package/dist/src/vite/index.d.ts +0 -3
- package/dist/src/vite/index.d.ts.map +0 -1
- package/dist/src/vite/index.js +0 -7
- package/dist/src/vite/plugins/index.d.ts +0 -3
- package/dist/src/vite/plugins/index.d.ts.map +0 -1
- package/dist/src/vite/plugins/index.js +0 -7
- package/dist/src/vite/plugins/shadow-dom-inject-css/index.d.ts +0 -8
- package/dist/src/vite/plugins/shadow-dom-inject-css/index.d.ts.map +0 -1
- package/dist/src/vite/plugins/third-party-css-inject/index.d.ts +0 -4
- package/dist/src/vite/plugins/third-party-css-inject/index.d.ts.map +0 -1
- package/dist/src/vite/plugins/third-party-css-inject/index.js +0 -13
- package/dist/src/vite/plugins/third-party-css-inject/main.d.ts +0 -17
- package/dist/src/vite/plugins/third-party-css-inject/main.d.ts.map +0 -1
- package/dist/src/vite/plugins/third-party-css-inject/utils.d.ts +0 -5
- package/dist/src/vite/plugins/third-party-css-inject/utils.d.ts.map +0 -1
- /package/dist/{src → cjs}/executors/deploy/schema.json +0 -0
- /package/dist/{src → cjs}/executors/environments/schema.json +0 -0
- /package/dist/{src → cjs}/executors/publish/schema.json +0 -0
- /package/dist/{src → cjs}/executors/update-executors-file/schema.json +0 -0
- /package/dist/{src → cjs}/executors/vtex-link/schema.json +0 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var path = require('path');
|
|
4
|
+
var utils = require('../shared/utils.cjs');
|
|
5
|
+
var helpers = require('./helpers.cjs');
|
|
6
|
+
|
|
7
|
+
const VTEX_PROJECT_PATH = process.env.NZ_VTEX_PROJECT;
|
|
8
|
+
async function runExecutor(opts, ctx) {
|
|
9
|
+
try {
|
|
10
|
+
const { rollback, skipLink, packageOrg } = opts;
|
|
11
|
+
const projectName = ctx.projectName || '';
|
|
12
|
+
helpers.validateEnvironment();
|
|
13
|
+
const projectConfig = utils.getProjectConfig(ctx);
|
|
14
|
+
const projectRoot = projectConfig.root;
|
|
15
|
+
const vtexProjectPath = path.resolve(VTEX_PROJECT_PATH, 'react');
|
|
16
|
+
const sharedContext = {
|
|
17
|
+
packageOrg,
|
|
18
|
+
projectRoot,
|
|
19
|
+
projectName,
|
|
20
|
+
vtexProjectPath
|
|
21
|
+
};
|
|
22
|
+
if (rollback) return await helpers.performRollback(sharedContext);
|
|
23
|
+
await helpers.buildAndLink(sharedContext, skipLink);
|
|
24
|
+
return utils.ok();
|
|
25
|
+
} catch (error) {
|
|
26
|
+
return utils.err(error);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
module.exports = runExecutor;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./executors/deploy/index.cjs');
|
|
4
|
+
var index$1 = require('./executors/environments/index.cjs');
|
|
5
|
+
var index$2 = require('./executors/publish/index.cjs');
|
|
6
|
+
var index$3 = require('./executors/update-executors-file/index.cjs');
|
|
7
|
+
var index$4 = require('./executors/vtex-link/index.cjs');
|
|
8
|
+
var main = require('./vite-utils/config-builder/main.cjs');
|
|
9
|
+
var types = require('./vite-utils/config-builder/shared/types.cjs');
|
|
10
|
+
var helpers = require('./vite-utils/config-builder/shared/utils/helpers.cjs');
|
|
11
|
+
var projectConfig = require('./vite-utils/config-builder/shared/utils/projectConfig.cjs');
|
|
12
|
+
var viteCommand = require('./vite-utils/config-builder/shared/utils/viteCommand.cjs');
|
|
13
|
+
var main$1 = require('./vite-utils/plugins/third-party-css-inject/main.cjs');
|
|
14
|
+
var index$5 = require('./vite-utils/plugins/shadow-dom-inject-css/index.cjs');
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
exports.deployExecutor = index;
|
|
19
|
+
exports.environmentsExecutor = index$1;
|
|
20
|
+
exports.publishExecutor = index$2;
|
|
21
|
+
exports.updateExecutorsFileExecutor = index$3;
|
|
22
|
+
exports.vtexLinkExecutor = index$4;
|
|
23
|
+
exports.createConfigBuilder = main.createConfigBuilder;
|
|
24
|
+
Object.defineProperty(exports, 'Flag', {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () { return types.Flag; }
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports, 'ProjectType', {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function () { return types.ProjectType; }
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(exports, 'Stage', {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () { return types.Stage; }
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, 'Target', {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () { return types.Target; }
|
|
39
|
+
});
|
|
40
|
+
Object.defineProperty(exports, 'ViteMode', {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
get: function () { return types.ViteMode; }
|
|
43
|
+
});
|
|
44
|
+
exports.chunkName = helpers.chunkName;
|
|
45
|
+
exports.deepMerge = helpers.deepMerge;
|
|
46
|
+
exports.getNxTsConfigPaths = helpers.getNxTsConfigPaths;
|
|
47
|
+
exports.getPlugins = helpers.getPlugins;
|
|
48
|
+
exports.when = helpers.when;
|
|
49
|
+
exports.getExternalDependencies = projectConfig.getExternalDependencies;
|
|
50
|
+
exports.getInitials = projectConfig.getInitials;
|
|
51
|
+
exports.initializeConfig = projectConfig.initializeConfig;
|
|
52
|
+
exports.mergeConfigs = projectConfig.mergeConfigs;
|
|
53
|
+
exports.getViteCmdFlags = viteCommand.getViteCmdFlags;
|
|
54
|
+
exports.getViteCommand = viteCommand.getViteCommand;
|
|
55
|
+
exports.thirdPartyCssInjectPlugin = main$1.thirdPartyCssInjectPlugin;
|
|
56
|
+
exports.injectCssIntoShadowDom = index$5.injectCssIntoShadowDom;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var devkit = require('@nx/devkit');
|
|
4
|
+
var child_process = require('child_process');
|
|
5
|
+
var promises = require('fs/promises');
|
|
6
|
+
var path = require('path');
|
|
7
|
+
var util = require('util');
|
|
8
|
+
|
|
9
|
+
const execAsync = util.promisify(child_process.exec);
|
|
10
|
+
const changesetDir = path.resolve('.changeset');
|
|
11
|
+
const preJsonPath = path.resolve(changesetDir, 'pre.json');
|
|
12
|
+
let preJson;
|
|
13
|
+
async function main() {
|
|
14
|
+
try {
|
|
15
|
+
const data = await promises.readFile(preJsonPath, 'utf8');
|
|
16
|
+
preJson = JSON.parse(data);
|
|
17
|
+
} catch {
|
|
18
|
+
preJson = {
|
|
19
|
+
mode: 'exit'
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
// Execute "version" command using @changeset/cli
|
|
23
|
+
try {
|
|
24
|
+
const { mode } = preJson;
|
|
25
|
+
if (mode === 'exit') {
|
|
26
|
+
const command = `pnpm changeset pre enter beta`;
|
|
27
|
+
const { stdout, stderr } = await execAsync(command);
|
|
28
|
+
devkit.logger.info(stdout);
|
|
29
|
+
devkit.logger.info(stderr);
|
|
30
|
+
devkit.logger.info(`🚀 Successfully enter prerelease mode`);
|
|
31
|
+
} else {
|
|
32
|
+
devkit.logger.info(`🚀 Prerelease mode has been previously entered`);
|
|
33
|
+
}
|
|
34
|
+
} catch (error) {
|
|
35
|
+
devkit.logger.error('❌ An error occurred!');
|
|
36
|
+
throw error;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
main();
|
|
40
|
+
|
|
41
|
+
exports.main = main;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chalk = require('chalk');
|
|
4
|
+
var R = require('ramda');
|
|
5
|
+
|
|
6
|
+
exports.LogLevel = void 0;
|
|
7
|
+
(function(LogLevel) {
|
|
8
|
+
LogLevel[LogLevel["ERROR"] = 0] = "ERROR";
|
|
9
|
+
LogLevel[LogLevel["WARN"] = 1] = "WARN";
|
|
10
|
+
LogLevel[LogLevel["INFO"] = 2] = "INFO";
|
|
11
|
+
LogLevel[LogLevel["DEBUG"] = 3] = "DEBUG";
|
|
12
|
+
})(exports.LogLevel || (exports.LogLevel = {}));
|
|
13
|
+
// Default log level
|
|
14
|
+
exports.currentLogLevel = 2;
|
|
15
|
+
/**
|
|
16
|
+
* Object mapping log levels to console log functions.
|
|
17
|
+
*
|
|
18
|
+
* @constant {Object} logFunctions
|
|
19
|
+
*/ const logFunctions = {
|
|
20
|
+
[0]: console.error,
|
|
21
|
+
[1]: console.warn,
|
|
22
|
+
[2]: console.info,
|
|
23
|
+
[3]: console.debug
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Object mapping log levels to chalk color functions.
|
|
27
|
+
*
|
|
28
|
+
* @constant {Object} colorFunctions
|
|
29
|
+
*/ const colorFunctions = {
|
|
30
|
+
[0]: chalk.red,
|
|
31
|
+
[1]: chalk.yellow,
|
|
32
|
+
[2]: chalk.blue,
|
|
33
|
+
[3]: chalk.magenta
|
|
34
|
+
};
|
|
35
|
+
const getLogLevelKey = (value)=>{
|
|
36
|
+
return Object.keys(exports.LogLevel).find((key)=>exports.LogLevel[key] === value);
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Sets the log level for the logger.
|
|
40
|
+
* Only logs at this level and above will be displayed.
|
|
41
|
+
*
|
|
42
|
+
* @param {LogLevel} level - The log level to set.
|
|
43
|
+
* @example
|
|
44
|
+
* // Set log level to WARN
|
|
45
|
+
* setLogLevel(LogLevel.WARN);
|
|
46
|
+
*
|
|
47
|
+
* // Now only WARN and ERROR logs will be displayed
|
|
48
|
+
* logger.debug('Debug message'); // Will not be logged
|
|
49
|
+
* logger.info('Info message'); // Will not be logged
|
|
50
|
+
* logger.warn('Warn message'); // Will be logged
|
|
51
|
+
* logger.error('Error message'); // Will be logged
|
|
52
|
+
*/ const setLogLevel = (level)=>{
|
|
53
|
+
exports.currentLogLevel = level;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Takes a list of arguments, stringifies each argument, and joins
|
|
57
|
+
* them with a newline character.
|
|
58
|
+
*
|
|
59
|
+
* @param {any[]} args - The arguments to process.
|
|
60
|
+
* @returns {string} - The processed string.
|
|
61
|
+
*/ const processArgs = R.pipe(R.map((arg)=>JSON.stringify(arg, null, 2)), R.join('\n'));
|
|
62
|
+
/**
|
|
63
|
+
* Formats the log message with a timestamp, log level, and any additional variables.
|
|
64
|
+
*
|
|
65
|
+
* @param {LogLevel} level - The log level.
|
|
66
|
+
* @param {string} message - The message to log.
|
|
67
|
+
* @param {any[]} rest - Any additional variables to log.
|
|
68
|
+
* @returns {string} - The formatted log message.
|
|
69
|
+
*/ const formatMessage = (level, message, ...rest)=>{
|
|
70
|
+
const levelKey = getLogLevelKey(level);
|
|
71
|
+
const timestamp = `${new Date().toLocaleTimeString()}`;
|
|
72
|
+
const formattedRest = rest.length ? `\n${processArgs(rest)}` : '';
|
|
73
|
+
return `${timestamp} [${levelKey}] ${message}${formattedRest}`;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Generates a log function for a specific log level.
|
|
77
|
+
*
|
|
78
|
+
* @param {LogLevel} level - The log level.
|
|
79
|
+
* @returns - The log function.
|
|
80
|
+
*/ const log = (level)=>(message, ...rest)=>{
|
|
81
|
+
if (level > exports.currentLogLevel) return; // Skip logging if level is below the current log level
|
|
82
|
+
const pipeline = R.pipe(()=>formatMessage(level, message, ...rest), colorFunctions[level], logFunctions[level]);
|
|
83
|
+
const errPipeline = R.pipe((err)=>`Failed to log message: ${err.message}`, colorFunctions[0], logFunctions[0]);
|
|
84
|
+
try {
|
|
85
|
+
pipeline();
|
|
86
|
+
} catch (err) {
|
|
87
|
+
errPipeline(err);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
const logger = {
|
|
91
|
+
error: log(0),
|
|
92
|
+
warn: log(1),
|
|
93
|
+
info: log(2),
|
|
94
|
+
debug: log(3)
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
exports.logger = logger;
|
|
98
|
+
exports.setLogLevel = setLogLevel;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var devkit = require('@nx/devkit');
|
|
4
|
+
var crypto = require('crypto');
|
|
5
|
+
var fs = require('fs');
|
|
6
|
+
var path = require('path');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Reads and parses the package.json file from the given project path.
|
|
10
|
+
*
|
|
11
|
+
* @param {string} projectPath - The path to the project.
|
|
12
|
+
* @returns {Record<string, any>} - The parsed package.json data.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* const pkgJsonData = getPkgJson('/path/to/project');
|
|
16
|
+
*/ const getPkgJson = (projectPath)=>{
|
|
17
|
+
try {
|
|
18
|
+
const data = fs.readFileSync(path.resolve(projectPath, './package.json'), 'utf-8');
|
|
19
|
+
return JSON.parse(data);
|
|
20
|
+
} catch (err) {
|
|
21
|
+
devkit.logger.error('Error reading or parsing package.json');
|
|
22
|
+
throw err;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Generates a random alphanumeric identifier of a specified length.
|
|
27
|
+
*
|
|
28
|
+
* @param {number} [length=8] - The length of the identifier to generate. Defaults to 8 if not specified.
|
|
29
|
+
* @returns {string} - A string representing a unique identifier.
|
|
30
|
+
*/ function shortId(length = 8) {
|
|
31
|
+
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
32
|
+
return Array.from(crypto.randomBytes(length), (b)=>chars[b % chars.length]).join('');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
exports.getPkgJson = getPkgJson;
|
|
36
|
+
exports.shortId = shortId;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var plugins = require('../plugins.cjs');
|
|
4
|
+
var types = require('../shared/types.cjs');
|
|
5
|
+
var helpers = require('../shared/utils/helpers.cjs');
|
|
6
|
+
require('minimatch');
|
|
7
|
+
require('../../../shared/logger.cjs');
|
|
8
|
+
require('@nx/devkit');
|
|
9
|
+
require('crypto');
|
|
10
|
+
var fs = require('fs');
|
|
11
|
+
var path = require('path');
|
|
12
|
+
require('chalk');
|
|
13
|
+
require('mri');
|
|
14
|
+
require('vite');
|
|
15
|
+
|
|
16
|
+
const getBaseConfig = (ctx)=>{
|
|
17
|
+
const { commonConfig, projectConfig, viteCmd } = ctx;
|
|
18
|
+
const { resolveEnvs, path: path$1 } = projectConfig;
|
|
19
|
+
const { stage, target, flags: cmdOverrides } = viteCmd;
|
|
20
|
+
const NODE_ENV = target === types.Target.BUILD ? types.ViteMode.PROD : types.ViteMode.DEV;
|
|
21
|
+
const sourcemap = cmdOverrides?.[types.Flag.SOURCEMAP] ?? stage !== types.Stage.PROD;
|
|
22
|
+
const envPrefix = `${commonConfig.envPrefix.toUpperCase()}_`;
|
|
23
|
+
const omittedStages = resolveEnvs.local ? [
|
|
24
|
+
types.Stage.DEV
|
|
25
|
+
] : [
|
|
26
|
+
types.Stage.DEV,
|
|
27
|
+
types.Stage.LOCAL
|
|
28
|
+
];
|
|
29
|
+
const envPath = `environments/environment.${stage}.ts`;
|
|
30
|
+
const fallbackEnvPath = `environments/environment.ts`;
|
|
31
|
+
// Verify if the local Environment file is present
|
|
32
|
+
const envFilePath = fs.existsSync(path.resolve(path$1, 'src', envPath)) ? envPath : fallbackEnvPath;
|
|
33
|
+
return {
|
|
34
|
+
envPrefix,
|
|
35
|
+
plugins: helpers.getPlugins(ctx, plugins.basePlugins, plugins.bundleAnalysisPlugin),
|
|
36
|
+
resolve: {
|
|
37
|
+
alias: {
|
|
38
|
+
...helpers.when(resolveEnvs.default && !omittedStages.includes(stage), {
|
|
39
|
+
'~env': envFilePath
|
|
40
|
+
})
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
define: {
|
|
44
|
+
'module.hot': false,
|
|
45
|
+
'process.env.DEBUG': null,
|
|
46
|
+
'process.env.NODE_ENV': JSON.stringify(NODE_ENV),
|
|
47
|
+
__vite_process_env_NODE_ENV: JSON.stringify(NODE_ENV)
|
|
48
|
+
},
|
|
49
|
+
build: {
|
|
50
|
+
sourcemap,
|
|
51
|
+
minify: true,
|
|
52
|
+
emptyOutDir: true,
|
|
53
|
+
cssCodeSplit: true
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
exports.getBaseConfig = getBaseConfig;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var types = require('../shared/types.cjs');
|
|
4
|
+
require('@nx/devkit');
|
|
5
|
+
require('path');
|
|
6
|
+
require('ramda');
|
|
7
|
+
require('../../../shared/logger.cjs');
|
|
8
|
+
require('crypto');
|
|
9
|
+
require('fs');
|
|
10
|
+
require('minimatch');
|
|
11
|
+
require('chalk');
|
|
12
|
+
require('mri');
|
|
13
|
+
require('vite');
|
|
14
|
+
var app = require('./app.cjs');
|
|
15
|
+
var base = require('./base.cjs');
|
|
16
|
+
var lib = require('./lib.cjs');
|
|
17
|
+
var script = require('./script.cjs');
|
|
18
|
+
|
|
19
|
+
const getConfig = (ctx, type = null)=>{
|
|
20
|
+
switch(type){
|
|
21
|
+
case types.ProjectType.APP:
|
|
22
|
+
return app.getAppConfig(ctx);
|
|
23
|
+
case types.ProjectType.LIB:
|
|
24
|
+
return lib.getLibConfig(ctx);
|
|
25
|
+
case types.ProjectType.SCRIPT:
|
|
26
|
+
return script.getScriptConfig(ctx);
|
|
27
|
+
default:
|
|
28
|
+
return base.getBaseConfig(ctx);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
exports.getAppConfig = app.getAppConfig;
|
|
33
|
+
exports.getBaseConfig = base.getBaseConfig;
|
|
34
|
+
exports.getLibConfig = lib.getLibConfig;
|
|
35
|
+
exports.getScriptConfig = script.getScriptConfig;
|
|
36
|
+
exports.getConfig = getConfig;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var path = require('path');
|
|
4
|
+
var plugins = require('../plugins.cjs');
|
|
5
|
+
require('../shared/types.cjs');
|
|
6
|
+
var helpers = require('../shared/utils/helpers.cjs');
|
|
7
|
+
var projectConfig = require('../shared/utils/projectConfig.cjs');
|
|
8
|
+
require('chalk');
|
|
9
|
+
require('mri');
|
|
10
|
+
require('vite');
|
|
11
|
+
|
|
12
|
+
const getLibConfig = (ctx)=>{
|
|
13
|
+
const { projectConfig: projectConfig$1, commonConfig } = ctx;
|
|
14
|
+
const { externalizeLibGlob = [] } = commonConfig;
|
|
15
|
+
const { name, path: path$1, externalizeLibs } = projectConfig$1;
|
|
16
|
+
const entry = path.resolve(path$1, projectConfig$1.entry ?? 'src/index.ts');
|
|
17
|
+
const defaultExternals = {
|
|
18
|
+
react: true,
|
|
19
|
+
'react-dom': true,
|
|
20
|
+
'react/jsx-runtime': true
|
|
21
|
+
};
|
|
22
|
+
// Get external dependencies based on glob patterns
|
|
23
|
+
const externalDeps = projectConfig.getExternalDependencies(path$1, [
|
|
24
|
+
...externalizeLibGlob,
|
|
25
|
+
...externalizeLibs.glob
|
|
26
|
+
]);
|
|
27
|
+
const rollupExternal = [
|
|
28
|
+
...externalDeps,
|
|
29
|
+
...Object.keys(helpers.when(externalizeLibs.default, defaultExternals))
|
|
30
|
+
];
|
|
31
|
+
const rollupGlobals = {
|
|
32
|
+
react: 'React',
|
|
33
|
+
'react-dom': 'ReactDOM',
|
|
34
|
+
'react/jsx-runtime': 'ReactJsxRuntime'
|
|
35
|
+
};
|
|
36
|
+
return {
|
|
37
|
+
plugins: helpers.getPlugins(ctx, plugins.dtsPlugin),
|
|
38
|
+
build: {
|
|
39
|
+
lib: {
|
|
40
|
+
name,
|
|
41
|
+
entry,
|
|
42
|
+
formats: [
|
|
43
|
+
'es'
|
|
44
|
+
],
|
|
45
|
+
fileName: (format)=>`index.${format === 'es' ? 'mjs' : 'cjs'}`
|
|
46
|
+
},
|
|
47
|
+
rollupOptions: {
|
|
48
|
+
external: rollupExternal,
|
|
49
|
+
output: {
|
|
50
|
+
globals: helpers.when(externalizeLibs.default, rollupGlobals)
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
exports.getLibConfig = getLibConfig;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var path = require('path');
|
|
4
|
+
var plugins = require('../plugins.cjs');
|
|
5
|
+
require('../shared/types.cjs');
|
|
6
|
+
var helpers = require('../shared/utils/helpers.cjs');
|
|
7
|
+
require('minimatch');
|
|
8
|
+
require('../../../shared/logger.cjs');
|
|
9
|
+
require('@nx/devkit');
|
|
10
|
+
require('crypto');
|
|
11
|
+
require('fs');
|
|
12
|
+
require('chalk');
|
|
13
|
+
require('mri');
|
|
14
|
+
require('vite');
|
|
15
|
+
|
|
16
|
+
const getScriptConfig = (ctx)=>{
|
|
17
|
+
const { commonConfig, projectConfig } = ctx;
|
|
18
|
+
const { envPrefix } = commonConfig;
|
|
19
|
+
const { port } = projectConfig;
|
|
20
|
+
const { name, path: path$1, fileName, chunkPrefix } = projectConfig;
|
|
21
|
+
const entry = path.resolve(path$1, projectConfig.entry ?? 'src/main');
|
|
22
|
+
return {
|
|
23
|
+
plugins: helpers.getPlugins(ctx, plugins.injectCssIntoShadowDomPlugin, plugins.injectCssByJsPlugin),
|
|
24
|
+
server: {
|
|
25
|
+
port,
|
|
26
|
+
host: true
|
|
27
|
+
},
|
|
28
|
+
build: {
|
|
29
|
+
lib: {
|
|
30
|
+
name,
|
|
31
|
+
entry,
|
|
32
|
+
fileName,
|
|
33
|
+
formats: [
|
|
34
|
+
'es'
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
rollupOptions: {
|
|
38
|
+
output: {
|
|
39
|
+
chunkFileNames: helpers.chunkName(`${envPrefix}-${chunkPrefix}`)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
exports.getScriptConfig = getScriptConfig;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var vite = require('vite');
|
|
4
|
+
var logger = require('../../shared/logger.cjs');
|
|
5
|
+
var utils = require('../../shared/utils.cjs');
|
|
6
|
+
var index = require('./configs/index.cjs');
|
|
7
|
+
require('./shared/types.cjs');
|
|
8
|
+
require('@nx/devkit');
|
|
9
|
+
require('path');
|
|
10
|
+
require('ramda');
|
|
11
|
+
var projectConfig = require('./shared/utils/projectConfig.cjs');
|
|
12
|
+
require('chalk');
|
|
13
|
+
require('mri');
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Builds the configuration based on common and project-specific configurations.
|
|
17
|
+
*
|
|
18
|
+
* @param {CommonProjectConfig} commonConfig - The common configuration.
|
|
19
|
+
* @returns - Returns a function that accepts a project configuration and returns the Vite configuration.
|
|
20
|
+
*/ const createConfigBuilder = (commonConfig)=>(projectConfig$1)=>{
|
|
21
|
+
try {
|
|
22
|
+
const localPkgJson = utils.getPkgJson(projectConfig$1.path);
|
|
23
|
+
const { cfg, viteCmd } = projectConfig.initializeConfig(commonConfig, projectConfig$1, localPkgJson);
|
|
24
|
+
const isDebug = logger.currentLogLevel === logger.LogLevel.DEBUG;
|
|
25
|
+
const { type, overrides } = cfg;
|
|
26
|
+
const ctx = {
|
|
27
|
+
viteCmd,
|
|
28
|
+
localPkgJson,
|
|
29
|
+
commonConfig,
|
|
30
|
+
projectConfig: cfg
|
|
31
|
+
};
|
|
32
|
+
const defaultConfig = projectConfig.mergeConfigs(index.getConfig(ctx), index.getConfig(ctx, type));
|
|
33
|
+
const config = projectConfig.mergeConfigs(defaultConfig, overrides);
|
|
34
|
+
if (isDebug) logger.logger.debug('Generated config:', config);
|
|
35
|
+
return vite.defineConfig(config);
|
|
36
|
+
} catch (err) {
|
|
37
|
+
logger.logger.error('buildConfig unexpected error:');
|
|
38
|
+
throw err;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
exports.createConfigBuilder = createConfigBuilder;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var vitePluginCommonjs = require('@originjs/vite-plugin-commonjs');
|
|
4
|
+
var graphql = require('@rollup/plugin-graphql');
|
|
5
|
+
var react = require('@vitejs/plugin-react-swc');
|
|
6
|
+
var path = require('path');
|
|
7
|
+
var rollupPluginVisualizer = require('rollup-plugin-visualizer');
|
|
8
|
+
var cssInjectedByJsPlugin = require('vite-plugin-css-injected-by-js');
|
|
9
|
+
var dts = require('vite-plugin-dts');
|
|
10
|
+
var tsconfigPaths = require('vite-tsconfig-paths');
|
|
11
|
+
require('vite');
|
|
12
|
+
var index = require('../plugins/shadow-dom-inject-css/index.cjs');
|
|
13
|
+
var types = require('./shared/types.cjs');
|
|
14
|
+
var helpers = require('./shared/utils/helpers.cjs');
|
|
15
|
+
require('minimatch');
|
|
16
|
+
require('../../shared/logger.cjs');
|
|
17
|
+
require('@nx/devkit');
|
|
18
|
+
require('crypto');
|
|
19
|
+
require('fs');
|
|
20
|
+
require('chalk');
|
|
21
|
+
require('mri');
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Base plugins configuration for apps and libs.
|
|
25
|
+
*
|
|
26
|
+
* Plugins configured:
|
|
27
|
+
* - vite-tsconfig-paths
|
|
28
|
+
* - @originjs/vite-plugin-commonjs
|
|
29
|
+
* - @rollup/plugin-graphql
|
|
30
|
+
* - @vitejs/plugin-react-swc
|
|
31
|
+
*/ const basePlugins = {
|
|
32
|
+
generate: ()=>{
|
|
33
|
+
const projects = helpers.getNxTsConfigPaths();
|
|
34
|
+
return [
|
|
35
|
+
tsconfigPaths({
|
|
36
|
+
projects
|
|
37
|
+
}),
|
|
38
|
+
vitePluginCommonjs.viteCommonjs(),
|
|
39
|
+
graphql(),
|
|
40
|
+
react({
|
|
41
|
+
tsDecorators: true
|
|
42
|
+
})
|
|
43
|
+
];
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Plugin configuration for generating type declarations using vite-plugin-dts.
|
|
48
|
+
*/ const dtsPlugin = {
|
|
49
|
+
generate: ({ projectConfig })=>[
|
|
50
|
+
dts({
|
|
51
|
+
tsconfigPath: path.resolve(projectConfig.path, 'tsconfig.lib.json'),
|
|
52
|
+
outDir: path.resolve(projectConfig.path, 'dist'),
|
|
53
|
+
entryRoot: path.resolve(projectConfig.path, 'src')
|
|
54
|
+
})
|
|
55
|
+
],
|
|
56
|
+
condition: ({ projectConfig, viteCmd })=>viteCmd.stage !== types.Stage.LOCAL && projectConfig.dts == null ? true : !!projectConfig.dts
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Plugin configuration for bundle analysis using rollup-plugin-visualizer.
|
|
60
|
+
*/ const bundleAnalysisPlugin = {
|
|
61
|
+
generate: ({ projectConfig })=>[
|
|
62
|
+
rollupPluginVisualizer.visualizer({
|
|
63
|
+
emitFile: true,
|
|
64
|
+
projectRoot: path.resolve(projectConfig.path, 'dist'),
|
|
65
|
+
filename: 'bundle-analysis.html'
|
|
66
|
+
})
|
|
67
|
+
],
|
|
68
|
+
condition: ({ viteCmd })=>viteCmd.flags?.[types.Flag.ANALYZE] === 'true'
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Plugin configuration for injecting CSS into JS files
|
|
72
|
+
* using vite-plugin-css-injected-by-js.
|
|
73
|
+
*/ const injectCssByJsPlugin = {
|
|
74
|
+
generate: (_)=>[
|
|
75
|
+
cssInjectedByJsPlugin()
|
|
76
|
+
],
|
|
77
|
+
condition: ({ projectConfig })=>!projectConfig.shadowDom
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Plugin configuration for injecting CSS into Shadow Dom.
|
|
81
|
+
* using local plugin.
|
|
82
|
+
*/ const injectCssIntoShadowDomPlugin = {
|
|
83
|
+
generate: (_)=>[
|
|
84
|
+
index.injectCssIntoShadowDom()
|
|
85
|
+
],
|
|
86
|
+
condition: ({ projectConfig })=>projectConfig.shadowDom
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
exports.basePlugins = basePlugins;
|
|
90
|
+
exports.bundleAnalysisPlugin = bundleAnalysisPlugin;
|
|
91
|
+
exports.dtsPlugin = dtsPlugin;
|
|
92
|
+
exports.injectCssByJsPlugin = injectCssByJsPlugin;
|
|
93
|
+
exports.injectCssIntoShadowDomPlugin = injectCssIntoShadowDomPlugin;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.ViteMode = void 0;
|
|
4
|
+
(function(ViteMode) {
|
|
5
|
+
ViteMode["PROD"] = "production";
|
|
6
|
+
ViteMode["DEV"] = "development";
|
|
7
|
+
})(exports.ViteMode || (exports.ViteMode = {}));
|
|
8
|
+
exports.Stage = void 0;
|
|
9
|
+
(function(Stage) {
|
|
10
|
+
Stage["PROD"] = "prod";
|
|
11
|
+
Stage["DEV"] = "dev";
|
|
12
|
+
Stage["STAGING"] = "staging";
|
|
13
|
+
Stage["LOCAL"] = "local";
|
|
14
|
+
})(exports.Stage || (exports.Stage = {}));
|
|
15
|
+
exports.ProjectType = void 0;
|
|
16
|
+
(function(ProjectType) {
|
|
17
|
+
ProjectType["APP"] = "app";
|
|
18
|
+
ProjectType["LIB"] = "lib";
|
|
19
|
+
ProjectType["SCRIPT"] = "script";
|
|
20
|
+
})(exports.ProjectType || (exports.ProjectType = {}));
|
|
21
|
+
exports.Flag = void 0;
|
|
22
|
+
(function(Flag) {
|
|
23
|
+
Flag["SOURCEMAP"] = "source-maps";
|
|
24
|
+
Flag["ANALYZE"] = "analyze";
|
|
25
|
+
Flag["VERBOSE"] = "verbose";
|
|
26
|
+
Flag["VERBOSE_ALIAS"] = "v";
|
|
27
|
+
})(exports.Flag || (exports.Flag = {}));
|
|
28
|
+
exports.Target = void 0;
|
|
29
|
+
(function(Target) {
|
|
30
|
+
Target["BUILD"] = "build";
|
|
31
|
+
Target["PREVIEW"] = "preview";
|
|
32
|
+
Target["SERVE"] = "serve";
|
|
33
|
+
})(exports.Target || (exports.Target = {}));
|