@kitschpatrol/create-project 1.0.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/.github/workflows/github-release.yml +81 -0
- package/.github/workflows/set-github-metadata.yml +21 -0
- package/.prettierignore +8 -0
- package/.remarkrc.js +5 -0
- package/.vscode/extensions.json +11 -0
- package/.vscode/settings.json +66 -0
- package/cspell.config.js +3 -0
- package/dist/index.js +3602 -0
- package/eslint.config.ts +19 -0
- package/knip.config.ts +5 -0
- package/license.txt +21 -0
- package/mdat.config.ts +3 -0
- package/package.json +49 -0
- package/pnpm-workspace.yaml +7 -0
- package/prettier.config.js +3 -0
- package/readme.md +98 -0
- package/src/index.ts +9 -0
- package/src/template.ts +72 -0
- package/stylelint.config.js +3 -0
- package/templates/cli/.github/workflows/github-release.yml +81 -0
- package/templates/cli/.github/workflows/set-github-metadata.yml +21 -0
- package/templates/cli/.prettierignore +8 -0
- package/templates/cli/.remarkrc.js +6 -0
- package/templates/cli/.vscode/extensions.json +8 -0
- package/templates/cli/.vscode/settings.json +68 -0
- package/templates/cli/cspell.config.js +3 -0
- package/templates/cli/eslint.config.ts +5 -0
- package/templates/cli/knip.config.ts +3 -0
- package/templates/cli/license.txt +21 -0
- package/templates/cli/mdat.config.ts +3 -0
- package/templates/cli/package.json +54 -0
- package/templates/cli/prettier.config.js +3 -0
- package/templates/cli/readme.md +45 -0
- package/templates/cli/src/index.ts +30 -0
- package/templates/cli/tsconfig.json +7 -0
- package/templates/cli+library/.github/workflows/github-release.yml +81 -0
- package/templates/cli+library/.github/workflows/set-github-metadata.yml +21 -0
- package/templates/cli+library/.prettierignore +8 -0
- package/templates/cli+library/.remarkrc.js +6 -0
- package/templates/cli+library/.vscode/extensions.json +8 -0
- package/templates/cli+library/.vscode/settings.json +68 -0
- package/templates/cli+library/cspell.config.js +3 -0
- package/templates/cli+library/eslint.config.ts +5 -0
- package/templates/cli+library/knip.config.ts +3 -0
- package/templates/cli+library/license.txt +21 -0
- package/templates/cli+library/mdat.config.ts +3 -0
- package/templates/cli+library/package.json +62 -0
- package/templates/cli+library/prettier.config.js +3 -0
- package/templates/cli+library/readme.md +53 -0
- package/templates/cli+library/src/bin/cli.ts +42 -0
- package/templates/cli+library/src/lib/index.ts +13 -0
- package/templates/cli+library/tsconfig.build.json +8 -0
- package/templates/cli+library/tsconfig.json +7 -0
- package/templates/cli+library/tsdown.config.ts +17 -0
- package/templates/library/.github/workflows/github-release.yml +81 -0
- package/templates/library/.github/workflows/set-github-metadata.yml +21 -0
- package/templates/library/.prettierignore +8 -0
- package/templates/library/.remarkrc.js +6 -0
- package/templates/library/.vscode/extensions.json +8 -0
- package/templates/library/.vscode/settings.json +68 -0
- package/templates/library/cspell.config.js +3 -0
- package/templates/library/eslint.config.ts +5 -0
- package/templates/library/knip.config.ts +3 -0
- package/templates/library/license.txt +21 -0
- package/templates/library/mdat.config.ts +3 -0
- package/templates/library/package.json +58 -0
- package/templates/library/prettier.config.js +3 -0
- package/templates/library/readme.md +43 -0
- package/templates/library/src/index.ts +13 -0
- package/templates/library/tsconfig.build.json +8 -0
- package/templates/library/tsconfig.json +7 -0
- package/templates/minimal/.github/workflows/github-release.yml +81 -0
- package/templates/minimal/.github/workflows/set-github-metadata.yml +21 -0
- package/templates/minimal/.prettierignore +8 -0
- package/templates/minimal/.remarkrc.js +6 -0
- package/templates/minimal/.vscode/extensions.json +9 -0
- package/templates/minimal/.vscode/settings.json +68 -0
- package/templates/minimal/cspell.config.js +3 -0
- package/templates/minimal/eslint.config.ts +5 -0
- package/templates/minimal/knip.config.ts +3 -0
- package/templates/minimal/license.txt +21 -0
- package/templates/minimal/mdat.config.ts +3 -0
- package/templates/minimal/package.json +46 -0
- package/templates/minimal/prettier.config.js +3 -0
- package/templates/minimal/readme.md +27 -0
- package/templates/minimal/script.ts +1 -0
- package/templates/minimal/stylelint.config.js +3 -0
- package/templates/minimal/tsconfig.build.json +8 -0
- package/templates/minimal/tsconfig.json +7 -0
- package/templates/web/.github/workflows/github-release.yml +81 -0
- package/templates/web/.github/workflows/set-github-metadata.yml +21 -0
- package/templates/web/.prettierignore +8 -0
- package/templates/web/.remarkrc.js +6 -0
- package/templates/web/.vscode/extensions.json +9 -0
- package/templates/web/.vscode/settings.json +68 -0
- package/templates/web/cspell.config.js +3 -0
- package/templates/web/eslint.config.ts +5 -0
- package/templates/web/index.html +13 -0
- package/templates/web/knip.config.ts +3 -0
- package/templates/web/license.txt +21 -0
- package/templates/web/mdat.config.ts +3 -0
- package/templates/web/package.json +52 -0
- package/templates/web/prettier.config.js +3 -0
- package/templates/web/public/vite.svg +35 -0
- package/templates/web/readme.md +27 -0
- package/templates/web/src/counter.ts +15 -0
- package/templates/web/src/main.ts +24 -0
- package/templates/web/src/style.css +102 -0
- package/templates/web/src/typescript.svg +14 -0
- package/templates/web/stylelint.config.js +3 -0
- package/templates/web/tsconfig.build.json +8 -0
- package/templates/web/tsconfig.json +7 -0
- package/tsconfig.build.json +8 -0
- package/tsconfig.json +7 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
name: Create GitHub Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v[0-9]*'
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build:
|
|
10
|
+
name: Create Release
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
env:
|
|
13
|
+
ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN || secrets.GITHUB_TOKEN }}
|
|
14
|
+
IS_VALID_COMMIT: false
|
|
15
|
+
TAG_NAME: ''
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout
|
|
19
|
+
uses: actions/checkout@v4
|
|
20
|
+
with:
|
|
21
|
+
fetch-depth: 0
|
|
22
|
+
|
|
23
|
+
- name: Log Token Type
|
|
24
|
+
run: |
|
|
25
|
+
if [ ${{ env.ACCESS_TOKEN }} == ${{ secrets.GITHUB_TOKEN }} ]; then
|
|
26
|
+
echo "🗝️ Authenticated with GitHub Token"
|
|
27
|
+
else
|
|
28
|
+
echo "🔑 Authenticated with Personal Access token"
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
- name: Validate Tag and Branch
|
|
32
|
+
id: validation
|
|
33
|
+
run: |
|
|
34
|
+
TAG=$(git tag --contains HEAD | grep '^v[0-9]' | head -n 1)
|
|
35
|
+
echo "🏷️ Tag for commit is: $TAG"
|
|
36
|
+
BRANCH=$(git branch -r --contains tags/${GITHUB_REF_NAME} | grep 'origin/main' | xargs)
|
|
37
|
+
if [[ -z "$BRANCH" ]]; then
|
|
38
|
+
echo "🚨 Tag is not on main branch"
|
|
39
|
+
else
|
|
40
|
+
echo "🕊️ Current branch is: $BRANCH"
|
|
41
|
+
fi
|
|
42
|
+
if [[ -z "$TAG" || -z "$BRANCH" ]]; then
|
|
43
|
+
echo "IS_VALID_COMMIT=false" >> "$GITHUB_ENV"
|
|
44
|
+
echo "TAG_NAME=''" >> "$GITHUB_ENV"
|
|
45
|
+
else
|
|
46
|
+
echo "IS_VALID_COMMIT=true" >> "$GITHUB_ENV"
|
|
47
|
+
echo "TAG_NAME=$TAG" >> "$GITHUB_ENV"
|
|
48
|
+
fi
|
|
49
|
+
|
|
50
|
+
- name: Release Notes
|
|
51
|
+
if: env.IS_VALID_COMMIT == 'true'
|
|
52
|
+
id: release-notes
|
|
53
|
+
uses: kitschpatrol/github-action-release-changelog@v2
|
|
54
|
+
|
|
55
|
+
- name: Release
|
|
56
|
+
if: env.IS_VALID_COMMIT == 'true'
|
|
57
|
+
id: release
|
|
58
|
+
uses: kitschpatrol/github-action-release@v2
|
|
59
|
+
with:
|
|
60
|
+
token: ${{ env.ACCESS_TOKEN }}
|
|
61
|
+
draft: false
|
|
62
|
+
prerelease: false
|
|
63
|
+
name: ${{ env.TAG_NAME }}
|
|
64
|
+
tag_name: ${{ env.TAG_NAME }}
|
|
65
|
+
body: |
|
|
66
|
+
${{ steps.release-notes.outputs.changelog }}
|
|
67
|
+
files: |
|
|
68
|
+
readme.md
|
|
69
|
+
README.md
|
|
70
|
+
LICENSE
|
|
71
|
+
license.txt
|
|
72
|
+
CHANGELOG
|
|
73
|
+
CHANGELOG.md
|
|
74
|
+
changelog.md
|
|
75
|
+
|
|
76
|
+
- name: Log Release Details
|
|
77
|
+
if: env.IS_VALID_COMMIT == 'true'
|
|
78
|
+
run: |
|
|
79
|
+
echo "📦 Successfully released: ${{ env.TAG_NAME }}"
|
|
80
|
+
echo "🔗 Release URL: ${{ steps.release.outputs.url }}"
|
|
81
|
+
echo "🪪 Release ID: ${{ steps.release.outputs.id }}"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: Set GitHub Metadata
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches: [main]
|
|
5
|
+
workflow_dispatch: {}
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
build:
|
|
9
|
+
name: Set GitHub Metadata
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
- name: Checkout
|
|
14
|
+
uses: actions/checkout@v4
|
|
15
|
+
with:
|
|
16
|
+
fetch-depth: 0
|
|
17
|
+
|
|
18
|
+
- name: Sync Package info to GitHub
|
|
19
|
+
uses: kitschpatrol/github-action-repo-sync@v3
|
|
20
|
+
with:
|
|
21
|
+
TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"explorer.fileNesting.enabled": true,
|
|
3
|
+
"explorer.fileNesting.expand": false,
|
|
4
|
+
"explorer.fileNesting.patterns": {
|
|
5
|
+
"*.js": "*.ts.map, *.js.map, *.d.ts, *.d.ts.map, *.d.js.map",
|
|
6
|
+
"*.ts": "*.ts.map, *.d.ts, *.d.ts.map",
|
|
7
|
+
".env": ".env.*",
|
|
8
|
+
"package.json": ".*ignore, .*rc, .*.js, .*.mjs, .*.cjs, .*.ts, .*.mts, .*.cts, .*.json, .*.jsonc, .*.json5, .*.yml, .*.yaml, *config.js, *config.mjs, *config.cjs, *config.ts, *config.mts, *config.cts, *config.json, *config.jsonc, *config.json5, *config.yml, *config.yaml, pnpm*, workspace*, yarn*, lerna.json, netlify.toml, package-lock.json, turbo.json, vercel.json, wrangler.toml, yarn.lock",
|
|
9
|
+
"readme.md": "authors*, backers*, changelog*, citation*, code_of_conduct*, contributing*, contributors*, copying*, credits*, governance*, history*, license*, maintainers*, release_notes*, security*, sponsors*"
|
|
10
|
+
},
|
|
11
|
+
"typescript.enablePromptUseWorkspaceTsdk": true,
|
|
12
|
+
"typescript.tsdk": "node_modules/typescript/lib",
|
|
13
|
+
"editor.codeActionsOnSave": {
|
|
14
|
+
"source.fixAll": "explicit",
|
|
15
|
+
"source.organizeImports": "never"
|
|
16
|
+
},
|
|
17
|
+
"eslint.enable": true,
|
|
18
|
+
"eslint.runtime": "node",
|
|
19
|
+
"eslint.validate": [
|
|
20
|
+
"astro",
|
|
21
|
+
"html",
|
|
22
|
+
"javascript",
|
|
23
|
+
"javascriptreact",
|
|
24
|
+
"json",
|
|
25
|
+
"json5",
|
|
26
|
+
"jsonc",
|
|
27
|
+
"markdown",
|
|
28
|
+
"mdx",
|
|
29
|
+
"svelte",
|
|
30
|
+
"toml",
|
|
31
|
+
"typescript",
|
|
32
|
+
"typescriptreact",
|
|
33
|
+
"xml",
|
|
34
|
+
"yaml"
|
|
35
|
+
],
|
|
36
|
+
"eslint.useFlatConfig": true,
|
|
37
|
+
"cSpell.enabled": true,
|
|
38
|
+
"cSpell.workspaceRootPath": ".",
|
|
39
|
+
"[astro]": {
|
|
40
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
41
|
+
},
|
|
42
|
+
"[gitignore]": {
|
|
43
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
44
|
+
},
|
|
45
|
+
"[ruby]": {
|
|
46
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
47
|
+
},
|
|
48
|
+
"[shellscript]": {
|
|
49
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
50
|
+
},
|
|
51
|
+
"[svelte]": {
|
|
52
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
53
|
+
},
|
|
54
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
55
|
+
"editor.formatOnSave": true,
|
|
56
|
+
"prettier.documentSelectors": [
|
|
57
|
+
"**/.eslintignore",
|
|
58
|
+
"**/.node-version",
|
|
59
|
+
"**/.npmrc",
|
|
60
|
+
"**/.prettierignore",
|
|
61
|
+
"**/*.astro",
|
|
62
|
+
"**/*.rb",
|
|
63
|
+
"**/*.svelte"
|
|
64
|
+
],
|
|
65
|
+
"prettier.enable": true,
|
|
66
|
+
"stylelint.enable": true,
|
|
67
|
+
"stylelint.validate": ["css", "html", "svelte", "astro"]
|
|
68
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>vite-project</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="app"></div>
|
|
11
|
+
<script type="module" src="/src/main.ts"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 {{author-name}}
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{github-repository}}",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"description": "A {{type}} project.",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"{{type}}"
|
|
8
|
+
],
|
|
9
|
+
"homepage": "https://github.com/{{github-owner}}/{{github-repository}}",
|
|
10
|
+
"bugs": "https://github.com/{{github-owner}}/{{github-repository}}/issues",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/{{github-owner}}/{{github-repository}}.git"
|
|
14
|
+
},
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"author": {
|
|
17
|
+
"name": "{{author-name}}",
|
|
18
|
+
"email": "{{author-email}}",
|
|
19
|
+
"url": "{{author-url}}"
|
|
20
|
+
},
|
|
21
|
+
"type": "module",
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "tsc -p tsconfig.build.json && vite build",
|
|
24
|
+
"clean": "git rm -f pnpm-lock.yaml ; git clean -fdX",
|
|
25
|
+
"dev": "vite",
|
|
26
|
+
"fix": "ksc fix",
|
|
27
|
+
"lint": "ksc lint",
|
|
28
|
+
"preview": "vite preview",
|
|
29
|
+
"release": "bumpp --commit 'Release: %s'",
|
|
30
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@types/node": "^20.19.21",
|
|
34
|
+
"@types/yargs": "^17.0.33",
|
|
35
|
+
"yargs": "^17.7.2"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@kitschpatrol/shared-config": "^5.7.2",
|
|
39
|
+
"bumpp": "^10.3.1",
|
|
40
|
+
"typescript": "~5.9.3",
|
|
41
|
+
"vite": "npm:rolldown-vite@7.1.14"
|
|
42
|
+
},
|
|
43
|
+
"packageManager": "pnpm@10.18.3",
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=20.19.0"
|
|
46
|
+
},
|
|
47
|
+
"pnpm": {
|
|
48
|
+
"overrides": {
|
|
49
|
+
"vite": "npm:rolldown-vite@7.1.14"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<svg
|
|
2
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
3
|
+
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
4
|
+
aria-hidden="true"
|
|
5
|
+
role="img"
|
|
6
|
+
class="iconify iconify--logos"
|
|
7
|
+
width="31.88"
|
|
8
|
+
height="32"
|
|
9
|
+
preserveAspectRatio="xMidYMid meet"
|
|
10
|
+
viewBox="0 0 256 257"
|
|
11
|
+
><defs><linearGradient
|
|
12
|
+
id="IconifyId1813088fe1fbc01fb466"
|
|
13
|
+
x1="-.828%"
|
|
14
|
+
x2="57.636%"
|
|
15
|
+
y1="7.652%"
|
|
16
|
+
y2="78.411%"
|
|
17
|
+
><stop offset="0%" stop-color="#41D1FF" /><stop
|
|
18
|
+
offset="100%"
|
|
19
|
+
stop-color="#BD34FE"
|
|
20
|
+
/></linearGradient><linearGradient
|
|
21
|
+
id="IconifyId1813088fe1fbc01fb467"
|
|
22
|
+
x1="43.376%"
|
|
23
|
+
x2="50.316%"
|
|
24
|
+
y1="2.242%"
|
|
25
|
+
y2="89.03%"
|
|
26
|
+
><stop offset="0%" stop-color="#FFEA83" /><stop offset="8.333%" stop-color="#FFDD35" /><stop
|
|
27
|
+
offset="100%"
|
|
28
|
+
stop-color="#FFA800"
|
|
29
|
+
/></linearGradient></defs><path
|
|
30
|
+
fill="url(#IconifyId1813088fe1fbc01fb466)"
|
|
31
|
+
d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"
|
|
32
|
+
/><path
|
|
33
|
+
fill="url(#IconifyId1813088fe1fbc01fb467)"
|
|
34
|
+
d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"
|
|
35
|
+
/></svg>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<!--+ Warning: Content inside HTML comment blocks was generated by mdat and may be overwritten. +-->
|
|
2
|
+
|
|
3
|
+
<!-- title -->
|
|
4
|
+
|
|
5
|
+
<!-- badges -->
|
|
6
|
+
|
|
7
|
+
<!-- short-description -->
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
## Getting started
|
|
12
|
+
|
|
13
|
+
### Dependencies
|
|
14
|
+
|
|
15
|
+
### Deployment
|
|
16
|
+
|
|
17
|
+
## Maintainers
|
|
18
|
+
|
|
19
|
+
_List maintainer(s) for a repository, along with one way of contacting them (e.g. GitHub link or email)._
|
|
20
|
+
|
|
21
|
+
## Acknowledgments
|
|
22
|
+
|
|
23
|
+
_State anyone or anything that significantly helped with the development of your project. State public contact hyper-links if applicable._
|
|
24
|
+
|
|
25
|
+
<!-- contributing -->
|
|
26
|
+
|
|
27
|
+
<!-- license -->
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Setup the counter on the button element
|
|
3
|
+
* @param element - The button element to setup the counter on
|
|
4
|
+
*/
|
|
5
|
+
export function setupCounter(element: HTMLButtonElement) {
|
|
6
|
+
let counter = 0
|
|
7
|
+
const setCounter = (count: number) => {
|
|
8
|
+
counter = count
|
|
9
|
+
element.innerHTML = `count is ${counter}`
|
|
10
|
+
}
|
|
11
|
+
element.addEventListener('click', () => {
|
|
12
|
+
setCounter(counter + 1)
|
|
13
|
+
})
|
|
14
|
+
setCounter(0)
|
|
15
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import './style.css'
|
|
2
|
+
import { setupCounter } from './counter.ts'
|
|
3
|
+
import typescriptLogo from './typescript.svg'
|
|
4
|
+
import viteLogo from '/vite.svg'
|
|
5
|
+
|
|
6
|
+
document.querySelector<HTMLDivElement>('#app')!.innerHTML = `
|
|
7
|
+
<div>
|
|
8
|
+
<a href="https://vite.dev" target="_blank">
|
|
9
|
+
<img src="${viteLogo}" class="logo" alt="Vite logo" />
|
|
10
|
+
</a>
|
|
11
|
+
<a href="https://www.typescriptlang.org/" target="_blank">
|
|
12
|
+
<img src="${typescriptLogo}" class="logo vanilla" alt="TypeScript logo" />
|
|
13
|
+
</a>
|
|
14
|
+
<h1>Vite + TypeScript</h1>
|
|
15
|
+
<div class="card">
|
|
16
|
+
<button id="counter" type="button"></button>
|
|
17
|
+
</div>
|
|
18
|
+
<p class="read-the-docs">
|
|
19
|
+
Click on the Vite and TypeScript logos to learn more
|
|
20
|
+
</p>
|
|
21
|
+
</div>
|
|
22
|
+
`
|
|
23
|
+
|
|
24
|
+
setupCounter(document.querySelector<HTMLButtonElement>('#counter')!)
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
font-family: system-ui, Helvetica, Arial, sans-serif;
|
|
3
|
+
font-weight: 400;
|
|
4
|
+
-webkit-font-smoothing: antialiased;
|
|
5
|
+
-moz-osx-font-smoothing: grayscale;
|
|
6
|
+
line-height: 1.5;
|
|
7
|
+
color: rgb(255 255 255 / 87%);
|
|
8
|
+
text-rendering: optimizelegibility;
|
|
9
|
+
color-scheme: light dark;
|
|
10
|
+
background-color: #242424;
|
|
11
|
+
|
|
12
|
+
font-synthesis: none;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
a {
|
|
16
|
+
font-weight: 500;
|
|
17
|
+
color: #646cff;
|
|
18
|
+
text-decoration: inherit;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
a:hover {
|
|
22
|
+
color: #535bf2;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
body {
|
|
26
|
+
display: flex;
|
|
27
|
+
place-items: center;
|
|
28
|
+
min-width: 320px;
|
|
29
|
+
min-height: 100vh;
|
|
30
|
+
margin: 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
h1 {
|
|
34
|
+
font-size: 3.2em;
|
|
35
|
+
line-height: 1.1;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
#app {
|
|
39
|
+
max-width: 1280px;
|
|
40
|
+
margin: 0 auto;
|
|
41
|
+
padding: 2rem;
|
|
42
|
+
text-align: center;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.logo {
|
|
46
|
+
will-change: filter;
|
|
47
|
+
height: 6em;
|
|
48
|
+
padding: 1.5em;
|
|
49
|
+
transition: filter 300ms;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.logo:hover {
|
|
53
|
+
filter: drop-shadow(0 0 2em #646cffaa);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.logo.vanilla:hover {
|
|
57
|
+
filter: drop-shadow(0 0 2em #3178c6aa);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.card {
|
|
61
|
+
padding: 2em;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.read-the-docs {
|
|
65
|
+
color: #888;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
button {
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
padding: 0.6em 1.2em;
|
|
71
|
+
border: 1px solid transparent;
|
|
72
|
+
border-radius: 8px;
|
|
73
|
+
font-family: inherit;
|
|
74
|
+
font-size: 1em;
|
|
75
|
+
font-weight: 500;
|
|
76
|
+
background-color: #1a1a1a;
|
|
77
|
+
transition: border-color 0.25s;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
button:hover {
|
|
81
|
+
border-color: #646cff;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
button:focus,
|
|
85
|
+
button:focus-visible {
|
|
86
|
+
outline: 4px auto -webkit-focus-ring-color;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@media (prefers-color-scheme: light) {
|
|
90
|
+
:root {
|
|
91
|
+
color: #213547;
|
|
92
|
+
background-color: #ffffff;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
a:hover {
|
|
96
|
+
color: #747bff;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
button {
|
|
100
|
+
background-color: #f9f9f9;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<svg
|
|
2
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
3
|
+
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
4
|
+
aria-hidden="true"
|
|
5
|
+
role="img"
|
|
6
|
+
class="iconify iconify--logos"
|
|
7
|
+
width="32"
|
|
8
|
+
height="32"
|
|
9
|
+
preserveAspectRatio="xMidYMid meet"
|
|
10
|
+
viewBox="0 0 256 256"
|
|
11
|
+
><path fill="#007ACC" d="M0 128v128h256V0H0z" /><path
|
|
12
|
+
fill="#FFF"
|
|
13
|
+
d="m56.612 128.85l-.081 10.483h33.32v94.68h23.568v-94.68h33.321v-10.28c0-5.69-.122-10.444-.284-10.566c-.122-.162-20.4-.244-44.983-.203l-44.74.122l-.121 10.443Zm149.955-10.742c6.501 1.625 11.459 4.51 16.01 9.224c2.357 2.52 5.851 7.111 6.136 8.208c.08.325-11.053 7.802-17.798 11.988c-.244.162-1.22-.894-2.317-2.52c-3.291-4.795-6.745-6.867-12.028-7.233c-7.76-.528-12.759 3.535-12.718 10.321c0 1.992.284 3.17 1.097 4.795c1.707 3.536 4.876 5.649 14.832 9.956c18.326 7.883 26.168 13.084 31.045 20.48c5.445 8.249 6.664 21.415 2.966 31.208c-4.063 10.646-14.14 17.879-28.323 20.276c-4.388.772-14.79.65-19.504-.203c-10.28-1.828-20.033-6.908-26.047-13.572c-2.357-2.6-6.949-9.387-6.664-9.874c.122-.163 1.178-.813 2.356-1.504c1.138-.65 5.446-3.129 9.509-5.485l7.355-4.267l1.544 2.276c2.154 3.29 6.867 7.801 9.712 9.305c8.167 4.307 19.383 3.698 24.909-1.26c2.357-2.153 3.332-4.388 3.332-7.68c0-2.966-.366-4.266-1.91-6.501c-1.99-2.845-6.054-5.242-17.595-10.24c-13.206-5.69-18.895-9.224-24.096-14.832c-3.007-3.25-5.852-8.452-7.03-12.8c-.975-3.617-1.22-12.678-.447-16.335c2.723-12.76 12.353-21.659 26.25-24.3c4.51-.853 14.994-.528 19.424.569Z"
|
|
14
|
+
/></svg>
|