@tanstack/cta-framework-solid 0.15.2 → 0.15.4
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/tests/solid.test.ts +3 -3
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: 'solid',
|
|
7
14
|
name: 'solid',
|
|
8
15
|
description: 'Solid templates for Tanstack Router Applications',
|
|
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: true,
|
|
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-solid",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.4",
|
|
4
4
|
"description": "CTA Framework for Solid",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"author": "Jack Herrington <jherr@pobox.com>",
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@tanstack/cta-engine": "0.15.
|
|
25
|
+
"@tanstack/cta-engine": "0.15.4"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@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: 'solid',
|
|
9
27
|
name: 'solid',
|
|
10
28
|
description: 'Solid templates for Tanstack Router Applications',
|
|
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: true,
|
|
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
|
}
|
package/tests/solid.test.ts
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
getFrameworkById,
|
|
8
8
|
} from '@tanstack/cta-engine'
|
|
9
9
|
|
|
10
|
-
import type { AddOn,
|
|
10
|
+
import type { AddOn, Options } from '@tanstack/cta-engine'
|
|
11
11
|
|
|
12
12
|
import { cleanupOutput } from './test-utilities.js'
|
|
13
13
|
|
|
@@ -77,7 +77,7 @@ test('file router on npm', async () => {
|
|
|
77
77
|
const { environment, output } = createMemoryEnvironment()
|
|
78
78
|
const options = {
|
|
79
79
|
...(await createSolidOptions(projectName)),
|
|
80
|
-
mode: 'file-router'
|
|
80
|
+
mode: 'file-router',
|
|
81
81
|
typescript: true,
|
|
82
82
|
}
|
|
83
83
|
await createApp(environment, options)
|
|
@@ -92,7 +92,7 @@ test('file router with tailwind on npm', async () => {
|
|
|
92
92
|
const { environment, output } = createMemoryEnvironment()
|
|
93
93
|
const options = {
|
|
94
94
|
...(await createSolidOptions(projectName)),
|
|
95
|
-
mode: 'file-router'
|
|
95
|
+
mode: 'file-router',
|
|
96
96
|
typescript: true,
|
|
97
97
|
tailwind: true,
|
|
98
98
|
}
|