@tanstack/create 0.61.5 → 0.62.0
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/CHANGELOG.md +23 -0
- package/dist/config-file.js +5 -2
- package/dist/custom-add-ons/starter.js +45 -28
- package/dist/file-helpers.js +1 -0
- package/dist/frameworks/react/add-ons/shadcn/assets/src/styles.css +224 -15
- package/dist/frameworks/react/add-ons/store/assets/src/lib/demo-store.ts +5 -6
- package/dist/frameworks/react/add-ons/store/assets/src/routes/demo/store.tsx.ejs +1 -1
- package/dist/frameworks/react/add-ons/store/package.json +2 -2
- package/dist/frameworks/react/add-ons/strapi/README.md +158 -8
- package/dist/frameworks/react/add-ons/strapi/assets/_dot_env.local.append +1 -1
- package/dist/frameworks/react/add-ons/strapi/assets/src/components/blocks/block-renderer.tsx +55 -0
- package/dist/frameworks/react/add-ons/strapi/assets/src/components/blocks/index.ts +14 -0
- package/dist/frameworks/react/add-ons/strapi/assets/src/components/blocks/media.tsx +27 -0
- package/dist/frameworks/react/add-ons/strapi/assets/src/components/blocks/quote.tsx +19 -0
- package/dist/frameworks/react/add-ons/strapi/assets/src/components/blocks/rich-text.tsx +11 -0
- package/dist/frameworks/react/add-ons/strapi/assets/src/components/blocks/slider.tsx +28 -0
- package/dist/frameworks/react/add-ons/strapi/assets/src/components/markdown-content.tsx +74 -0
- package/dist/frameworks/react/add-ons/strapi/assets/src/components/pagination.tsx +120 -0
- package/dist/frameworks/react/add-ons/strapi/assets/src/components/search.tsx +35 -0
- package/dist/frameworks/react/add-ons/strapi/assets/src/components/strapi-image.tsx +47 -0
- package/dist/frameworks/react/add-ons/strapi/assets/src/data/loaders/articles.ts +106 -0
- package/dist/frameworks/react/add-ons/strapi/assets/src/data/loaders/index.ts +28 -0
- package/dist/frameworks/react/add-ons/strapi/assets/src/data/strapi-sdk.ts +9 -0
- package/dist/frameworks/react/add-ons/strapi/assets/src/lib/strapi-utils.ts +25 -0
- package/dist/frameworks/react/add-ons/strapi/assets/src/routes/demo/strapi.$articleId.tsx +170 -0
- package/dist/frameworks/react/add-ons/strapi/assets/src/routes/demo/strapi.tsx +269 -43
- package/dist/frameworks/react/add-ons/strapi/assets/src/types/strapi.ts +90 -0
- package/dist/frameworks/react/add-ons/strapi/info.json +3 -3
- package/dist/frameworks/react/add-ons/strapi/package.json +5 -2
- package/dist/frameworks/react/index.js +2 -2
- package/dist/frameworks/react/project/base/content/blog/fifth-post.mdx.ejs +54 -0
- package/dist/frameworks/react/project/base/content/blog/first-post.md.ejs +47 -0
- package/dist/frameworks/react/project/base/content/blog/fourth-post.md.ejs +42 -0
- package/dist/frameworks/react/project/base/content/blog/second-post.mdx.ejs +46 -0
- package/dist/frameworks/react/project/base/content/blog/third-post.md.ejs +49 -0
- package/dist/frameworks/react/project/base/content-collections.ts.ejs +37 -0
- package/dist/frameworks/react/project/base/package.json +8 -1
- package/dist/frameworks/react/project/base/public/images/lagoon-1.svg +13 -0
- package/dist/frameworks/react/project/base/public/images/lagoon-2.svg +12 -0
- package/dist/frameworks/react/project/base/public/images/lagoon-3.svg +12 -0
- package/dist/frameworks/react/project/base/public/images/lagoon-4.svg +12 -0
- package/dist/frameworks/react/project/base/public/images/lagoon-5.svg +12 -0
- package/dist/frameworks/react/project/base/public/images/lagoon-about.svg +14 -0
- package/dist/frameworks/react/project/base/src/components/Footer.tsx.ejs +42 -0
- package/dist/frameworks/react/project/base/src/components/Header.tsx.ejs +92 -138
- package/dist/frameworks/react/project/base/src/components/MdxCallout.tsx.ejs +16 -0
- package/dist/frameworks/react/project/base/src/components/MdxMetrics.tsx.ejs +23 -0
- package/dist/frameworks/react/project/base/src/components/ThemeToggle.tsx.ejs +81 -0
- package/dist/frameworks/react/project/base/src/lib/site.ts.ejs +4 -0
- package/dist/frameworks/react/project/base/src/main.tsx.ejs +0 -1
- package/dist/frameworks/react/project/base/src/routes/__root.tsx.ejs +10 -6
- package/dist/frameworks/react/project/base/src/routes/about.tsx.ejs +27 -0
- package/dist/frameworks/react/project/base/src/routes/blog.$slug.tsx.ejs +71 -0
- package/dist/frameworks/react/project/base/src/routes/blog.index.tsx.ejs +93 -0
- package/dist/frameworks/react/project/base/src/routes/index.tsx.ejs +58 -91
- package/dist/frameworks/react/project/base/src/routes/rss[.]xml.ts.ejs +35 -0
- package/dist/frameworks/react/project/base/src/styles.css.ejs +268 -6
- package/dist/frameworks/react/project/base/tsconfig.json.ejs +2 -0
- package/dist/frameworks/react/project/base/vite.config.ts.ejs +2 -0
- package/dist/frameworks/solid/add-ons/store/assets/src/lib/demo-store.ts +5 -6
- package/dist/frameworks/solid/add-ons/store/assets/src/routes/demo.store.tsx.ejs +2 -2
- package/dist/frameworks/solid/examples/tanchat/assets/src/lib/demo-store.ts +5 -6
- package/dist/frameworks/solid/project/base/src/components/Header.tsx.ejs +8 -6
- package/dist/frameworks/solid/project/base/src/routes/__root.tsx.ejs +1 -1
- package/dist/frameworks/solid/project/base/src/routes/index.tsx.ejs +1 -1
- package/dist/frameworks.js +3 -0
- package/dist/package-json.js +1 -1
- package/dist/registry.js +21 -4
- package/dist/types/registry.d.ts +38 -0
- package/package.json +1 -1
- package/src/config-file.ts +6 -2
- package/src/custom-add-ons/starter.ts +30 -10
- package/src/file-helpers.ts +1 -0
- package/src/frameworks/react/add-ons/shadcn/assets/src/styles.css +224 -15
- package/src/frameworks/react/add-ons/store/assets/src/lib/demo-store.ts +5 -6
- package/src/frameworks/react/add-ons/store/assets/src/routes/demo/store.tsx.ejs +1 -1
- package/src/frameworks/react/add-ons/store/package.json +2 -2
- package/src/frameworks/react/add-ons/strapi/README.md +158 -8
- package/src/frameworks/react/add-ons/strapi/assets/_dot_env.local.append +1 -1
- package/src/frameworks/react/add-ons/strapi/assets/src/components/blocks/block-renderer.tsx +55 -0
- package/src/frameworks/react/add-ons/strapi/assets/src/components/blocks/index.ts +14 -0
- package/src/frameworks/react/add-ons/strapi/assets/src/components/blocks/media.tsx +27 -0
- package/src/frameworks/react/add-ons/strapi/assets/src/components/blocks/quote.tsx +19 -0
- package/src/frameworks/react/add-ons/strapi/assets/src/components/blocks/rich-text.tsx +11 -0
- package/src/frameworks/react/add-ons/strapi/assets/src/components/blocks/slider.tsx +28 -0
- package/src/frameworks/react/add-ons/strapi/assets/src/components/markdown-content.tsx +74 -0
- package/src/frameworks/react/add-ons/strapi/assets/src/components/pagination.tsx +120 -0
- package/src/frameworks/react/add-ons/strapi/assets/src/components/search.tsx +35 -0
- package/src/frameworks/react/add-ons/strapi/assets/src/components/strapi-image.tsx +47 -0
- package/src/frameworks/react/add-ons/strapi/assets/src/data/loaders/articles.ts +106 -0
- package/src/frameworks/react/add-ons/strapi/assets/src/data/loaders/index.ts +28 -0
- package/src/frameworks/react/add-ons/strapi/assets/src/data/strapi-sdk.ts +9 -0
- package/src/frameworks/react/add-ons/strapi/assets/src/lib/strapi-utils.ts +25 -0
- package/src/frameworks/react/add-ons/strapi/assets/src/routes/demo/strapi.$articleId.tsx +170 -0
- package/src/frameworks/react/add-ons/strapi/assets/src/routes/demo/strapi.tsx +269 -43
- package/src/frameworks/react/add-ons/strapi/assets/src/types/strapi.ts +90 -0
- package/src/frameworks/react/add-ons/strapi/info.json +3 -3
- package/src/frameworks/react/add-ons/strapi/package.json +5 -2
- package/src/frameworks/react/index.ts +2 -2
- package/src/frameworks/react/project/base/content/blog/fifth-post.mdx.ejs +54 -0
- package/src/frameworks/react/project/base/content/blog/first-post.md.ejs +47 -0
- package/src/frameworks/react/project/base/content/blog/fourth-post.md.ejs +42 -0
- package/src/frameworks/react/project/base/content/blog/second-post.mdx.ejs +46 -0
- package/src/frameworks/react/project/base/content/blog/third-post.md.ejs +49 -0
- package/src/frameworks/react/project/base/content-collections.ts.ejs +37 -0
- package/src/frameworks/react/project/base/package.json +8 -1
- package/src/frameworks/react/project/base/public/images/lagoon-1.svg +13 -0
- package/src/frameworks/react/project/base/public/images/lagoon-2.svg +12 -0
- package/src/frameworks/react/project/base/public/images/lagoon-3.svg +12 -0
- package/src/frameworks/react/project/base/public/images/lagoon-4.svg +12 -0
- package/src/frameworks/react/project/base/public/images/lagoon-5.svg +12 -0
- package/src/frameworks/react/project/base/public/images/lagoon-about.svg +14 -0
- package/src/frameworks/react/project/base/src/components/Footer.tsx.ejs +42 -0
- package/src/frameworks/react/project/base/src/components/Header.tsx.ejs +92 -138
- package/src/frameworks/react/project/base/src/components/MdxCallout.tsx.ejs +16 -0
- package/src/frameworks/react/project/base/src/components/MdxMetrics.tsx.ejs +23 -0
- package/src/frameworks/react/project/base/src/components/ThemeToggle.tsx.ejs +81 -0
- package/src/frameworks/react/project/base/src/lib/site.ts.ejs +4 -0
- package/src/frameworks/react/project/base/src/main.tsx.ejs +0 -1
- package/src/frameworks/react/project/base/src/routes/__root.tsx.ejs +10 -6
- package/src/frameworks/react/project/base/src/routes/about.tsx.ejs +27 -0
- package/src/frameworks/react/project/base/src/routes/blog.$slug.tsx.ejs +71 -0
- package/src/frameworks/react/project/base/src/routes/blog.index.tsx.ejs +93 -0
- package/src/frameworks/react/project/base/src/routes/index.tsx.ejs +58 -91
- package/src/frameworks/react/project/base/src/routes/rss[.]xml.ts.ejs +35 -0
- package/src/frameworks/react/project/base/src/styles.css.ejs +268 -6
- package/src/frameworks/react/project/base/tsconfig.json.ejs +2 -0
- package/src/frameworks/react/project/base/vite.config.ts.ejs +2 -0
- package/src/frameworks/solid/add-ons/store/assets/src/lib/demo-store.ts +5 -6
- package/src/frameworks/solid/add-ons/store/assets/src/routes/demo.store.tsx.ejs +2 -2
- package/src/frameworks/solid/examples/tanchat/assets/src/lib/demo-store.ts +5 -6
- package/src/frameworks/solid/project/base/src/components/Header.tsx.ejs +8 -6
- package/src/frameworks/solid/project/base/src/routes/__root.tsx.ejs +1 -1
- package/src/frameworks/solid/project/base/src/routes/index.tsx.ejs +1 -1
- package/src/frameworks.ts +4 -0
- package/src/package-json.ts +1 -1
- package/src/registry.ts +28 -4
- package/tests/add-ons.test.ts +4 -4
- package/tests/config-file.test.ts +3 -3
- package/tests/custom-add-ons/starter.test.ts +34 -2
- package/tests/frameworks.test.ts +24 -0
- package/tests/options.test.ts +4 -4
- package/tests/utils.test.ts +2 -2
- package/dist/frameworks/react/add-ons/strapi/assets/src/lib/strapiClient.ts +0 -7
- package/dist/frameworks/react/add-ons/strapi/assets/src/routes/demo/strapi_.$articleId.tsx +0 -78
- package/src/frameworks/react/add-ons/strapi/assets/src/lib/strapiClient.ts +0 -7
- package/src/frameworks/react/add-ons/strapi/assets/src/routes/demo/strapi_.$articleId.tsx +0 -78
package/tests/options.test.ts
CHANGED
|
@@ -7,12 +7,12 @@ describe('createSerializedOptions', () => {
|
|
|
7
7
|
it('handle no add-ons', () => {
|
|
8
8
|
const options = createSerializedOptions({
|
|
9
9
|
framework: {
|
|
10
|
-
id: 'react
|
|
10
|
+
id: 'react',
|
|
11
11
|
} as Framework,
|
|
12
12
|
chosenAddOns: [],
|
|
13
13
|
} as unknown as Options)
|
|
14
14
|
expect(options).toEqual({
|
|
15
|
-
framework: 'react
|
|
15
|
+
framework: 'react',
|
|
16
16
|
chosenAddOns: [],
|
|
17
17
|
})
|
|
18
18
|
})
|
|
@@ -20,7 +20,7 @@ describe('createSerializedOptions', () => {
|
|
|
20
20
|
it('handle add-ons and a starter', () => {
|
|
21
21
|
const options = createSerializedOptions({
|
|
22
22
|
framework: {
|
|
23
|
-
id: 'react
|
|
23
|
+
id: 'react',
|
|
24
24
|
} as Framework,
|
|
25
25
|
chosenAddOns: [
|
|
26
26
|
{
|
|
@@ -34,7 +34,7 @@ describe('createSerializedOptions', () => {
|
|
|
34
34
|
} as unknown as Starter,
|
|
35
35
|
} as unknown as Options)
|
|
36
36
|
expect(options).toEqual({
|
|
37
|
-
framework: 'react
|
|
37
|
+
framework: 'react',
|
|
38
38
|
chosenAddOns: ['add-on-1'],
|
|
39
39
|
starter: 'starter-1',
|
|
40
40
|
})
|
package/tests/utils.test.ts
CHANGED
|
@@ -31,10 +31,10 @@ describe('handleSpecialURL', () => {
|
|
|
31
31
|
it('should handle special URLs', () => {
|
|
32
32
|
expect(
|
|
33
33
|
handleSpecialURL(
|
|
34
|
-
'https://github.com/TanStack/create-tsrouter-app/blob/main/examples/react
|
|
34
|
+
'https://github.com/TanStack/create-tsrouter-app/blob/main/examples/react/registry.json',
|
|
35
35
|
),
|
|
36
36
|
).toEqual(
|
|
37
|
-
'https://raw.githubusercontent.com/TanStack/create-tsrouter-app/refs/heads/main/examples/react
|
|
37
|
+
'https://raw.githubusercontent.com/TanStack/create-tsrouter-app/refs/heads/main/examples/react/registry.json',
|
|
38
38
|
)
|
|
39
39
|
|
|
40
40
|
expect(
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { articles } from '#/lib/strapiClient'
|
|
2
|
-
import { createFileRoute, Link } from '@tanstack/react-router'
|
|
3
|
-
|
|
4
|
-
export const Route = createFileRoute('/demo/strapi_/$articleId')({
|
|
5
|
-
component: RouteComponent,
|
|
6
|
-
loader: async ({ params }) => {
|
|
7
|
-
const { data: article } = await articles.findOne(params.articleId)
|
|
8
|
-
return article
|
|
9
|
-
},
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
function RouteComponent() {
|
|
13
|
-
const article = Route.useLoaderData()
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<div className="min-h-screen bg-gradient-to-b from-slate-900 via-slate-800 to-slate-900 p-8">
|
|
17
|
-
<div className="max-w-4xl mx-auto">
|
|
18
|
-
<Link
|
|
19
|
-
to="/demo/strapi"
|
|
20
|
-
className="inline-flex items-center text-cyan-400 hover:text-cyan-300 mb-6 transition-colors"
|
|
21
|
-
>
|
|
22
|
-
<svg
|
|
23
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
24
|
-
className="h-5 w-5 mr-2"
|
|
25
|
-
viewBox="0 0 20 20"
|
|
26
|
-
fill="currentColor"
|
|
27
|
-
>
|
|
28
|
-
<path
|
|
29
|
-
fillRule="evenodd"
|
|
30
|
-
d="M9.707 16.707a1 1 0 01-1.414 0l-6-6a1 1 0 010-1.414l6-6a1 1 0 011.414 1.414L5.414 9H17a1 1 0 110 2H5.414l4.293 4.293a1 1 0 010 1.414z"
|
|
31
|
-
clipRule="evenodd"
|
|
32
|
-
/>
|
|
33
|
-
</svg>
|
|
34
|
-
Back to Articles
|
|
35
|
-
</Link>
|
|
36
|
-
|
|
37
|
-
<article className="bg-slate-800/50 backdrop-blur-sm border border-slate-700 rounded-xl p-8">
|
|
38
|
-
<h1 className="text-4xl font-bold text-white mb-4">
|
|
39
|
-
{article?.title || 'Untitled'}
|
|
40
|
-
</h1>
|
|
41
|
-
|
|
42
|
-
{article?.createdAt && (
|
|
43
|
-
<p className="text-sm text-cyan-400/70 mb-6">
|
|
44
|
-
Published on{' '}
|
|
45
|
-
{new Date(article?.createdAt).toLocaleDateString('en-US', {
|
|
46
|
-
year: 'numeric',
|
|
47
|
-
month: 'long',
|
|
48
|
-
day: 'numeric',
|
|
49
|
-
})}
|
|
50
|
-
</p>
|
|
51
|
-
)}
|
|
52
|
-
|
|
53
|
-
{article?.description && (
|
|
54
|
-
<div className="mb-6">
|
|
55
|
-
<h2 className="text-xl font-semibold text-gray-300 mb-3">
|
|
56
|
-
Description
|
|
57
|
-
</h2>
|
|
58
|
-
<p className="text-gray-400 leading-relaxed">
|
|
59
|
-
{article?.description}
|
|
60
|
-
</p>
|
|
61
|
-
</div>
|
|
62
|
-
)}
|
|
63
|
-
|
|
64
|
-
{article?.content && (
|
|
65
|
-
<div>
|
|
66
|
-
<h2 className="text-xl font-semibold text-gray-300 mb-3">
|
|
67
|
-
Content
|
|
68
|
-
</h2>
|
|
69
|
-
<div className="text-gray-400 leading-relaxed whitespace-pre-wrap">
|
|
70
|
-
{article?.content}
|
|
71
|
-
</div>
|
|
72
|
-
</div>
|
|
73
|
-
)}
|
|
74
|
-
</article>
|
|
75
|
-
</div>
|
|
76
|
-
</div>
|
|
77
|
-
)
|
|
78
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { articles } from '#/lib/strapiClient'
|
|
2
|
-
import { createFileRoute, Link } from '@tanstack/react-router'
|
|
3
|
-
|
|
4
|
-
export const Route = createFileRoute('/demo/strapi_/$articleId')({
|
|
5
|
-
component: RouteComponent,
|
|
6
|
-
loader: async ({ params }) => {
|
|
7
|
-
const { data: article } = await articles.findOne(params.articleId)
|
|
8
|
-
return article
|
|
9
|
-
},
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
function RouteComponent() {
|
|
13
|
-
const article = Route.useLoaderData()
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<div className="min-h-screen bg-gradient-to-b from-slate-900 via-slate-800 to-slate-900 p-8">
|
|
17
|
-
<div className="max-w-4xl mx-auto">
|
|
18
|
-
<Link
|
|
19
|
-
to="/demo/strapi"
|
|
20
|
-
className="inline-flex items-center text-cyan-400 hover:text-cyan-300 mb-6 transition-colors"
|
|
21
|
-
>
|
|
22
|
-
<svg
|
|
23
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
24
|
-
className="h-5 w-5 mr-2"
|
|
25
|
-
viewBox="0 0 20 20"
|
|
26
|
-
fill="currentColor"
|
|
27
|
-
>
|
|
28
|
-
<path
|
|
29
|
-
fillRule="evenodd"
|
|
30
|
-
d="M9.707 16.707a1 1 0 01-1.414 0l-6-6a1 1 0 010-1.414l6-6a1 1 0 011.414 1.414L5.414 9H17a1 1 0 110 2H5.414l4.293 4.293a1 1 0 010 1.414z"
|
|
31
|
-
clipRule="evenodd"
|
|
32
|
-
/>
|
|
33
|
-
</svg>
|
|
34
|
-
Back to Articles
|
|
35
|
-
</Link>
|
|
36
|
-
|
|
37
|
-
<article className="bg-slate-800/50 backdrop-blur-sm border border-slate-700 rounded-xl p-8">
|
|
38
|
-
<h1 className="text-4xl font-bold text-white mb-4">
|
|
39
|
-
{article?.title || 'Untitled'}
|
|
40
|
-
</h1>
|
|
41
|
-
|
|
42
|
-
{article?.createdAt && (
|
|
43
|
-
<p className="text-sm text-cyan-400/70 mb-6">
|
|
44
|
-
Published on{' '}
|
|
45
|
-
{new Date(article?.createdAt).toLocaleDateString('en-US', {
|
|
46
|
-
year: 'numeric',
|
|
47
|
-
month: 'long',
|
|
48
|
-
day: 'numeric',
|
|
49
|
-
})}
|
|
50
|
-
</p>
|
|
51
|
-
)}
|
|
52
|
-
|
|
53
|
-
{article?.description && (
|
|
54
|
-
<div className="mb-6">
|
|
55
|
-
<h2 className="text-xl font-semibold text-gray-300 mb-3">
|
|
56
|
-
Description
|
|
57
|
-
</h2>
|
|
58
|
-
<p className="text-gray-400 leading-relaxed">
|
|
59
|
-
{article?.description}
|
|
60
|
-
</p>
|
|
61
|
-
</div>
|
|
62
|
-
)}
|
|
63
|
-
|
|
64
|
-
{article?.content && (
|
|
65
|
-
<div>
|
|
66
|
-
<h2 className="text-xl font-semibold text-gray-300 mb-3">
|
|
67
|
-
Content
|
|
68
|
-
</h2>
|
|
69
|
-
<div className="text-gray-400 leading-relaxed whitespace-pre-wrap">
|
|
70
|
-
{article?.content}
|
|
71
|
-
</div>
|
|
72
|
-
</div>
|
|
73
|
-
)}
|
|
74
|
-
</article>
|
|
75
|
-
</div>
|
|
76
|
-
</div>
|
|
77
|
-
)
|
|
78
|
-
}
|