Compare commits
41
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
587af64fea | ||
|
|
1cd07a98ff | ||
|
|
977d3d4066 | ||
|
|
b898f3cf9a | ||
|
|
f44a384227 | ||
|
|
83cf9c396b | ||
|
|
68c00a2b25 | ||
|
|
e76a9c0f18 | ||
|
|
d16cf1e854 | ||
|
|
bcca902a44 | ||
|
|
8a2f9026ff | ||
|
|
95557b44ae | ||
|
|
6011481edc | ||
|
|
4d180f40bf | ||
|
|
296e97d5fa | ||
|
|
3fd967d71f | ||
|
|
608a888262 | ||
|
|
1ed66db81d | ||
|
|
49248f74e2 | ||
|
|
11e95cd5da | ||
|
|
e86bcbe3d5 | ||
|
|
a4c4a820ec | ||
|
|
2036435c45 | ||
|
|
7feaa975d3 | ||
|
|
396cbec550 | ||
|
|
0c31fbe960 | ||
|
|
1f51d21f90 | ||
|
|
a05f3ec6f5 | ||
|
|
964047d5be | ||
|
|
f8fb542605 | ||
|
|
d5f7e5f41d | ||
|
|
eb55ddbc3b | ||
|
|
0cc51c5e79 | ||
|
|
9fe749aa56 | ||
|
|
fe571ba0c2 | ||
|
|
1f834fb7f9 | ||
|
|
f30e2757bf | ||
|
|
41b9f245ff | ||
|
|
a2e9f70880 | ||
|
|
657ff8de2b | ||
|
|
c427ea1aa2 |
No files matched your search
@@ -1 +1,2 @@
|
|||||||
github: [antfu]
|
github: [antfu]
|
||||||
|
opencollective: antfu
|
||||||
+20
-54
@@ -13,46 +13,19 @@ jobs:
|
|||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
|
- uses: pnpm/action-setup@v6
|
||||||
- name: Install pnpm
|
with:
|
||||||
uses: pnpm/action-setup@v2
|
run_install: false
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
- name: Set node
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
with:
|
||||||
node-version: lts/*
|
node-version: lts/*
|
||||||
|
cache: pnpm
|
||||||
|
|
||||||
- name: Setup
|
- run: pnpm i -g @antfu/ni
|
||||||
run: npm i -g @antfu/ni
|
- run: nci
|
||||||
|
- run: nr lint
|
||||||
- name: Install
|
- run: nr typecheck
|
||||||
run: nci
|
|
||||||
|
|
||||||
- name: Lint
|
|
||||||
run: nr lint
|
|
||||||
|
|
||||||
typecheck:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Install pnpm
|
|
||||||
uses: pnpm/action-setup@v2
|
|
||||||
|
|
||||||
- name: Set node
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: lts/*
|
|
||||||
|
|
||||||
- name: Setup
|
|
||||||
run: npm i -g @antfu/ni
|
|
||||||
|
|
||||||
- name: Install
|
|
||||||
run: nci
|
|
||||||
|
|
||||||
- name: Typecheck
|
|
||||||
run: nr typecheck
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
@@ -64,24 +37,17 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
|
- uses: pnpm/action-setup@v6
|
||||||
- name: Install pnpm
|
with:
|
||||||
uses: pnpm/action-setup@v2
|
run_install: false
|
||||||
|
|
||||||
- name: Set node ${{ matrix.node }}
|
- name: Set node ${{ matrix.node }}
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node }}
|
node-version: ${{ matrix.node }}
|
||||||
|
cache: pnpm
|
||||||
|
|
||||||
- name: Setup
|
- run: pnpm i -g @antfu/ni
|
||||||
run: npm i -g @antfu/ni
|
- run: nci
|
||||||
|
- run: nr build
|
||||||
- name: Install
|
- run: nr test
|
||||||
run: nci
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: nr build
|
|
||||||
|
|
||||||
- name: Test
|
|
||||||
run: nr test
|
|
||||||
@@ -1,8 +1,5 @@
|
|||||||
name: Release
|
name: Release
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
@@ -10,20 +7,9 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
runs-on: ubuntu-latest
|
uses: sxzz/workflows/.github/workflows/release.yml@v1
|
||||||
steps:
|
with:
|
||||||
- uses: actions/checkout@v3
|
publish: true
|
||||||
with:
|
permissions:
|
||||||
fetch-depth: 0
|
contents: write
|
||||||
|
id-token: write
|
||||||
- name: Install pnpm
|
|
||||||
uses: pnpm/action-setup@v2
|
|
||||||
|
|
||||||
- name: Set node
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: lts/*
|
|
||||||
|
|
||||||
- run: npx changelogithub
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
.cache
|
.cache
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
.githooks
|
||||||
.idea
|
.idea
|
||||||
*.log
|
*.log
|
||||||
*.tgz
|
*.tgz
|
||||||
@@ -8,4 +9,5 @@ dist
|
|||||||
lib-cov
|
lib-cov
|
||||||
logs
|
logs
|
||||||
node_modules
|
node_modules
|
||||||
|
skills/npm-*
|
||||||
temp
|
temp
|
||||||
Vendored
+6
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"recommendations": [
|
||||||
|
"dbaeumer.vscode-eslint",
|
||||||
|
"antfu.pnpm-catalog-lens"
|
||||||
|
]
|
||||||
|
}
|
||||||
Vendored
+1
-4
@@ -1,14 +1,11 @@
|
|||||||
{
|
{
|
||||||
// Enable the ESlint flat config support
|
|
||||||
"eslint.experimental.useFlatConfig": true,
|
|
||||||
|
|
||||||
// Disable the default formatter, use eslint instead
|
// Disable the default formatter, use eslint instead
|
||||||
"prettier.enable": false,
|
"prettier.enable": false,
|
||||||
"editor.formatOnSave": false,
|
"editor.formatOnSave": false,
|
||||||
|
|
||||||
// Auto fix
|
// Auto fix
|
||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
"source.fixAll": "explicit",
|
"source.fixAll.eslint": "explicit",
|
||||||
"source.organizeImports": "never"
|
"source.organizeImports": "never"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2022 Anthony Fu <https://github.com/antfu>
|
Copyright (c) 2025-PRESENT Anthony Fu <https://github.com/antfu>
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
@@ -8,28 +8,32 @@
|
|||||||
|
|
||||||
_description_
|
_description_
|
||||||
|
|
||||||
> **Note**:
|
## Note for Developers
|
||||||
> Replace `pkg-placeholder`, `_description_` and `antfu` globally to use this template.
|
|
||||||
|
This starter recommands using [npm Trusted Publisher](https://github.com/e18e/ecosystem-issues/issues/201), where the release is done on CI to ensure the security of the packages.
|
||||||
|
|
||||||
|
To do so, you need to run `pnpm publish` manually for the very first time to create the package on npm, and then go to `https://www.npmjs.com/package/<your-package-name>/access` to set the connection to your GitHub repo.
|
||||||
|
|
||||||
|
Then for the future releases, you can run `pnpm run release` to do the release and the GitHub Actions will take care of the release process.
|
||||||
|
|
||||||
## Sponsors
|
## Sponsors
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg">
|
<a href="https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg">
|
||||||
<img src='https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg'/>
|
<img src="https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg" alt="Sponsors"/>
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
[MIT](./LICENSE) License © 2023-PRESENT [Anthony Fu](https://github.com/antfu)
|
[MIT](./LICENSE) License © [Anthony Fu](https://github.com/antfu)
|
||||||
|
|
||||||
|
|
||||||
<!-- Badges -->
|
<!-- Badges -->
|
||||||
|
|
||||||
[npm-version-src]: https://img.shields.io/npm/v/pkg-placeholder?style=flat&colorA=080f12&colorB=1fa669
|
[npm-version-src]: https://img.shields.io/npm/v/pkg-placeholder?style=flat&colorA=080f12&colorB=1fa669
|
||||||
[npm-version-href]: https://npmjs.com/package/pkg-placeholder
|
[npm-version-href]: https://npmx.dev/package/pkg-placeholder
|
||||||
[npm-downloads-src]: https://img.shields.io/npm/dm/pkg-placeholder?style=flat&colorA=080f12&colorB=1fa669
|
[npm-downloads-src]: https://img.shields.io/npm/dm/pkg-placeholder?style=flat&colorA=080f12&colorB=1fa669
|
||||||
[npm-downloads-href]: https://npmjs.com/package/pkg-placeholder
|
[npm-downloads-href]: https://npmx.dev/package/pkg-placeholder
|
||||||
[bundle-src]: https://img.shields.io/bundlephobia/minzip/pkg-placeholder?style=flat&colorA=080f12&colorB=1fa669&label=minzip
|
[bundle-src]: https://img.shields.io/bundlephobia/minzip/pkg-placeholder?style=flat&colorA=080f12&colorB=1fa669&label=minzip
|
||||||
[bundle-href]: https://bundlephobia.com/result?p=pkg-placeholder
|
[bundle-href]: https://bundlephobia.com/result?p=pkg-placeholder
|
||||||
[license-src]: https://img.shields.io/github/license/antfu/pkg-placeholder.svg?style=flat&colorA=080f12&colorB=1fa669
|
[license-src]: https://img.shields.io/github/license/antfu/pkg-placeholder.svg?style=flat&colorA=080f12&colorB=1fa669
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
import { defineBuildConfig } from 'unbuild'
|
|
||||||
|
|
||||||
export default defineBuildConfig({
|
|
||||||
entries: [
|
|
||||||
'src/index',
|
|
||||||
],
|
|
||||||
declaration: true,
|
|
||||||
clean: true,
|
|
||||||
rollup: {
|
|
||||||
emitCJS: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
+2
-8
@@ -3,13 +3,7 @@ import antfu from '@antfu/eslint-config'
|
|||||||
|
|
||||||
export default antfu(
|
export default antfu(
|
||||||
{
|
{
|
||||||
ignores: [
|
type: 'lib',
|
||||||
// eslint ignore globs here
|
pnpm: true,
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
rules: {
|
|
||||||
// overrides
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
+31
-42
@@ -2,7 +2,7 @@
|
|||||||
"name": "pkg-placeholder",
|
"name": "pkg-placeholder",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"packageManager": "pnpm@8.8.0",
|
"packageManager": "pnpm@11.1.3",
|
||||||
"description": "_description_",
|
"description": "_description_",
|
||||||
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -16,58 +16,47 @@
|
|||||||
"keywords": [],
|
"keywords": [],
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
"exports": {
|
"exports": {
|
||||||
".": {
|
".": "./dist/index.mjs",
|
||||||
"types": "./dist/index.d.ts",
|
"./package.json": "./package.json"
|
||||||
"import": "./dist/index.mjs",
|
|
||||||
"require": "./dist/index.cjs"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"main": "./dist/index.mjs",
|
|
||||||
"module": "./dist/index.mjs",
|
|
||||||
"types": "./dist/index.d.ts",
|
|
||||||
"typesVersions": {
|
|
||||||
"*": {
|
|
||||||
"*": [
|
|
||||||
"./dist/*",
|
|
||||||
"./dist/index.d.ts"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
"types": "./dist/index.d.mts",
|
||||||
"files": [
|
"files": [
|
||||||
"dist"
|
"dist"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "unbuild",
|
"build": "tsdown",
|
||||||
"dev": "unbuild --stub",
|
"dev": "tsdown --watch",
|
||||||
"lint": "eslint .",
|
"lint": "eslint",
|
||||||
"prepublishOnly": "nr build",
|
"prepublishOnly": "nr build",
|
||||||
"release": "bumpp && npm publish",
|
"release": "bumpp",
|
||||||
"start": "esno src/index.ts",
|
"start": "tsx src/index.ts",
|
||||||
"test": "vitest",
|
"test": "pnpm run build && vitest",
|
||||||
"typecheck": "tsc --noEmit",
|
"typecheck": "tsc",
|
||||||
"prepare": "simple-git-hooks"
|
"prepare": "git config core.hooksPath .githooks && simple-git-hooks && skills-npm"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@antfu/eslint-config": "^1.0.0-beta.22",
|
"@antfu/eslint-config": "catalog:cli",
|
||||||
"@antfu/ni": "^0.21.8",
|
"@antfu/ni": "catalog:cli",
|
||||||
"@antfu/utils": "^0.7.6",
|
"@antfu/utils": "catalog:inlined",
|
||||||
"@types/node": "^20.8.3",
|
"@types/node": "catalog:types",
|
||||||
"bumpp": "^9.2.0",
|
"bumpp": "catalog:cli",
|
||||||
"eslint": "^8.51.0",
|
"eslint": "catalog:cli",
|
||||||
"esno": "^0.17.0",
|
"nano-staged": "catalog:cli",
|
||||||
"lint-staged": "^14.0.1",
|
"publint": "catalog:cli",
|
||||||
"pnpm": "^8.8.0",
|
"simple-git-hooks": "catalog:cli",
|
||||||
"rimraf": "^5.0.5",
|
"skills-npm": "catalog:cli",
|
||||||
"simple-git-hooks": "^2.9.0",
|
"tsdown": "catalog:cli",
|
||||||
"typescript": "^5.2.2",
|
"tsdown-stale-guard": "catalog:testing",
|
||||||
"unbuild": "^2.0.0",
|
"tsnapi": "catalog:testing",
|
||||||
"vite": "^4.4.11",
|
"tsx": "catalog:cli",
|
||||||
"vitest": "^0.34.6"
|
"typescript": "catalog:cli",
|
||||||
|
"vite": "catalog:cli",
|
||||||
|
"vitest": "catalog:testing"
|
||||||
},
|
},
|
||||||
"simple-git-hooks": {
|
"simple-git-hooks": {
|
||||||
"pre-commit": "pnpm lint-staged"
|
"pre-commit": "pnpm i --frozen-lockfile --ignore-scripts --offline && pnpm run build && npx nano-staged"
|
||||||
},
|
},
|
||||||
"lint-staged": {
|
"nano-staged": {
|
||||||
"*": "eslint --fix"
|
"*": "eslint --fix"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Generated
+4463
-3849
File diff suppressed because it is too large.
Load diff
@@ -1,3 +1,39 @@
|
|||||||
|
catalogMode: prefer
|
||||||
|
ignoreWorkspaceRootCheck: true
|
||||||
|
minimumReleaseAgeExclude:
|
||||||
|
- '@types/node@25.9.0'
|
||||||
|
- tsx@4.22.2
|
||||||
|
shellEmulator: true
|
||||||
|
trustPolicy: no-downgrade
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
- playground
|
- playground
|
||||||
|
- docs
|
||||||
|
- packages/*
|
||||||
- examples/*
|
- examples/*
|
||||||
|
|
||||||
|
catalogs:
|
||||||
|
cli:
|
||||||
|
'@antfu/eslint-config': ^9.0.0
|
||||||
|
'@antfu/ni': ^30.1.0
|
||||||
|
bumpp: ^11.1.0
|
||||||
|
eslint: ^10.4.0
|
||||||
|
nano-staged: ^1.0.2
|
||||||
|
publint: ^0.3.21
|
||||||
|
simple-git-hooks: ^2.13.1
|
||||||
|
skills-npm: ^1.1.1
|
||||||
|
tsdown: ^0.22.0
|
||||||
|
tsx: ^4.22.2
|
||||||
|
typescript: ^6.0.3
|
||||||
|
vite: ^8.0.13
|
||||||
|
inlined:
|
||||||
|
'@antfu/utils': ^9.3.0
|
||||||
|
testing:
|
||||||
|
tsdown-stale-guard: ^0.1.2
|
||||||
|
tsnapi: ^0.3.3
|
||||||
|
vitest: ^4.1.6
|
||||||
|
types:
|
||||||
|
'@types/node': ^25.9.0
|
||||||
|
allowBuilds:
|
||||||
|
esbuild: true
|
||||||
|
simple-git-hooks: true
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
/**
|
||||||
|
* Generated by tsnapi — public API snapshot of `pkg-placeholder`
|
||||||
|
*/
|
||||||
|
// #region Variables
|
||||||
|
export declare const one: number;
|
||||||
|
export declare const two: number;
|
||||||
|
// #endregion
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
/**
|
||||||
|
* Generated by tsnapi — public API snapshot of `pkg-placeholder`
|
||||||
|
*/
|
||||||
|
// #region Variables
|
||||||
|
export var one /* const */
|
||||||
|
export var two /* const */
|
||||||
|
// #endregion
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
import { fileURLToPath } from 'node:url'
|
||||||
|
import { guardStaleBuild } from 'tsdown-stale-guard'
|
||||||
|
import { snapshotApiPerEntry } from 'tsnapi/vitest'
|
||||||
|
import { beforeAll, describe } from 'vitest'
|
||||||
|
|
||||||
|
const root = fileURLToPath(new URL('..', import.meta.url))
|
||||||
|
|
||||||
|
describe('api snapshot', () => {
|
||||||
|
beforeAll(async () => {
|
||||||
|
await guardStaleBuild({ root })
|
||||||
|
})
|
||||||
|
|
||||||
|
snapshotApiPerEntry(root)
|
||||||
|
})
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
import { describe, expect, it } from 'vitest'
|
|
||||||
|
|
||||||
describe('should', () => {
|
|
||||||
it('exported', () => {
|
|
||||||
expect(1).toEqual(1)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
+7
-5
@@ -1,13 +1,15 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es2018",
|
"target": "ESNext",
|
||||||
"lib": ["esnext"],
|
"lib": ["ESNext"],
|
||||||
"module": "esnext",
|
"module": "ESNext",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "Bundler",
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"esModuleInterop": true,
|
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"strictNullChecks": true,
|
"strictNullChecks": true,
|
||||||
|
"noEmit": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"verbatimModuleSyntax": true,
|
||||||
"skipDefaultLibCheck": true,
|
"skipDefaultLibCheck": true,
|
||||||
"skipLibCheck": true
|
"skipLibCheck": true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
import { defineConfig } from 'tsdown'
|
||||||
|
import { StaleGuardRecorder } from 'tsdown-stale-guard'
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
entry: [
|
||||||
|
'src/index.ts',
|
||||||
|
],
|
||||||
|
dts: true,
|
||||||
|
exports: true,
|
||||||
|
publint: true,
|
||||||
|
plugins: [
|
||||||
|
StaleGuardRecorder(),
|
||||||
|
],
|
||||||
|
})
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
import { defineConfig } from 'vitest/config'
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
test: {
|
||||||
|
},
|
||||||
|
})
|
||||||
Reference in new issue
Block a user