@nizza/devkit 0.1.0-alpha.10 → 0.1.0-alpha.12
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/update-executors-file/index.cjs +2 -2
- package/dist/cjs/index.cjs +7 -22
- package/dist/cjs/shared/utils.cjs +0 -28
- package/dist/cjs/{vite → vitejs}/config-builder/configs/lib.cjs +2 -1
- package/dist/cjs/{vite → vitejs}/config-builder/plugins.cjs +3 -3
- 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/update-executors-file/index.mjs +2 -2
- package/dist/esm/index.mjs +7 -9
- package/dist/esm/shared/utils.mjs +1 -28
- package/dist/esm/{vite → vitejs}/config-builder/configs/lib.mjs +2 -1
- package/dist/esm/{vite → vitejs}/config-builder/plugins.mjs +3 -3
- package/dist/esm/{vite → vitejs}/config-builder/shared/utils/helpers.mjs +2 -2
- package/dist/esm/{vite → vitejs}/config-builder/shared/utils/projectConfig.mjs +1 -1
- package/dist/esm/{vite → vitejs}/plugins/third-party-css-inject/utils.mjs +1 -3
- package/dist/index.d.ts +367 -0
- package/package.json +4 -6
- 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 -25
- 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 -10
- 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 -19
- 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 -25
- 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 -10
- 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 -19
- 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/executors.json +0 -29
- /package/dist/cjs/{vite → vitejs}/config-builder/configs/app.cjs +0 -0
- /package/dist/cjs/{vite → vitejs}/config-builder/configs/base.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/types.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/base.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/types.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/cjs/index.d.cts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { default as deployExecutor } from "./executors/deploy/index.js";
|
|
2
|
-
export { default as environmentsExecutor } from "./executors/environments/index.js";
|
|
3
|
-
export { default as publishExecutor } from "./executors/publish/index.js";
|
|
4
|
-
export { default as updateExecutorsFileExecutor } from "./executors/update-executors-file/index.js";
|
|
5
|
-
export { default as vtexLinkExecutor } from "./executors/vtex-link/index.js";
|
|
6
|
-
export * from "./index-17143e35.js";
|
|
7
|
-
export * from "./vite/config-builder/main.js";
|
|
8
|
-
export * from "./index-f6330edc.js";
|
|
9
|
-
export * from "./index-0ce2daf7.js";
|
|
10
|
-
//# sourceMappingURL=index.d.cts.map
|
package/dist/cjs/index.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/index.ts","../../src/executors/index.ts","../../src/vite/config-builder/index.ts","../../src/vite/index.ts"],"names":[],"mappings":";;;;;AACA,oCAAyB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./changeset-pre-mode.js";
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Enum representing the different log levels.
|
|
3
|
-
*/
|
|
4
|
-
declare enum LogLevel {
|
|
5
|
-
ERROR = 0,
|
|
6
|
-
WARN = 1,
|
|
7
|
-
INFO = 2,
|
|
8
|
-
DEBUG = 3
|
|
9
|
-
}
|
|
10
|
-
declare let currentLogLevel: LogLevel;
|
|
11
|
-
/**
|
|
12
|
-
* Sets the log level for the logger.
|
|
13
|
-
* Only logs at this level and above will be displayed.
|
|
14
|
-
*
|
|
15
|
-
* @param {LogLevel} level - The log level to set.
|
|
16
|
-
* @example
|
|
17
|
-
* // Set log level to WARN
|
|
18
|
-
* setLogLevel(LogLevel.WARN);
|
|
19
|
-
*
|
|
20
|
-
* // Now only WARN and ERROR logs will be displayed
|
|
21
|
-
* logger.debug('Debug message'); // Will not be logged
|
|
22
|
-
* logger.info('Info message'); // Will not be logged
|
|
23
|
-
* logger.warn('Warn message'); // Will be logged
|
|
24
|
-
* logger.error('Error message'); // Will be logged
|
|
25
|
-
*/
|
|
26
|
-
declare const setLogLevel: (level: LogLevel) => void;
|
|
27
|
-
declare const logger: {
|
|
28
|
-
error: (message: string, ...rest: any[]) => void;
|
|
29
|
-
warn: (message: string, ...rest: any[]) => void;
|
|
30
|
-
info: (message: string, ...rest: any[]) => void;
|
|
31
|
-
debug: (message: string, ...rest: any[]) => void;
|
|
32
|
-
};
|
|
33
|
-
export { LogLevel, currentLogLevel, setLogLevel, logger };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Reads and parses the package.json file from the given project path.
|
|
3
|
-
*
|
|
4
|
-
* @param {string} projectPath - The path to the project.
|
|
5
|
-
* @returns {Record<string, any>} - The parsed package.json data.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* const pkgJsonData = getPkgJson('/path/to/project');
|
|
9
|
-
*/
|
|
10
|
-
declare const getPkgJson: (projectPath: string) => Record<string, any>;
|
|
11
|
-
/**
|
|
12
|
-
* Generates a random alphanumeric identifier of a specified length.
|
|
13
|
-
*
|
|
14
|
-
* @param {number} [length=8] - The length of the identifier to generate. Defaults to 8 if not specified.
|
|
15
|
-
* @returns {string} - A string representing a unique identifier.
|
|
16
|
-
*/
|
|
17
|
-
declare function shortId(length?: number): string;
|
|
18
|
-
declare function combineGlobStyles(array: Record<string, any>[]): Record<string, string>;
|
|
19
|
-
export { getPkgJson, shortId, combineGlobStyles };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
interface SharedContext {
|
|
2
|
-
vtexProjectPath: string;
|
|
3
|
-
projectRoot: string;
|
|
4
|
-
projectName: string;
|
|
5
|
-
packageOrg: string;
|
|
6
|
-
}
|
|
7
|
-
interface ExecutorOptions {
|
|
8
|
-
packageOrg: string;
|
|
9
|
-
rollback?: boolean;
|
|
10
|
-
skipLink?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export { SharedContext, ExecutorOptions };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
interface ExecutorOptions {
|
|
2
|
-
}
|
|
3
|
-
interface ExecutorConfig {
|
|
4
|
-
implementation: string;
|
|
5
|
-
schema: string;
|
|
6
|
-
description: string;
|
|
7
|
-
}
|
|
8
|
-
interface Executors {
|
|
9
|
-
[executorName: string]: ExecutorConfig;
|
|
10
|
-
}
|
|
11
|
-
interface ExecutorsFile {
|
|
12
|
-
executors: Executors;
|
|
13
|
-
}
|
|
14
|
-
export { ExecutorOptions, ExecutorConfig, Executors, ExecutorsFile };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ProjectType, Context } from "../../../index-f6330edc.js";
|
|
2
|
-
declare const getConfig: (ctx: Context, type?: ProjectType | null) => import("vite").UserConfig;
|
|
3
|
-
export * from "./app.js";
|
|
4
|
-
export * from "./base.js";
|
|
5
|
-
export * from "./lib.js";
|
|
6
|
-
export * from "./script.js";
|
|
7
|
-
export { getConfig };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { UserConfig } from 'vite';
|
|
2
|
-
import { CommonProjectConfig, ProjectConfig } from "../../index-f6330edc.js";
|
|
3
|
-
/**
|
|
4
|
-
* Builds the configuration based on common and project-specific configurations.
|
|
5
|
-
*
|
|
6
|
-
* @param {CommonProjectConfig} commonConfig - The common configuration.
|
|
7
|
-
* @returns - Returns a function that accepts a project configuration and returns the Vite configuration.
|
|
8
|
-
*/
|
|
9
|
-
declare const createConfigBuilder: (commonConfig: CommonProjectConfig) => (projectConfig: ProjectConfig) => UserConfig;
|
|
10
|
-
export { createConfigBuilder };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { PluginConfig } from "../../index-f6330edc.js";
|
|
2
|
-
/**
|
|
3
|
-
* Base plugins configuration for apps and libs.
|
|
4
|
-
*
|
|
5
|
-
* Plugins configured:
|
|
6
|
-
* - vite-tsconfig-paths
|
|
7
|
-
* - @originjs/vite-plugin-commonjs
|
|
8
|
-
* - @rollup/plugin-graphql
|
|
9
|
-
* - @vitejs/plugin-react-swc
|
|
10
|
-
*/
|
|
11
|
-
declare const basePlugins: PluginConfig;
|
|
12
|
-
/**
|
|
13
|
-
* Plugin configuration for generating type declarations using vite-plugin-dts.
|
|
14
|
-
*/
|
|
15
|
-
declare const dtsPlugin: PluginConfig;
|
|
16
|
-
/**
|
|
17
|
-
* Plugin configuration for bundle analysis using rollup-plugin-visualizer.
|
|
18
|
-
*/
|
|
19
|
-
declare const bundleAnalysisPlugin: PluginConfig;
|
|
20
|
-
/**
|
|
21
|
-
* Plugin configuration for injecting CSS into JS files
|
|
22
|
-
* using vite-plugin-css-injected-by-js.
|
|
23
|
-
*/
|
|
24
|
-
declare const injectCssByJsPlugin: PluginConfig;
|
|
25
|
-
/**
|
|
26
|
-
* Plugin configuration for injecting CSS into Shadow Dom.
|
|
27
|
-
* using local plugin.
|
|
28
|
-
*/
|
|
29
|
-
declare const injectCssIntoShadowDomPlugin: PluginConfig;
|
|
30
|
-
export { basePlugins, dtsPlugin, bundleAnalysisPlugin, injectCssByJsPlugin, injectCssIntoShadowDomPlugin };
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import { ConfigEnv, LibraryOptions, UserConfig } from 'vite';
|
|
2
|
-
import { LogLevel } from "../../../index-17143e35.js";
|
|
3
|
-
declare enum ViteMode {
|
|
4
|
-
PROD = "production",
|
|
5
|
-
DEV = "development"
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Project stages, it coincides with the target configurations of the project.json of NX.
|
|
9
|
-
* @readonly
|
|
10
|
-
* @enum {string}
|
|
11
|
-
*/
|
|
12
|
-
declare enum Stage {
|
|
13
|
-
PROD = "prod",
|
|
14
|
-
DEV = "dev",
|
|
15
|
-
STAGING = "staging",
|
|
16
|
-
LOCAL = "local"
|
|
17
|
-
}
|
|
18
|
-
declare enum ProjectType {
|
|
19
|
-
APP = "app",
|
|
20
|
-
LIB = "lib",
|
|
21
|
-
SCRIPT = "script"
|
|
22
|
-
}
|
|
23
|
-
declare enum Flag {
|
|
24
|
-
SOURCEMAP = "source-maps",
|
|
25
|
-
ANALYZE = "analyze",
|
|
26
|
-
VERBOSE = "verbose",
|
|
27
|
-
VERBOSE_ALIAS = "v"
|
|
28
|
-
}
|
|
29
|
-
declare enum Target {
|
|
30
|
-
BUILD = "build",
|
|
31
|
-
PREVIEW = "preview",
|
|
32
|
-
SERVE = "serve"
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Vite Environment.
|
|
36
|
-
*
|
|
37
|
-
* @property {ViteMode} mode - Vite mode.
|
|
38
|
-
*/
|
|
39
|
-
type ViteEnv = ConfigEnv & {
|
|
40
|
-
mode: ViteMode;
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* Externalizing libraries.
|
|
44
|
-
*
|
|
45
|
-
* @property {boolean} default - React externalizes and other common dependencies,
|
|
46
|
-
* this only applies to libraries.
|
|
47
|
-
* @property {boolean} glob - Glob expression or list of glob expressions to exclude
|
|
48
|
-
* dependencies from the package.json.
|
|
49
|
-
*/
|
|
50
|
-
type ExternalizeLibs = {
|
|
51
|
-
default: boolean;
|
|
52
|
-
glob: string | string[];
|
|
53
|
-
};
|
|
54
|
-
type ResolveEnvs = {
|
|
55
|
-
default: boolean;
|
|
56
|
-
local: boolean;
|
|
57
|
-
};
|
|
58
|
-
/**
|
|
59
|
-
* Project configuration.
|
|
60
|
-
*
|
|
61
|
-
* @property {ProjectType} type - Type of the project.
|
|
62
|
-
* @property {string} path - Path of the project.
|
|
63
|
-
* @property {string} entry - Path of the file entry point.
|
|
64
|
-
* @property {string} name - Name of the project, it is also used to define the name of the library.
|
|
65
|
-
* @property {string} port - Server port.
|
|
66
|
-
* @property {boolean} debug - Print data purification data.
|
|
67
|
-
* @property {boolean} dts - Control if the .d.ts files are generated, by default it is True.
|
|
68
|
-
* @property {Partial<ResolveEnvs>} resolveEnvs - Flag for resolving environment.
|
|
69
|
-
* @property {boolean} shadowDom - If component is render into shadow dom.
|
|
70
|
-
* @property {Partial<ExternalizeLibs>} externalizeLibs - Configuration for externalizing libraries.
|
|
71
|
-
* @property {LibraryOptions['fileName']} fileName - Output file name for library.
|
|
72
|
-
* @property {string} fileName - Prefix for chunk file name.
|
|
73
|
-
* @property {ViteEnv} viteEnv - Vite environment configuration.
|
|
74
|
-
* @property {UserConfig} overrides - Overrides for vite configuration.
|
|
75
|
-
*/
|
|
76
|
-
interface ProjectConfig {
|
|
77
|
-
type: ProjectType;
|
|
78
|
-
path: string;
|
|
79
|
-
entry?: string;
|
|
80
|
-
name?: string;
|
|
81
|
-
port?: number;
|
|
82
|
-
logLevel?: LogLevel;
|
|
83
|
-
dts?: boolean;
|
|
84
|
-
resolveEnvs?: Partial<ResolveEnvs>;
|
|
85
|
-
shadowDom?: boolean;
|
|
86
|
-
externalizeLibs?: Partial<ExternalizeLibs>;
|
|
87
|
-
fileName?: LibraryOptions['fileName'];
|
|
88
|
-
chunkPrefix?: string;
|
|
89
|
-
viteEnv: ViteEnv;
|
|
90
|
-
overrides?: UserConfig;
|
|
91
|
-
}
|
|
92
|
-
interface ProjectConfigInitialized extends ProjectConfig {
|
|
93
|
-
name: string;
|
|
94
|
-
fileName: string;
|
|
95
|
-
chunkPrefix: string;
|
|
96
|
-
logLevel: LogLevel;
|
|
97
|
-
overrides: UserConfig;
|
|
98
|
-
shadowDom: boolean;
|
|
99
|
-
resolveEnvs: ResolveEnvs;
|
|
100
|
-
externalizeLibs: ExternalizeLibs;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Vite command details.
|
|
104
|
-
* @interface
|
|
105
|
-
* @property {Stage} stage - Stage of the project.
|
|
106
|
-
* @property {string} target - Command name.
|
|
107
|
-
* @property {Record<string, any>} flags - Flags for customize command.
|
|
108
|
-
*/
|
|
109
|
-
interface ViteCommand {
|
|
110
|
-
stage: Stage;
|
|
111
|
-
target: string;
|
|
112
|
-
flags: Record<string, any>;
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Common project configuration.
|
|
116
|
-
*
|
|
117
|
-
* @property {string} envPrefix - Prefix in lowercase for environment variables and output files.
|
|
118
|
-
* @property {boolean} externalizeLibGlob - Glob expression or list of glob expressions to exclude
|
|
119
|
-
* dependencies from the package.json.
|
|
120
|
-
*/
|
|
121
|
-
interface CommonProjectConfig {
|
|
122
|
-
envPrefix: string;
|
|
123
|
-
externalizeLibGlob?: string | string[];
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Config builder context.
|
|
127
|
-
*
|
|
128
|
-
* @property {CommonProjectConfig} commonConfig - Common configuration for the project.
|
|
129
|
-
* @property {ProjectConfigInitialized} projectConfig - Initialized project configuration.
|
|
130
|
-
* @property {ViteCommandDetail} viteCmd - Vite command details.
|
|
131
|
-
*/
|
|
132
|
-
interface Context {
|
|
133
|
-
commonConfig: CommonProjectConfig;
|
|
134
|
-
projectConfig: ProjectConfigInitialized;
|
|
135
|
-
viteCmd: ViteCommand;
|
|
136
|
-
localPkgJson: Record<string, any>;
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Interface for plugin configuration.
|
|
140
|
-
*/
|
|
141
|
-
interface PluginConfig {
|
|
142
|
-
/**
|
|
143
|
-
* Generates plugin(s) based on the provided configuration.
|
|
144
|
-
* @param {Context} ctx - The main configuration object.
|
|
145
|
-
* @returns {any[]} An array of plugins.
|
|
146
|
-
*/
|
|
147
|
-
generate: (ctx: Context) => any[];
|
|
148
|
-
/**
|
|
149
|
-
* Condition to determine if the plugin(s) should be included.
|
|
150
|
-
* @param {Context} ctx - The main configuration object.
|
|
151
|
-
* @returns {boolean} True if the plugin(s) should be included; false otherwise.
|
|
152
|
-
*/
|
|
153
|
-
condition?: (ctx: Context) => boolean;
|
|
154
|
-
}
|
|
155
|
-
export { ViteMode, Stage, ProjectType, Flag, Target, ViteEnv, ExternalizeLibs, ResolveEnvs, ProjectConfig, ProjectConfigInitialized, ViteCommand, CommonProjectConfig, Context, PluginConfig };
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { PreRenderedChunk } from 'rollup';
|
|
2
|
-
import { PluginOption } from 'vite';
|
|
3
|
-
import { Context, PluginConfig } from "../types.js";
|
|
4
|
-
/**
|
|
5
|
-
* Deeply merges two objects, combining their properties.
|
|
6
|
-
*
|
|
7
|
-
* @param {Record<string, any>} v1 - The first object.
|
|
8
|
-
* @param {Record<string, any>} v2 - The second object.
|
|
9
|
-
* @returns {Record<string, any>} - The merged object.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* const obj1 = { a: 1, b: { c: 2 } };
|
|
13
|
-
* const obj2 = { b: { d: 3 } };
|
|
14
|
-
* const merged = deepMerge(obj1, obj2); // Outputs: { a: 1, b: { c: 2, d: 3 } }
|
|
15
|
-
*/
|
|
16
|
-
declare function deepMerge(v1: Record<string, any>, v2: Record<string, any>): Record<string, any>;
|
|
17
|
-
/**
|
|
18
|
-
* Generates a name for js files.
|
|
19
|
-
*
|
|
20
|
-
* @param {string} [prefix] - An optional prefix for the chunk name.
|
|
21
|
-
* @returns - A function that takes an item and generates a chunk name.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* const generateChunkName = chunkName('prefix');
|
|
25
|
-
* const name = generateChunkName({ name: 'example' }); // Outputs: "prefix-example-Aj3_Dk7_2j.js"
|
|
26
|
-
*/
|
|
27
|
-
declare const chunkName: (prefix?: string) => (x: PreRenderedChunk) => string;
|
|
28
|
-
/**
|
|
29
|
-
* Returns the given object if the condition is true, otherwise returns null.
|
|
30
|
-
*
|
|
31
|
-
* @param {any} condition - The condition to evaluate.
|
|
32
|
-
* @param {Record<string, any>} obj - The object to return if the condition is true.
|
|
33
|
-
* @returns {Record<string, any> | null} - The object or null based on the condition.
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* const obj = { a: 1 };
|
|
37
|
-
* const result = when(true, obj); // Outputs: { a: 1 }
|
|
38
|
-
* const result2 = when(false, obj); // Outputs: {}
|
|
39
|
-
*/
|
|
40
|
-
declare const when: (condition: any, obj: Record<string, any>) => Record<string, any>;
|
|
41
|
-
/**
|
|
42
|
-
* Filters and generates plugin configurations based on conditions and the provided context.
|
|
43
|
-
*
|
|
44
|
-
* @param {Context} ctx - The main configuration object.
|
|
45
|
-
* @returns {any[]} - An array of generated plugin configurations.
|
|
46
|
-
*/
|
|
47
|
-
declare const getPlugins: (ctx: Context, ...pluginConfigs: PluginConfig[]) => PluginOption[];
|
|
48
|
-
/**
|
|
49
|
-
* Gets the paths to the tsconfig files for all relevant projects.
|
|
50
|
-
*
|
|
51
|
-
* @returns {string[]} - An array containing paths to tsconfig files for both app and lib projects.
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* const projects = {
|
|
55
|
-
* 'my-app': {
|
|
56
|
-
* type: 'app',
|
|
57
|
-
* data: { root: 'apps/my-app' }
|
|
58
|
-
* },
|
|
59
|
-
* 'my-lib': {
|
|
60
|
-
* type: 'lib',
|
|
61
|
-
* data: { root: 'libs/my-lib' }
|
|
62
|
-
* }
|
|
63
|
-
* };
|
|
64
|
-
*
|
|
65
|
-
* const tsConfigPaths = getTsConfigPaths(projects);
|
|
66
|
-
* console.log(tsConfigPaths);
|
|
67
|
-
* // Output:
|
|
68
|
-
* // ['apps/my-app/tsconfig.app.json', 'libs/my-lib/tsconfig.lib.json']
|
|
69
|
-
*/
|
|
70
|
-
declare const getNxTsConfigPaths: () => string[];
|
|
71
|
-
export { deepMerge, chunkName, when, getPlugins, getNxTsConfigPaths };
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { UserConfig } from 'vite';
|
|
2
|
-
import { CommonProjectConfig, ProjectConfig, ProjectConfigInitialized } from "../types.js";
|
|
3
|
-
/**
|
|
4
|
-
* Initializes the project configuration with default values.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* const config = { type: ProjectType.APP, path: '/path/to/project', viteEnv: { mode: ViteMode.DEV } };
|
|
8
|
-
* const initializedConfig = initializeConfig(config);
|
|
9
|
-
*/
|
|
10
|
-
declare const initializeConfig: (ccfg: CommonProjectConfig, pcfg: ProjectConfig, localPkgJson: Record<string, any>) => {
|
|
11
|
-
viteCmd: import("../types.js").ViteCommand;
|
|
12
|
-
cfg: ProjectConfigInitialized;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Handles merging configurations and logs any errors.
|
|
16
|
-
*
|
|
17
|
-
* @param {UserConfig} defaultConfig - The default configuration.
|
|
18
|
-
* @param {UserConfig} overrides - The overrides configuration.
|
|
19
|
-
* @returns {UserConfig} - The merged configuration.
|
|
20
|
-
*/
|
|
21
|
-
declare const mergeConfigs: (defaultConfig: UserConfig, overrides: UserConfig) => UserConfig;
|
|
22
|
-
/**
|
|
23
|
-
* Resolves glob patterns to actual package names found in package.json dependencies.
|
|
24
|
-
* This function is used to determine which packages should be treated as external
|
|
25
|
-
* in a Rollup or Vite build configuration.
|
|
26
|
-
*
|
|
27
|
-
* @param {string} path - The base path where package.json is located.
|
|
28
|
-
* @param {string | string[]} globs - A glob pattern or an array of glob patterns to match dependencies against.
|
|
29
|
-
* @returns {string[]} An array of package names that match the given glob patterns.
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* // Example of using `getExternalDependencies` to find all dependencies starting with "my-lib" and "lodash"
|
|
33
|
-
* const projectPath = '/path/to/project';
|
|
34
|
-
* const globs = ['my-lib*', 'lodash'];
|
|
35
|
-
* const externalDependencies = getExternalDependencies(projectPath, globs);
|
|
36
|
-
* console.log(externalDependencies);
|
|
37
|
-
* // Output might be: ['my-lib/utils', 'my-lib/core', 'lodash']
|
|
38
|
-
*/
|
|
39
|
-
declare const getExternalDependencies: (path: string, globs?: string | string[]) => string[];
|
|
40
|
-
/**
|
|
41
|
-
* Generates a string of initials based on the input string,
|
|
42
|
-
* following certain rules:
|
|
43
|
-
* 1. A word is considered as a sequence of characters
|
|
44
|
-
* separated by hyphens.
|
|
45
|
-
* 2. If the string contains '@', any characters before
|
|
46
|
-
* and including the next '/' are ignored.
|
|
47
|
-
* 3. The first character of each word is taken to form
|
|
48
|
-
* the initials.
|
|
49
|
-
*
|
|
50
|
-
* @param {string} input - The input string from which to generate the initials.
|
|
51
|
-
* @returns {string} The initials formed by taking the first character
|
|
52
|
-
* of each word, after applying the specified rules.
|
|
53
|
-
*
|
|
54
|
-
* @example
|
|
55
|
-
* getInitials("player-script"); // returns "ps"
|
|
56
|
-
* getInitials("ssv-admin"); // returns "sa"
|
|
57
|
-
* getInitials("@nizza/customize-live"); // returns "cl"
|
|
58
|
-
*/
|
|
59
|
-
declare function getInitials(input: string): string;
|
|
60
|
-
export { initializeConfig, mergeConfigs, getExternalDependencies, getInitials };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ViteMode, ViteCommand } from "../types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Retrieves the Vite command details.
|
|
4
|
-
*
|
|
5
|
-
* @param {ViteMode} mode - The Vite mode.
|
|
6
|
-
* @returns {ViteCommand} - The command details.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* const command = getViteCommand(ViteMode.PROD);
|
|
10
|
-
* // Outputs: { stage: Stage.PROD, target: 'build', flags: {} }
|
|
11
|
-
*/
|
|
12
|
-
declare function getViteCommand(mode: ViteMode): ViteCommand;
|
|
13
|
-
/**
|
|
14
|
-
* Parses the command string to extract flags.
|
|
15
|
-
*
|
|
16
|
-
* @param {string | undefined} commandString - The command string.
|
|
17
|
-
* @returns {Record<string, string>} - The flags extracted from the command string.
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* const flags = getViteCmdFlags('nx run core:build --source-maps');
|
|
21
|
-
* // Outputs: { 'source-maps: 'true' }
|
|
22
|
-
*/
|
|
23
|
-
declare function getViteCmdFlags(commandString: string | undefined): Record<string, string>;
|
|
24
|
-
export { getViteCommand, getViteCmdFlags };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Plugin } from 'vite';
|
|
2
|
-
interface Execute {
|
|
3
|
-
function: (data?: string) => void;
|
|
4
|
-
listen: string;
|
|
5
|
-
observer: string;
|
|
6
|
-
}
|
|
7
|
-
interface ThirdPartyCssInjectPlugin {
|
|
8
|
-
topExecutionPriority?: boolean;
|
|
9
|
-
execute?: Execute[];
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Inject the CSS compiled with JS.
|
|
13
|
-
*
|
|
14
|
-
* @return {Plugin}
|
|
15
|
-
*/
|
|
16
|
-
declare function thirdPartyCssInjectPlugin({ topExecutionPriority, execute }?: ThirdPartyCssInjectPlugin | undefined): Plugin;
|
|
17
|
-
export { Execute, ThirdPartyCssInjectPlugin, thirdPartyCssInjectPlugin };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { OutputChunk } from 'rollup';
|
|
2
|
-
import { Execute } from "../../../index-3080371d.js";
|
|
3
|
-
declare function buildCSSInjectionCode(execute?: Execute[]): Promise<OutputChunk | null | any>;
|
|
4
|
-
declare function removeLinkStyleSheets(html: string, cssFileName: string): string;
|
|
5
|
-
export { buildCSSInjectionCode, removeLinkStyleSheets };
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
declare function cleanS3Bucket(s3BucketPath: string): Promise<void>;
|
|
2
|
-
declare function copyAssetsToS3(s3BucketPath: string, projectRoot: string): Promise<void>;
|
|
3
|
-
declare function createCloudFrontInvalidation(distributionId: string, invalidationPaths: string[]): Promise<void>;
|
|
4
|
-
export { cleanS3Bucket, copyAssetsToS3, createCloudFrontInvalidation };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ExecutorContext } from '@nx/devkit';
|
|
2
|
-
import { ExecutorResponse } from "../../index-f6330edc.js";
|
|
3
|
-
interface ExecutorOptions {
|
|
4
|
-
s3BucketPath: string;
|
|
5
|
-
cloudFrontDistributionId: string;
|
|
6
|
-
cloudFrontInvalidationPaths: string[];
|
|
7
|
-
buildTarget: string;
|
|
8
|
-
skipBuild?: boolean;
|
|
9
|
-
}
|
|
10
|
-
declare function deployExecutor(opts: ExecutorOptions, ctx: ExecutorContext): Promise<ExecutorResponse>;
|
|
11
|
-
export { ExecutorOptions, deployExecutor as default };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
interface CreateEnvironmentData {
|
|
2
|
-
projectOrg: string;
|
|
3
|
-
coreEnvFile: string;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Creates the content for an environment file based on the core environment path.
|
|
7
|
-
*
|
|
8
|
-
* @param {CreateEnvironmentData} data - Values to replace in template.
|
|
9
|
-
* @returns {string} The content of the environment file.
|
|
10
|
-
*/
|
|
11
|
-
declare function createEnvironmentFileContent({ coreEnvFile, projectOrg, }: CreateEnvironmentData): Promise<string>;
|
|
12
|
-
/**
|
|
13
|
-
* Ensures that the given directory exists, creating it if it does not.
|
|
14
|
-
*
|
|
15
|
-
* @param {string} dir - The path to the directory to check/create.
|
|
16
|
-
*/
|
|
17
|
-
declare function ensureDirectoryExists(dir: string): Promise<void>;
|
|
18
|
-
/**
|
|
19
|
-
* Writes environment files to the given base path if they do not already exist.
|
|
20
|
-
*
|
|
21
|
-
* @param {string} basePath - The base directory where the files should be written.
|
|
22
|
-
* @param {Record<string, string>} files - An object containing filenames and their respective content.
|
|
23
|
-
*/
|
|
24
|
-
declare function writeFilesIfNotExist(basePath: string, files: Record<string, string>): Promise<void>;
|
|
25
|
-
export { createEnvironmentFileContent, ensureDirectoryExists, writeFilesIfNotExist };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ExecutorContext } from '@nx/devkit';
|
|
2
|
-
import { ExecutorResponse } from "../../index-f6330edc.js";
|
|
3
|
-
interface ExecutorOptions {
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* The executor function to create environment files.
|
|
7
|
-
* Ensures that the directory for the environment files exists and creates the files
|
|
8
|
-
* if they do not exist already. Files created are 'environment.ts', 'environment.prod.ts',
|
|
9
|
-
* and 'environment.staging.ts'.
|
|
10
|
-
*
|
|
11
|
-
* @param {ExecutorOptions} _opts - Executor options, currently not used but provided for future extensibility.
|
|
12
|
-
* @param {ExecutorContext} ctx - The executor context, providing access to the project configuration.
|
|
13
|
-
* @returns {Promise<ExecutorResponse>} The result object with a success or error status.
|
|
14
|
-
*/
|
|
15
|
-
declare function runExecutor(_opts: ExecutorOptions, ctx: ExecutorContext): Promise<ExecutorResponse>;
|
|
16
|
-
export { ExecutorOptions, runExecutor as default };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Retrieves the version of a published package with a given name and tag.
|
|
3
|
-
*
|
|
4
|
-
* @param {string} packageName The name of the package to retrieve the version for.
|
|
5
|
-
* @param {string} tag The tag to retrieve the version for.
|
|
6
|
-
* @returns The version of the package as a string or an object containing versions for each tag.
|
|
7
|
-
*/
|
|
8
|
-
declare function getPublishedPackageVersion(packageName: string, tag?: string): Promise<any>;
|
|
9
|
-
/**
|
|
10
|
-
* Checks if a package with the given name is already published and returns its version.
|
|
11
|
-
*
|
|
12
|
-
* @param {string} packageName The name of the package to check for.
|
|
13
|
-
* @returns An object containing the published versions of the package and a flag indicating if it is the first version.
|
|
14
|
-
*/
|
|
15
|
-
declare function checkPublishedVersion(packageName: string): Promise<{
|
|
16
|
-
publishedVersion: any;
|
|
17
|
-
isFirstVersion: boolean;
|
|
18
|
-
}>;
|
|
19
|
-
export { getPublishedPackageVersion, checkPublishedVersion };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ExecutorContext } from '@nx/devkit';
|
|
2
|
-
import { ExecutorResponse } from "../../index-f6330edc.js";
|
|
3
|
-
interface ExecutorOptions {
|
|
4
|
-
tag: string;
|
|
5
|
-
dryRun?: boolean;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* This is a minimal script to publish package to "npm".
|
|
9
|
-
* Need to authenticate with NPM before running this script.
|
|
10
|
-
*/
|
|
11
|
-
declare function runExecutor(opts: ExecutorOptions, ctx: ExecutorContext): Promise<ExecutorResponse>;
|
|
12
|
-
export { ExecutorOptions, runExecutor as default };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { ExecutorContext, ProjectConfiguration } from '@nx/devkit';
|
|
2
|
-
import { ExecutorResponse } from "../../types-7377dcc9.js";
|
|
3
|
-
/**
|
|
4
|
-
* Indicates a successful executor operation.
|
|
5
|
-
*
|
|
6
|
-
* @param {string} message - Optional message to log for the success case.
|
|
7
|
-
* @returns {ExecutorResponse} - An object representing a successful operation.
|
|
8
|
-
*/
|
|
9
|
-
declare function ok(message?: string): ExecutorResponse;
|
|
10
|
-
/**
|
|
11
|
-
* Indicates a failed executor operation.
|
|
12
|
-
*
|
|
13
|
-
* @param {string | Error | unknown} err - An optional error object or message indicating the nature of the failure.
|
|
14
|
-
* @param {string} message - An optional message to log for the error case. If not provided, a default error message is logged.
|
|
15
|
-
* @returns {ExecutorResponse} - An object representing a failed operation.
|
|
16
|
-
*/
|
|
17
|
-
declare function err(err?: string | Error | unknown, message?: string): ExecutorResponse;
|
|
18
|
-
/**
|
|
19
|
-
* Retrieves the project configuration for the current execution context.
|
|
20
|
-
*
|
|
21
|
-
* @param {ExecutorContext} ctx - The execution context containing project information.
|
|
22
|
-
* @returns {ProjectConfiguration} - The configuration object for the current project.
|
|
23
|
-
* @throws {Error} If the project configuration is invalid or not found.
|
|
24
|
-
*/
|
|
25
|
-
declare function getProjectConfig(ctx: ExecutorContext): ProjectConfiguration;
|
|
26
|
-
declare function runCommand(command: string, cwd?: string | URL): Promise<void>;
|
|
27
|
-
export { ok, err, getProjectConfig, runCommand };
|