-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from Intosoft/feat/web
chore: code quality
- Loading branch information
Showing
25 changed files
with
3,733 additions
and
1,882 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/dist | ||
/node_modules | ||
/.github | ||
/examples | ||
/.git | ||
esbuild.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"extends": ["plugin:@typescript-eslint/recommended", "airbnb-base", "prettier"], | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": ["prettier", "@typescript-eslint"], | ||
"rules": { | ||
"prettier/prettier": "error", | ||
"no-unused-vars": ["error", { "vars": "all", "args": "none" }], | ||
"no-console": "off", | ||
"import/order": "error", | ||
"import/no-unresolved": "off", | ||
"import/named": 0, | ||
"import/extensions": "off", | ||
"import/prefer-default-export": "off", | ||
"no-plusplus": "off", | ||
"no-shadow": "off", | ||
"@typescript-eslint/ban-ts-comment": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,5 +23,8 @@ jobs: | |
- name: TSC | ||
run: yarn tsc | ||
|
||
- name: yarn lint | ||
run: yarn lint | ||
|
||
- name: Build | ||
run: yarn build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
cache: "yarn" | ||
node-version: 18 | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
cache: 'yarn' | ||
node-version: 18 | ||
|
||
- name: Install node modules | ||
run: yarn | ||
- name: Install node modules | ||
run: yarn | ||
|
||
- name: Build | ||
run: yarn build | ||
- name: Build | ||
run: yarn build | ||
|
||
- uses: JS-DevTools/npm-publish@v3 | ||
with: | ||
token: ${{ secrets.NPM_TOKEN }} | ||
- uses: JS-DevTools/npm-publish@v3 | ||
with: | ||
token: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,5 @@ | |
/.github | ||
/src | ||
.nvmrc | ||
./scripts | ||
./scripts | ||
esbuild.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
dist/ | ||
node_modules/ | ||
examples/ | ||
.git/ | ||
.github/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"printWidth": 100, | ||
"useTabs": false, | ||
"tabWidth": 4, | ||
"singleQuote": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
/* eslint-disable import/no-extraneous-dependencies */ | ||
const { build } = require('esbuild'); | ||
const { Generator } = require('npm-dts'); | ||
const { dependencies } = require('./package.json'); | ||
|
||
new Generator({ | ||
entry: 'src/index.ts', | ||
output: 'dist/index.d.ts', | ||
}).generate(); | ||
|
||
const sharedConfig = { | ||
entryPoints: ['src/index.ts'], | ||
bundle: true, | ||
minify: true, | ||
external: Object.keys(dependencies), | ||
}; | ||
|
||
build({ | ||
...sharedConfig, | ||
platform: 'node', // for CJS | ||
outfile: 'dist/index.js', | ||
}); | ||
|
||
build({ | ||
...sharedConfig, | ||
outfile: 'dist/index.esm.js', | ||
platform: 'neutral', // for ESM | ||
format: 'esm', | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,41 @@ | ||
{ | ||
"name": "@intosoft/qrcode", | ||
"version": "0.0.6", | ||
"description": "", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"tsc": "tsc", | ||
"build": "esbuild ./src/index.ts --bundle --outfile=dist/index.js" | ||
}, | ||
"author": "[email protected]", | ||
"license": "MIT", | ||
"dependencies": { | ||
"qrcode": "^1.5.3" | ||
}, | ||
"devDependencies": { | ||
"@types/qrcode": "^1.5.5", | ||
"esbuild": "^0.20.1", | ||
"tsx": "^4.7.1", | ||
"typescript": "^5.3.3" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
"name": "@intosoft/qrcode", | ||
"version": "0.0.7", | ||
"description": "", | ||
"module": "dist/index.esm.js", | ||
"main": "dist/index.js", | ||
"typings": "dist/index.d.ts", | ||
"scripts": { | ||
"build": "node esbuild.js", | ||
"unused-exports": "ts-unused-exports ./tsconfig.json --excludePathsFromReport='index.ts'", | ||
"tsc": "tsc", | ||
"lint": "yarn format && yarn eslint && yarn unused-exports", | ||
"format": "prettier --check .", | ||
"eslint": "eslint .", | ||
"lint:fix": "eslint --fix ." | ||
}, | ||
"author": "[email protected]", | ||
"license": "MIT", | ||
"dependencies": { | ||
"qrcode": "^1.5.3" | ||
}, | ||
"devDependencies": { | ||
"@types/qrcode": "^1.5.5", | ||
"@typescript-eslint/eslint-plugin": "^7.1.1", | ||
"@typescript-eslint/parser": "^7.1.1", | ||
"esbuild": "^0.20.1", | ||
"eslint": "^8.57.0", | ||
"eslint-config-airbnb-base": "^15.0.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-import": "^2.29.1", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"npm-dts": "^1.3.12", | ||
"prettier": "^3.2.5", | ||
"ts-unused-exports": "^10.0.1", | ||
"tsx": "^4.7.1", | ||
"typescript": "^5.3.3" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
Oops, something went wrong.