@nx/js 19.2.0-beta.4 → 19.2.0-beta.5
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/js",
|
|
3
|
-
"version": "19.2.0-beta.
|
|
3
|
+
"version": "19.2.0-beta.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The JS plugin for Nx contains executors and generators that provide the best experience for developing JavaScript and TypeScript projects. ",
|
|
6
6
|
"repository": {
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
"semver": "^7.5.3",
|
|
59
59
|
"source-map-support": "0.5.19",
|
|
60
60
|
"tslib": "^2.3.0",
|
|
61
|
-
"@nx/devkit": "19.2.0-beta.
|
|
62
|
-
"@nx/workspace": "19.2.0-beta.
|
|
63
|
-
"@nrwl/js": "19.2.0-beta.
|
|
61
|
+
"@nx/devkit": "19.2.0-beta.5",
|
|
62
|
+
"@nx/workspace": "19.2.0-beta.5",
|
|
63
|
+
"@nrwl/js": "19.2.0-beta.5"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"verdaccio": "^5.0.4"
|
|
@@ -41,6 +41,14 @@ async function libraryGeneratorInternal(tree, schema) {
|
|
|
41
41
|
if (options.publishable) {
|
|
42
42
|
tasks.push(await (0, generator_1.default)(tree, { ...options, skipFormat: true }));
|
|
43
43
|
}
|
|
44
|
+
if (options.bundler === 'rollup') {
|
|
45
|
+
const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/rollup', versions_1.nxVersion);
|
|
46
|
+
await configurationGenerator(tree, {
|
|
47
|
+
project: options.name,
|
|
48
|
+
compiler: 'swc',
|
|
49
|
+
format: ['cjs', 'esm'],
|
|
50
|
+
});
|
|
51
|
+
}
|
|
44
52
|
if (options.bundler === 'vite') {
|
|
45
53
|
const { viteConfigurationGenerator, createOrEditViteConfig } = (0, devkit_1.ensurePackage)('@nx/vite', versions_1.nxVersion);
|
|
46
54
|
const viteTask = await viteConfigurationGenerator(tree, {
|
|
@@ -124,36 +132,31 @@ async function addProject(tree, options) {
|
|
|
124
132
|
if (options.bundler &&
|
|
125
133
|
options.bundler !== 'none' &&
|
|
126
134
|
options.config !== 'npm-scripts') {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
if (!options.minimal &&
|
|
153
|
-
// TODO(jack): assets for rollup have validation that we need to fix (assets must be under <project-root>/src)
|
|
154
|
-
options.bundler !== 'rollup') {
|
|
155
|
-
projectConfiguration.targets.build.options.assets ??= [];
|
|
156
|
-
projectConfiguration.targets.build.options.assets.push((0, devkit_1.joinPathFragments)(options.projectRoot, '*.md'));
|
|
135
|
+
if (options.bundler !== 'rollup') {
|
|
136
|
+
const outputPath = getOutputPath(options);
|
|
137
|
+
const executor = getBuildExecutor(options.bundler);
|
|
138
|
+
(0, add_build_target_defaults_1.addBuildTargetDefaults)(tree, executor);
|
|
139
|
+
projectConfiguration.targets.build = {
|
|
140
|
+
executor,
|
|
141
|
+
outputs: ['{options.outputPath}'],
|
|
142
|
+
options: {
|
|
143
|
+
outputPath,
|
|
144
|
+
main: `${options.projectRoot}/src/index` + (options.js ? '.js' : '.ts'),
|
|
145
|
+
tsConfig: `${options.projectRoot}/tsconfig.lib.json`,
|
|
146
|
+
assets: [],
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
if (options.bundler === 'esbuild') {
|
|
150
|
+
projectConfiguration.targets.build.options.generatePackageJson = true;
|
|
151
|
+
projectConfiguration.targets.build.options.format = ['cjs'];
|
|
152
|
+
}
|
|
153
|
+
if (options.bundler === 'swc' && options.skipTypeCheck) {
|
|
154
|
+
projectConfiguration.targets.build.options.skipTypeCheck = true;
|
|
155
|
+
}
|
|
156
|
+
if (!options.minimal) {
|
|
157
|
+
projectConfiguration.targets.build.options.assets ??= [];
|
|
158
|
+
projectConfiguration.targets.build.options.assets.push((0, devkit_1.joinPathFragments)(options.projectRoot, '*.md'));
|
|
159
|
+
}
|
|
157
160
|
}
|
|
158
161
|
if (options.publishable) {
|
|
159
162
|
const packageRoot = (0, path_1.join)(defaultOutputDirectory, '{projectRoot}');
|
|
@@ -201,6 +204,8 @@ async function addLint(tree, options) {
|
|
|
201
204
|
setParserOptionsProject: options.setParserOptionsProject,
|
|
202
205
|
rootProject: options.rootProject,
|
|
203
206
|
addPlugin: options.addPlugin,
|
|
207
|
+
// Since the build target is inferred now, we need to let the generator know to add @nx/dependency-checks regardless.
|
|
208
|
+
addPackageJsonDependencyChecks: options.bundler !== 'none',
|
|
204
209
|
});
|
|
205
210
|
const { addOverrideToLintConfig, lintConfigHasOverride, isEslintConfigSupported, updateOverrideInLintConfig,
|
|
206
211
|
// nx-ignore-next-line
|