@nx/vite 22.0.0-beta.2 → 22.0.0-beta.3
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/vite",
|
|
3
|
-
"version": "22.0.0-beta.
|
|
3
|
+
"version": "22.0.0-beta.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Plugin for building and testing applications using Vite",
|
|
6
6
|
"repository": {
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
"migrations": "./migrations.json"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@nx/devkit": "22.0.0-beta.
|
|
33
|
+
"@nx/devkit": "22.0.0-beta.3",
|
|
34
34
|
"@phenomnomnominal/tsquery": "~5.0.1",
|
|
35
35
|
"enquirer": "~2.3.6",
|
|
36
|
-
"@nx/js": "22.0.0-beta.
|
|
36
|
+
"@nx/js": "22.0.0-beta.3",
|
|
37
37
|
"picomatch": "4.0.2",
|
|
38
38
|
"tsconfig-paths": "^4.1.2",
|
|
39
39
|
"semver": "^7.6.3",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"ajv": "^8.0.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"nx": "22.0.0-beta.
|
|
44
|
+
"nx": "22.0.0-beta.3"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0",
|
package/src/plugins/plugin.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CreateDependencies,
|
|
1
|
+
import { CreateDependencies, CreateNodesV2 } from '@nx/devkit';
|
|
2
2
|
export interface VitePluginOptions {
|
|
3
3
|
buildTargetName?: string;
|
|
4
4
|
testTargetName?: string;
|
|
@@ -17,6 +17,6 @@ export interface VitePluginOptions {
|
|
|
17
17
|
* @deprecated The 'createDependencies' function is now a no-op. This functionality is included in 'createNodesV2'.
|
|
18
18
|
*/
|
|
19
19
|
export declare const createDependencies: CreateDependencies;
|
|
20
|
+
export declare const createNodes: CreateNodesV2<VitePluginOptions>;
|
|
20
21
|
export declare const createNodesV2: CreateNodesV2<VitePluginOptions>;
|
|
21
|
-
export declare const createNodes: CreateNodes<VitePluginOptions>;
|
|
22
22
|
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/vite/src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/vite/src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAGlB,aAAa,EAQd,MAAM,YAAY,CAAC;AAkBpB,MAAM,WAAW,iBAAiB;IAChC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAiBD;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,kBAEhC,CAAC;AAIF,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,iBAAiB,CAuGxD,CAAC;AAEF,eAAO,MAAM,aAAa,kCAAc,CAAC"}
|
package/src/plugins/plugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.createNodesV2 = exports.createNodes = exports.createDependencies = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const path_1 = require("path");
|
|
6
6
|
const get_named_inputs_1 = require("@nx/devkit/src/utils/get-named-inputs");
|
|
@@ -30,7 +30,7 @@ const createDependencies = () => {
|
|
|
30
30
|
};
|
|
31
31
|
exports.createDependencies = createDependencies;
|
|
32
32
|
const viteVitestConfigGlob = '**/{vite,vitest}.config.{js,ts,mjs,mts,cjs,cts}';
|
|
33
|
-
exports.
|
|
33
|
+
exports.createNodes = [
|
|
34
34
|
viteVitestConfigGlob,
|
|
35
35
|
async (configFilePaths, options, context) => {
|
|
36
36
|
const optionsHash = (0, file_hasher_1.hashObject)(options);
|
|
@@ -92,43 +92,7 @@ exports.createNodesV2 = [
|
|
|
92
92
|
}
|
|
93
93
|
},
|
|
94
94
|
];
|
|
95
|
-
exports.
|
|
96
|
-
viteVitestConfigGlob,
|
|
97
|
-
async (configFilePath, options, context) => {
|
|
98
|
-
devkit_1.logger.warn('`createNodes` is deprecated. Update your plugin to utilize createNodesV2 instead. In Nx 20, this will change to the createNodesV2 API.');
|
|
99
|
-
const projectRoot = (0, path_1.dirname)(configFilePath);
|
|
100
|
-
// Do not create a project if package.json and project.json isn't there.
|
|
101
|
-
const siblingFiles = (0, fs_1.readdirSync)((0, path_1.join)(context.workspaceRoot, projectRoot));
|
|
102
|
-
if (!siblingFiles.includes('package.json') &&
|
|
103
|
-
!siblingFiles.includes('project.json')) {
|
|
104
|
-
return {};
|
|
105
|
-
}
|
|
106
|
-
const tsConfigFiles = siblingFiles.filter((p) => picomatch('tsconfig*{.json,.*.json}')(p)) ??
|
|
107
|
-
[];
|
|
108
|
-
const hasReactRouterConfig = siblingFiles.some((configFile) => {
|
|
109
|
-
const parts = configFile.split('.');
|
|
110
|
-
return (parts[0] === 'react-router' && parts[1] === 'config' && parts.length > 2);
|
|
111
|
-
});
|
|
112
|
-
const normalizedOptions = normalizeOptions(options);
|
|
113
|
-
const isUsingTsSolutionSetup = (0, ts_solution_setup_1.isUsingTsSolutionSetup)();
|
|
114
|
-
const { projectType, metadata, targets } = await buildViteTargets(configFilePath, projectRoot, normalizedOptions, tsConfigFiles, hasReactRouterConfig, isUsingTsSolutionSetup, context);
|
|
115
|
-
const project = {
|
|
116
|
-
root: projectRoot,
|
|
117
|
-
targets,
|
|
118
|
-
metadata,
|
|
119
|
-
};
|
|
120
|
-
// If project is buildable, then the project type.
|
|
121
|
-
// If it is not buildable, then leave it to other plugins/project.json to set the project type.
|
|
122
|
-
if (project.targets[normalizedOptions.buildTargetName]) {
|
|
123
|
-
project.projectType = projectType;
|
|
124
|
-
}
|
|
125
|
-
return {
|
|
126
|
-
projects: {
|
|
127
|
-
[projectRoot]: project,
|
|
128
|
-
},
|
|
129
|
-
};
|
|
130
|
-
},
|
|
131
|
-
];
|
|
95
|
+
exports.createNodesV2 = exports.createNodes;
|
|
132
96
|
async function buildViteTargets(configFilePath, projectRoot, options, tsConfigFiles, hasReactRouterConfig, isUsingTsSolutionSetup, context) {
|
|
133
97
|
const absoluteConfigFilePath = (0, devkit_1.joinPathFragments)(context.workspaceRoot, configFilePath);
|
|
134
98
|
// Workaround for the `build$3 is not a function` error that we sometimes see in agents.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/vite/src/utils/options-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,
|
|
1
|
+
{"version":3,"file":"options-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/vite/src/utils/options-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAMhB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAG9E;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,UAAU,CAAC,EAAE,MAAM,GAClB,MAAM,GAAG,SAAS,CAgCpB;AAED,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,MAAM,GAClB,MAAM,GAAG,SAAS,CAYpB;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,OAAO,EAAE,eAAe,GACvB,MAAM,GAAG,SAAS,CAapB;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,4BAA4B,EACrC,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAyBlC;AAED,wBAAgB,cAAc,CAC5B,OAAO,EAAE,eAAe,EACxB,WAAW,CAAC,EAAE,MAAM,GACnB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,SAAS,CAO9C;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,OAG1E"}
|
|
@@ -31,11 +31,11 @@ function normalizeViteConfigFilePath(contextRoot, projectRoot, configFile) {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
function getProjectTsConfigPath(projectRoot) {
|
|
34
|
-
return (0, fs_1.existsSync)((0, devkit_1.joinPathFragments)(projectRoot, 'tsconfig.app.json'))
|
|
34
|
+
return (0, fs_1.existsSync)((0, devkit_1.joinPathFragments)(devkit_1.workspaceRoot, projectRoot, 'tsconfig.app.json'))
|
|
35
35
|
? (0, devkit_1.joinPathFragments)(projectRoot, 'tsconfig.app.json')
|
|
36
|
-
: (0, fs_1.existsSync)((0, devkit_1.joinPathFragments)(projectRoot, 'tsconfig.lib.json'))
|
|
36
|
+
: (0, fs_1.existsSync)((0, devkit_1.joinPathFragments)(devkit_1.workspaceRoot, projectRoot, 'tsconfig.lib.json'))
|
|
37
37
|
? (0, devkit_1.joinPathFragments)(projectRoot, 'tsconfig.lib.json')
|
|
38
|
-
: (0, fs_1.existsSync)((0, devkit_1.joinPathFragments)(projectRoot, 'tsconfig.json'))
|
|
38
|
+
: (0, fs_1.existsSync)((0, devkit_1.joinPathFragments)(devkit_1.workspaceRoot, projectRoot, 'tsconfig.json'))
|
|
39
39
|
? (0, devkit_1.joinPathFragments)(projectRoot, 'tsconfig.json')
|
|
40
40
|
: undefined;
|
|
41
41
|
}
|