Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
msimerson committed Apr 2, 2024
1 parent 2c82772 commit d6fab02
Show file tree
Hide file tree
Showing 10 changed files with 112 additions and 119 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
custom: ["https://www.buymeacoffee.com/reklatsmasters"]
custom: ['https://www.buymeacoffee.com/reklatsmasters']
6 changes: 3 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
- package-ecosystem: 'npm' # See documentation for possible values
directory: '/' # Location of package manifests
schedule:
interval: "weekly"
interval: 'weekly'
versioning-strategy: increase
88 changes: 44 additions & 44 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,71 +10,71 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
- uses: actions/checkout@v4
- run: npm install
- run: npm install eslint@^8
- run: npm run lint
- uses: actions/setup-node@v4
- uses: actions/checkout@v4
- run: npm install
- run: npm install eslint@^8
- run: npm run lint

coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
- uses: actions/checkout@v4
- run: npm install
- name: run coverage
run: |
npm install --no-save c8
npx c8 --reporter=lcov npm test
env:
NODE_ENV: cov
- uses: actions/setup-node@v4
- uses: actions/checkout@v4
- run: npm install
- name: run coverage
run: |
npm install --no-save c8
npx c8 --reporter=lcov npm test
env:
NODE_ENV: cov

- name: codecov
uses: codecov/codecov-action@v3
- name: codecov
uses: codecov/codecov-action@v3

- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}

ubuntu:
needs: [ lint, get-lts ]
needs: [lint, get-lts]
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ${{ fromJson(needs.get-lts.outputs.active) }}
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
name: Node ${{ matrix.node-version }} on ubuntu-latest
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run test
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
name: Node ${{ matrix.node-version }} on ubuntu-latest
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run test

windows:
needs: [ lint, get-lts ]
needs: [lint, get-lts]
runs-on: windows-latest
strategy:
matrix:
node-version: ${{ fromJson(needs.get-lts.outputs.active) }}
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
name: Node.js ${{ matrix.node-version }} on windows-latest
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run test
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
name: Node.js ${{ matrix.node-version }} on windows-latest
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run test

get-lts:
runs-on: ubuntu-latest
steps:
- id: get
uses: msimerson/node-lts-versions@v1
outputs:
active: ${{ steps.get.outputs.active }}
lts: ${{ steps.get.outputs.lts }}
min: ${{ steps.get.outputs.min }}
runs-on: ubuntu-latest
steps:
- id: get
uses: msimerson/node-lts-versions@v1
outputs:
active: ${{ steps.get.outputs.active }}
lts: ${{ steps.get.outputs.lts }}
min: ${{ steps.get.outputs.min }}
58 changes: 29 additions & 29 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
name: 'CodeQL'

on:
push:
branches: [ master ]
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
branches: [master]
schedule:
- cron: '32 1 * * 3'

Expand All @@ -32,39 +32,39 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
language: ['javascript']
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release
#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
8 changes: 4 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- run: npm test

publish-npm:
needs: [ build ]
needs: [build]
runs-on: ubuntu-latest
environment: npm
steps:
Expand All @@ -32,7 +32,7 @@ jobs:
- uses: actions/setup-node@v3
with:
registry-url: https://registry.npmjs.org/
scope: "@msimerson"
scope: '@msimerson'
- name: rename package with @msimerson scope
run: node .npm/prepend-scope.cjs @msimerson
- name: publish to NPM
Expand All @@ -41,7 +41,7 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

publish-gpr:
needs: [ build ]
needs: [build]
runs-on: ubuntu-latest
environment: ghpm
permissions:
Expand All @@ -54,7 +54,7 @@ jobs:
- uses: actions/setup-node@v3
with:
registry-url: https://npm.pkg.github.com/
scope: "@msimerson"
scope: '@msimerson'
- name: rename package with @msimerson scope
run: node .npm/prepend-scope.cjs @msimerson
- run: npm publish
Expand Down
23 changes: 12 additions & 11 deletions .npm/prepend-scope.cjs
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
#!node
function usage () {
console.log(`${process.argv[1]} <scope>`)
process.exit(1)
function usage() {
console.log(`${process.argv[1]} <scope>`);
process.exit(1);
}
const scope = process.argv[2]; if (!scope) usage()
const fs = require('fs')
const pkg = JSON.parse(fs.readFileSync('./package.json'))
const checkExistsRe = new RegExp(`^${scope}/`, 'g')
const scope = process.argv[2];
if (!scope) usage();
const fs = require('fs');
const pkg = JSON.parse(fs.readFileSync('./package.json'));
const checkExistsRe = new RegExp(`^${scope}/`, 'g');
// console.log(`name: ${pkg.name}, scope: ${scope}, re: ${checkExistsRe}`)
if (checkExistsRe.test(pkg.name)) {
console.error(`already scoped to ${scope}`)
process.exit(1)
console.error(`already scoped to ${scope}`);
process.exit(1);
}
pkg.name = `${scope}/${pkg.name}`
fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2))
pkg.name = `${scope}/${pkg.name}`;
fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2));
10 changes: 5 additions & 5 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
singleQuote: true,
trailingComma: 'es5',
printWidth: 100,
endOfLine: 'lf',
};
singleQuote: true,
trailingComma: 'es5',
printWidth: 100,
endOfLine: 'lf',
};
7 changes: 2 additions & 5 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,22 @@ All notable changes to the "stun" package will be documented in this file.
### [3.0.0] - 2023-12-13

- BREAKING: drop support for node.js <= 16
- still works, but no legacy version testing
- still works, but no legacy version testing
- dep(eslint): bump to 8.55.0
- dep(jest): bump to 29.7.0
- dep(prettier): bump to 3.1.1


## [2.1.16] - 2023-12-09

- dep(meow): replace with minimist
- dep(parse-url): replace with native URL
- require node.js >= 10
- require node.js >= 10
- ci: replace Travis with GHA


## [2.1.0] - 2019-11-23

- `stun.request` supports promise interface.


## [2.0.0] - 2019-06-02

- Add `request()` method to simplify client-side requests. Follow the `STUN` specification.
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"lint": "npx eslint .",
"lint-fix": "npx eslint --fix .",
"prettier": "npx prettier --check .",
"prettier:fix": "npx prettier --fix .",
"prettier:fix": "npx prettier --write .",
"test": "npx jest",
"versions": "npx dependency-version-checker check"
},
Expand All @@ -30,8 +30,7 @@
"url": "https://github.com/msimerson/stun/issues"
},
"homepage": "https://github.com/msimerson/stun#readme",
"devDependencies": {
},
"devDependencies": {},
"dependencies": {
"binary-data": "^0.6.0",
"buffer-xor": "^2.0.2",
Expand Down
Loading

0 comments on commit d6fab02

Please sign in to comment.