@nizza/devkit 0.1.0-alpha.8 → 0.1.0-beta.0
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/environments/helpers.cjs +10 -11
- package/dist/cjs/executors/environments/index.cjs +17 -11
- package/dist/cjs/executors/update-executors-file/index.cjs +3 -6
- package/dist/cjs/index.cjs +7 -7
- package/dist/cjs/node_modules/.pnpm/@vitejs_plugin-basic-ssl@1.0.2_vite@5.0.4/node_modules/@vitejs/plugin-basic-ssl/dist/chunks/certificate.cjs +19578 -0
- package/dist/cjs/node_modules/.pnpm/@vitejs_plugin-basic-ssl@1.0.2_vite@5.0.4/node_modules/@vitejs/plugin-basic-ssl/dist/index.cjs +40 -0
- package/dist/cjs/shared/utils.cjs +2 -2
- package/dist/cjs/{vite → vitejs}/config-builder/configs/base.cjs +3 -3
- package/dist/cjs/{vite → vitejs}/config-builder/configs/lib.cjs +2 -1
- package/dist/cjs/{vite → vitejs}/config-builder/plugins.cjs +16 -3
- package/dist/cjs/{vite → vitejs}/config-builder/shared/types.cjs +1 -0
- package/dist/cjs/{vite → vitejs}/config-builder/shared/utils/helpers.cjs +2 -2
- package/dist/cjs/{vite → vitejs}/plugins/third-party-css-inject/utils.cjs +1 -3
- package/dist/esm/executors/environments/helpers.mjs +10 -11
- package/dist/esm/executors/environments/index.mjs +17 -11
- package/dist/esm/executors/update-executors-file/index.mjs +3 -6
- package/dist/esm/index.mjs +7 -7
- package/dist/esm/node_modules/.pnpm/@vitejs_plugin-basic-ssl@1.0.2_vite@5.0.4/node_modules/@vitejs/plugin-basic-ssl/dist/chunks/certificate.mjs +19576 -0
- package/dist/esm/node_modules/.pnpm/@vitejs_plugin-basic-ssl@1.0.2_vite@5.0.4/node_modules/@vitejs/plugin-basic-ssl/dist/index.mjs +35 -0
- package/dist/esm/{vite → vitejs}/config-builder/configs/base.mjs +4 -4
- package/dist/esm/{vite → vitejs}/config-builder/configs/lib.mjs +2 -1
- package/dist/esm/{vite → vitejs}/config-builder/plugins.mjs +16 -4
- package/dist/esm/{vite → vitejs}/config-builder/shared/types.mjs +1 -0
- package/dist/esm/{vite → vitejs}/config-builder/shared/utils/helpers.mjs +2 -2
- package/dist/esm/{vite → vitejs}/plugins/third-party-css-inject/utils.mjs +1 -3
- package/dist/index.d.ts +367 -0
- package/package.json +6 -7
- package/dist/cjs/executors/deploy/helpers.d.cts +0 -4
- package/dist/cjs/executors/deploy/index.d.cts +0 -11
- package/dist/cjs/executors/environments/helpers.d.cts +0 -21
- package/dist/cjs/executors/environments/index.d.cts +0 -16
- package/dist/cjs/executors/publish/helpers.d.cts +0 -19
- package/dist/cjs/executors/publish/index.d.cts +0 -12
- package/dist/cjs/executors/shared/utils.d.cts +0 -27
- package/dist/cjs/executors/update-executors-file/helpers.d.cts +0 -17
- package/dist/cjs/executors/update-executors-file/index.d.cts +0 -12
- package/dist/cjs/executors/vtex-link/constants.d.cts +0 -4
- package/dist/cjs/executors/vtex-link/helpers.d.cts +0 -77
- package/dist/cjs/executors/vtex-link/index.d.cts +0 -5
- package/dist/cjs/index-0ce2daf7.d.ts +0 -2
- package/dist/cjs/index-17143e35.d.ts +0 -2
- package/dist/cjs/index-3080371d.d.ts +0 -3
- package/dist/cjs/index-f6330edc.d.ts +0 -2
- package/dist/cjs/index.d.cts +0 -9
- package/dist/cjs/index.d.cts.map +0 -1
- package/dist/cjs/scripts/changeset-pre-mode.d.cts +0 -2
- package/dist/cjs/scripts/index.d.cts +0 -1
- package/dist/cjs/shared/logger.d.cts +0 -33
- package/dist/cjs/shared/utils.d.cts +0 -18
- package/dist/cjs/types-1282e639.d.ts +0 -12
- package/dist/cjs/types-7377dcc9.d.ts +0 -4
- package/dist/cjs/types-763439e4.d.ts +0 -14
- package/dist/cjs/vite/config-builder/configs/app.d.cts +0 -4
- package/dist/cjs/vite/config-builder/configs/base.d.cts +0 -4
- package/dist/cjs/vite/config-builder/configs/index.d.cts +0 -7
- package/dist/cjs/vite/config-builder/configs/lib.d.cts +0 -4
- package/dist/cjs/vite/config-builder/configs/script.d.cts +0 -4
- package/dist/cjs/vite/config-builder/main.d.cts +0 -10
- package/dist/cjs/vite/config-builder/plugins.d.cts +0 -30
- package/dist/cjs/vite/config-builder/shared/types.d.cts +0 -155
- package/dist/cjs/vite/config-builder/shared/utils/helpers.d.cts +0 -71
- package/dist/cjs/vite/config-builder/shared/utils/projectConfig.d.cts +0 -60
- package/dist/cjs/vite/config-builder/shared/utils/viteCommand.d.cts +0 -24
- package/dist/cjs/vite/plugins/shadow-dom-inject-css/index.d.cts +0 -7
- package/dist/cjs/vite/plugins/third-party-css-inject/main.d.cts +0 -17
- package/dist/cjs/vite/plugins/third-party-css-inject/utils.d.cts +0 -5
- package/dist/esm/executors/deploy/helpers.d.mts +0 -4
- package/dist/esm/executors/deploy/index.d.mts +0 -11
- package/dist/esm/executors/environments/helpers.d.mts +0 -21
- package/dist/esm/executors/environments/index.d.mts +0 -16
- package/dist/esm/executors/publish/helpers.d.mts +0 -19
- package/dist/esm/executors/publish/index.d.mts +0 -12
- package/dist/esm/executors/shared/utils.d.mts +0 -27
- package/dist/esm/executors/update-executors-file/helpers.d.mts +0 -17
- package/dist/esm/executors/update-executors-file/index.d.mts +0 -12
- package/dist/esm/executors/vtex-link/constants.d.mts +0 -4
- package/dist/esm/executors/vtex-link/helpers.d.mts +0 -77
- package/dist/esm/executors/vtex-link/index.d.mts +0 -5
- package/dist/esm/index-0ce2daf7.d.ts +0 -2
- package/dist/esm/index-17143e35.d.ts +0 -2
- package/dist/esm/index-3080371d.d.ts +0 -3
- package/dist/esm/index-f6330edc.d.ts +0 -2
- package/dist/esm/index.d.mts +0 -9
- package/dist/esm/index.d.mts.map +0 -1
- package/dist/esm/scripts/changeset-pre-mode.d.mts +0 -2
- package/dist/esm/scripts/index.d.mts +0 -1
- package/dist/esm/shared/logger.d.mts +0 -33
- package/dist/esm/shared/utils.d.mts +0 -18
- package/dist/esm/types-1282e639.d.ts +0 -12
- package/dist/esm/types-7377dcc9.d.ts +0 -4
- package/dist/esm/types-763439e4.d.ts +0 -14
- package/dist/esm/vite/config-builder/configs/app.d.mts +0 -4
- package/dist/esm/vite/config-builder/configs/base.d.mts +0 -4
- package/dist/esm/vite/config-builder/configs/index.d.mts +0 -7
- package/dist/esm/vite/config-builder/configs/lib.d.mts +0 -4
- package/dist/esm/vite/config-builder/configs/script.d.mts +0 -4
- package/dist/esm/vite/config-builder/main.d.mts +0 -10
- package/dist/esm/vite/config-builder/plugins.d.mts +0 -30
- package/dist/esm/vite/config-builder/shared/types.d.mts +0 -155
- package/dist/esm/vite/config-builder/shared/utils/helpers.d.mts +0 -71
- package/dist/esm/vite/config-builder/shared/utils/projectConfig.d.mts +0 -60
- package/dist/esm/vite/config-builder/shared/utils/viteCommand.d.mts +0 -24
- package/dist/esm/vite/plugins/shadow-dom-inject-css/index.d.mts +0 -7
- package/dist/esm/vite/plugins/third-party-css-inject/main.d.mts +0 -17
- package/dist/esm/vite/plugins/third-party-css-inject/utils.d.mts +0 -5
- /package/dist/cjs/{vite → vitejs}/config-builder/configs/app.cjs +0 -0
- /package/dist/cjs/{vite → vitejs}/config-builder/configs/index.cjs +0 -0
- /package/dist/cjs/{vite → vitejs}/config-builder/configs/script.cjs +0 -0
- /package/dist/cjs/{vite → vitejs}/config-builder/main.cjs +0 -0
- /package/dist/cjs/{vite → vitejs}/config-builder/shared/utils/projectConfig.cjs +0 -0
- /package/dist/cjs/{vite → vitejs}/config-builder/shared/utils/viteCommand.cjs +0 -0
- /package/dist/cjs/{vite → vitejs}/plugins/shadow-dom-inject-css/index.cjs +0 -0
- /package/dist/cjs/{vite → vitejs}/plugins/third-party-css-inject/main.cjs +0 -0
- /package/dist/esm/{vite → vitejs}/config-builder/configs/app.mjs +0 -0
- /package/dist/esm/{vite → vitejs}/config-builder/configs/index.mjs +0 -0
- /package/dist/esm/{vite → vitejs}/config-builder/configs/script.mjs +0 -0
- /package/dist/esm/{vite → vitejs}/config-builder/main.mjs +0 -0
- /package/dist/esm/{vite → vitejs}/config-builder/shared/utils/projectConfig.mjs +0 -0
- /package/dist/esm/{vite → vitejs}/config-builder/shared/utils/viteCommand.mjs +0 -0
- /package/dist/esm/{vite → vitejs}/plugins/shadow-dom-inject-css/index.mjs +0 -0
- /package/dist/esm/{vite → vitejs}/plugins/third-party-css-inject/main.mjs +0 -0
- /package/{dist/executors.json → executors.json} +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var path = require('node:path');
|
|
6
|
+
var node_fs = require('node:fs');
|
|
7
|
+
|
|
8
|
+
const defaultCacheDir = "node_modules/.vite";
|
|
9
|
+
function viteBasicSslPlugin() {
|
|
10
|
+
return {
|
|
11
|
+
name: "vite:basic-ssl",
|
|
12
|
+
async configResolved(config) {
|
|
13
|
+
const certificate = await getCertificate((config.cacheDir ?? defaultCacheDir) + "/basic-ssl");
|
|
14
|
+
const https = () => ({ cert: certificate, key: certificate });
|
|
15
|
+
config.server.https = Object.assign({}, config.server.https, https());
|
|
16
|
+
config.preview.https = Object.assign({}, config.preview.https, https());
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
async function getCertificate(cacheDir) {
|
|
21
|
+
const cachePath = path.join(cacheDir, "_cert.pem");
|
|
22
|
+
try {
|
|
23
|
+
const [stat, content] = await Promise.all([
|
|
24
|
+
node_fs.promises.stat(cachePath),
|
|
25
|
+
node_fs.promises.readFile(cachePath, "utf8")
|
|
26
|
+
]);
|
|
27
|
+
if (Date.now() - stat.ctime.valueOf() > 30 * 24 * 60 * 60 * 1e3) {
|
|
28
|
+
throw new Error("cache is outdated.");
|
|
29
|
+
}
|
|
30
|
+
return content;
|
|
31
|
+
} catch {
|
|
32
|
+
const content = (await Promise.resolve().then(function () { return require('./chunks/certificate.cjs'); })).createCertificate();
|
|
33
|
+
node_fs.promises.mkdir(cacheDir, { recursive: true }).then(() => node_fs.promises.writeFile(cachePath, content)).catch(() => {
|
|
34
|
+
});
|
|
35
|
+
return content;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
exports.default = viteBasicSslPlugin;
|
|
40
|
+
exports.getCertificate = getCertificate;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var devkit = require('@nx/devkit');
|
|
4
|
-
var
|
|
4
|
+
var require$$1 = require('crypto');
|
|
5
5
|
var fs = require('fs');
|
|
6
6
|
var path = require('path');
|
|
7
7
|
|
|
@@ -29,7 +29,7 @@ var path = require('path');
|
|
|
29
29
|
* @returns {string} - A string representing a unique identifier.
|
|
30
30
|
*/ function shortId(length = 8) {
|
|
31
31
|
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
32
|
-
return Array.from(
|
|
32
|
+
return Array.from(require$$1.randomBytes(length), (b)=>chars[b % chars.length]).join('');
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
exports.getPkgJson = getPkgJson;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var fs = require('fs');
|
|
4
|
+
var path = require('path');
|
|
3
5
|
var plugins = require('../plugins.cjs');
|
|
4
6
|
var types = require('../shared/types.cjs');
|
|
5
7
|
var helpers = require('../shared/utils/helpers.cjs');
|
|
@@ -7,8 +9,6 @@ require('minimatch');
|
|
|
7
9
|
require('../../../shared/logger.cjs');
|
|
8
10
|
require('@nx/devkit');
|
|
9
11
|
require('crypto');
|
|
10
|
-
var fs = require('fs');
|
|
11
|
-
var path = require('path');
|
|
12
12
|
require('chalk');
|
|
13
13
|
require('mri');
|
|
14
14
|
require('vite');
|
|
@@ -32,7 +32,7 @@ const getBaseConfig = (ctx)=>{
|
|
|
32
32
|
const envFilePath = fs.existsSync(path.resolve(path$1, 'src', envPath)) ? envPath : fallbackEnvPath;
|
|
33
33
|
return {
|
|
34
34
|
envPrefix,
|
|
35
|
-
plugins: helpers.getPlugins(ctx, plugins.basePlugins, plugins.bundleAnalysisPlugin),
|
|
35
|
+
plugins: helpers.getPlugins(ctx, plugins.basePlugins, plugins.httpsServerPlugin, plugins.bundleAnalysisPlugin),
|
|
36
36
|
resolve: {
|
|
37
37
|
alias: {
|
|
38
38
|
...helpers.when(resolveEnvs.default && !omittedStages.includes(stage), {
|
|
@@ -19,6 +19,7 @@ require('crypto');
|
|
|
19
19
|
require('fs');
|
|
20
20
|
require('chalk');
|
|
21
21
|
require('mri');
|
|
22
|
+
var index$1 = require('../../node_modules/.pnpm/@vitejs_plugin-basic-ssl@1.0.2_vite@5.0.4/node_modules/@vitejs/plugin-basic-ssl/dist/index.cjs');
|
|
22
23
|
|
|
23
24
|
/**
|
|
24
25
|
* Base plugins configuration for apps and libs.
|
|
@@ -65,13 +66,13 @@ require('mri');
|
|
|
65
66
|
filename: 'bundle-analysis.html'
|
|
66
67
|
})
|
|
67
68
|
],
|
|
68
|
-
condition: ({ viteCmd })=>viteCmd.flags?.[types.Flag.ANALYZE]
|
|
69
|
+
condition: ({ viteCmd })=>viteCmd.flags?.[types.Flag.ANALYZE]
|
|
69
70
|
};
|
|
70
71
|
/**
|
|
71
72
|
* Plugin configuration for injecting CSS into JS files
|
|
72
73
|
* using vite-plugin-css-injected-by-js.
|
|
73
74
|
*/ const injectCssByJsPlugin = {
|
|
74
|
-
generate: (
|
|
75
|
+
generate: ()=>[
|
|
75
76
|
cssInjectedByJsPlugin()
|
|
76
77
|
],
|
|
77
78
|
condition: ({ projectConfig })=>!projectConfig.shadowDom
|
|
@@ -80,14 +81,26 @@ require('mri');
|
|
|
80
81
|
* Plugin configuration for injecting CSS into Shadow Dom.
|
|
81
82
|
* using local plugin.
|
|
82
83
|
*/ const injectCssIntoShadowDomPlugin = {
|
|
83
|
-
generate: (
|
|
84
|
+
generate: ()=>[
|
|
84
85
|
index.injectCssIntoShadowDom()
|
|
85
86
|
],
|
|
86
87
|
condition: ({ projectConfig })=>projectConfig.shadowDom
|
|
87
88
|
};
|
|
89
|
+
/**
|
|
90
|
+
* Use the plugin @vitejs/plugin-basic-ssl to create a SSL
|
|
91
|
+
* certificate and create https server.
|
|
92
|
+
*/ const httpsServerPlugin = {
|
|
93
|
+
generate: ()=>[
|
|
94
|
+
index$1.default()
|
|
95
|
+
],
|
|
96
|
+
condition: ({ viteCmd })=>{
|
|
97
|
+
return viteCmd.flags?.[types.Flag.HTTPS];
|
|
98
|
+
}
|
|
99
|
+
};
|
|
88
100
|
|
|
89
101
|
exports.basePlugins = basePlugins;
|
|
90
102
|
exports.bundleAnalysisPlugin = bundleAnalysisPlugin;
|
|
91
103
|
exports.dtsPlugin = dtsPlugin;
|
|
104
|
+
exports.httpsServerPlugin = httpsServerPlugin;
|
|
92
105
|
exports.injectCssByJsPlugin = injectCssByJsPlugin;
|
|
93
106
|
exports.injectCssIntoShadowDomPlugin = injectCssIntoShadowDomPlugin;
|
|
@@ -76,8 +76,8 @@ var R__namespace = /*#__PURE__*/_interopNamespaceDefault(R);
|
|
|
76
76
|
*
|
|
77
77
|
* @param {Context} ctx - The main configuration object.
|
|
78
78
|
* @returns {any[]} - An array of generated plugin configurations.
|
|
79
|
-
*/ const getPlugins = (ctx, ...pluginConfigs)=>pluginConfigs
|
|
80
|
-
.filter((p)=>!p.condition || p.condition(ctx))
|
|
79
|
+
*/ const getPlugins = (ctx, ...pluginConfigs)=>pluginConfigs// Filters the plugins based on conditions
|
|
80
|
+
.filter((p)=>!p.condition || p.condition(ctx))// Generates the configuration of each plugin and flattens the resulting array
|
|
81
81
|
.flatMap((p)=>p.generate(ctx));
|
|
82
82
|
/**
|
|
83
83
|
* Gets the paths to the tsconfig files for all relevant projects.
|
|
@@ -66,13 +66,11 @@ async function buildCSSInjectionCode(execute) {
|
|
|
66
66
|
*/ function injectionCSSCodePlugin(execute) {
|
|
67
67
|
return {
|
|
68
68
|
name: 'vite:third-party-css-inject',
|
|
69
|
-
// @ts-ignore
|
|
70
69
|
resolveId (id) {
|
|
71
70
|
if (id == cssInjectedByJsId) {
|
|
72
71
|
return id;
|
|
73
72
|
}
|
|
74
73
|
},
|
|
75
|
-
// @ts-ignore
|
|
76
74
|
load (id) {
|
|
77
75
|
if (id == cssInjectedByJsId) {
|
|
78
76
|
let executeJs = [];
|
|
@@ -86,7 +84,7 @@ async function buildCSSInjectionCode(execute) {
|
|
|
86
84
|
return `try{if(typeof document != 'undefined'){
|
|
87
85
|
const waitForElement=${waitForElement.toString()};
|
|
88
86
|
${executeJs.join(' ')}
|
|
89
|
-
}}catch(e){console.error('vite
|
|
87
|
+
}}catch(e){console.error('vite:third-party-css-inject', e);}`;
|
|
90
88
|
}
|
|
91
89
|
}
|
|
92
90
|
};
|
|
@@ -6,20 +6,19 @@ const { mkdir, writeFile, access } = promises;
|
|
|
6
6
|
/**
|
|
7
7
|
* Creates the content for an environment file based on the core environment path.
|
|
8
8
|
*
|
|
9
|
-
* @param {
|
|
9
|
+
* @param {CreateEnvironmentData} data - Values to replace in template.
|
|
10
10
|
* @returns {string} The content of the environment file.
|
|
11
|
-
*/ async function createEnvironmentFileContent(
|
|
12
|
-
return `
|
|
13
|
-
|
|
14
|
-
import coreEnvs from '${coreEnvPath}';
|
|
11
|
+
*/ async function createEnvironmentFileContent({ coreEnvFile, projectOrg }) {
|
|
12
|
+
return `import { Environment } from '@${projectOrg}/core';
|
|
13
|
+
import coreEnvs from '@${projectOrg}/core/envs/${coreEnvFile}';
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
const config = {
|
|
16
|
+
...coreEnvs,
|
|
17
|
+
};
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
export const environment: Environment<typeof config> = config;
|
|
20
|
+
export default environment;
|
|
21
|
+
`;
|
|
23
22
|
}
|
|
24
23
|
/**
|
|
25
24
|
* Ensures that the given directory exists, creating it if it does not.
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { join } from 'path';
|
|
2
2
|
import { getProjectConfig, ok, err } from '../shared/utils.mjs';
|
|
3
3
|
import { ensureDirectoryExists, createEnvironmentFileContent, writeFilesIfNotExist } from './helpers.mjs';
|
|
4
|
+
import '../../shared/logger.mjs';
|
|
5
|
+
import { getPkgJson } from '../../shared/utils.mjs';
|
|
4
6
|
|
|
5
7
|
const ENV_DIR = 'src/environments';
|
|
6
8
|
const ENV_DEV_FILE = 'environment.ts';
|
|
@@ -26,10 +28,23 @@ const environmentFiles = [
|
|
|
26
28
|
try {
|
|
27
29
|
const projectConfig = getProjectConfig(ctx);
|
|
28
30
|
const environmentsDir = join(projectConfig.root, ENV_DIR);
|
|
31
|
+
const mainPkgJson = getPkgJson(ctx.root);
|
|
32
|
+
const getEnvPath = (fileName)=>{
|
|
33
|
+
const isLocal = fileName.includes('.local');
|
|
34
|
+
const coreEnvFile = (isLocal ? ENV_DEV_FILE : fileName).replace('.ts', '');
|
|
35
|
+
const key = isLocal ? ENV_LOCAL_FILE : fileName;
|
|
36
|
+
return {
|
|
37
|
+
key,
|
|
38
|
+
coreEnvFile
|
|
39
|
+
};
|
|
40
|
+
};
|
|
29
41
|
await ensureDirectoryExists(environmentsDir);
|
|
30
42
|
for (const envFileName of environmentFiles){
|
|
31
|
-
const { key,
|
|
32
|
-
const content = await createEnvironmentFileContent(
|
|
43
|
+
const { key, coreEnvFile } = getEnvPath(envFileName);
|
|
44
|
+
const content = await createEnvironmentFileContent({
|
|
45
|
+
coreEnvFile,
|
|
46
|
+
projectOrg: mainPkgJson.name
|
|
47
|
+
});
|
|
33
48
|
await writeFilesIfNotExist(environmentsDir, {
|
|
34
49
|
[key]: content
|
|
35
50
|
});
|
|
@@ -39,14 +54,5 @@ const environmentFiles = [
|
|
|
39
54
|
return err(error, `Failed to create environment files:`);
|
|
40
55
|
}
|
|
41
56
|
}
|
|
42
|
-
function getEnvPath(fileName) {
|
|
43
|
-
const isLocal = fileName.includes('.local');
|
|
44
|
-
const baseFileName = isLocal ? ENV_DEV_FILE : fileName;
|
|
45
|
-
const key = isLocal ? ENV_LOCAL_FILE : fileName;
|
|
46
|
-
return {
|
|
47
|
-
key,
|
|
48
|
-
path: `@nizza/core/envs/${baseFileName.replace('.ts', '')}`
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
57
|
|
|
52
58
|
export { runExecutor as default };
|
|
@@ -15,22 +15,19 @@ const { readFile } = promises;
|
|
|
15
15
|
const projectConfig = getProjectConfig(ctx);
|
|
16
16
|
const rootDir = projectConfig.root;
|
|
17
17
|
const executorsFilePath = join(rootDir, 'executors.json');
|
|
18
|
-
const distExecutorsFilePath = join(rootDir, 'dist', 'executors.json');
|
|
18
|
+
// const distExecutorsFilePath = join(rootDir, 'dist', 'executors.json');
|
|
19
19
|
const originalContent = JSON.parse(await readFile(executorsFilePath, 'utf8'));
|
|
20
20
|
// Update paths to point to './dist/' and add '.js'
|
|
21
21
|
const updatedExecutors = updateExecutorPaths(originalContent.executors, false);
|
|
22
22
|
// Prepare the version for the dist folder by removing './dist/' from paths
|
|
23
|
-
const distExecutors = updateExecutorPaths(updatedExecutors, true);
|
|
23
|
+
// const distExecutors = updateExecutorPaths(updatedExecutors, true);
|
|
24
24
|
// Write both files asynchronously and in parallel
|
|
25
25
|
await Promise.all([
|
|
26
26
|
writeJsonFileAsync(executorsFilePath, {
|
|
27
27
|
executors: updatedExecutors
|
|
28
|
-
}),
|
|
29
|
-
writeJsonFileAsync(distExecutorsFilePath, {
|
|
30
|
-
executors: distExecutors
|
|
31
28
|
})
|
|
32
29
|
]);
|
|
33
|
-
return ok(
|
|
30
|
+
return ok();
|
|
34
31
|
} catch (error) {
|
|
35
32
|
return err(error, `❌ Error processing file: ${error}`);
|
|
36
33
|
}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -3,10 +3,10 @@ export { default as environmentsExecutor } from './executors/environments/index.
|
|
|
3
3
|
export { default as publishExecutor } from './executors/publish/index.mjs';
|
|
4
4
|
export { default as updateExecutorsFileExecutor } from './executors/update-executors-file/index.mjs';
|
|
5
5
|
export { default as vtexLinkExecutor } from './executors/vtex-link/index.mjs';
|
|
6
|
-
export { createConfigBuilder } from './
|
|
7
|
-
export { Flag, ProjectType, Stage, Target, ViteMode } from './
|
|
8
|
-
export { chunkName, deepMerge, getNxTsConfigPaths, getPlugins, when } from './
|
|
9
|
-
export { getExternalDependencies, getInitials, initializeConfig, mergeConfigs } from './
|
|
10
|
-
export { getViteCmdFlags, getViteCommand } from './
|
|
11
|
-
export { thirdPartyCssInjectPlugin } from './
|
|
12
|
-
export { injectCssIntoShadowDom } from './
|
|
6
|
+
export { createConfigBuilder } from './vitejs/config-builder/main.mjs';
|
|
7
|
+
export { Flag, ProjectType, Stage, Target, ViteMode } from './vitejs/config-builder/shared/types.mjs';
|
|
8
|
+
export { chunkName, deepMerge, getNxTsConfigPaths, getPlugins, when } from './vitejs/config-builder/shared/utils/helpers.mjs';
|
|
9
|
+
export { getExternalDependencies, getInitials, initializeConfig, mergeConfigs } from './vitejs/config-builder/shared/utils/projectConfig.mjs';
|
|
10
|
+
export { getViteCmdFlags, getViteCommand } from './vitejs/config-builder/shared/utils/viteCommand.mjs';
|
|
11
|
+
export { thirdPartyCssInjectPlugin } from './vitejs/plugins/third-party-css-inject/main.mjs';
|
|
12
|
+
export { injectCssIntoShadowDom } from './vitejs/plugins/shadow-dom-inject-css/index.mjs';
|