Skip to content

Commit

Permalink
Add the files
Browse files Browse the repository at this point in the history
  • Loading branch information
EpeusJS committed Jul 3, 2024
1 parent 748d123 commit cd61004
Show file tree
Hide file tree
Showing 27 changed files with 4,287 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# These are supported funding model platforms

github: [w3nl]
patreon: w3news
21 changes: 21 additions & 0 deletions .github/workflows/cpd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Node Copy Paste Detector

on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- name: npm cpd
run: |
npm ci
npm run cpd
env:
CI: true
21 changes: 21 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Node Lint

on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- name: npm lint
run: |
npm ci
npm run lint
env:
CI: true
34 changes: 34 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# 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://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: Node.js Package

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run build --if-present
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
27 changes: 27 additions & 0 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: SonarCloud

on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- name: npm install, lint, and test
run: |
npm ci
npm run lint:report
npm test
env:
CI: true
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
25 changes: 25 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Node Test

on: [push]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x, 21.x, 22.x]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- name: npm test
run: |
npm ci
npm test
env:
CI: true
21 changes: 21 additions & 0 deletions .github/workflows/vulnerabilities.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Node Vulnerability Check

on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- name: npm vulnerabilities
run: |
npm ci
npm run vulnerabilities
env:
CI: true
14 changes: 14 additions & 0 deletions .jscpd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"threshold": 0,
"reporters": [
"json",
"console"
],
"ignore": [
"**/__snapshots__/**",
"**/__fixtures__/**",
"**/__tests__/**"
],
"absolute": true,
"gitignore": true
}
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.15.0
34 changes: 34 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"all": true,
"include": [
"src/**/*.js"
],
"exclude": [
"**/*.test.js",
"**/*.spec.js"
],
"reporter": [
"text",
"text-summary",
"lcov",
"clover"
],
"watermarks": {
"lines": [
80,
95
],
"functions": [
80,
95
],
"branches": [
80,
95
],
"statements": [
80,
95
]
}
}
21 changes: 21 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"recommendations": [
"dbaeumer.vscode-eslint", // ESLint
"ryu1kn.annotator", // Annotator / Blame
"ms-vscode.atom-keybindings", // Atom Keymap
"shakram02.bash-beautify", // Bash Beautify
"ryanluker.vscode-coverage-gutters", // Coverage Gutters (Code coverage for tests)
"editorconfig.editorconfig", // EditorConfig for VS Code
"github.vscode-pull-request-github", // GitHub Pull Requests and Issues
"eamodio.gitlens", // GitLens — Git supercharged
"xabikos.javascriptsnippets", // JavaScript (ES6) code snippets
"ms-vscode.vscode-typescript-next", // JavaScript and TypeScript Nightly
"shd101wyy.markdown-preview-enhanced", // Markdown Preview Enhanced
"christian-kohler.npm-intellisense", // npm Intellisense (autocompletes npm modules in import statements)
"christian-kohler.path-intellisense", // Path Intellisense (autocompletes filenames)
"robertoachar.vscode-essentials-snippets", // VSCode Essentials Snippets
"codeandstuff.package-json-upgrade", // Package Json Upgrade
"mikestead.dotenv", // DotENV (syntax highlighting for .env files)
"redhat.vscode-yaml" // YAML (Validation, auto completion, formatter, ...)
]
}
58 changes: 58 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Test and watch",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run",
"test:watch",
"--",
"--inspect-brk"
],
"cwd": "${workspaceRoot}/src",
"autoAttachChildProcesses": true,
"restart": true,
"sourceMaps": true,
"stopOnEntry": false,
"console": "integratedTerminal",
},
{
"type": "node",
"request": "launch",
"name": "Lint and fix",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run",
"lint:fix"
],
"cwd": "${workspaceRoot}/src",
"autoAttachChildProcesses": true,
"restart": true,
"sourceMaps": true,
"stopOnEntry": false,
"console": "integratedTerminal",
},
{
"type": "node",
"request": "launch",
"name": "Test current file",
"runtimeExecutable": "node",
"runtimeArgs": [
"--test",
"${file}"
],
"cwd": "${workspaceRoot}",
"autoAttachChildProcesses": true,
"restart": true,
"sourceMaps": true,
"stopOnEntry": false,
"console": "integratedTerminal",
}
]
}
63 changes: 63 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"eslint.codeActionsOnSave.rules": null,
"editor.formatOnSave": true,
"coverage-gutters.coverageFileNames": [
"lcov.info",
"cov.xml",
"coverage.xml",
"jacoco.xml",
"coverage.cobertura.xml"
],
"eslint.notebooks.rules.customizations": [],
"debug.javascript.debugByLinkOptions": "on",
"markdown-preview-enhanced.mathBlockDelimiters": [
[
"$$",
"$$"
],
[
"\\[",
"\\]"
]
],
"npm.exclude": "",
"npm.packageManager": "npm",
"npm.enableRunFromFolder": true,
"npm.enableTouchbar": true,
"lcov.path": "coverage/lcov.info",
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
},
"[javascript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"eslint.alwaysShowStatus": true,
"eslint.validate": [
"javascript",
"vue"
],
"eslint.format.enable": true,
"eslint.options": {
"resolvePluginsRelativeTo": ".",
},
"eslint.workingDirectories": [
{
"mode": "auto"
}
],
"eslint.useESLintClass": true,
"editor.inlineSuggest.enabled": true,
"editor.acceptSuggestionOnCommitCharacter": true,
"eslint.run": "onSave",
"files.exclude": {
".idea": true
},
"git.autofetch": true,
"files.watcherExclude": {
".npmrc": true
},
"githubPullRequests.ignoredPullRequestBranches": [
"main"
]
}
1 change: 1 addition & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Pieter Wigboldus <npm@w3news.org>
Loading

0 comments on commit cd61004

Please sign in to comment.