Skip to content

Commit

Permalink
feat(projects): init project
Browse files Browse the repository at this point in the history
  • Loading branch information
honghuangdc committed Dec 9, 2023
0 parents commit fe8786b
Show file tree
Hide file tree
Showing 19 changed files with 6,759 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Editor configuration, see http://editorconfig.org

root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
21 changes: 21 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"*.js" eol=lf
"*.ts" eol=lf
"*.jsx" eol=lf
"*.tsx" eol=lf
"*.cjs" eol=lf
"*.cts" eol=lf
"*.mjs" eol=lf
"*.mts" eol=lf
"*.html" eol=lf
"*.css" eol=lf
"*.vue" eol=lf
"*.json" eol=lf
"*.less" eol=lf
"*.scss" eol=lf
"*.sass" eol=lf
"*.styl" eol=lf
"*.svelte" eol=lf
"*.md" eol=lf
"*.yml" eol=lf
"*.astro" eol=lf
"*.mdx" eol=lf
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release

on:
push:
tags:
- "v*"

jobs:
release:
permissions:
id-token: write
contents: write
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/*
cache: pnpm
registry-url: "https://registry.npmjs.org"

- run: npx githublogen
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Install Dependencies
run: pnpm install --no-frozen-lockfile

- name: PNPM build
run: pnpm run build

- name: Publish to NPM
run: pnpm -r publish --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NPM_CONFIG_PROVENANCE: true
30 changes: 30 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
.DS_Store
dist
dist-ssr
coverage
*.local

/cypress/videos/
/cypress/screenshots/

# Editor directories and files
.vscode/*
!.vscode/extensions.json
!.vscode/settings.json
!.vscode/launch.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
registry=https://registry.npmmirror.com/
shamefully-hoist=true
Empty file added .prettierrc
Empty file.
13 changes: 13 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"recommendations": [
"antfu.unocss",
"dbaeumer.vscode-eslint",
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"formulahendry.auto-complete-tag",
"formulahendry.auto-close-tag",
"formulahendry.auto-rename-tag",
"kisstkondoros.vscode-gutter-preview",
"mhutchie.git-graph"
]
}
13 changes: 13 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": "1.0.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "TS debugger",
"skipFiles": ["<node_internals>/**"],
"runtimeArgs": ["--loader", "tsx"],
"program": "${relativeFile}"
}
]
}
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
},
"eslint.experimental.useFlatConfig": true,
"editor.formatOnSave": false,
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact", "json", "jsonc", "json5"],
"prettier.enable": false
}
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# prettier-plugin-json-sort

A prettier plugin to sort package.json and tsconfig.json.

Powered by [prettier-plugin-pkg](https://github.com/un-ts/prettier/tree/master/packages/pkg)
18 changes: 18 additions & 0 deletions build.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { URL, fileURLToPath } from 'node:url';
import { defineBuildConfig } from 'unbuild';

export default defineBuildConfig({
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
},
entries: ['src/index'],
clean: true,
declaration: true,
rollup: {
emitCJS: true,
inlineDependencies: true,
esbuild: {
minify: true
}
}
});
3 changes: 3 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { defineConfig } from '@soybeanjs/eslint-config';

export default defineConfig();
66 changes: 66 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"name": "prettier-plugin-json-sort",
"type": "module",
"version": "0.0.0",
"packageManager": "[email protected]",
"author": {
"name": "Soybean",
"email": "[email protected]",
"url": "https://github.com/soybeanjs"
},
"license": "MIT",
"homepage": "https://github.com/soybeanjs/prettier-plugin-json-sort",
"repository": {
"url": "https://github.com/soybeanjs/prettier-plugin-json-sort.git"
},
"bugs": {
"url": "https://github.com/soybeanjs/prettier-plugin-json-sort/issues"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/"
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
}
},
"main": "dist/index.cjs",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"files": ["dist"],
"scripts": {
"build": "unbuild",
"typecheck": "tsc --noEmit --skipLibCheck",
"lint": "eslint . --fix",
"commit": "soy git-commit",
"cleanup": "soy cleanup",
"update-pkg": "soy ncu",
"publish-pkg": "pnpm publish --access public",
"release": "soy release",
"prepare": "simple-git-hooks"
},
"peerDependencies": {
"prettier": ">=2.0.0"
},
"devDependencies": {
"@soybeanjs/cli": "0.8.2",
"@soybeanjs/eslint-config": "1.0.5",
"@types/node": "20.10.4",
"eslint": "8.55.0",
"lint-staged": "15.2.0",
"prettier": "3.1.0",
"simple-git-hooks": "2.9.0",
"tsx": "4.6.2",
"typescript": "5.3.3",
"unbuild": "2.0.0"
},
"simple-git-hooks": {
"commit-msg": "pnpm soy git-commit-verify",
"pre-commit": "pnpm typecheck && pnpm lint-staged"
},
"lint-staged": {
"*": "eslint --fix"
}
}
Loading

0 comments on commit fe8786b

Please sign in to comment.