-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
255 additions
and
122 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 |
---|---|---|
@@ -1,28 +1,35 @@ | ||
/* eslint-env node */ | ||
module.exports = { | ||
extends: [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"eslint-config-prettier", | ||
"prettier" | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"eslint-config-prettier", | ||
"prettier", | ||
], | ||
parser: "@typescript-eslint/parser", | ||
parserOptions: { | ||
project: ["./tsconfig.cjs.json"] | ||
project: ["./tsconfig.cjs.json", "./tsconfig.esm.json","./tsconfig.json"], | ||
}, | ||
plugins: ["@typescript-eslint"], | ||
root: true, | ||
env: { | ||
node: true, | ||
jest: true, | ||
node: true, | ||
jest: true, | ||
}, | ||
ignorePatterns: ["dist", "node_modules", ".eslintrc.cjs"], | ||
ignorePatterns: [ | ||
"lib", | ||
"node_modules", | ||
".eslintrc.cjs", | ||
"**/__tests__/*.spec.ts", | ||
"vitest.config.ts", | ||
], | ||
rules: { | ||
"@typescript-eslint/adjacent-overload-signatures": "error", | ||
"@typescript-eslint/array-type": ["error", { default: "generic" }], | ||
"@typescript-eslint/await-thenable": "error", | ||
"@typescript-eslint/ban-types": "error", | ||
"@typescript-eslint/class-literal-property-style": "error", | ||
"@typescript-eslint/explicit-function-return-type": "error", | ||
"@typescript-eslint/adjacent-overload-signatures": "error", | ||
"@typescript-eslint/array-type": ["error", { default: "generic" }], | ||
"@typescript-eslint/await-thenable": "error", | ||
"@typescript-eslint/ban-types": "error", | ||
"@typescript-eslint/class-literal-property-style": "error", | ||
"@typescript-eslint/explicit-function-return-type": "error", | ||
}, | ||
} | ||
}; | ||
|
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,42 +1,51 @@ | ||
# name: Build and Publish to NPM | ||
# name: Build and Test | ||
|
||
# on: | ||
# push: | ||
# branches: | ||
# - main | ||
# pull_request: | ||
# # The branches below must be a subset of the branches above | ||
# branches: [ "main" ] | ||
# pull_request_target: | ||
# types: [opened, synchronize, reopened] | ||
# push: | ||
# branches: | ||
# - main | ||
# pull_request: | ||
# branches: ["main"] | ||
# pull_request_target: | ||
# types: [opened, synchronize, reopened] | ||
|
||
# jobs: | ||
# build: | ||
# runs-on: ubuntu-latest | ||
|
||
# steps: | ||
# - name: Checkout code | ||
# uses: actions/checkout@v2 | ||
|
||
# - name: Use Node.js | ||
# uses: actions/setup-node@v2 | ||
# with: | ||
# node-version: '18.11.0' | ||
|
||
# - name: Install Dependencies | ||
# run: npm install | ||
|
||
# - name: Build | ||
# run: npm run build:linux | ||
|
||
#- name: Unit Tests | ||
# working-directory: packages/core | ||
# run: npm test | ||
# env: | ||
# CI: true | ||
|
||
# - name: Set up .npmrc | ||
# run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc | ||
# - name: Install dependencies | ||
# run: npm ci | ||
|
||
# build: | ||
# runs-on: ubuntu-latest | ||
|
||
# steps: | ||
# - name: Checkout code | ||
# uses: actions/checkout@v2 | ||
|
||
# - name: Use Node.js | ||
# uses: actions/setup-node@v2 | ||
# with: | ||
# node-version: "18.11.0" | ||
|
||
# - name: Install Dependencies | ||
# run: npm install | ||
|
||
# - name: Build | ||
# run: npm run build | ||
|
||
# - name: Unit Tests | ||
# working-directory: ./src | ||
# run: npm run test | ||
# env: | ||
# CI: true | ||
|
||
# - name: Run Code Coverage | ||
# working-directory: ./src | ||
# run: npm run coverage | ||
|
||
# - name: Upload coverage reports to Codecov | ||
# uses: codecov/[email protected] | ||
# with: | ||
# working-directory: . | ||
# token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
# - name: Set up .npmrc | ||
# run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc | ||
|
||
# - name: Install dependencies | ||
# run: npm ci |
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 |
---|---|---|
|
@@ -60,7 +60,7 @@ representative at an online or offline event. | |
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be | ||
reported to the community leaders responsible for enforcement at | ||
[email protected]. | ||
<[email protected]>. | ||
All complaints will be reviewed and investigated promptly and fairly. | ||
|
||
All community leaders are obligated to respect the privacy and security of the | ||
|
@@ -116,13 +116,13 @@ the community. | |
|
||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], | ||
version 2.0, available at | ||
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. | ||
<https://www.contributor-covenant.org/version/2/0/code_of_conduct.html>. | ||
|
||
Community Impact Guidelines were inspired by [Mozilla's code of conduct | ||
enforcement ladder](https://github.com/mozilla/diversity). | ||
|
||
[homepage]: https://www.contributor-covenant.org | ||
|
||
For answers to common questions about this code of conduct, see the FAQ at | ||
https://www.contributor-covenant.org/faq. Translations are available at | ||
https://www.contributor-covenant.org/translations. | ||
<https://www.contributor-covenant.org/faq>. Translations are available at | ||
<https://www.contributor-covenant.org/translations>. |
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 was deleted.
Oops, something went wrong.
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,35 @@ | ||
const fs = require("fs"); | ||
const path = require("path"); | ||
|
||
function copyRecursiveSync(src, dest) { | ||
const exists = fs.existsSync(src); | ||
const stats = exists && fs.statSync(src); | ||
const isDirectory = exists && stats.isDirectory(); | ||
|
||
if (isDirectory) { | ||
fs.mkdirSync(dest); | ||
fs.readdirSync(src).forEach(function (childItemName) { | ||
copyRecursiveSync( | ||
path.join(src, childItemName), | ||
path.join(dest, childItemName), | ||
); | ||
}); | ||
} else { | ||
fs.copyFileSync(src, dest); | ||
} | ||
} | ||
|
||
if (process.argv.length < 4) { | ||
process.stderr.write( | ||
"Usage: node copy.js <origin1> <origin2> ... <destination>\n", | ||
); | ||
process.exit(1); | ||
} | ||
|
||
const destination = process.argv[process.argv.length - 1]; | ||
|
||
for (let i = 2; i < process.argv.length - 1; i++) { | ||
const origin = process.argv[i]; | ||
copyRecursiveSync(origin, path.join(destination, path.basename(origin))); | ||
process.stdout.write(`Copied: ${origin} to ${destination}\n`); | ||
} |
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 @@ | ||
const fs = require("fs").promises; | ||
|
||
const moveFile = async (origin, destination) => { | ||
try { | ||
await fs.access(origin); | ||
} catch (error) { | ||
process.stderr.write(`Error: Origin '${origin}' not found\n`); | ||
process.exit(1); | ||
} | ||
|
||
try { | ||
await fs.rename(origin, destination); | ||
process.stdout.write(`Move: ${origin} to ${destination}\n`); | ||
} catch (error) { | ||
process.stderr.write( | ||
`Error: Unable to move '${origin}' to '${destination}'\n`, | ||
); | ||
process.exit(1); | ||
} | ||
}; | ||
|
||
if (process.argv.length !== 4) { | ||
process.stderr.write("Usage: node mv.js <origin> <destination>\n"); | ||
process.exit(1); | ||
} | ||
|
||
const origin = process.argv[2]; | ||
const destination = process.argv[3]; | ||
|
||
moveFile(origin, destination); |
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,19 @@ | ||
const fs = require("fs").promises; | ||
|
||
const removeTarget = async (target) => { | ||
try { | ||
await fs.rm(target, { recursive: true, force: true }); | ||
process.stdout.write(`Removed: ${target}\n`); | ||
} catch (error) { | ||
process.stderr.write(`Error: Unable to remove '${target}'\n`); | ||
process.exit(1); | ||
} | ||
}; | ||
|
||
if (process.argv.length !== 3) { | ||
process.stderr.write("Usage: node rm.js <dir/file>\n"); | ||
process.exit(1); | ||
} | ||
|
||
const target = process.argv[2]; | ||
removeTarget(target); |
Oops, something went wrong.