Skip to content

Commit

Permalink
初次上传工程所有文件
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoranner committed May 11, 2024
0 parents commit 27f0f5a
Show file tree
Hide file tree
Showing 13 changed files with 1,243 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Node.js Package

on:
push:
tags:
- 'v*'

jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.org/
- run: npm install
- run: npm run build
- run: npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_ACCESS_TOKEN}}
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
node_modules
/npm-debug.log*
/yarn-error.log

.DS_Store

.vscode
.idea

*.log
*.tgz

dist
temp
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
coverage
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "none",
"eslintIntegration": true
}
11 changes: 11 additions & 0 deletions es-build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { build } from 'esbuild';

build({
entryPoints: ['src/**/*.ts'],
outdir: 'dist',
bundle: false,
platform: 'node',
target: 'es6',
format: 'esm',
tsconfig: 'tsconfig.json'
});
5 changes: 5 additions & 0 deletions nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"watch": ["src", "es-build.js", "tsconfig.json"],
"ext": "ts,js,json",
"exec": "pnpm run build"
}
33 changes: 33 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "duan-hub-sdk",
"version": "0.0.1",
"description": "DuanHub SDK",
"author": "Zoranner",
"license": "MIT",
"exports": "./index.js",
"engines": {
"node": "^18.17.0 || >=20.5.0"
},
"type": "module",
"scripts": {
"build": "node es-build.js",
"build:watch": "nodemon",
"format": "prettier --write --parser=typescript src/**/*.ts",
"postbuild": "tsc --emitDeclarationOnly --declaration"
},
"keywords": [],
"files": [
"dist/**/*"
],
"dependencies": {
"uuid": "^9.0.1"
},
"devDependencies": {
"@types/uuid": "9.0.8",
"esbuild": "^0.20.2",
"lint-staged": "^15.2.2",
"nodemon": "^3.1.0",
"prettier": "^3.2.5",
"typescript": "^5.4.4"
}
}
Loading

0 comments on commit 27f0f5a

Please sign in to comment.