Compare commits
43
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
44c491c079 | ||
|
|
99a0a2874a | ||
|
|
0ac25856a3 | ||
|
|
d25b1bce8e | ||
|
|
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]
|
||||
opencollective: antfu
|
||||
+12
-80
@@ -1,87 +1,19 @@
|
||||
name: CI
|
||||
name: Unit Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
branches: [main]
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
unit-test:
|
||||
uses: sxzz/workflows/.github/workflows/unit-test.yml@main
|
||||
|
||||
- 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: 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:
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node: [lts/*]
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
fail-fast: false
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
|
||||
- name: Set node ${{ matrix.node }}
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
|
||||
- name: Setup
|
||||
run: npm i -g @antfu/ni
|
||||
|
||||
- name: Install
|
||||
run: nci
|
||||
|
||||
- name: Build
|
||||
run: nr build
|
||||
|
||||
- name: Test
|
||||
run: nr test
|
||||
# coverage:
|
||||
# uses: sxzz/workflows/.github/workflows/coverage.yml@main
|
||||
# needs: unit-test
|
||||
# permissions:
|
||||
# id-token: write
|
||||
@@ -1,8 +1,5 @@
|
||||
name: Release
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
@@ -10,20 +7,9 @@ on:
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- 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}}
|
||||
uses: sxzz/workflows/.github/workflows/release.yml@main
|
||||
with:
|
||||
publish: true
|
||||
permissions:
|
||||
contents: write
|
||||
id-token: write
|
||||
@@ -1,5 +1,6 @@
|
||||
.cache
|
||||
.DS_Store
|
||||
.githooks
|
||||
.idea
|
||||
*.log
|
||||
*.tgz
|
||||
@@ -8,4 +9,5 @@ dist
|
||||
lib-cov
|
||||
logs
|
||||
node_modules
|
||||
skills/npm-*
|
||||
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
|
||||
"prettier.enable": false,
|
||||
"editor.formatOnSave": false,
|
||||
|
||||
// Auto fix
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll": "explicit",
|
||||
"source.fixAll.eslint": "explicit",
|
||||
"source.organizeImports": "never"
|
||||
},
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
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
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -8,28 +8,32 @@
|
||||
|
||||
_description_
|
||||
|
||||
> **Note**:
|
||||
> Replace `pkg-placeholder`, `_description_` and `antfu` globally to use this template.
|
||||
## Note for Developers
|
||||
|
||||
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
|
||||
|
||||
<p align="center">
|
||||
<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>
|
||||
</p>
|
||||
|
||||
## License
|
||||
|
||||
[MIT](./LICENSE) License © 2023-PRESENT [Anthony Fu](https://github.com/antfu)
|
||||
|
||||
[MIT](./LICENSE) License © [Anthony Fu](https://github.com/antfu)
|
||||
|
||||
<!-- Badges -->
|
||||
|
||||
[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-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-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
|
||||
|
||||
@@ -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(
|
||||
{
|
||||
ignores: [
|
||||
// eslint ignore globs here
|
||||
],
|
||||
},
|
||||
{
|
||||
rules: {
|
||||
// overrides
|
||||
},
|
||||
type: 'lib',
|
||||
pnpm: true,
|
||||
},
|
||||
)
|
||||
+43
-43
@@ -2,7 +2,7 @@
|
||||
"name": "pkg-placeholder",
|
||||
"type": "module",
|
||||
"version": "0.0.0",
|
||||
"packageManager": "pnpm@8.8.0",
|
||||
"packageManager": "pnpm@11.15.1",
|
||||
"description": "_description_",
|
||||
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
||||
"license": "MIT",
|
||||
@@ -16,58 +16,58 @@
|
||||
"keywords": [],
|
||||
"sideEffects": false,
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"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"
|
||||
]
|
||||
}
|
||||
".": "./dist/index.mjs",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"types": "./dist/index.d.mts",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "unbuild",
|
||||
"dev": "unbuild --stub",
|
||||
"lint": "eslint .",
|
||||
"prepublishOnly": "nr build",
|
||||
"release": "bumpp && npm publish",
|
||||
"start": "esno src/index.ts",
|
||||
"test": "vitest",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"prepare": "simple-git-hooks"
|
||||
"build": "tsdown",
|
||||
"dev": "tsdown --watch",
|
||||
"lint": "eslint",
|
||||
"prepack": "nr build",
|
||||
"release": "bumpp",
|
||||
"start": "tsx src/index.ts",
|
||||
"test": "pnpm run build && vitest",
|
||||
"typecheck": "tsc",
|
||||
"prepare": "git config core.hooksPath .githooks && simple-git-hooks && skills-npm"
|
||||
},
|
||||
"scripts-info": {
|
||||
"build": "Build the library for publishing",
|
||||
"dev": "Rebuild on change during development",
|
||||
"lint": "Check for code style issues",
|
||||
"prepack": "Build before publishing",
|
||||
"release": "Bump version and publish a release",
|
||||
"start": "Run the entry file",
|
||||
"test": "Run the test suite",
|
||||
"typecheck": "Check types",
|
||||
"prepare": "Set up git hooks and skills"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@antfu/eslint-config": "^1.0.0-beta.22",
|
||||
"@antfu/ni": "^0.21.8",
|
||||
"@antfu/utils": "^0.7.6",
|
||||
"@types/node": "^20.8.3",
|
||||
"bumpp": "^9.2.0",
|
||||
"eslint": "^8.51.0",
|
||||
"esno": "^0.17.0",
|
||||
"lint-staged": "^14.0.1",
|
||||
"pnpm": "^8.8.0",
|
||||
"rimraf": "^5.0.5",
|
||||
"simple-git-hooks": "^2.9.0",
|
||||
"typescript": "^5.2.2",
|
||||
"unbuild": "^2.0.0",
|
||||
"vite": "^4.4.11",
|
||||
"vitest": "^0.34.6"
|
||||
"@antfu/eslint-config": "catalog:cli",
|
||||
"@antfu/ni": "catalog:cli",
|
||||
"@antfu/utils": "catalog:inlined",
|
||||
"@types/node": "catalog:types",
|
||||
"bumpp": "catalog:cli",
|
||||
"eslint": "catalog:cli",
|
||||
"nano-staged": "catalog:cli",
|
||||
"publint": "catalog:cli",
|
||||
"simple-git-hooks": "catalog:cli",
|
||||
"skills-npm": "catalog:cli",
|
||||
"tsdown": "catalog:cli",
|
||||
"tsdown-stale-guard": "catalog:testing",
|
||||
"tsnapi": "catalog:testing",
|
||||
"tsx": "catalog:cli",
|
||||
"typescript": "catalog:cli",
|
||||
"vite": "catalog:cli",
|
||||
"vitest": "catalog:testing"
|
||||
},
|
||||
"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"
|
||||
}
|
||||
}
|
||||
Generated
+4906
-3854
File diff suppressed because it is too large.
Load diff
@@ -1,3 +1,40 @@
|
||||
catalogMode: prefer
|
||||
ignoreWorkspaceRootCheck: true
|
||||
minimumReleaseAgeExclude:
|
||||
- '@types/node@25.9.0'
|
||||
- tsx@4.22.2
|
||||
- bumpp@12.0.0
|
||||
shellEmulator: true
|
||||
trustPolicy: no-downgrade
|
||||
|
||||
packages:
|
||||
- playground
|
||||
- docs
|
||||
- packages/*
|
||||
- examples/*
|
||||
|
||||
catalogs:
|
||||
cli:
|
||||
'@antfu/eslint-config': ^9.1.0
|
||||
'@antfu/ni': ^30.2.0
|
||||
bumpp: ^12.0.0
|
||||
eslint: ^10.7.0
|
||||
nano-staged: ^1.0.2
|
||||
publint: ^0.3.21
|
||||
simple-git-hooks: ^2.13.1
|
||||
skills-npm: ^1.2.0
|
||||
tsdown: ^0.22.12
|
||||
tsx: ^4.23.1
|
||||
typescript: ^6.0.3
|
||||
vite: ^8.1.5
|
||||
inlined:
|
||||
'@antfu/utils': ^9.3.0
|
||||
testing:
|
||||
tsdown-stale-guard: ^0.1.3
|
||||
tsnapi: ^1.0.0
|
||||
vitest: ^4.1.10
|
||||
types:
|
||||
'@types/node': ^26.1.1
|
||||
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": {
|
||||
"target": "es2018",
|
||||
"lib": ["esnext"],
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"target": "ESNext",
|
||||
"lib": ["ESNext"],
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Bundler",
|
||||
"resolveJsonModule": true,
|
||||
"esModuleInterop": true,
|
||||
"strict": true,
|
||||
"strictNullChecks": true,
|
||||
"noEmit": true,
|
||||
"esModuleInterop": true,
|
||||
"verbatimModuleSyntax": true,
|
||||
"skipDefaultLibCheck": 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