@rs-x/cli 2.0.0-next.0 → 2.0.0-next.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/README.md
CHANGED
|
@@ -49,10 +49,10 @@ The rs-x VS Code extension provides:
|
|
|
49
49
|
- `rsx doctor`
|
|
50
50
|
- `rsx add` (aliases: `rsx -a`, `rsx -add`)
|
|
51
51
|
- `rsx install vscode [--force] [--local] [--dry-run]`
|
|
52
|
-
- `rsx install compiler [--pm <pnpm|npm|yarn|bun>] [--dry-run]`
|
|
53
|
-
- `rsx setup [--pm <pnpm|npm|yarn|bun>] [--force] [--local] [--dry-run]`
|
|
54
|
-
- `rsx init [--pm <pnpm|npm|yarn|bun>] [--entry <path>] [--skip-install] [--skip-vscode] [--force] [--local] [--dry-run]`
|
|
55
|
-
- `rsx project [angular|vuejs|react|nextjs|nodejs] [--name <project-name>] [--template <...>] [--pm <pnpm|npm|yarn|bun>] [--skip-install] [--skip-vscode] [--dry-run]`
|
|
52
|
+
- `rsx install compiler [--pm <pnpm|npm|yarn|bun>] [--next] [--dry-run]`
|
|
53
|
+
- `rsx setup [--pm <pnpm|npm|yarn|bun>] [--next] [--force] [--local] [--dry-run]`
|
|
54
|
+
- `rsx init [--pm <pnpm|npm|yarn|bun>] [--entry <path>] [--next] [--skip-install] [--skip-vscode] [--force] [--local] [--dry-run]`
|
|
55
|
+
- `rsx project [angular|vuejs|react|nextjs|nodejs] [--name <project-name>] [--template <...>] [--pm <pnpm|npm|yarn|bun>] [--next] [--skip-install] [--skip-vscode] [--dry-run]`
|
|
56
56
|
- `rsx build [--project <path-to-tsconfig>] [--out-dir <path>] [--dry-run]`
|
|
57
57
|
- `rsx typecheck [--project <path-to-tsconfig>] [--dry-run]`
|
|
58
58
|
|
|
@@ -88,5 +88,6 @@ npx @rs-x/cli init --entry src/main.ts --skip-vscode
|
|
|
88
88
|
npx @rs-x/cli setup
|
|
89
89
|
npx @rs-x/cli install vscode --force
|
|
90
90
|
npx @rs-x/cli install compiler --pm pnpm
|
|
91
|
+
npx @rs-x/cli install compiler --next
|
|
91
92
|
npx @rs-x/cli typecheck --project tsconfig.json
|
|
92
93
|
```
|
package/bin/rsx.cjs
CHANGED
|
@@ -178,15 +178,38 @@ function detectPackageManager(explicitPm) {
|
|
|
178
178
|
return 'npm';
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
+
function applyTagToPackages(packages, tag) {
|
|
182
|
+
return packages.map((pkg) => {
|
|
183
|
+
const lastAt = pkg.lastIndexOf('@');
|
|
184
|
+
const slashIndex = pkg.indexOf('/');
|
|
185
|
+
const hasVersion = pkg.startsWith('@') ? lastAt > slashIndex : lastAt > 0;
|
|
186
|
+
if (hasVersion) {
|
|
187
|
+
return pkg;
|
|
188
|
+
}
|
|
189
|
+
return `${pkg}@${tag}`;
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function resolveInstallTag(flags) {
|
|
194
|
+
return parseBooleanFlag(flags.next, false) ? 'next' : undefined;
|
|
195
|
+
}
|
|
196
|
+
|
|
181
197
|
function installPackages(pm, packages, options = {}) {
|
|
182
|
-
const { dev = false, dryRun = false, label = 'packages' } = options;
|
|
198
|
+
const { dev = false, dryRun = false, label = 'packages', tag } = options;
|
|
199
|
+
const resolvedPackages = tag ? applyTagToPackages(packages, tag) : packages;
|
|
183
200
|
const argsByPm = {
|
|
184
|
-
pnpm: dev
|
|
201
|
+
pnpm: dev
|
|
202
|
+
? ['add', '-D', ...resolvedPackages]
|
|
203
|
+
: ['add', ...resolvedPackages],
|
|
185
204
|
npm: dev
|
|
186
|
-
? ['install', '--save-dev', ...
|
|
187
|
-
: ['install', '--save', ...
|
|
188
|
-
yarn: dev
|
|
189
|
-
|
|
205
|
+
? ['install', '--save-dev', ...resolvedPackages]
|
|
206
|
+
: ['install', '--save', ...resolvedPackages],
|
|
207
|
+
yarn: dev
|
|
208
|
+
? ['add', '--dev', ...resolvedPackages]
|
|
209
|
+
: ['add', ...resolvedPackages],
|
|
210
|
+
bun: dev
|
|
211
|
+
? ['add', '--dev', ...resolvedPackages]
|
|
212
|
+
: ['add', ...resolvedPackages],
|
|
190
213
|
};
|
|
191
214
|
|
|
192
215
|
const installArgs = argsByPm[pm];
|
|
@@ -195,23 +218,26 @@ function installPackages(pm, packages, options = {}) {
|
|
|
195
218
|
process.exit(1);
|
|
196
219
|
}
|
|
197
220
|
|
|
198
|
-
|
|
221
|
+
const tagInfo = tag ? ` (tag: ${tag})` : '';
|
|
222
|
+
logInfo(`Installing ${label} with ${pm}${tagInfo}...`);
|
|
199
223
|
run(pm, installArgs, { dryRun });
|
|
200
224
|
logOk(`Installed ${label}.`);
|
|
201
225
|
}
|
|
202
226
|
|
|
203
|
-
function installRuntimePackages(pm, dryRun) {
|
|
227
|
+
function installRuntimePackages(pm, dryRun, tag) {
|
|
204
228
|
installPackages(pm, RUNTIME_PACKAGES, {
|
|
205
229
|
dev: false,
|
|
206
230
|
dryRun,
|
|
231
|
+
tag,
|
|
207
232
|
label: 'runtime RS-X packages',
|
|
208
233
|
});
|
|
209
234
|
}
|
|
210
235
|
|
|
211
|
-
function installCompilerPackages(pm, dryRun) {
|
|
236
|
+
function installCompilerPackages(pm, dryRun, tag) {
|
|
212
237
|
installPackages(pm, COMPILER_PACKAGES, {
|
|
213
238
|
dev: true,
|
|
214
239
|
dryRun,
|
|
240
|
+
tag,
|
|
215
241
|
label: 'compiler tooling',
|
|
216
242
|
});
|
|
217
243
|
}
|
|
@@ -608,13 +634,14 @@ function resolveProjectRsxSpecs(
|
|
|
608
634
|
options = {},
|
|
609
635
|
) {
|
|
610
636
|
const includeAngularPackage = Boolean(options.includeAngularPackage);
|
|
637
|
+
const versionSpec = options.tag ? options.tag : RSX_PACKAGE_VERSION;
|
|
611
638
|
const defaults = {
|
|
612
|
-
'@rs-x/core':
|
|
613
|
-
'@rs-x/state-manager':
|
|
614
|
-
'@rs-x/expression-parser':
|
|
615
|
-
'@rs-x/compiler':
|
|
616
|
-
'@rs-x/typescript-plugin':
|
|
617
|
-
...(includeAngularPackage ? { '@rs-x/angular':
|
|
639
|
+
'@rs-x/core': versionSpec,
|
|
640
|
+
'@rs-x/state-manager': versionSpec,
|
|
641
|
+
'@rs-x/expression-parser': versionSpec,
|
|
642
|
+
'@rs-x/compiler': versionSpec,
|
|
643
|
+
'@rs-x/typescript-plugin': versionSpec,
|
|
644
|
+
...(includeAngularPackage ? { '@rs-x/angular': versionSpec } : {}),
|
|
618
645
|
'@rs-x/cli': null,
|
|
619
646
|
};
|
|
620
647
|
|
|
@@ -919,6 +946,7 @@ async function runProject(flags) {
|
|
|
919
946
|
const dryRun = Boolean(flags['dry-run']);
|
|
920
947
|
const skipInstall = Boolean(flags['skip-install']);
|
|
921
948
|
const pm = detectPackageManager(flags.pm);
|
|
949
|
+
const tag = resolveInstallTag(flags);
|
|
922
950
|
let projectName = typeof flags.name === 'string' ? flags.name.trim() : '';
|
|
923
951
|
|
|
924
952
|
if (!projectName) {
|
|
@@ -946,6 +974,7 @@ async function runProject(flags) {
|
|
|
946
974
|
projectRoot,
|
|
947
975
|
workspaceRoot,
|
|
948
976
|
tarballsDir,
|
|
977
|
+
{ tag },
|
|
949
978
|
);
|
|
950
979
|
if (fs.existsSync(projectRoot) && fs.readdirSync(projectRoot).length > 0) {
|
|
951
980
|
logError(`Target directory is not empty: ${projectRoot}`);
|
|
@@ -1700,11 +1729,12 @@ function runInit(flags) {
|
|
|
1700
1729
|
const skipVscode = Boolean(flags['skip-vscode']);
|
|
1701
1730
|
const skipInstall = Boolean(flags['skip-install']);
|
|
1702
1731
|
const pm = detectPackageManager(flags.pm);
|
|
1732
|
+
const tag = resolveInstallTag(flags);
|
|
1703
1733
|
const projectRoot = process.cwd();
|
|
1704
1734
|
|
|
1705
1735
|
if (!skipInstall) {
|
|
1706
|
-
installRuntimePackages(pm, dryRun);
|
|
1707
|
-
installCompilerPackages(pm, dryRun);
|
|
1736
|
+
installRuntimePackages(pm, dryRun, tag);
|
|
1737
|
+
installCompilerPackages(pm, dryRun, tag);
|
|
1708
1738
|
} else {
|
|
1709
1739
|
logInfo('Skipping package installation (--skip-install).');
|
|
1710
1740
|
}
|
|
@@ -2212,6 +2242,7 @@ module.exports = {
|
|
|
2212
2242
|
function runSetupReact(flags) {
|
|
2213
2243
|
const dryRun = Boolean(flags['dry-run']);
|
|
2214
2244
|
const pm = detectPackageManager(flags.pm);
|
|
2245
|
+
const tag = resolveInstallTag(flags);
|
|
2215
2246
|
const projectRoot = process.cwd();
|
|
2216
2247
|
const packageJsonPath = path.join(projectRoot, 'package.json');
|
|
2217
2248
|
if (!fs.existsSync(packageJsonPath)) {
|
|
@@ -2238,6 +2269,7 @@ function runSetupReact(flags) {
|
|
|
2238
2269
|
installPackages(pm, ['@rs-x/react'], {
|
|
2239
2270
|
dev: false,
|
|
2240
2271
|
dryRun,
|
|
2272
|
+
tag,
|
|
2241
2273
|
label: 'RS-X React bindings',
|
|
2242
2274
|
});
|
|
2243
2275
|
} else {
|
|
@@ -2253,6 +2285,7 @@ function runSetupReact(flags) {
|
|
|
2253
2285
|
function runSetupNext(flags) {
|
|
2254
2286
|
const dryRun = Boolean(flags['dry-run']);
|
|
2255
2287
|
const pm = detectPackageManager(flags.pm);
|
|
2288
|
+
const tag = resolveInstallTag(flags);
|
|
2256
2289
|
runInit({
|
|
2257
2290
|
...flags,
|
|
2258
2291
|
'skip-vscode': true,
|
|
@@ -2261,6 +2294,7 @@ function runSetupNext(flags) {
|
|
|
2261
2294
|
installPackages(pm, ['@rs-x/react'], {
|
|
2262
2295
|
dev: false,
|
|
2263
2296
|
dryRun,
|
|
2297
|
+
tag,
|
|
2264
2298
|
label: 'RS-X React bindings',
|
|
2265
2299
|
});
|
|
2266
2300
|
} else {
|
|
@@ -2276,6 +2310,7 @@ function runSetupNext(flags) {
|
|
|
2276
2310
|
function runSetupVue(flags) {
|
|
2277
2311
|
const dryRun = Boolean(flags['dry-run']);
|
|
2278
2312
|
const pm = detectPackageManager(flags.pm);
|
|
2313
|
+
const tag = resolveInstallTag(flags);
|
|
2279
2314
|
runInit({
|
|
2280
2315
|
...flags,
|
|
2281
2316
|
'skip-vscode': true,
|
|
@@ -2284,6 +2319,7 @@ function runSetupVue(flags) {
|
|
|
2284
2319
|
installPackages(pm, ['@rs-x/vue'], {
|
|
2285
2320
|
dev: false,
|
|
2286
2321
|
dryRun,
|
|
2322
|
+
tag,
|
|
2287
2323
|
label: 'RS-X Vue bindings',
|
|
2288
2324
|
});
|
|
2289
2325
|
} else {
|
|
@@ -2299,6 +2335,7 @@ function runSetupVue(flags) {
|
|
|
2299
2335
|
function runSetupAngular(flags) {
|
|
2300
2336
|
const dryRun = Boolean(flags['dry-run']);
|
|
2301
2337
|
const pm = detectPackageManager(flags.pm);
|
|
2338
|
+
const tag = resolveInstallTag(flags);
|
|
2302
2339
|
|
|
2303
2340
|
runInit({
|
|
2304
2341
|
...flags,
|
|
@@ -2309,6 +2346,7 @@ function runSetupAngular(flags) {
|
|
|
2309
2346
|
installPackages(pm, ['@rs-x/angular'], {
|
|
2310
2347
|
dev: false,
|
|
2311
2348
|
dryRun,
|
|
2349
|
+
tag,
|
|
2312
2350
|
label: 'RS-X Angular bindings',
|
|
2313
2351
|
});
|
|
2314
2352
|
installPackages(pm, ['@angular-builders/custom-webpack'], {
|
|
@@ -2345,6 +2383,7 @@ function runSetupAngular(flags) {
|
|
|
2345
2383
|
function runSetupAuto(flags) {
|
|
2346
2384
|
const projectRoot = process.cwd();
|
|
2347
2385
|
const context = detectProjectContext(projectRoot);
|
|
2386
|
+
const tag = resolveInstallTag(flags);
|
|
2348
2387
|
|
|
2349
2388
|
if (context === 'react') {
|
|
2350
2389
|
logInfo('Auto-detected framework: react');
|
|
@@ -2372,8 +2411,8 @@ function runSetupAuto(flags) {
|
|
|
2372
2411
|
|
|
2373
2412
|
logInfo('No framework-specific setup detected; running generic setup.');
|
|
2374
2413
|
const pm = detectPackageManager(flags.pm);
|
|
2375
|
-
installRuntimePackages(pm, Boolean(flags['dry-run']));
|
|
2376
|
-
installCompilerPackages(pm, Boolean(flags['dry-run']));
|
|
2414
|
+
installRuntimePackages(pm, Boolean(flags['dry-run']), tag);
|
|
2415
|
+
installCompilerPackages(pm, Boolean(flags['dry-run']), tag);
|
|
2377
2416
|
installVsCodeExtension(flags);
|
|
2378
2417
|
}
|
|
2379
2418
|
|
|
@@ -3142,24 +3181,27 @@ function printInstallHelp(target) {
|
|
|
3142
3181
|
if (target === 'compiler') {
|
|
3143
3182
|
console.log('Usage:');
|
|
3144
3183
|
console.log(
|
|
3145
|
-
' rsx install compiler [--pm <pnpm|npm|yarn|bun>] [--dry-run]',
|
|
3184
|
+
' rsx install compiler [--pm <pnpm|npm|yarn|bun>] [--next] [--dry-run]',
|
|
3146
3185
|
);
|
|
3147
3186
|
console.log('');
|
|
3148
3187
|
console.log('Options:');
|
|
3149
3188
|
console.log(' --pm Explicit package manager');
|
|
3189
|
+
console.log(' --next Install prerelease versions (dist-tag next)');
|
|
3150
3190
|
console.log(' --dry-run Print commands without executing them');
|
|
3151
3191
|
return;
|
|
3152
3192
|
}
|
|
3153
3193
|
|
|
3154
3194
|
console.log('Usage:');
|
|
3155
3195
|
console.log(' rsx install vscode [--force] [--local] [--dry-run]');
|
|
3156
|
-
console.log(
|
|
3196
|
+
console.log(
|
|
3197
|
+
' rsx install compiler [--pm <pnpm|npm|yarn|bun>] [--next] [--dry-run]',
|
|
3198
|
+
);
|
|
3157
3199
|
}
|
|
3158
3200
|
|
|
3159
3201
|
function printSetupHelp() {
|
|
3160
3202
|
console.log('Usage:');
|
|
3161
3203
|
console.log(
|
|
3162
|
-
' rsx setup [--pm <pnpm|npm|yarn|bun>] [--force] [--local] [--dry-run]',
|
|
3204
|
+
' rsx setup [--pm <pnpm|npm|yarn|bun>] [--next] [--force] [--local] [--dry-run]',
|
|
3163
3205
|
);
|
|
3164
3206
|
console.log('');
|
|
3165
3207
|
console.log('What it does:');
|
|
@@ -3173,6 +3215,7 @@ function printSetupHelp() {
|
|
|
3173
3215
|
console.log('');
|
|
3174
3216
|
console.log('Options:');
|
|
3175
3217
|
console.log(' --pm Explicit package manager');
|
|
3218
|
+
console.log(' --next Install prerelease versions (dist-tag next)');
|
|
3176
3219
|
console.log(' --force Reinstall extension if already installed');
|
|
3177
3220
|
console.log(' --local Build/install local VSIX from repo workspace');
|
|
3178
3221
|
console.log(' --dry-run Print commands without executing them');
|
|
@@ -3181,7 +3224,7 @@ function printSetupHelp() {
|
|
|
3181
3224
|
function printInitHelp() {
|
|
3182
3225
|
console.log('Usage:');
|
|
3183
3226
|
console.log(
|
|
3184
|
-
' rsx init [--pm <pnpm|npm|yarn|bun>] [--entry <path>] [--skip-install] [--skip-vscode] [--force] [--local] [--dry-run]',
|
|
3227
|
+
' rsx init [--pm <pnpm|npm|yarn|bun>] [--entry <path>] [--next] [--skip-install] [--skip-vscode] [--force] [--local] [--dry-run]',
|
|
3185
3228
|
);
|
|
3186
3229
|
console.log('');
|
|
3187
3230
|
console.log('What it does:');
|
|
@@ -3196,6 +3239,7 @@ function printInitHelp() {
|
|
|
3196
3239
|
console.log('Options:');
|
|
3197
3240
|
console.log(' --pm Explicit package manager');
|
|
3198
3241
|
console.log(' --entry Explicit application entry file');
|
|
3242
|
+
console.log(' --next Install prerelease versions (dist-tag next)');
|
|
3199
3243
|
console.log(' --skip-install Skip npm/pnpm/yarn/bun package installation');
|
|
3200
3244
|
console.log(' --skip-vscode Skip VS Code extension installation');
|
|
3201
3245
|
console.log(' --force Reinstall extension if already installed');
|
|
@@ -3206,7 +3250,7 @@ function printInitHelp() {
|
|
|
3206
3250
|
function printProjectHelp() {
|
|
3207
3251
|
console.log('Usage:');
|
|
3208
3252
|
console.log(
|
|
3209
|
-
' rsx project [angular|vuejs|react|nextjs|nodejs] [--name <project-name>] [--pm <pnpm|npm|yarn|bun>] [--template <angular|vuejs|react|nextjs|nodejs>] [--tarballs-dir <path>] [--skip-install] [--skip-vscode] [--dry-run]',
|
|
3253
|
+
' rsx project [angular|vuejs|react|nextjs|nodejs] [--name <project-name>] [--pm <pnpm|npm|yarn|bun>] [--next] [--template <angular|vuejs|react|nextjs|nodejs>] [--tarballs-dir <path>] [--skip-install] [--skip-vscode] [--dry-run]',
|
|
3210
3254
|
);
|
|
3211
3255
|
console.log('');
|
|
3212
3256
|
console.log('What it does:');
|
|
@@ -3228,6 +3272,7 @@ function printProjectHelp() {
|
|
|
3228
3272
|
' --template Project template (if omitted, asks interactively)',
|
|
3229
3273
|
);
|
|
3230
3274
|
console.log(' --pm Explicit package manager');
|
|
3275
|
+
console.log(' --next Install prerelease versions (dist-tag next)');
|
|
3231
3276
|
console.log(
|
|
3232
3277
|
' --tarballs-dir Directory containing local RS-X package tarballs (*.tgz)',
|
|
3233
3278
|
);
|
|
@@ -3449,7 +3494,8 @@ function main() {
|
|
|
3449
3494
|
|
|
3450
3495
|
if (command === 'install' && target === 'compiler') {
|
|
3451
3496
|
const pm = detectPackageManager(flags.pm);
|
|
3452
|
-
|
|
3497
|
+
const tag = resolveInstallTag(flags);
|
|
3498
|
+
installCompilerPackages(pm, Boolean(flags['dry-run']), tag);
|
|
3453
3499
|
return;
|
|
3454
3500
|
}
|
|
3455
3501
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rs-x/cli",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.2",
|
|
4
4
|
"description": "CLI for installing RS-X compiler tooling and VS Code integration",
|
|
5
5
|
"bin": {
|
|
6
6
|
"rsx": "./bin/rsx.cjs"
|
|
@@ -11,6 +11,18 @@
|
|
|
11
11
|
"*.vsix",
|
|
12
12
|
"README.md"
|
|
13
13
|
],
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/robert-sanders-software-ontwikkeling/rs-x"
|
|
17
|
+
},
|
|
18
|
+
"homepage": "https://github.com/robert-sanders-software-ontwikkeling/rs-x",
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/robert-sanders-software-ontwikkeling/rs-x/issues"
|
|
21
|
+
},
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public",
|
|
24
|
+
"provenance": true
|
|
25
|
+
},
|
|
14
26
|
"engines": {
|
|
15
27
|
"node": ">=20"
|
|
16
28
|
},
|
|
index 807d16a..d46cc36 100644
|
|
|
Binary file
|