@rs-x/cli 2.0.0-next.13 → 2.0.0-next.15

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
@@ -1310,16 +1310,36 @@ function scaffoldProjectTemplate(template, projectName, pm, flags) {
1310
1310
  }
1311
1311
 
1312
1312
  if (template === 'react') {
1313
- run('npx', ['create-vite@latest', projectName, '--template', 'react-ts'], {
1314
- dryRun,
1315
- });
1313
+ run(
1314
+ 'npx',
1315
+ [
1316
+ 'create-vite@latest',
1317
+ projectName,
1318
+ '--no-interactive',
1319
+ '--template',
1320
+ 'react-ts',
1321
+ ],
1322
+ {
1323
+ dryRun,
1324
+ },
1325
+ );
1316
1326
  return;
1317
1327
  }
1318
1328
 
1319
1329
  if (template === 'vuejs') {
1320
- run('npx', ['create-vite@latest', projectName, '--template', 'vue-ts'], {
1321
- dryRun,
1322
- });
1330
+ run(
1331
+ 'npx',
1332
+ [
1333
+ 'create-vite@latest',
1334
+ projectName,
1335
+ '--no-interactive',
1336
+ '--template',
1337
+ 'vue-ts',
1338
+ ],
1339
+ {
1340
+ dryRun,
1341
+ },
1342
+ );
1323
1343
  return;
1324
1344
  }
1325
1345
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rs-x/cli",
3
- "version": "2.0.0-next.13",
3
+ "version": "2.0.0-next.15",
4
4
  "description": "CLI for installing RS-X compiler tooling and VS Code integration",
5
5
  "bin": {
6
6
  "rsx": "./bin/rsx.cjs"
@@ -1,18 +1,48 @@
1
1
  import { InjectionContainer } from '@rs-x/core';
2
2
  import { RsXExpressionParserModule } from '@rs-x/expression-parser';
3
3
 
4
- import { registerRsxAotCompiledExpressions } from './rsx-generated/rsx-aot-compiled.generated';
5
- import { registerRsxAotParsedExpressionCache } from './rsx-generated/rsx-aot-preparsed.generated';
6
-
7
4
  let initialized = false;
8
5
 
6
+ type RsxCompiledModule = {
7
+ registerRsxAotCompiledExpressions?: () => void;
8
+ };
9
+
10
+ type RsxPreparsedModule = {
11
+ registerRsxAotParsedExpressionCache?: () => void;
12
+ };
13
+
14
+ async function loadCompiledModule(): Promise<RsxCompiledModule> {
15
+ try {
16
+ return (await import(
17
+ /* @vite-ignore */
18
+ './rsx-generated/' + 'rsx-aot-compiled.generated'
19
+ )) as RsxCompiledModule;
20
+ } catch {
21
+ return {};
22
+ }
23
+ }
24
+
25
+ async function loadPreparsedModule(): Promise<RsxPreparsedModule> {
26
+ try {
27
+ return (await import(
28
+ /* @vite-ignore */
29
+ './rsx-generated/' + 'rsx-aot-preparsed.generated'
30
+ )) as RsxPreparsedModule;
31
+ } catch {
32
+ return {};
33
+ }
34
+ }
35
+
9
36
  export async function initRsx(): Promise<void> {
10
37
  if (initialized) {
11
38
  return;
12
39
  }
13
40
 
14
- registerRsxAotParsedExpressionCache();
15
- registerRsxAotCompiledExpressions();
41
+ const preparsedModule = await loadPreparsedModule();
42
+ const compiledModule = await loadCompiledModule();
43
+
44
+ preparsedModule.registerRsxAotParsedExpressionCache?.();
45
+ compiledModule.registerRsxAotCompiledExpressions?.();
16
46
  await InjectionContainer.load(RsXExpressionParserModule);
17
47
  initialized = true;
18
48
  }
@@ -13,5 +13,5 @@
13
13
  }
14
14
  ]
15
15
  },
16
- "include": ["src/**/*.ts", "src/**/*.tsx"]
16
+ "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts"]
17
17
  }