@tanstack/cta-framework-react-cra 0.15.3 → 0.15.5
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/index.js +30 -11
- package/dist/types/index.d.ts +2 -0
- package/package.json +2 -2
- package/src/index.ts +42 -17
package/dist/index.js
CHANGED
|
@@ -1,18 +1,37 @@
|
|
|
1
1
|
import { dirname, join } from 'node:path';
|
|
2
2
|
import { fileURLToPath } from 'node:url';
|
|
3
|
-
import { registerFramework } from '@tanstack/cta-engine';
|
|
4
|
-
export function
|
|
5
|
-
|
|
3
|
+
import { registerFramework, scanAddOnDirectories, scanProjectDirectory, } from '@tanstack/cta-engine';
|
|
4
|
+
export function createFrameworkDefinition() {
|
|
5
|
+
const baseDirectory = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
6
|
+
const addOns = scanAddOnDirectories([
|
|
7
|
+
join(baseDirectory, 'add-ons'),
|
|
8
|
+
join(baseDirectory, 'toolchains'),
|
|
9
|
+
join(baseDirectory, 'examples'),
|
|
10
|
+
]);
|
|
11
|
+
const { files, basePackageJSON, optionalPackages } = scanProjectDirectory(join(baseDirectory, 'project'), join(baseDirectory, 'project/base'));
|
|
12
|
+
return {
|
|
6
13
|
id: 'react-cra',
|
|
7
14
|
name: 'react',
|
|
8
15
|
description: 'Templates for React CRA',
|
|
9
16
|
version: '0.1.0',
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
base: files,
|
|
18
|
+
addOns,
|
|
19
|
+
basePackageJSON,
|
|
20
|
+
optionalPackages,
|
|
21
|
+
supportedModes: {
|
|
22
|
+
'code-router': {
|
|
23
|
+
displayName: 'Code Router',
|
|
24
|
+
description: 'TanStack Router using code to define the routes',
|
|
25
|
+
forceTypescript: false,
|
|
26
|
+
},
|
|
27
|
+
'file-router': {
|
|
28
|
+
displayName: 'File Router',
|
|
29
|
+
description: 'TanStack Router using files to define the routes',
|
|
30
|
+
forceTypescript: true,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export function register() {
|
|
36
|
+
registerFramework(createFrameworkDefinition());
|
|
18
37
|
}
|
package/dist/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/cta-framework-react-cra",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.5",
|
|
4
4
|
"description": "CTA Framework for React (Create React App)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"author": "Jack Herrington <jherr@pobox.com>",
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@tanstack/cta-engine": "0.15.
|
|
26
|
+
"@tanstack/cta-engine": "0.15.5"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/node": "^22.13.4",
|
package/src/index.ts
CHANGED
|
@@ -1,26 +1,51 @@
|
|
|
1
1
|
import { dirname, join } from 'node:path'
|
|
2
2
|
import { fileURLToPath } from 'node:url'
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
registerFramework,
|
|
6
|
+
scanAddOnDirectories,
|
|
7
|
+
scanProjectDirectory,
|
|
8
|
+
} from '@tanstack/cta-engine'
|
|
9
|
+
import type { FrameworkDefinition } from '@tanstack/cta-engine'
|
|
5
10
|
|
|
6
|
-
export function
|
|
7
|
-
|
|
11
|
+
export function createFrameworkDefinition(): FrameworkDefinition {
|
|
12
|
+
const baseDirectory = dirname(dirname(fileURLToPath(import.meta.url)))
|
|
13
|
+
|
|
14
|
+
const addOns = scanAddOnDirectories([
|
|
15
|
+
join(baseDirectory, 'add-ons'),
|
|
16
|
+
join(baseDirectory, 'toolchains'),
|
|
17
|
+
join(baseDirectory, 'examples'),
|
|
18
|
+
])
|
|
19
|
+
|
|
20
|
+
const { files, basePackageJSON, optionalPackages } = scanProjectDirectory(
|
|
21
|
+
join(baseDirectory, 'project'),
|
|
22
|
+
join(baseDirectory, 'project/base'),
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
return {
|
|
8
26
|
id: 'react-cra',
|
|
9
27
|
name: 'react',
|
|
10
28
|
description: 'Templates for React CRA',
|
|
11
29
|
version: '0.1.0',
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
30
|
+
base: files,
|
|
31
|
+
addOns,
|
|
32
|
+
basePackageJSON,
|
|
33
|
+
optionalPackages,
|
|
34
|
+
supportedModes: {
|
|
35
|
+
'code-router': {
|
|
36
|
+
displayName: 'Code Router',
|
|
37
|
+
description: 'TanStack Router using code to define the routes',
|
|
38
|
+
forceTypescript: false,
|
|
39
|
+
},
|
|
40
|
+
'file-router': {
|
|
41
|
+
displayName: 'File Router',
|
|
42
|
+
description: 'TanStack Router using files to define the routes',
|
|
43
|
+
forceTypescript: true,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function register() {
|
|
50
|
+
registerFramework(createFrameworkDefinition())
|
|
26
51
|
}
|