create-node-lib 2.8.1 → 2.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-node-lib",
3
- "version": "2.8.1",
3
+ "version": "2.9.1",
4
4
  "description": "Scaffolding out a Node.js library module",
5
5
  "bin": "./bin/cli.js",
6
6
  "engines": {
@@ -17,6 +17,11 @@ updates:
17
17
  schedule:
18
18
  interval: "weekly"
19
19
  open-pull-requests-limit: 10
20
+ # Use the 'dependencies' default label and add
21
+ # the 'automerge' one for automerge github action support
22
+ labels:
23
+ - "dependencies"
24
+ - "automerge"
20
25
  groups:
21
26
  # Production dependencies without breaking changes
22
27
  dependencies:
@@ -0,0 +1,39 @@
1
+ name: automerge
2
+ on:
3
+ pull_request:
4
+ types:
5
+ - labeled
6
+ - unlabeled
7
+ - synchronize
8
+ - opened
9
+ - edited
10
+ - ready_for_review
11
+ - reopened
12
+ - unlocked
13
+ pull_request_review:
14
+ types:
15
+ - submitted
16
+ check_suite:
17
+ types:
18
+ - completed
19
+ status: {}
20
+ jobs:
21
+ automerge:
22
+ runs-on: ubuntu-latest
23
+ permissions:
24
+ contents: write
25
+ pull-requests: write
26
+ steps:
27
+ - id: automerge
28
+ name: automerge
29
+ uses: "pascalgn/automerge-action@v0.16.4"
30
+ env:
31
+ GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
32
+ # we only merge PRs with labels of "dependencies"
33
+ MERGE_LABELS: "automerge"
34
+ MERGE_REMOVE_LABELS: "automerge"
35
+ MERGE_METHOD: "squash"
36
+ MERGE_COMMIT_MESSAGE: "automatic"
37
+ MERGE_FORKS: "false"
38
+ MERGE_REQUIRED_APPROVALS: "0"
39
+ UPDATE_METHOD: "rebase"
@@ -13,14 +13,11 @@ jobs:
13
13
  steps:
14
14
  - uses: actions/checkout@v4
15
15
 
16
- - name: Markdown Lint
17
- uses: ruzickap/action-my-markdown-linter@26b4129bf0352527e60b5bd739357af63df1b7bf
16
+ - name: Setup Node.js
17
+ uses: actions/setup-node@v4
18
18
  with:
19
- debug: true
20
- config_file: .github/.markdownlint.yml
21
- exclude: |
22
- .changeset/
23
- .github/
24
- CODE_OF_CONDUCT.md
25
- LICENSE
26
- CHANGELOG.md
19
+ node-version: '22'
20
+
21
+ - name: Markdown Lint
22
+ run: |
23
+ npm run lint:markdown || npx -y markdownlint-cli@0.45.0 -c .github/.markdownlint.yml -i '.git' -i '__tests__' -i '.github' -i '.changeset' -i 'CODE_OF_CONDUCT.md' -i 'CHANGELOG.md' -i 'node_modules' -i 'dist' '**/**.md'
@@ -3,7 +3,7 @@ import neostandard, { resolveIgnoresFromGitignore, plugins } from 'neostandard'
3
3
 
4
4
  export default [
5
5
  ...neostandard({
6
- ignores: resolveIgnoresFromGitignore(),
6
+ ignores: ['__tests__/**/*.ts', ...resolveIgnoresFromGitignore()],
7
7
  ts: true, // Enable TypeScript support,
8
8
  filesTs: ['src/**/*.ts', '__tests__/**/*.ts']
9
9
  }),
@@ -11,10 +11,10 @@ export default [
11
11
  pluginSecurity.configs.recommended,
12
12
  {
13
13
  rules: {
14
- 'n/no-process-exit': 'warn',
14
+ 'n/no-process-exit': 'off',
15
15
  'n/no-unsupported-features': 'off',
16
16
  'n/no-unpublished-require': 'off',
17
- 'security/detect-non-literal-fs-filename': 'error',
17
+ 'security/detect-non-literal-fs-filename': 'off',
18
18
  'security/detect-unsafe-regex': 'error',
19
19
  'security/detect-buffer-noassert': 'error',
20
20
  'security/detect-child-process': 'error',
@@ -22,16 +22,18 @@ export default [
22
22
  'security/detect-eval-with-expression': 'error',
23
23
  'security/detect-no-csrf-before-method-override': 'error',
24
24
  'security/detect-non-literal-regexp': 'error',
25
- 'security/detect-object-injection': 'warn',
25
+ 'security/detect-object-injection': 'off',
26
26
  'security/detect-possible-timing-attacks': 'error',
27
27
  'security/detect-pseudoRandomBytes': 'error',
28
28
  'space-before-function-paren': 'off',
29
29
  'object-curly-spacing': 'off',
30
- 'n/hashbang': 'off'
30
+ 'no-control-regex': 'off',
31
+ 'n/hashbang': 'off',
32
+ 'n/no-unsupported-features/node-builtins': 'warn'
31
33
  },
32
34
  languageOptions: {
33
35
  ecmaVersion: 2024,
34
36
  sourceType: 'module',
35
37
  },
36
38
  },
37
- ]
39
+ ]
@@ -35,7 +35,8 @@
35
35
  "scripts": {
36
36
  "start": "node --import tsx src/bin/cli.ts",
37
37
  "build": "tsc && tsup",
38
- "lint": "eslint . && npm run lint:lockfile",
38
+ "lint": "eslint . && npm run lint:lockfile && npm run lint:markdown",
39
+ "lint:markdown": "npx -y markdownlint-cli@0.45.0 -c .github/.markdownlint.yml -i '.git' -i '__tests__' -i '.github' -i '.changeset' -i 'CODE_OF_CONDUCT.md' -i 'CHANGELOG.md' -i 'docs/**' -i 'node_modules' -i 'dist' '**/**.md' --fix",
39
40
  "lint:fix": "eslint . --fix",
40
41
  "lint:lockfile": "lockfile-lint --path package-lock.json --validate-https --allowed-hosts npm yarn",
41
42
  "test": "c8 node --import tsx --test __tests__/**/*.test.ts",
@@ -85,5 +86,22 @@
85
86
  "**/*.{js,json}": [
86
87
  "npm run lint:fix"
87
88
  ]
89
+ },
90
+ "c8": {
91
+ "exclude": [
92
+ "dist/**",
93
+ "coverage/**",
94
+ "__tests__/**",
95
+ "**/*.test.ts",
96
+ "**/*.test.js"
97
+ ],
98
+ "include": [
99
+ "src/**"
100
+ ],
101
+ "reporter": [
102
+ "text",
103
+ "lcov",
104
+ "html"
105
+ ]
88
106
  }
89
107
  }
@@ -5,8 +5,8 @@ import { add } from '../main.ts'
5
5
  const debug = debuglog('<%= projectName %>')
6
6
 
7
7
  async function init () {
8
- const sum = await add(1, 2)
9
- debug(sum.toString())
8
+ const sum = await add(1, 2)
9
+ debug(sum.toString())
10
10
  }
11
11
 
12
12
  init()
@@ -1,3 +1,3 @@
1
- export async function add(arg1: number, arg2: number): Promise<number> {
1
+ export async function add (arg1: number, arg2: number): Promise<number> {
2
2
  return Promise.resolve(arg1 + arg2)
3
3
  }