@knighted/duel 2.0.0-rc.1 → 2.0.0-rc.2
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/duel.cjs +1 -1
- package/dist/cjs/init.d.cts +2 -2
- package/dist/cjs/util.cjs +6 -2
- package/dist/esm/duel.js +3 -3
- package/dist/esm/init.d.ts +2 -2
- package/dist/esm/util.js +7 -3
- package/package.json +13 -11
package/dist/cjs/duel.cjs
CHANGED
|
@@ -38,7 +38,7 @@ const duel = async (args) => {
|
|
|
38
38
|
const runBuild = (project, outDir) => {
|
|
39
39
|
return new Promise((resolve, reject) => {
|
|
40
40
|
const args = outDir ? ['-p', project, '--outDir', outDir] : ['-p', project];
|
|
41
|
-
const build = (0, node_child_process_1.spawn)(tsc, args, { stdio: 'inherit' });
|
|
41
|
+
const build = (0, node_child_process_1.spawn)(tsc, args, { stdio: 'inherit', shell: node_process_1.platform === 'win32' });
|
|
42
42
|
build.on('error', err => {
|
|
43
43
|
reject(new Error(`Failed to compile: ${err.message}`));
|
|
44
44
|
});
|
package/dist/cjs/init.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export function init(args: any): Promise<false | {
|
|
2
2
|
pkg: import("read-package-up", { with: { "resolution-mode": "import" } }).NormalizedReadResult;
|
|
3
|
-
dirs: boolean
|
|
4
|
-
modules: boolean
|
|
3
|
+
dirs: boolean;
|
|
4
|
+
modules: boolean;
|
|
5
5
|
tsconfig: any;
|
|
6
6
|
projectDir: string;
|
|
7
7
|
configPath: string;
|
package/dist/cjs/util.cjs
CHANGED
|
@@ -5,6 +5,7 @@ const node_url_1 = require("node:url");
|
|
|
5
5
|
const promises_1 = require("node:fs/promises");
|
|
6
6
|
const node_child_process_1 = require("node:child_process");
|
|
7
7
|
const node_process_1 = require("node:process");
|
|
8
|
+
const node_os_1 = require("node:os");
|
|
8
9
|
const log = (color = '\x1b[30m', msg = '') => {
|
|
9
10
|
// eslint-disable-next-line no-console
|
|
10
11
|
console.log(`${color}%s\x1b[0m`, msg);
|
|
@@ -19,11 +20,14 @@ const getRealPathAsFileUrl = async (path) => {
|
|
|
19
20
|
};
|
|
20
21
|
exports.getRealPathAsFileUrl = getRealPathAsFileUrl;
|
|
21
22
|
const getCompileFiles = (tscBinPath, wd = (0, node_process_1.cwd)()) => {
|
|
22
|
-
const { stdout } = (0, node_child_process_1.spawnSync)(tscBinPath, ['--listFilesOnly'], {
|
|
23
|
+
const { stdout } = (0, node_child_process_1.spawnSync)(tscBinPath, ['--listFilesOnly'], {
|
|
24
|
+
cwd: wd,
|
|
25
|
+
shell: node_process_1.platform === 'win32',
|
|
26
|
+
});
|
|
23
27
|
// Exclude node_modules and empty strings.
|
|
24
28
|
return stdout
|
|
25
29
|
.toString()
|
|
26
|
-
.split(
|
|
30
|
+
.split(node_os_1.EOL)
|
|
27
31
|
.filter(path => !/node_modules|^$/.test(path));
|
|
28
32
|
};
|
|
29
33
|
exports.getCompileFiles = getCompileFiles;
|
package/dist/esm/duel.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { argv } from 'node:process';
|
|
2
|
+
import { argv, platform } from 'node:process';
|
|
3
3
|
import { join, dirname, resolve, relative } from 'node:path';
|
|
4
4
|
import { spawn } from 'node:child_process';
|
|
5
|
-
import { writeFile, rm, rename,
|
|
5
|
+
import { writeFile, rm, rename, mkdir, cp } from 'node:fs/promises';
|
|
6
6
|
import { randomBytes } from 'node:crypto';
|
|
7
7
|
import { performance } from 'node:perf_hooks';
|
|
8
8
|
import { glob } from 'glob';
|
|
@@ -35,7 +35,7 @@ const duel = async (args) => {
|
|
|
35
35
|
const runBuild = (project, outDir) => {
|
|
36
36
|
return new Promise((resolve, reject) => {
|
|
37
37
|
const args = outDir ? ['-p', project, '--outDir', outDir] : ['-p', project];
|
|
38
|
-
const build = spawn(tsc, args, { stdio: 'inherit' });
|
|
38
|
+
const build = spawn(tsc, args, { stdio: 'inherit', shell: platform === 'win32' });
|
|
39
39
|
build.on('error', err => {
|
|
40
40
|
reject(new Error(`Failed to compile: ${err.message}`));
|
|
41
41
|
});
|
package/dist/esm/init.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export function init(args: any): Promise<false | {
|
|
2
2
|
pkg: import("read-package-up").NormalizedReadResult;
|
|
3
|
-
dirs: boolean
|
|
4
|
-
modules: boolean
|
|
3
|
+
dirs: boolean;
|
|
4
|
+
modules: boolean;
|
|
5
5
|
tsconfig: any;
|
|
6
6
|
projectDir: string;
|
|
7
7
|
configPath: string;
|
package/dist/esm/util.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { pathToFileURL } from 'node:url';
|
|
2
2
|
import { realpath } from 'node:fs/promises';
|
|
3
3
|
import { spawnSync } from 'node:child_process';
|
|
4
|
-
import { cwd } from 'node:process';
|
|
4
|
+
import { cwd, platform } from 'node:process';
|
|
5
|
+
import { EOL } from 'node:os';
|
|
5
6
|
const log = (color = '\x1b[30m', msg = '') => {
|
|
6
7
|
// eslint-disable-next-line no-console
|
|
7
8
|
console.log(`${color}%s\x1b[0m`, msg);
|
|
@@ -13,11 +14,14 @@ const getRealPathAsFileUrl = async (path) => {
|
|
|
13
14
|
return asFileUrl;
|
|
14
15
|
};
|
|
15
16
|
const getCompileFiles = (tscBinPath, wd = cwd()) => {
|
|
16
|
-
const { stdout } = spawnSync(tscBinPath, ['--listFilesOnly'], {
|
|
17
|
+
const { stdout } = spawnSync(tscBinPath, ['--listFilesOnly'], {
|
|
18
|
+
cwd: wd,
|
|
19
|
+
shell: platform === 'win32',
|
|
20
|
+
});
|
|
17
21
|
// Exclude node_modules and empty strings.
|
|
18
22
|
return stdout
|
|
19
23
|
.toString()
|
|
20
|
-
.split(
|
|
24
|
+
.split(EOL)
|
|
21
25
|
.filter(path => !/node_modules|^$/.test(path));
|
|
22
26
|
};
|
|
23
27
|
export { log, logError, getRealPathAsFileUrl, getCompileFiles };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knighted/duel",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.2",
|
|
4
4
|
"description": "TypeScript dual packages.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/esm/duel.js",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
},
|
|
19
19
|
"engineStrict": true,
|
|
20
20
|
"scripts": {
|
|
21
|
-
"prettier": "prettier -w src/*.js test/*.js",
|
|
21
|
+
"prettier": "prettier -w *.js src/*.js test/*.js",
|
|
22
22
|
"lint": "eslint src/*.js test/*.js",
|
|
23
23
|
"test:integration": "node --test --test-reporter=spec test/integration.js",
|
|
24
24
|
"test:monorepos": "node --test --test-reporter=spec test/monorepos.js",
|
|
25
|
-
"test": "c8 --reporter=text --reporter=text-summary --reporter=lcov node --test --test-reporter=spec test
|
|
25
|
+
"test": "c8 --reporter=text --reporter=text-summary --reporter=lcov node --test --test-reporter=spec test/integration.js test/monorepos.js",
|
|
26
26
|
"build": "node src/duel.js --dirs",
|
|
27
27
|
"prepack": "npm run build"
|
|
28
28
|
},
|
|
@@ -53,17 +53,19 @@
|
|
|
53
53
|
"url": "https://github.com/knightedcodemonkey/duel/issues"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"typescript": ">=
|
|
56
|
+
"typescript": ">=5.5.0-dev || >=5.6.0-dev || >=5.7.0-dev || next"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"eslint
|
|
59
|
+
"@eslint/js": "^9.6.0",
|
|
60
|
+
"@types/node": "^22.7.4",
|
|
61
|
+
"c8": "^10.1.2",
|
|
62
|
+
"eslint": "^9.5.0",
|
|
63
|
+
"eslint-plugin-n": "^17.9.0",
|
|
64
|
+
"globals": "^15.6.0",
|
|
63
65
|
"prettier": "^3.2.4",
|
|
64
|
-
"tsx": "^4.
|
|
65
|
-
"typescript": "^5.
|
|
66
|
-
"vite": "^5.
|
|
66
|
+
"tsx": "^4.19.1",
|
|
67
|
+
"typescript": "^5.6.2",
|
|
68
|
+
"vite": "^5.4.8"
|
|
67
69
|
},
|
|
68
70
|
"dependencies": {
|
|
69
71
|
"@knighted/module": "^1.0.0-alpha.4",
|