Compare commits
68
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c12bd19573 | ||
|
|
b55a386469 | ||
|
|
1f68471391 | ||
|
|
abeb203b4a | ||
|
|
2c477f87ab | ||
|
|
0ec76ee5f0 | ||
|
|
220b8af18e | ||
|
|
0bfc447aa9 | ||
|
|
87d92c78f1 | ||
|
|
e8eb570761 | ||
|
|
3a442dd5d1 | ||
|
|
711293df81 | ||
|
|
03d463b56e | ||
|
|
5cc4d93838 | ||
|
|
690f972463 | ||
|
|
49627f98bf | ||
|
|
9ba269f01a | ||
|
|
3a70f34631 | ||
|
|
e2b1f8730f | ||
|
|
cba4dfacc3 | ||
|
|
1d3e667264 | ||
|
|
bd802599bc | ||
|
|
574bae6096 | ||
|
|
b1d2f21629 | ||
|
|
5d1361cad2 | ||
|
|
3334f2167d | ||
|
|
65021595cc | ||
|
|
4358d816f1 | ||
|
|
f99510b3fb | ||
|
|
d76bbf90cd | ||
|
|
644079f3c4 | ||
|
|
843ab09319 | ||
|
|
d414465d2e | ||
|
|
120f702862 | ||
|
|
cbfb52684c | ||
|
|
54669e1e8b | ||
|
|
b652bb2324 | ||
|
|
b735ccf16b | ||
|
|
05277145ac | ||
|
|
58de0a0f2d | ||
|
|
dcccf3089c | ||
|
|
c1604b337a | ||
|
|
945bc12c45 | ||
|
|
b8e4da60ee | ||
|
|
479f69e9a8 | ||
|
|
19c99b081a | ||
|
|
b038774520 | ||
|
|
49ec8e540e | ||
|
|
1e6c30d40e | ||
|
|
09cf08abb8 | ||
|
|
88d31bc365 | ||
|
|
7b9688536c | ||
|
|
db055b9ed1 | ||
|
|
60b53aaa2f | ||
|
|
b6d7f4fcab | ||
|
|
f1d73e195d | ||
|
|
e9f6d37360 | ||
|
|
eb6526281c | ||
|
|
8550c2d748 | ||
|
|
f56ba9fddf | ||
|
|
b7164bf251 | ||
|
|
2b653b5424 | ||
|
|
f51d60af4c | ||
|
|
12ca186a5c | ||
|
|
2eb2b6edf4 | ||
|
|
55b2258ba4 | ||
|
|
5df24c5bf2 | ||
|
|
bba0a5148a |
No files matched your search
@@ -1,2 +0,0 @@
|
||||
dist
|
||||
typings
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"root": true,
|
||||
"env": {
|
||||
"es6": true,
|
||||
"browser": true,
|
||||
"node": true,
|
||||
"jest": true
|
||||
},
|
||||
"extends": ["@antfu/eslint-config-ts"],
|
||||
"plugins": ["jest"],
|
||||
"rules": {}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
github: [antfu]
|
||||
@@ -0,0 +1,87 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
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: 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
|
||||
@@ -0,0 +1,29 @@
|
||||
name: Release
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
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}}
|
||||
@@ -1,24 +0,0 @@
|
||||
name: Test
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [12.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: Install
|
||||
run: npm ci
|
||||
|
||||
- name: Lint
|
||||
run: npm run lint
|
||||
|
||||
- name: Test
|
||||
run: npm test
|
||||
+9
-79
@@ -1,81 +1,11 @@
|
||||
# Created by .ignore support plugin (hsz.mobi)
|
||||
### Node template
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
bower_components
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# TypeScript v1 declaration files
|
||||
typings/
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variables file
|
||||
.env
|
||||
|
||||
# parcel-bundler cache (https://parceljs.org/)
|
||||
.cache
|
||||
|
||||
# next.js build output
|
||||
.next
|
||||
|
||||
# nuxt.js build output
|
||||
.nuxt
|
||||
|
||||
# Nuxt generate
|
||||
dist
|
||||
|
||||
# vuepress build output
|
||||
.vuepress/dist
|
||||
|
||||
# Serverless directories
|
||||
.serverless
|
||||
|
||||
# IDE
|
||||
.DS_Store
|
||||
.idea
|
||||
*.log
|
||||
*.tgz
|
||||
coverage
|
||||
dist
|
||||
lib-cov
|
||||
logs
|
||||
node_modules
|
||||
temp
|
||||
Vendored
+41
@@ -0,0 +1,41 @@
|
||||
{
|
||||
// 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.organizeImports": "never"
|
||||
},
|
||||
|
||||
// Silent the stylistic rules in you IDE, but still auto fix them
|
||||
"eslint.rules.customizations": [
|
||||
{ "rule": "style/*", "severity": "off" },
|
||||
{ "rule": "*-indent", "severity": "off" },
|
||||
{ "rule": "*-spacing", "severity": "off" },
|
||||
{ "rule": "*-spaces", "severity": "off" },
|
||||
{ "rule": "*-order", "severity": "off" },
|
||||
{ "rule": "*-dangle", "severity": "off" },
|
||||
{ "rule": "*-newline", "severity": "off" },
|
||||
{ "rule": "*quotes", "severity": "off" },
|
||||
{ "rule": "*semi", "severity": "off" }
|
||||
],
|
||||
|
||||
// Enable eslint for all supported languages
|
||||
"eslint.validate": [
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
"vue",
|
||||
"html",
|
||||
"markdown",
|
||||
"json",
|
||||
"jsonc",
|
||||
"yaml"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
Please refer to https://github.com/antfu/contribute
|
||||
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 Anthony Fu <https://github.com/antfu>
|
||||
Copyright (c) 2022 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
|
||||
|
||||
@@ -1 +1,38 @@
|
||||
# ts-starter
|
||||
# pkg-placeholder
|
||||
|
||||
[![npm version][npm-version-src]][npm-version-href]
|
||||
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
||||
[![bundle][bundle-src]][bundle-href]
|
||||
[![JSDocs][jsdocs-src]][jsdocs-href]
|
||||
[![License][license-src]][license-href]
|
||||
|
||||
_description_
|
||||
|
||||
> **Note**:
|
||||
> Replace `pkg-placeholder`, `_description_` and `antfu` globally to use this template.
|
||||
|
||||
## 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'/>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
## License
|
||||
|
||||
[MIT](./LICENSE) License © 2023-PRESENT [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-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
|
||||
[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
|
||||
[license-href]: https://github.com/antfu/pkg-placeholder/blob/main/LICENSE
|
||||
[jsdocs-src]: https://img.shields.io/badge/jsdocs-reference-080f12?style=flat&colorA=080f12&colorB=1fa669
|
||||
[jsdocs-href]: https://www.jsdocs.io/package/pkg-placeholder
|
||||
@@ -0,0 +1,12 @@
|
||||
import { defineBuildConfig } from 'unbuild'
|
||||
|
||||
export default defineBuildConfig({
|
||||
entries: [
|
||||
'src/index',
|
||||
],
|
||||
declaration: true,
|
||||
clean: true,
|
||||
rollup: {
|
||||
emitCJS: true,
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,15 @@
|
||||
// @ts-check
|
||||
import antfu from '@antfu/eslint-config'
|
||||
|
||||
export default antfu(
|
||||
{
|
||||
ignores: [
|
||||
// eslint ignore globs here
|
||||
],
|
||||
},
|
||||
{
|
||||
rules: {
|
||||
// overrides
|
||||
},
|
||||
},
|
||||
)
|
||||
@@ -1,12 +0,0 @@
|
||||
module.exports = {
|
||||
roots: [
|
||||
'<rootDir>/test',
|
||||
],
|
||||
testMatch: [
|
||||
'**/__tests__/**/*.+(ts|tsx|js)',
|
||||
'**/?(*.)+(spec|test).+(ts|tsx|js)',
|
||||
],
|
||||
transform: {
|
||||
'^.+\\.(ts|tsx)$': 'ts-jest',
|
||||
},
|
||||
}
|
||||
Generated
-8926
File diff suppressed because it is too large.
Load diff
+57
-43
@@ -1,59 +1,73 @@
|
||||
{
|
||||
"name": "@antfu/ts-starter",
|
||||
"name": "pkg-placeholder",
|
||||
"type": "module",
|
||||
"version": "0.0.0",
|
||||
"description": "",
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/index.mjs",
|
||||
"types": "dist/index.d.ts",
|
||||
"packageManager": "pnpm@8.8.0",
|
||||
"description": "_description_",
|
||||
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
||||
"license": "MIT",
|
||||
"sideEffects": false,
|
||||
"bugs": {
|
||||
"url": "https://github.com/<placeholder>/issues"
|
||||
},
|
||||
"homepage": "https://github.com/<placeholder>#readme",
|
||||
"funding": "https://github.com/sponsors/antfu",
|
||||
"homepage": "https://github.com/antfu/pkg-placeholder#readme",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/<placeholder>.git"
|
||||
"url": "git+https://github.com/antfu/pkg-placeholder.git"
|
||||
},
|
||||
"scripts": {
|
||||
"prepublishOnly": "npm run build",
|
||||
"watch": "npm run build -- --watch",
|
||||
"dev": "esno src/index.ts",
|
||||
"build": "tsup src/index.ts --format cjs,esm --dts",
|
||||
"publish:ci": "npm publish --access public",
|
||||
"release": "npx bumpp --commit --push --tag && npm run publish:ci",
|
||||
"lint": "eslint \"{src,test}/**/*.ts\"",
|
||||
"lint:fix": "npm run lint -- --fix",
|
||||
"test": "jest"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
"bugs": "https://github.com/antfu/pkg-placeholder/issues",
|
||||
"keywords": [],
|
||||
"sideEffects": false,
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.cjs"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{ts,js}": [
|
||||
"eslint --fix",
|
||||
"git add"
|
||||
]
|
||||
"main": "./dist/index.mjs",
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.ts",
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
"*": [
|
||||
"./dist/*",
|
||||
"./dist/index.d.ts"
|
||||
]
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {},
|
||||
"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"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@antfu/eslint-config-ts": "^0.4.3",
|
||||
"@types/jest": "^26.0.15",
|
||||
"@types/node": "^14.14.6",
|
||||
"eslint": "^7.12.1",
|
||||
"eslint-plugin-jest": "^24.1.0",
|
||||
"esno": "^0.2.4",
|
||||
"husky": "^4.3.0",
|
||||
"jest": "^26.6.3",
|
||||
"lint-staged": "^10.5.1",
|
||||
"ts-jest": "^26.4.3",
|
||||
"tsup": "^3.7.1",
|
||||
"typescript": "^4.0.5"
|
||||
"@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"
|
||||
},
|
||||
"simple-git-hooks": {
|
||||
"pre-commit": "pnpm lint-staged"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*": "eslint --fix"
|
||||
}
|
||||
}
|
||||
Generated
+4384
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,3 @@
|
||||
packages:
|
||||
- playground
|
||||
- examples/*
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"extends": [
|
||||
"config:base"
|
||||
]
|
||||
}
|
||||
+2
-1
@@ -1 +1,2 @@
|
||||
export * from './number'
|
||||
export const one = 1
|
||||
export const two = 2
|
||||
@@ -1,2 +0,0 @@
|
||||
export const one = 1
|
||||
export const two = 2
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import { one } from '../src'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
describe('should', () => {
|
||||
it('exported', () => {
|
||||
expect(one).toEqual(1)
|
||||
expect(1).toEqual(1)
|
||||
})
|
||||
})
|
||||
+5
-3
@@ -1,12 +1,14 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es2017",
|
||||
"module": "esnext",
|
||||
"target": "es2018",
|
||||
"lib": ["esnext"],
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"resolveJsonModule": true,
|
||||
"esModuleInterop": true,
|
||||
"strict": true,
|
||||
"strictNullChecks": true,
|
||||
"resolveJsonModule": true
|
||||
"skipDefaultLibCheck": true,
|
||||
"skipLibCheck": true
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user