@rs-x/cli 2.0.0-next.8 → 2.0.0-next.9
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/bin/rsx.cjs
CHANGED
|
@@ -671,6 +671,15 @@ function removeFileOrDirectoryWithDryRun(targetPath, dryRun) {
|
|
|
671
671
|
fs.rmSync(targetPath, { recursive: true, force: true });
|
|
672
672
|
}
|
|
673
673
|
|
|
674
|
+
function resolveAngularProjectTsConfig(projectRoot) {
|
|
675
|
+
const appTsConfigPath = path.join(projectRoot, 'tsconfig.app.json');
|
|
676
|
+
if (fs.existsSync(appTsConfigPath)) {
|
|
677
|
+
return appTsConfigPath;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
return path.join(projectRoot, 'tsconfig.json');
|
|
681
|
+
}
|
|
682
|
+
|
|
674
683
|
function toFileDependencySpec(fromDir, targetPath) {
|
|
675
684
|
const relative = path.relative(fromDir, targetPath).replace(/\\/gu, '/');
|
|
676
685
|
const normalized = relative.startsWith('.') ? relative : `./${relative}`;
|
|
@@ -1330,12 +1339,18 @@ function applyAngularDemoStarter(projectRoot, projectName, pm, flags) {
|
|
|
1330
1339
|
}
|
|
1331
1340
|
|
|
1332
1341
|
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
|
1342
|
+
const angularTsConfigPath = resolveAngularProjectTsConfig(projectRoot);
|
|
1343
|
+
const angularTsConfigRelative = path
|
|
1344
|
+
.relative(projectRoot, angularTsConfigPath)
|
|
1345
|
+
.replace(/\\/gu, '/');
|
|
1333
1346
|
packageJson.name = projectName;
|
|
1334
1347
|
packageJson.private = true;
|
|
1335
1348
|
packageJson.version = '0.1.0';
|
|
1336
1349
|
packageJson.scripts = {
|
|
1337
|
-
|
|
1338
|
-
|
|
1350
|
+
'build:rsx': `rsx build --project ${angularTsConfigRelative} --no-emit --prod`,
|
|
1351
|
+
'typecheck:rsx': `rsx typecheck --project ${angularTsConfigRelative}`,
|
|
1352
|
+
prebuild: 'npm run build:rsx',
|
|
1353
|
+
start: 'npm run build:rsx && ng serve',
|
|
1339
1354
|
build: 'ng build',
|
|
1340
1355
|
};
|
|
1341
1356
|
packageJson.rsx = {
|
|
@@ -1418,6 +1433,10 @@ function applyAngularDemoStarter(projectRoot, projectName, pm, flags) {
|
|
|
1418
1433
|
buildOptions.polyfills = polyfills;
|
|
1419
1434
|
build.options = buildOptions;
|
|
1420
1435
|
|
|
1436
|
+
if (build.configurations?.production?.budgets) {
|
|
1437
|
+
delete build.configurations.production.budgets;
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1421
1440
|
if (dryRun) {
|
|
1422
1441
|
logInfo(`[dry-run] patch ${angularJsonPath}`);
|
|
1423
1442
|
} else {
|
|
@@ -2513,6 +2532,10 @@ function runSetupReact(flags) {
|
|
|
2513
2532
|
const pm = detectPackageManager(flags.pm);
|
|
2514
2533
|
const tag = resolveInstallTag(flags);
|
|
2515
2534
|
const projectRoot = process.cwd();
|
|
2535
|
+
const angularTsConfigPath = resolveAngularProjectTsConfig(projectRoot);
|
|
2536
|
+
const angularTsConfigRelative = path
|
|
2537
|
+
.relative(projectRoot, angularTsConfigPath)
|
|
2538
|
+
.replace(/\\/gu, '/');
|
|
2516
2539
|
const packageJsonPath = path.join(projectRoot, 'package.json');
|
|
2517
2540
|
if (!fs.existsSync(packageJsonPath)) {
|
|
2518
2541
|
logError(`package.json not found in ${projectRoot}`);
|
|
@@ -2627,13 +2650,13 @@ function runSetupAngular(flags) {
|
|
|
2627
2650
|
upsertScriptInPackageJson(
|
|
2628
2651
|
projectRoot,
|
|
2629
2652
|
'build:rsx',
|
|
2630
|
-
|
|
2653
|
+
`rsx build --project ${angularTsConfigRelative} --no-emit --prod`,
|
|
2631
2654
|
dryRun,
|
|
2632
2655
|
);
|
|
2633
2656
|
upsertScriptInPackageJson(
|
|
2634
2657
|
projectRoot,
|
|
2635
2658
|
'typecheck:rsx',
|
|
2636
|
-
|
|
2659
|
+
`rsx typecheck --project ${angularTsConfigRelative}`,
|
|
2637
2660
|
dryRun,
|
|
2638
2661
|
);
|
|
2639
2662
|
|
|
@@ -2643,7 +2666,7 @@ function runSetupAngular(flags) {
|
|
|
2643
2666
|
);
|
|
2644
2667
|
ensureAngularPolyfillsContainsFile({
|
|
2645
2668
|
projectRoot,
|
|
2646
|
-
configPath:
|
|
2669
|
+
configPath: angularTsConfigPath,
|
|
2647
2670
|
filePath: rsxRegistrationFile,
|
|
2648
2671
|
dryRun,
|
|
2649
2672
|
});
|
package/package.json
CHANGED
|
Binary file
|
|
@@ -22,7 +22,7 @@ type ThemeMode = 'light' | 'dark';
|
|
|
22
22
|
export class AppComponent implements OnInit {
|
|
23
23
|
private readonly _document = inject(DOCUMENT);
|
|
24
24
|
@HostBinding('class.theme-dark') public isDarkTheme = false;
|
|
25
|
-
public theme: ThemeMode = '
|
|
25
|
+
public theme: ThemeMode = 'dark';
|
|
26
26
|
|
|
27
27
|
public ngOnInit(): void {
|
|
28
28
|
this.theme = this.getInitialTheme();
|
|
@@ -41,7 +41,7 @@ export class AppComponent implements OnInit {
|
|
|
41
41
|
return storedTheme;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
return '
|
|
44
|
+
return 'dark';
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
private applyTheme(theme: ThemeMode): void {
|