Skip to content

Commit 10a18d4

Browse files
committed
chore: example custom cli
1 parent c839c9b commit 10a18d4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1143
-123
lines changed

cli/create-start-app/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ cli({
1212
appName: 'TanStack Start',
1313
forcedMode: 'file-router',
1414
forcedAddOns: ['start'],
15+
craCompatible: true,
1516
})

cli/create-tanstack-app/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ cli({
1111
name: 'create-tanstack-app',
1212
appName: 'TanStack',
1313
defaultTemplate: 'file-router',
14+
craCompatible: true,
1415
})

cli/create-tanstack/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ cli({
1111
name: 'create-tanstack',
1212
appName: 'TanStack',
1313
defaultTemplate: 'file-router',
14+
craCompatible: true,
1415
})

cli/create-tsrouter-app/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ registerSolid()
1010
cli({
1111
name: 'create-tsrouter-app',
1212
appName: 'TanStack',
13+
craCompatible: true,
1314
})
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { component$ } from '@builder.io/qwik'
2+
import type { DocumentHead } from '@builder.io/qwik-city'
3+
import { ThumbsUpIcon } from 'qwik-feather-icons'
4+
5+
export default component$(() => {
6+
return (
7+
<>
8+
<h1 class="text-3xl font-bold underline p-5">Hi 👋</h1>
9+
<div>
10+
<ThumbsUpIcon />
11+
</div>
12+
</>
13+
)
14+
})
15+
16+
export const head: DocumentHead = {
17+
title: 'Feather Icons',
18+
meta: [
19+
{
20+
name: 'description',
21+
content: 'Feather Icons',
22+
},
23+
],
24+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "Feather Icons",
3+
"description": "Add Feather Icons to your application.",
4+
"phase": "add-on",
5+
"modes": ["default"],
6+
"type": "add-on",
7+
"link": "https://github.com/egmaleta/qwik-feather-icons",
8+
"routes": [
9+
{
10+
"url": "/demo-feather",
11+
"name": "Feather Icons",
12+
"path": "src/routes/demo-feather/index.tsx",
13+
"jsName": "FeatherIconsDemo"
14+
}
15+
]
16+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"devDependencies": {
3+
"qwik-feather-icons": "^1.2.1"
4+
}
5+
}
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "create-qwik-app",
3+
"version": "0.15.2",
4+
"description": "CTA Qwik Builder",
5+
"bin": "./dist/index.js",
6+
"type": "module",
7+
"scripts": {
8+
"build": "tsc",
9+
"dev": "tsc --watch",
10+
"start": "node dist/index.js"
11+
},
12+
"repository": {
13+
"type": "git",
14+
"url": "https://github.com/TanStack/create-router-app.git"
15+
},
16+
"homepage": "https://tanstack.com/router",
17+
"funding": {
18+
"type": "github",
19+
"url": "https://github.com/sponsors/tannerlinsley"
20+
},
21+
"keywords": [
22+
"qwik",
23+
"create-tanstack-app",
24+
"tanstack",
25+
"create-qwik-app"
26+
],
27+
"author": "Jack Herrington <[email protected]>",
28+
"license": "MIT",
29+
"packageManager": "[email protected]",
30+
"dependencies": {
31+
"@tanstack/cta-cli": "workspace:*",
32+
"@tanstack/cta-engine": "workspace:*"
33+
},
34+
"devDependencies": {
35+
"@types/node": "^22.13.4",
36+
"typescript": "^5.6.3"
37+
}
38+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
**/*.log
2+
**/.DS_Store
3+
*.
4+
.vscode/settings.json
5+
.history
6+
.yarn
7+
bazel-*
8+
bazel-bin
9+
bazel-out
10+
bazel-qwik
11+
bazel-testlogs
12+
dist
13+
dist-dev
14+
lib
15+
lib-types
16+
etc
17+
external
18+
node_modules
19+
temp
20+
tsc-out
21+
tsdoc-metadata.json
22+
target
23+
output
24+
rollup.config.js
25+
build
26+
.cache
27+
.vscode
28+
.rollup.cache
29+
dist
30+
tsconfig.tsbuildinfo
31+
vite.config.ts
32+
*.spec.tsx
33+
*.spec.ts
34+
.netlify
35+
pnpm-lock.yaml
36+
package-lock.json
37+
yarn.lock
38+
server
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
browser: true,
5+
es2021: true,
6+
node: true,
7+
},
8+
extends: [
9+
"eslint:recommended",
10+
"plugin:@typescript-eslint/recommended",
11+
"plugin:qwik/recommended",
12+
],
13+
parser: "@typescript-eslint/parser",
14+
parserOptions: {
15+
tsconfigRootDir: __dirname,
16+
project: ["./tsconfig.json"],
17+
ecmaVersion: 2021,
18+
sourceType: "module",
19+
ecmaFeatures: {
20+
jsx: true,
21+
},
22+
},
23+
plugins: ["@typescript-eslint"],
24+
rules: {
25+
"@typescript-eslint/no-explicit-any": "off",
26+
"@typescript-eslint/explicit-module-boundary-types": "off",
27+
"@typescript-eslint/no-inferrable-types": "off",
28+
"@typescript-eslint/no-non-null-assertion": "off",
29+
"@typescript-eslint/no-empty-interface": "off",
30+
"@typescript-eslint/no-namespace": "off",
31+
"@typescript-eslint/no-empty-function": "off",
32+
"@typescript-eslint/no-this-alias": "off",
33+
"@typescript-eslint/ban-types": "off",
34+
"@typescript-eslint/ban-ts-comment": "off",
35+
"prefer-spread": "off",
36+
"no-case-declarations": "off",
37+
"no-console": "off",
38+
"@typescript-eslint/no-unused-vars": ["error"],
39+
"@typescript-eslint/consistent-type-imports": "warn",
40+
"@typescript-eslint/no-unnecessary-condition": "warn",
41+
},
42+
};
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Build
2+
/dist
3+
/lib
4+
/lib-types
5+
/server
6+
7+
# Development
8+
node_modules
9+
.env
10+
*.local
11+
12+
# Cache
13+
.cache
14+
.mf
15+
.rollup.cache
16+
tsconfig.tsbuildinfo
17+
18+
# Logs
19+
logs
20+
*.log
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*
24+
pnpm-debug.log*
25+
lerna-debug.log*
26+
27+
# Editor
28+
.vscode/*
29+
!.vscode/launch.json
30+
!.vscode/*.code-snippets
31+
32+
.idea
33+
.DS_Store
34+
*.suo
35+
*.ntvs*
36+
*.njsproj
37+
*.sln
38+
*.sw?
39+
40+
# Yarn
41+
.yarn/*
42+
!.yarn/releases
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
**/*.log
2+
**/.DS_Store
3+
*.
4+
.vscode/settings.json
5+
.history
6+
.yarn
7+
bazel-*
8+
bazel-bin
9+
bazel-out
10+
bazel-qwik
11+
bazel-testlogs
12+
dist
13+
dist-dev
14+
lib
15+
lib-types
16+
etc
17+
external
18+
node_modules
19+
temp
20+
tsc-out
21+
tsdoc-metadata.json
22+
target
23+
output
24+
rollup.config.js
25+
build
26+
.cache
27+
.vscode
28+
.rollup.cache
29+
tsconfig.tsbuildinfo
30+
vite.config.ts
31+
*.spec.tsx
32+
*.spec.ts
33+
.netlify
34+
pnpm-lock.yaml
35+
package-lock.json
36+
yarn.lock
37+
server
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"recommendations": ["dbaeumer.vscode-eslint", "unifiedjs.vscode-mdx"],
3+
"unwantedRecommendations": []
4+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Launch Chrome",
9+
"request": "launch",
10+
"type": "chrome",
11+
"url": "http://localhost:5173",
12+
"webRoot": "${workspaceFolder}"
13+
},
14+
{
15+
"type": "node",
16+
"name": "dev.debug",
17+
"request": "launch",
18+
"skipFiles": ["<node_internals>/**"],
19+
"cwd": "${workspaceFolder}",
20+
"program": "${workspaceFolder}/node_modules/vite/bin/vite.js",
21+
"args": ["--mode", "ssr", "--force"]
22+
}
23+
]
24+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"onRequest": {
3+
"scope": "javascriptreact,typescriptreact",
4+
"prefix": "qonRequest",
5+
"description": "onRequest function for a route index",
6+
"body": [
7+
"export const onRequest: RequestHandler = (request) => {",
8+
" $0",
9+
"};",
10+
],
11+
},
12+
"loader$": {
13+
"scope": "javascriptreact,typescriptreact",
14+
"prefix": "qloader$",
15+
"description": "loader$()",
16+
"body": ["export const $1 = routeLoader$(() => {", " $0", "});"],
17+
},
18+
"action$": {
19+
"scope": "javascriptreact,typescriptreact",
20+
"prefix": "qaction$",
21+
"description": "action$()",
22+
"body": ["export const $1 = routeAction$((data) => {", " $0", "});"],
23+
},
24+
"Full Page": {
25+
"scope": "javascriptreact,typescriptreact",
26+
"prefix": "qpage",
27+
"description": "Simple page component",
28+
"body": [
29+
"import { component$ } from '@builder.io/qwik';",
30+
"",
31+
"export default component$(() => {",
32+
" $0",
33+
"});",
34+
],
35+
},
36+
}

0 commit comments

Comments
 (0)