@nx/js 24.0.0-beta.2 → 24.0.0-beta.4
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/internal.d.ts +2 -0
- package/dist/internal.js +8 -2
- package/dist/src/generators/init/init.js +3 -33
- package/dist/src/generators/init/schema.d.ts +0 -1
- package/dist/src/generators/library/library.d.ts +1 -1
- package/dist/src/generators/library/library.js +3 -16
- package/dist/src/generators/library/schema.d.ts +0 -1
- package/dist/src/generators/setup-build/generator.js +0 -5
- package/dist/src/plugins/scripts/create-script-nodes.d.ts +6 -2
- package/dist/src/plugins/scripts/create-script-nodes.js +18 -71
- package/dist/src/plugins/scripts/node-plugin.d.ts +2 -1
- package/dist/src/plugins/scripts/shebang.d.ts +7 -2
- package/dist/src/plugins/scripts/shebang.js +27 -10
- package/dist/src/plugins/scripts/target-name.d.ts +9 -0
- package/dist/src/plugins/scripts/target-name.js +19 -0
- package/dist/src/plugins/scripts/tsx-plugin.d.ts +3 -2
- package/dist/src/plugins/typescript/build-typechecks.d.ts +8 -0
- package/dist/src/plugins/typescript/build-typechecks.js +45 -0
- package/dist/src/plugins/typescript/plugin.js +107 -38
- package/dist/src/plugins/typescript/typecheck-target.d.ts +54 -0
- package/dist/src/plugins/typescript/typecheck-target.js +81 -0
- package/dist/src/utils/add-linting-to-project.d.ts +0 -2
- package/dist/src/utils/add-linting-to-project.js +0 -3
- package/dist/src/utils/swc/compile-swc.d.ts +2 -0
- package/dist/src/utils/swc/compile-swc.js +2 -1
- package/dist/src/utils/typescript/add-typescript-plugin.d.ts +22 -0
- package/dist/src/utils/typescript/add-typescript-plugin.js +145 -0
- package/dist/src/utils/typescript/ts-solution-setup.d.ts +1 -1
- package/dist/src/utils/typescript/ts-solution-setup.js +1 -10
- package/package.json +11 -11
- package/dist/src/plugins/scripts/frontmatter.d.ts +0 -6
- package/dist/src/plugins/scripts/frontmatter.js +0 -52
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/js",
|
|
3
|
-
"version": "24.0.0-beta.
|
|
3
|
+
"version": "24.0.0-beta.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"files": [
|
|
@@ -154,8 +154,8 @@
|
|
|
154
154
|
"@babel/preset-env": "^7.23.2",
|
|
155
155
|
"@babel/preset-typescript": "^7.22.5",
|
|
156
156
|
"@babel/runtime": "^7.22.6",
|
|
157
|
-
"@nx/devkit": "24.0.0-beta.
|
|
158
|
-
"@nx/workspace": "24.0.0-beta.
|
|
157
|
+
"@nx/devkit": "24.0.0-beta.4",
|
|
158
|
+
"@nx/workspace": "24.0.0-beta.4",
|
|
159
159
|
"@zkochan/js-yaml": "0.0.7",
|
|
160
160
|
"babel-plugin-const-enum": "^1.0.1",
|
|
161
161
|
"babel-plugin-macros": "^3.1.0",
|
|
@@ -175,14 +175,14 @@
|
|
|
175
175
|
"tslib": "^2.3.0"
|
|
176
176
|
},
|
|
177
177
|
"devDependencies": {
|
|
178
|
-
"@nx/esbuild": "24.0.0-beta.
|
|
179
|
-
"@nx/eslint": "24.0.0-beta.
|
|
180
|
-
"@nx/jest": "24.0.0-beta.
|
|
181
|
-
"@nx/oxlint": "24.0.0-beta.
|
|
182
|
-
"@nx/rollup": "24.0.0-beta.
|
|
183
|
-
"@nx/vite": "24.0.0-beta.
|
|
184
|
-
"@nx/vitest": "24.0.0-beta.
|
|
185
|
-
"nx": "24.0.0-beta.
|
|
178
|
+
"@nx/esbuild": "24.0.0-beta.4",
|
|
179
|
+
"@nx/eslint": "24.0.0-beta.4",
|
|
180
|
+
"@nx/jest": "24.0.0-beta.4",
|
|
181
|
+
"@nx/oxlint": "24.0.0-beta.4",
|
|
182
|
+
"@nx/rollup": "24.0.0-beta.4",
|
|
183
|
+
"@nx/vite": "24.0.0-beta.4",
|
|
184
|
+
"@nx/vitest": "24.0.0-beta.4",
|
|
185
|
+
"nx": "24.0.0-beta.4"
|
|
186
186
|
},
|
|
187
187
|
"peerDependencies": {
|
|
188
188
|
"@swc/cli": ">=0.6.0 <0.9.0",
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export type Frontmatter = Record<string, unknown>;
|
|
2
|
-
/**
|
|
3
|
-
* Reads the YAML in a `/** @nx ... *\/` block comment after the shebang. Any other
|
|
4
|
-
* first comment yields `{}`. Throws on malformed YAML or an unterminated `@nx` block.
|
|
5
|
-
*/
|
|
6
|
-
export declare function parseFrontmatter(source: string): Frontmatter;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseFrontmatter = parseFrontmatter;
|
|
4
|
-
const js_yaml_1 = require("@zkochan/js-yaml");
|
|
5
|
-
const shebang_1 = require("./shebang");
|
|
6
|
-
/**
|
|
7
|
-
* Reads the YAML in a `/** @nx ... *\/` block comment after the shebang. Any other
|
|
8
|
-
* first comment yields `{}`. Throws on malformed YAML or an unterminated `@nx` block.
|
|
9
|
-
*/
|
|
10
|
-
function parseFrontmatter(source) {
|
|
11
|
-
const lines = (0, shebang_1.stripBom)(source).split(/\r?\n/);
|
|
12
|
-
// lines[0] is the shebang; blank lines may follow it.
|
|
13
|
-
let start = 1;
|
|
14
|
-
while (start < lines.length && !lines[start].trim()) {
|
|
15
|
-
start++;
|
|
16
|
-
}
|
|
17
|
-
if (!lines[start]?.trim().startsWith('/*')) {
|
|
18
|
-
return {};
|
|
19
|
-
}
|
|
20
|
-
const block = [];
|
|
21
|
-
let terminated = false;
|
|
22
|
-
for (let i = start; i < lines.length; i++) {
|
|
23
|
-
let line = i === start ? lines[i].trim().replace(/^\/\*\*?/, '') : lines[i];
|
|
24
|
-
const end = line.indexOf('*/');
|
|
25
|
-
if (end !== -1) {
|
|
26
|
-
line = line.slice(0, end);
|
|
27
|
-
terminated = true;
|
|
28
|
-
}
|
|
29
|
-
// Tolerate JSDoc-style ` * ` line prefixes.
|
|
30
|
-
block.push(line.replace(/^\s*\* ?/, ''));
|
|
31
|
-
if (terminated) {
|
|
32
|
-
break;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
const firstContent = block.findIndex((line) => line.trim());
|
|
36
|
-
const marker = (block[firstContent] ?? '').match(/^\s*@nx(?=\s|$)(.*)$/);
|
|
37
|
-
if (!marker) {
|
|
38
|
-
return {};
|
|
39
|
-
}
|
|
40
|
-
if (!terminated) {
|
|
41
|
-
throw new Error('Unterminated "@nx" frontmatter block.');
|
|
42
|
-
}
|
|
43
|
-
const body = [marker[1].trim(), ...block.slice(firstContent + 1)];
|
|
44
|
-
const parsed = (0, js_yaml_1.load)(body.join('\n'));
|
|
45
|
-
if (parsed == null) {
|
|
46
|
-
return {};
|
|
47
|
-
}
|
|
48
|
-
if (typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
49
|
-
throw new Error('The "@nx" frontmatter block must be a YAML mapping.');
|
|
50
|
-
}
|
|
51
|
-
return parsed;
|
|
52
|
-
}
|