@kitschpatrol/create-project 1.1.3 → 1.2.1
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 +26 -8
- package/package.json +11 -10
- package/readme.md +11 -10
- package/templates/cli/.npmrc +0 -12
- package/templates/cli/.vscode/settings.json +30 -30
- package/templates/cli/license.txt +1 -1
- package/templates/cli/package.json +19 -22
- package/templates/cli/pnpm-workspace.yaml +14 -0
- package/templates/cli+library/.npmrc +0 -12
- package/templates/cli+library/.vscode/settings.json +30 -30
- package/templates/cli+library/license.txt +1 -1
- package/templates/cli+library/package.json +19 -22
- package/templates/cli+library/pnpm-workspace.yaml +14 -0
- package/templates/electron/.npmrc +0 -12
- package/templates/electron/.vscode/settings.json +30 -30
- package/templates/electron/cspell.config.js +1 -1
- package/templates/electron/electron-builder.ts +2 -0
- package/templates/electron/eslint.config.ts +1 -0
- package/templates/electron/knip.config.ts +3 -1
- package/templates/electron/license.txt +1 -1
- package/templates/electron/package.json +17 -17
- package/templates/electron/pnpm-workspace.yaml +14 -0
- package/templates/electron/src/style.css +3 -4
- package/templates/electron/tsconfig.json +1 -1
- package/templates/library/.npmrc +0 -12
- package/templates/library/.vscode/settings.json +30 -30
- package/templates/library/license.txt +1 -1
- package/templates/library/package.json +14 -17
- package/templates/library/pnpm-workspace.yaml +14 -0
- package/templates/minimal/.npmrc +0 -12
- package/templates/minimal/.vscode/settings.json +30 -30
- package/templates/minimal/license.txt +1 -1
- package/templates/minimal/package.json +14 -14
- package/templates/minimal/pnpm-workspace.yaml +14 -0
- package/templates/unplugin/.github/workflows/github-release.yml +81 -0
- package/templates/unplugin/.github/workflows/set-github-metadata.yml +21 -0
- package/templates/unplugin/.gitignore +22 -0
- package/templates/unplugin/.npmrc +4 -0
- package/templates/unplugin/.prettierignore +8 -0
- package/templates/unplugin/.remarkrc.js +8 -0
- package/templates/unplugin/.vscode/extensions.json +9 -0
- package/templates/unplugin/.vscode/settings.json +68 -0
- package/templates/unplugin/cspell.config.js +3 -0
- package/templates/unplugin/eslint.config.ts +11 -0
- package/templates/unplugin/knip.config.ts +5 -0
- package/templates/unplugin/license.txt +21 -0
- package/templates/unplugin/mdat.config.ts +3 -0
- package/templates/unplugin/package.json +82 -0
- package/templates/unplugin/pnpm-workspace.yaml +17 -0
- package/templates/unplugin/prettier.config.js +3 -0
- package/templates/unplugin/readme.md +27 -0
- package/templates/unplugin/src/api.ts +2 -0
- package/templates/unplugin/src/core/options.ts +28 -0
- package/templates/unplugin/src/esbuild.ts +22 -0
- package/templates/unplugin/src/farm.ts +22 -0
- package/templates/unplugin/src/index.ts +27 -0
- package/templates/unplugin/src/rolldown.ts +22 -0
- package/templates/unplugin/src/rollup.ts +22 -0
- package/templates/unplugin/src/rspack.ts +22 -0
- package/templates/unplugin/src/vite.ts +22 -0
- package/templates/unplugin/src/webpack.ts +24 -0
- package/templates/unplugin/stylelint.config.js +3 -0
- package/templates/unplugin/tests/__snapshots__/rollup.test.ts.snap +10 -0
- package/templates/unplugin/tests/fixtures/basic.js +1 -0
- package/templates/unplugin/tests/rollup.test.ts +16 -0
- package/templates/unplugin/tsconfig.build.json +5 -0
- package/templates/unplugin/tsconfig.json +7 -0
- package/templates/unplugin/tsdown.config.ts +7 -0
- package/templates/web/.npmrc +0 -12
- package/templates/web/.vscode/settings.json +30 -30
- package/templates/web/license.txt +1 -1
- package/templates/web/package.json +14 -14
- package/templates/web/pnpm-workspace.yaml +14 -0
- package/templates/web/src/style.css +3 -4
|
@@ -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,22 @@
|
|
|
1
|
+
# Git Ignore
|
|
2
|
+
# Also used by CSpell, Stylelint, and ESLint
|
|
3
|
+
|
|
4
|
+
# @kitschpatrol/repo-config boilerplate
|
|
5
|
+
.astro/
|
|
6
|
+
.DS_Store
|
|
7
|
+
.env
|
|
8
|
+
.env.*
|
|
9
|
+
!.env.example
|
|
10
|
+
.eslint-config-inspector
|
|
11
|
+
.svelte-kit/
|
|
12
|
+
{tmp,temp}/
|
|
13
|
+
**/*.min.js
|
|
14
|
+
/scratch/
|
|
15
|
+
bower_components/
|
|
16
|
+
build/
|
|
17
|
+
coverage/
|
|
18
|
+
dist/
|
|
19
|
+
node_modules/
|
|
20
|
+
vendor/
|
|
21
|
+
|
|
22
|
+
# Customizations
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"[astro]": {
|
|
3
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
4
|
+
},
|
|
5
|
+
"[gitignore]": {
|
|
6
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
7
|
+
},
|
|
8
|
+
"[ruby]": {
|
|
9
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
10
|
+
},
|
|
11
|
+
"[shellscript]": {
|
|
12
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
13
|
+
},
|
|
14
|
+
"[svelte]": {
|
|
15
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
16
|
+
},
|
|
17
|
+
"cSpell.enabled": true,
|
|
18
|
+
"cSpell.workspaceRootPath": ".",
|
|
19
|
+
"editor.codeActionsOnSave": {
|
|
20
|
+
"source.fixAll": "explicit",
|
|
21
|
+
"source.organizeImports": "never"
|
|
22
|
+
},
|
|
23
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
24
|
+
"editor.formatOnSave": true,
|
|
25
|
+
"eslint.enable": true,
|
|
26
|
+
"eslint.runtime": "node",
|
|
27
|
+
"eslint.useFlatConfig": true,
|
|
28
|
+
"eslint.validate": [
|
|
29
|
+
"astro",
|
|
30
|
+
"html",
|
|
31
|
+
"javascript",
|
|
32
|
+
"javascriptreact",
|
|
33
|
+
"json",
|
|
34
|
+
"json5",
|
|
35
|
+
"jsonc",
|
|
36
|
+
"markdown",
|
|
37
|
+
"mdx",
|
|
38
|
+
"svelte",
|
|
39
|
+
"toml",
|
|
40
|
+
"typescript",
|
|
41
|
+
"typescriptreact",
|
|
42
|
+
"xml",
|
|
43
|
+
"yaml"
|
|
44
|
+
],
|
|
45
|
+
"explorer.fileNesting.enabled": true,
|
|
46
|
+
"explorer.fileNesting.expand": false,
|
|
47
|
+
"explorer.fileNesting.patterns": {
|
|
48
|
+
".env": ".env.*, .template.env",
|
|
49
|
+
"*.js": "${basename}.ts.map, ${basename}.js.map, ${basename}.d.ts, ${basename}.d.ts.map, ${basename}.d.js.map",
|
|
50
|
+
"*.ts": "${basename}.ts.map, ${basename}.d.ts, ${basename}.d.ts.map",
|
|
51
|
+
"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",
|
|
52
|
+
"readme.md": "authors*, backers*, changelog*, citation*, code_of_conduct*, contributing*, contributors*, copying*, credits*, governance*, history*, license*, maintainers*, release_notes*, security*, sponsors*"
|
|
53
|
+
},
|
|
54
|
+
"prettier.documentSelectors": [
|
|
55
|
+
"**/.eslintignore",
|
|
56
|
+
"**/.node-version",
|
|
57
|
+
"**/.npmrc",
|
|
58
|
+
"**/.prettierignore",
|
|
59
|
+
"**/*.astro",
|
|
60
|
+
"**/*.rb",
|
|
61
|
+
"**/*.svelte"
|
|
62
|
+
],
|
|
63
|
+
"prettier.enable": true,
|
|
64
|
+
"stylelint.enable": true,
|
|
65
|
+
"stylelint.validate": ["css", "html", "svelte", "astro"],
|
|
66
|
+
"typescript.enablePromptUseWorkspaceTsdk": true,
|
|
67
|
+
"typescript.tsdk": "node_modules/typescript/lib"
|
|
68
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) {{{year}}} {{{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,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{{github-repository}}}",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "An unplugin project",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"unplugin",
|
|
7
|
+
"vite",
|
|
8
|
+
"webpack",
|
|
9
|
+
"rspack",
|
|
10
|
+
"rollup",
|
|
11
|
+
"rolldown",
|
|
12
|
+
"esbuild",
|
|
13
|
+
"farm",
|
|
14
|
+
"transform",
|
|
15
|
+
"npm-package"
|
|
16
|
+
],
|
|
17
|
+
"homepage": "https://github.com/{{{github-owner}}}/{{{github-repository}}}",
|
|
18
|
+
"bugs": "https://github.com/{{{github-owner}}}/{{{github-repository}}}/issues",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/{{{github-owner}}}/{{{github-repository}}}.git"
|
|
22
|
+
},
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"author": {
|
|
25
|
+
"name": "{{{author-name}}}",
|
|
26
|
+
"email": "{{{author-email}}}",
|
|
27
|
+
"url": "{{{author-url}}}"
|
|
28
|
+
},
|
|
29
|
+
"type": "module",
|
|
30
|
+
"exports": {
|
|
31
|
+
".": "./dist/index.js",
|
|
32
|
+
"./*": "./*",
|
|
33
|
+
"./api": "./dist/api.js",
|
|
34
|
+
"./esbuild": "./dist/esbuild.js",
|
|
35
|
+
"./farm": "./dist/farm.js",
|
|
36
|
+
"./rolldown": "./dist/rolldown.js",
|
|
37
|
+
"./rollup": "./dist/rollup.js",
|
|
38
|
+
"./rspack": "./dist/rspack.js",
|
|
39
|
+
"./vite": "./dist/vite.js",
|
|
40
|
+
"./webpack": "./dist/webpack.js"
|
|
41
|
+
},
|
|
42
|
+
"main": "./dist/index.js",
|
|
43
|
+
"module": "./dist/index.js",
|
|
44
|
+
"types": "./dist/index.d.ts",
|
|
45
|
+
"typesVersions": {
|
|
46
|
+
"*": {
|
|
47
|
+
"*": [
|
|
48
|
+
"./dist/*",
|
|
49
|
+
"./*"
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"files": [
|
|
54
|
+
"dist"
|
|
55
|
+
],
|
|
56
|
+
"scripts": {
|
|
57
|
+
"build": "tsdown",
|
|
58
|
+
"clean": "git rm -f pnpm-lock.yaml ; git clean -fdX",
|
|
59
|
+
"dev": "tsdown --watch",
|
|
60
|
+
"fix": "ksc fix",
|
|
61
|
+
"lint": "ksc lint",
|
|
62
|
+
"release": "bumpp --commit 'Release: %s' && pnpm run build && NPM_AUTH_TOKEN=$(op read 'op://Personal/npm/token') && pnpm publish",
|
|
63
|
+
"test": "vitest"
|
|
64
|
+
},
|
|
65
|
+
"dependencies": {
|
|
66
|
+
"@types/node": "~22.16.5",
|
|
67
|
+
"unplugin": "^2.3.11",
|
|
68
|
+
"unplugin-utils": "^0.3.1"
|
|
69
|
+
},
|
|
70
|
+
"devDependencies": {
|
|
71
|
+
"@kitschpatrol/shared-config": "^5.10.0",
|
|
72
|
+
"@sxzz/test-utils": "^0.5.15",
|
|
73
|
+
"bumpp": "^10.3.2",
|
|
74
|
+
"tsdown": "^0.18.3",
|
|
75
|
+
"typescript": "~5.9.3",
|
|
76
|
+
"vitest": "^4.0.16"
|
|
77
|
+
},
|
|
78
|
+
"packageManager": "pnpm@10.26.2",
|
|
79
|
+
"engines": {
|
|
80
|
+
"node": ">=22.16.0"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Required by @kitschpatrol/shared-config
|
|
2
|
+
|
|
3
|
+
onlyBuiltDependencies:
|
|
4
|
+
- esbuild
|
|
5
|
+
- unrs-resolver
|
|
6
|
+
|
|
7
|
+
publicHoistPattern:
|
|
8
|
+
- '@kitschpatrol/repo-config'
|
|
9
|
+
- '@kitschpatrol/typescript-config'
|
|
10
|
+
- 'case-police'
|
|
11
|
+
- '*cspell*'
|
|
12
|
+
- '*eslint*'
|
|
13
|
+
- '*knip*'
|
|
14
|
+
- '*mdat*'
|
|
15
|
+
- '*prettier*'
|
|
16
|
+
- '*remark*'
|
|
17
|
+
- '*stylelint*'
|
|
@@ -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,28 @@
|
|
|
1
|
+
import type { FilterPattern } from 'unplugin-utils'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export interface Options {
|
|
7
|
+
enforce?: 'post' | 'pre' | undefined
|
|
8
|
+
exclude?: FilterPattern
|
|
9
|
+
include?: FilterPattern
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
type Overwrite<T, U> = Pick<T, Exclude<keyof T, keyof U>> & U
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
export type OptionsResolved = Overwrite<Required<Options>, Pick<Options, 'enforce'>>
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Resolve and normalize user options.
|
|
21
|
+
*/
|
|
22
|
+
export function resolveOptions(options: Options): OptionsResolved {
|
|
23
|
+
return {
|
|
24
|
+
enforce: 'enforce' in options ? options.enforce : 'pre',
|
|
25
|
+
exclude: options.exclude ?? [/node_modules/],
|
|
26
|
+
include: options.include ?? [/\.[cm]?[jt]sx?$/],
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This entry file is for esbuild plugin.
|
|
3
|
+
* @module
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { starter } from './index'
|
|
7
|
+
|
|
8
|
+
// @case-police-ignore esbuild
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Esbuild plugin
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { build } from 'esbuild'
|
|
15
|
+
* import starter from '{{{github-repository}}}/esbuild'
|
|
16
|
+
*
|
|
17
|
+
* build({ plugins: [starter()] })
|
|
18
|
+
```
|
|
19
|
+
*/
|
|
20
|
+
const { esbuild } = starter
|
|
21
|
+
export default esbuild
|
|
22
|
+
export { esbuild as 'module.exports' }
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This entry file is for Farm plugin.
|
|
3
|
+
* @module
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { starter } from './index'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Farm plugin
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* // farm.config.js
|
|
13
|
+
* import starter from '{{{github-repository}}}/farm'
|
|
14
|
+
*
|
|
15
|
+
* export default {
|
|
16
|
+
* plugins: [starter()],
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
const { farm } = starter
|
|
21
|
+
export default farm
|
|
22
|
+
export { farm as 'module.exports' }
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { UnpluginInstance } from 'unplugin'
|
|
2
|
+
import { createUnplugin } from 'unplugin'
|
|
3
|
+
import { createFilter } from 'unplugin-utils'
|
|
4
|
+
import type { Options } from './core/options'
|
|
5
|
+
import { resolveOptions } from './core/options'
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A starter unplugin template.
|
|
9
|
+
*/
|
|
10
|
+
export const starter: UnpluginInstance<Options | undefined, false> = createUnplugin(
|
|
11
|
+
(rawOptions = {}) => {
|
|
12
|
+
const options = resolveOptions(rawOptions)
|
|
13
|
+
const filter = createFilter(options.include, options.exclude)
|
|
14
|
+
|
|
15
|
+
const name = '{{{github-repository}}}'
|
|
16
|
+
return {
|
|
17
|
+
enforce: options.enforce,
|
|
18
|
+
name,
|
|
19
|
+
transform(code, _id) {
|
|
20
|
+
return `// {{{github-repository}}} injected\n${code}`
|
|
21
|
+
},
|
|
22
|
+
transformInclude(id) {
|
|
23
|
+
return filter(id)
|
|
24
|
+
},
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This entry file is for Rolldown plugin.
|
|
3
|
+
* @module
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { starter } from './index'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Rolldown plugin
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* // rolldown.config.js
|
|
13
|
+
* import starter from '{{{github-repository}}}/rolldown'
|
|
14
|
+
*
|
|
15
|
+
* export default {
|
|
16
|
+
* plugins: [starter()],
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
const { rolldown } = starter
|
|
21
|
+
export default rolldown
|
|
22
|
+
export { rolldown as 'module.exports' }
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This entry file is for Rollup plugin.
|
|
3
|
+
* @module
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { starter } from './index'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Rollup plugin
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* // rollup.config.js
|
|
13
|
+
* import starter from '{{{github-repository}}}/rollup'
|
|
14
|
+
*
|
|
15
|
+
* export default {
|
|
16
|
+
* plugins: [starter()],
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
const { rollup } = starter
|
|
21
|
+
export default rollup
|
|
22
|
+
export { rollup as 'module.exports' }
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This entry file is for Rspack plugin.
|
|
3
|
+
* @module
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { starter } from './index'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Rspack plugin
|
|
10
|
+
* @example
|
|
11
|
+
* ```js
|
|
12
|
+
* // rspack.config.js
|
|
13
|
+
* import starter from '{{{github-repository}}}/rspack'
|
|
14
|
+
*
|
|
15
|
+
* export default {
|
|
16
|
+
* plugins: [starter()],
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
const { rspack } = starter
|
|
21
|
+
export default rspack
|
|
22
|
+
export { rspack as 'module.exports' }
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This entry file is for Vite plugin.
|
|
3
|
+
* @module
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { starter } from './index'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Vite plugin
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* // vite.config.ts
|
|
13
|
+
* import starter from '{{{github-repository}}}/vite'
|
|
14
|
+
*
|
|
15
|
+
* export default defineConfig({
|
|
16
|
+
* plugins: [starter()],
|
|
17
|
+
* })
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
const { vite } = starter
|
|
21
|
+
export default vite
|
|
22
|
+
export { vite as 'module.exports' }
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This entry file is for webpack plugin.
|
|
3
|
+
* @module
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { starter } from './index'
|
|
7
|
+
|
|
8
|
+
// @case-police-ignore webpack
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Webpack plugin
|
|
12
|
+
* @example
|
|
13
|
+
* ```js
|
|
14
|
+
* // webpack.config.js
|
|
15
|
+
* import starter from '{{{github-repository}}}/webpack'
|
|
16
|
+
*
|
|
17
|
+
* export default {
|
|
18
|
+
* plugins: [starter()],
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
const { webpack } = starter
|
|
23
|
+
export default webpack
|
|
24
|
+
export { webpack as 'module.exports' }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const someValue = 10
|