41 Commits

Author SHA1 Message Date
Nick Alteen
bf07408ed9 Add license generation 2025-02-11 16:38:04 -05:00
Nick Alteen
a76d098d06 Merge pull request #466 from actions/dependabot/npm_and_yarn/npm-development-8bab57db68
Bump the npm-development group across 1 directory with 4 updates
2025-02-11 14:57:40 -05:00
Nick Alteen
725300a6e2 Rebuild dist 2025-02-11 14:56:35 -05:00
dependabot[bot]
ad27785903 Bump the npm-development group across 1 directory with 4 updates
Bumps the npm-development group with 4 updates in the / directory: [@github/local-action](https://github.com/github/local-action), [eslint](https://github.com/eslint/eslint), [prettier](https://github.com/prettier/prettier) and [rollup](https://github.com/rollup/rollup).


Updates `@github/local-action` from 2.5.1 to 2.6.1
- [Release notes](https://github.com/github/local-action/releases)
- [Commits](https://github.com/github/local-action/compare/v2.5.1...v2.6.1)

Updates `eslint` from 9.19.0 to 9.20.1
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v9.19.0...v9.20.1)

Updates `prettier` from 3.4.2 to 3.5.0
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.4.2...3.5.0)

Updates `rollup` from 4.34.1 to 4.34.6
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v4.34.1...v4.34.6)

---
updated-dependencies:
- dependency-name: "@github/local-action"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-development
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-development
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-development
- dependency-name: rollup
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-development
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-11 19:52:12 +00:00
Nick Alteen
b20bf2e912 Merge pull request #465 from actions/dependabot/npm_and_yarn/npm-production-22765cb201
Bump @rollup/rollup-linux-x64-gnu from 4.34.1 to 4.34.6 in the npm-production group
2025-02-11 14:50:25 -05:00
dependabot[bot]
ec57a4c31b Bump @rollup/rollup-linux-x64-gnu in the npm-production group
Bumps the npm-production group with 1 update: [@rollup/rollup-linux-x64-gnu](https://github.com/rollup/rollup).


Updates `@rollup/rollup-linux-x64-gnu` from 4.34.1 to 4.34.6
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v4.34.1...v4.34.6)

---
updated-dependencies:
- dependency-name: "@rollup/rollup-linux-x64-gnu"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-10 10:01:24 +00:00
Nick Alteen
14c6df91f7 Merge pull request #462 from actions/dependabot/npm_and_yarn/npm-development-3e5463d133
Bump the npm-development group across 1 directory with 3 updates
2025-02-03 16:33:00 -05:00
Nick Alteen
f89c074fba Rebuild dist 2025-02-03 16:30:15 -05:00
dependabot[bot]
fa9d73a3f7 Bump the npm-development group across 1 directory with 3 updates
Bumps the npm-development group with 3 updates in the / directory: [@eslint/compat](https://github.com/eslint/rewrite), [eslint](https://github.com/eslint/eslint) and [rollup](https://github.com/rollup/rollup).


Updates `@eslint/compat` from 1.2.5 to 1.2.6
- [Release notes](https://github.com/eslint/rewrite/releases)
- [Changelog](https://github.com/eslint/rewrite/blob/main/release-please-config.json)
- [Commits](https://github.com/eslint/rewrite/compare/compat-v1.2.5...compat-v1.2.6)

Updates `eslint` from 9.18.0 to 9.19.0
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v9.18.0...v9.19.0)

Updates `rollup` from 4.31.0 to 4.34.1
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v4.31.0...v4.34.1)

---
updated-dependencies:
- dependency-name: "@eslint/compat"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-development
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-development
- dependency-name: rollup
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-development
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-03 21:16:59 +00:00
Nick Alteen
e62c6fb586 Merge pull request #461 from actions/dependabot/npm_and_yarn/rollup/rollup-linux-x64-gnu-4.34.1
Bump @rollup/rollup-linux-x64-gnu from 4.31.0 to 4.34.1
2025-02-03 16:15:29 -05:00
dependabot[bot]
9792e7c295 Bump @rollup/rollup-linux-x64-gnu from 4.31.0 to 4.34.1
Bumps [@rollup/rollup-linux-x64-gnu](https://github.com/rollup/rollup) from 4.31.0 to 4.34.1.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v4.31.0...v4.34.1)

---
updated-dependencies:
- dependency-name: "@rollup/rollup-linux-x64-gnu"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-03 09:55:28 +00:00
Nick Alteen
9020a2af63 Merge pull request #453 from actions/dependabot/npm_and_yarn/undici-5.28.5
Bump undici from 5.28.4 to 5.28.5
2025-01-23 11:10:23 -05:00
Nick Alteen
3d977ce510 Rebuild dist 2025-01-23 11:00:08 -05:00
dependabot[bot]
8a1d297bda Bump undici from 5.28.4 to 5.28.5
Bumps [undici](https://github.com/nodejs/undici) from 5.28.4 to 5.28.5.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.28.4...v5.28.5)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-22 00:54:12 +00:00
Nick Alteen
05854d806b Merge pull request #451 from actions/dependabot/npm_and_yarn/eslint-config-prettier-10.0.1
Bump eslint-config-prettier from 9.1.0 to 10.0.1
2025-01-21 12:25:06 -05:00
dependabot[bot]
d3fa3fa915 Bump eslint-config-prettier from 9.1.0 to 10.0.1
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 9.1.0 to 10.0.1.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v9.1.0...v10.0.1)

---
updated-dependencies:
- dependency-name: eslint-config-prettier
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-21 17:18:27 +00:00
Nick Alteen
48f6b7e1c9 Merge pull request #450 from actions/dependabot/npm_and_yarn/npm-development-8b55486f0f
Bump the npm-development group with 4 updates
2025-01-21 12:17:07 -05:00
dependabot[bot]
78cf8d293c Bump the npm-development group with 4 updates
Bumps the npm-development group with 4 updates: [@github/local-action](https://github.com/github/local-action), [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest), [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) and [rollup](https://github.com/rollup/rollup).


Updates `@github/local-action` from 2.5.0 to 2.5.1
- [Release notes](https://github.com/github/local-action/releases)
- [Commits](https://github.com/github/local-action/compare/v2.5...v2.5.1)

Updates `eslint-plugin-jest` from 28.10.0 to 28.11.0
- [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases)
- [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jest-community/eslint-plugin-jest/compare/v28.10.0...v28.11.0)

Updates `eslint-plugin-prettier` from 5.2.1 to 5.2.3
- [Release notes](https://github.com/prettier/eslint-plugin-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-plugin-prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-plugin-prettier/compare/v5.2.1...v5.2.3)

Updates `rollup` from 4.30.1 to 4.31.0
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v4.30.1...v4.31.0)

---
updated-dependencies:
- dependency-name: "@github/local-action"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-development
- dependency-name: eslint-plugin-jest
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-development
- dependency-name: eslint-plugin-prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-development
- dependency-name: rollup
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-development
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-20 09:31:24 +00:00
Nick Alteen
ab0a836a6e Merge pull request #448 from actions/dependabot/npm_and_yarn/npm-development-c341a066e9
Bump the npm-development group with 4 updates
2025-01-13 10:46:37 -05:00
Nick Alteen
81f37580f8 Rebuild dist 2025-01-13 10:45:33 -05:00
dependabot[bot]
fa6ce62a7f Bump the npm-development group with 4 updates
Bumps the npm-development group with 4 updates: [@eslint/compat](https://github.com/eslint/rewrite), [@rollup/plugin-commonjs](https://github.com/rollup/plugins/tree/HEAD/packages/commonjs), [eslint](https://github.com/eslint/eslint) and [rollup](https://github.com/rollup/rollup).


Updates `@eslint/compat` from 1.2.3 to 1.2.5
- [Release notes](https://github.com/eslint/rewrite/releases)
- [Changelog](https://github.com/eslint/rewrite/blob/main/release-please-config.json)
- [Commits](https://github.com/eslint/rewrite/compare/compat-v1.2.3...compat-v1.2.5)

Updates `@rollup/plugin-commonjs` from 28.0.1 to 28.0.2
- [Changelog](https://github.com/rollup/plugins/blob/master/packages/commonjs/CHANGELOG.md)
- [Commits](https://github.com/rollup/plugins/commits/commonjs-v28.0.2/packages/commonjs)

Updates `eslint` from 9.17.0 to 9.18.0
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v9.17.0...v9.18.0)

Updates `rollup` from 4.27.1 to 4.30.1
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v4.27.1...v4.30.1)

---
updated-dependencies:
- dependency-name: "@eslint/compat"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-development
- dependency-name: "@rollup/plugin-commonjs"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-development
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-development
- dependency-name: rollup
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-development
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-13 15:44:02 +00:00
Nick Alteen
92ced6f207 Merge pull request #449 from actions/dependabot/npm_and_yarn/rollup/plugin-node-resolve-16.0.0
Bump @rollup/plugin-node-resolve from 15.3.0 to 16.0.0
2025-01-13 10:42:36 -05:00
dependabot[bot]
8866d6e98e Bump @rollup/plugin-node-resolve from 15.3.0 to 16.0.0
Bumps [@rollup/plugin-node-resolve](https://github.com/rollup/plugins/tree/HEAD/packages/node-resolve) from 15.3.0 to 16.0.0.
- [Changelog](https://github.com/rollup/plugins/blob/master/packages/node-resolve/CHANGELOG.md)
- [Commits](https://github.com/rollup/plugins/commits/commonjs-v16.0.0/packages/node-resolve)

---
updated-dependencies:
- dependency-name: "@rollup/plugin-node-resolve"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-13 09:18:19 +00:00
Nick Alteen
ddfd38ef6d Merge pull request #444 from actions/dependabot/npm_and_yarn/eslint-9.17.0
Bump eslint from 8.57.1 to 9.17.0
2025-01-10 09:35:30 -05:00
dependabot[bot]
7d8b19ec32 Bump eslint from 8.57.1 to 9.17.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.57.1 to 9.17.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.57.1...v9.17.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-10 14:32:48 +00:00
Nick Alteen
89f1f8b86e Merge pull request #434 from actions/ncalteen/esm
Convert to ESM
2025-01-10 09:31:35 -05:00
Nick Alteen
0162b739ab Set node version in package.json 2025-01-09 17:23:41 -05:00
Nick Alteen
1bab47cf53 Lower node version 2025-01-09 17:13:18 -05:00
Nick Alteen
e8deae9ecb Delete extra linter files 2025-01-08 11:48:12 -05:00
Nick Alteen
6c0950181d Merge branch 'main' into ncalteen/esm 2025-01-08 10:10:53 -05:00
Nick Alteen
aa81e86d55 Merge pull request #445 from actions/dependabot/npm_and_yarn/npm-development-2937112f77
Bump eslint-plugin-jest from 28.9.0 to 28.10.0 in the npm-development group
2025-01-03 10:44:39 -05:00
dependabot[bot]
376ade8d59 Bump eslint-plugin-jest in the npm-development group
Bumps the npm-development group with 1 update: [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest).


Updates `eslint-plugin-jest` from 28.9.0 to 28.10.0
- [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases)
- [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jest-community/eslint-plugin-jest/compare/v28.9.0...v28.10.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-jest
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-23 09:17:36 +00:00
Nick Alteen
79d1b397fa Merge branch 'main' into ncalteen/esm 2024-12-11 13:59:35 -05:00
Nick Alteen
e440420ba2 Merge pull request #442 from actions/dependabot/npm_and_yarn/npm-development-8659346cde
Bump the npm-development group across 1 directory with 3 updates
2024-12-11 12:07:09 -05:00
dependabot[bot]
0c1056335d Bump the npm-development group across 1 directory with 3 updates
Bumps the npm-development group with 3 updates in the / directory: [@github/local-action](https://github.com/github/local-action), [eslint-plugin-github](https://github.com/github/eslint-plugin-github) and [prettier](https://github.com/prettier/prettier).


Updates `@github/local-action` from 2.2.0 to 2.2.1
- [Release notes](https://github.com/github/local-action/releases)
- [Commits](https://github.com/github/local-action/compare/v2.2...v2.2.1)

Updates `eslint-plugin-github` from 5.0.2 to 5.1.4
- [Release notes](https://github.com/github/eslint-plugin-github/releases)
- [Commits](https://github.com/github/eslint-plugin-github/compare/v5.0.2...v5.1.4)

Updates `prettier` from 3.3.3 to 3.4.2
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.3.3...3.4.2)

---
updated-dependencies:
- dependency-name: "@github/local-action"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-development
- dependency-name: eslint-plugin-github
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-development
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-09 10:18:58 +00:00
Nick Alteen
b0ea639bf1 Merge pull request #435 from actions/dependabot/npm_and_yarn/npm-development-de458a5699
Bump @vercel/ncc from 0.38.2 to 0.38.3 in the npm-development group
2024-11-19 12:08:06 -05:00
dependabot[bot]
276175d1e5 Bump @vercel/ncc from 0.38.2 to 0.38.3 in the npm-development group
Bumps the npm-development group with 1 update: [@vercel/ncc](https://github.com/vercel/ncc).


Updates `@vercel/ncc` from 0.38.2 to 0.38.3
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](https://github.com/vercel/ncc/compare/0.38.2...0.38.3)

---
updated-dependencies:
- dependency-name: "@vercel/ncc"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-18 10:02:12 +00:00
Nick Alteen
713f6464fe Add optional dependency for GHA build 2024-11-15 12:34:11 -05:00
Nick Alteen
081d9e881a Convert to ESM 2024-11-15 12:30:35 -05:00
Nick Alteen
14c58ed4a7 Merge pull request #433 from actions/dependabot/npm_and_yarn/npm-development-c126f5a339
Bump the npm-development group with 2 updates
2024-11-12 15:03:34 -05:00
dependabot[bot]
8daef5da3d Bump the npm-development group with 2 updates
Bumps the npm-development group with 2 updates: [@github/local-action](https://github.com/github/local-action) and [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest).


Updates `@github/local-action` from 2.1.3 to 2.2.0
- [Release notes](https://github.com/github/local-action/releases)
- [Commits](https://github.com/github/local-action/compare/v2.1.3...v2.2)

Updates `eslint-plugin-jest` from 28.8.3 to 28.9.0
- [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases)
- [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jest-community/eslint-plugin-jest/compare/v28.8.3...v28.9.0)

---
updated-dependencies:
- dependency-name: "@github/local-action"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-development
- dependency-name: eslint-plugin-jest
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-11 09:59:43 +00:00
33 changed files with 34356 additions and 9601 deletions

View File

@@ -1,4 +0,0 @@
lib/
dist/
node_modules/
coverage/

View File

@@ -1,50 +0,0 @@
env:
commonjs: true
es6: true
jest: true
node: true
globals:
Atomics: readonly
SharedArrayBuffer: readonly
ignorePatterns:
- '!.*'
- '**/node_modules/.*'
- '**/dist/.*'
- '**/coverage/.*'
- '*.json'
parser: '@babel/eslint-parser'
parserOptions:
ecmaVersion: 2023
sourceType: module
requireConfigFile: false
babelOptions:
babelrc: false
configFile: false
presets:
- jest
plugins:
- jest
extends:
- eslint:recommended
- plugin:github/recommended
- plugin:jest/recommended
rules:
{
'camelcase': 'off',
'eslint-comments/no-use': 'off',
'eslint-comments/no-unused-disable': 'off',
'i18n-text/no-en': 'off',
'import/no-commonjs': 'off',
'import/no-namespace': 'off',
'no-console': 'off',
'no-unused-vars': 'off',
'prettier/prettier': 'error',
'semi': 'off'
}

View File

@@ -9,33 +9,15 @@
# expected from the build.
name: Check Transpiled JavaScript
# This workflow will only run on PRs targeting `main` and direct pushes to
# `main`. It will only run if the listed files/paths are modified (e.g. there is
# no need to run this workflow when documentation files are modified).
on:
pull_request:
branches:
- main
paths:
- src/**
- .node-version
- .prettierrc.json
- package.json
- package-lock.json
- tsconfig.json
push:
branches:
- main
paths:
- src/**
- .node-version
- .prettierrc.json
- package.json
- package-lock.json
- tsconfig.json
permissions:
checks: write
contents: read
jobs:
@@ -44,10 +26,12 @@ jobs:
runs-on: ubuntu-latest
steps:
# Checkout the repository.
- name: Checkout
id: checkout
uses: actions/checkout@v4
# Setup Node.js using the version specified in `.node-version`.
- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v4
@@ -55,17 +39,19 @@ jobs:
node-version-file: .node-version
cache: npm
# Install dependencies using `npm ci`.
- name: Install Dependencies
id: install
run: npm ci
# Build the `dist/` directory.
- name: Build dist/ Directory
id: build
run: npm run bundle
# This will fail the workflow if the `dist/` directory is different than
# expected.
- name: Compare Expected and Actual Directories
- name: Compare Directories
id: diff
run: |
if [ ! -d dist/ ]; then

View File

@@ -1,5 +1,3 @@
# This workflow performs CI tests to ensure that the code reaching `main`
# has been tested and validated.
name: Continuous Integration
on:
@@ -11,7 +9,6 @@ on:
- main
permissions:
checks: write
contents: read
jobs:
@@ -60,7 +57,7 @@ jobs:
id: test-action
uses: ./
with:
milliseconds: 2000
milliseconds: 1000
- name: Print Output
id: output

View File

@@ -1,60 +0,0 @@
# This workflow creates a new release any time a PR is merged that includes an
# update to the version listed in `package.json`. This ensures that the releases
# are always in sync with the version listed in the package manifest.
name: Continuous Delivery
on:
pull_request:
types:
- closed
branches:
- main
workflow_dispatch:
permissions:
contents: write
jobs:
release:
name: Release Version
runs-on: ubuntu-latest
# Only run this job if the workflow was triggered manually or a
# non-Dependabot PR was merged.
if: |
github.event_name == 'workflow_dispatch' ||
(github.event.pull_request.merged == true &&
startsWith(github.head_ref, 'dependabot/') == false)
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
# Parse the version from package.json and, if not already present,
# publish a new action version.
- name: Tag
id: tag
uses: issue-ops/semver@v2
with:
manifest-path: package.json
workspace: ${{ github.workspace }}
ref: main
# Always overwrite if the workflow was triggered manually.
overwrite: ${{ github.event_name == 'workflow_dispatch' }}
# Create a release using the tag from the previous step. The release will
# always be created if the workflow was triggered manually, but will only
# be created on PR merge if the tag step ran successfully.
- if: |
github.event_name == 'workflow_dispatch' ||
steps.tag.outcome == 'success'
name: Create Release
id: release
uses: issue-ops/releaser@v2
with:
tag: v${{ steps.tag.outputs.version }}

View File

@@ -1,3 +1,8 @@
# This workflow will lint the entire codebase using the
# `super-linter/super-linter` action.
#
# For more information, see the super-linter repository:
# https://github.com/super-linter/super-linter
name: Lint Codebase
on:
@@ -19,12 +24,14 @@ jobs:
runs-on: ubuntu-latest
steps:
# Checkout the repository.
- name: Checkout
id: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# Setup Node.js using the version specified in `.node-version`.
- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v4
@@ -32,10 +39,12 @@ jobs:
node-version-file: .node-version
cache: npm
# Install dependencies using `npm ci`.
- name: Install Dependencies
id: install
run: npm ci
# Lint the codebase using the `super-linter/super-linter` action.
- name: Lint Codebase
id: super-linter
uses: super-linter/super-linter/slim@v7
@@ -43,6 +52,9 @@ jobs:
DEFAULT_BRANCH: main
FILTER_REGEX_EXCLUDE: dist/**/*
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_JAVASCRIPT_STANDARD: false
LINTER_RULES_PATH: ${{ github.workspace }}
VALIDATE_ALL_CODEBASE: true
VALIDATE_JAVASCRIPT_ES: false
VALIDATE_JAVASCRIPT_STANDARD: false
VALIDATE_JSCPD: false
VALIDATE_JSON: false

View File

@@ -1,41 +0,0 @@
# This workflow checks the version of the action that will be published by the
# current pull request. If the version has already been published, the workflow
# fails in order to prevent PRs from being merged until the version has been
# incremented in the package.json manifest file.
name: Version Check
on:
pull_request:
branches:
- main
env:
MANIFEST_PATH: package.json
permissions:
checks: write
contents: read
pull-requests: write
jobs:
check-version:
name: Version Check
runs-on: ubuntu-latest
# Skips Dependabot PRs
if: ${{ startsWith(github.head_ref, 'dependabot/') == false }}
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Check Version
id: check-version
uses: issue-ops/semver@v2
with:
check-only: true
manifest-path: ${{ env.MANIFEST_PATH }}

View File

@@ -1,7 +1,13 @@
# See: https://github.com/DavidAnson/markdownlint
# Unordered list style
MD004:
style: dash
# Disable line length for tables
MD013:
tables: false
# Ordered list item prefix
MD029:
style: one

View File

@@ -1 +1 @@
20.6.0
20.9.0

View File

@@ -1,3 +1,4 @@
.DS_Store
dist/
node_modules/
coverage/
coverage/

View File

@@ -1,16 +0,0 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": false,
"singleQuote": true,
"quoteProps": "as-needed",
"jsxSingleQuote": false,
"trailingComma": "none",
"bracketSpacing": true,
"bracketSameLine": true,
"arrowParens": "avoid",
"proseWrap": "always",
"htmlWhitespaceSensitivity": "css",
"endOfLine": "lf"
}

16
.prettierrc.yml Normal file
View File

@@ -0,0 +1,16 @@
# See: https://prettier.io/docs/en/configuration
printWidth: 80
tabWidth: 2
useTabs: false
semi: false
singleQuote: true
quoteProps: as-needed
jsxSingleQuote: false
trailingComma: none
bracketSpacing: true
bracketSameLine: true
arrowParens: always
proseWrap: always
htmlWhitespaceSensitivity: css
endOfLine: lf

View File

@@ -1,3 +1,5 @@
# See: https://yamllint.readthedocs.io/en/stable/
rules:
document-end: disable
document-start:

View File

@@ -1,3 +1,7 @@
# Repository CODEOWNERS
############################################################################
# Repository CODEOWNERS #
# Order is important! The last matching pattern takes the most precedence. #
############################################################################
# Default owners, unless a later match takes precedence.
* @actions/actions-oss-maintainers

View File

@@ -229,28 +229,3 @@ steps:
id: output
run: echo "${{ steps.run-action.outputs.time }}"
```
## Publishing a New Release
This project includes two workflow files, `continuous-integration.yml` and
`continuous-delivery.yml` that are used to build, test, and publish new releases
of the action.
The `continuous-integration.yml` workflow is triggered on every push to a pull
request branch. It will run unit tests and add a comment to the pull request
with the test results.
The `continuous-delivery.yml` workflow is triggered when a pull request is
merged to the `main` branch. It will create a new release of the action based on
the version specified in the `version` property of the `package.json` file.
The steps to publish a new version are as follows:
1. Create a feature branch
1. Make changes to the action code
1. Add tests for the changes
1. Update the `version` property in the `package.json` file
1. Commit and push the changes to the feature branch
1. Open a pull request to merge the changes to the `main` branch
After the pull request is merged, a new release will be created automatically.

12
__fixtures__/core.js Normal file
View File

@@ -0,0 +1,12 @@
/**
* This file is used to mock the `@actions/core` module in tests.
*/
import { jest } from '@jest/globals'
export const debug = jest.fn()
export const error = jest.fn()
export const info = jest.fn()
export const getInput = jest.fn()
export const setOutput = jest.fn()
export const setFailed = jest.fn()
export const warning = jest.fn()

3
__fixtures__/wait.js Normal file
View File

@@ -0,0 +1,3 @@
import { jest } from '@jest/globals'
export const wait = jest.fn()

View File

@@ -1,18 +0,0 @@
/**
* Unit tests for the action's entrypoint, src/index.js
*/
const { run } = require('../src/main')
// Mock the action's entrypoint
jest.mock('../src/main', () => ({
run: jest.fn()
}))
describe('index', () => {
it('calls run when imported', async () => {
require('../src/index')
expect(run).toHaveBeenCalled()
})
})

View File

@@ -1,96 +1,62 @@
/**
* Unit tests for the action's main functionality, src/main.js
*
* To mock dependencies in ESM, you can create fixtures that export mock
* functions and objects. For example, the core module is mocked in this test,
* so that the actual '@actions/core' module is not imported.
*/
const core = require('@actions/core')
const main = require('../src/main')
import { jest } from '@jest/globals'
import * as core from '../__fixtures__/core.js'
import { wait } from '../__fixtures__/wait.js'
// Mock the GitHub Actions core library
const debugMock = jest.spyOn(core, 'debug').mockImplementation()
const getInputMock = jest.spyOn(core, 'getInput').mockImplementation()
const setFailedMock = jest.spyOn(core, 'setFailed').mockImplementation()
const setOutputMock = jest.spyOn(core, 'setOutput').mockImplementation()
// Mocks should be declared before the module being tested is imported.
jest.unstable_mockModule('@actions/core', () => core)
jest.unstable_mockModule('../src/wait.js', () => ({ wait }))
// Mock the action's main function
const runMock = jest.spyOn(main, 'run')
// The module being tested should be imported dynamically. This ensures that the
// mocks are used in place of any actual dependencies.
const { run } = await import('../src/main.js')
// Other utilities
const timeRegex = /^\d{2}:\d{2}:\d{2}/
describe('action', () => {
describe('main.js', () => {
beforeEach(() => {
jest.clearAllMocks()
// Set the action's inputs as return values from core.getInput().
core.getInput.mockImplementation(() => '500')
// Mock the wait function so that it does not actually wait.
wait.mockImplementation(() => Promise.resolve('done!'))
})
it('sets the time output', async () => {
// Set the action's inputs as return values from core.getInput()
getInputMock.mockImplementation(name => {
switch (name) {
case 'milliseconds':
return '500'
default:
return ''
}
})
afterEach(() => {
jest.resetAllMocks()
})
await main.run()
expect(runMock).toHaveReturned()
it('Sets the time output', async () => {
await run()
// Verify that all of the core library functions were called correctly
expect(debugMock).toHaveBeenNthCalledWith(1, 'Waiting 500 milliseconds ...')
expect(debugMock).toHaveBeenNthCalledWith(
2,
expect.stringMatching(timeRegex)
)
expect(debugMock).toHaveBeenNthCalledWith(
3,
expect.stringMatching(timeRegex)
)
expect(setOutputMock).toHaveBeenNthCalledWith(
// Verify the time output was set.
expect(core.setOutput).toHaveBeenNthCalledWith(
1,
'time',
expect.stringMatching(timeRegex)
// Simple regex to match a time string in the format HH:MM:SS.
expect.stringMatching(/^\d{2}:\d{2}:\d{2}/)
)
})
it('sets a failed status', async () => {
// Set the action's inputs as return values from core.getInput()
getInputMock.mockImplementation(name => {
switch (name) {
case 'milliseconds':
return 'this is not a number'
default:
return ''
}
})
it('Sets a failed status', async () => {
// Clear the getInput mock and return an invalid value.
core.getInput.mockClear().mockReturnValueOnce('this is not a number')
await main.run()
expect(runMock).toHaveReturned()
// Clear the wait mock and return a rejected promise.
wait
.mockClear()
.mockRejectedValueOnce(new Error('milliseconds is not a number'))
// Verify that all of the core library functions were called correctly
expect(setFailedMock).toHaveBeenNthCalledWith(
await run()
// Verify that the action was marked as failed.
expect(core.setFailed).toHaveBeenNthCalledWith(
1,
'milliseconds not a number'
)
})
it('fails if no input is provided', async () => {
// Set the action's inputs as return values from core.getInput()
getInputMock.mockImplementation(name => {
switch (name) {
case 'milliseconds':
throw new Error('Input required and not supplied: milliseconds')
default:
return ''
}
})
await main.run()
expect(runMock).toHaveReturned()
// Verify that all of the core library functions were called correctly
expect(setFailedMock).toHaveBeenNthCalledWith(
1,
'Input required and not supplied: milliseconds'
'milliseconds is not a number'
)
})
})

View File

@@ -1,18 +1,18 @@
/**
* Unit tests for src/wait.js
*/
const { wait } = require('../src/wait')
const { expect } = require('@jest/globals')
import { wait } from '../src/wait.js'
describe('wait.js', () => {
it('throws an invalid number', async () => {
it('Throws an invalid number', async () => {
const input = parseInt('foo', 10)
expect(isNaN(input)).toBe(true)
await expect(wait(input)).rejects.toThrow('milliseconds not a number')
await expect(wait(input)).rejects.toThrow('milliseconds is not a number')
})
it('waits with a valid number', async () => {
it('Waits with a valid number', async () => {
const start = new Date()
await wait(500)
const end = new Date()

View File

@@ -1,18 +1,23 @@
name: 'The name of your action here'
description: 'Provide a description here'
author: 'Your name or organization here'
name: The name of your action here
description: Provide a description here
author: Your name or organization here
# Add your action's branding here. This will appear on the GitHub Marketplace.
branding:
icon: heart
color: red
# Define your inputs here.
inputs:
milliseconds:
description: 'Your input description here'
description: Your input description here
required: true
default: '1000'
# Define your outputs here.
outputs:
time:
description: 'Your output description here'
description: Your output description here
runs:
using: node20

30844
dist/index.js generated vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

179
dist/licenses.txt generated vendored
View File

@@ -1,5 +1,13 @@
@actions/core
MIT
Name: @actions/core
Version: 1.11.1
License: MIT
Private: false
Description: Actions core lib
Repository: git+https://github.com/actions/toolkit.git
Homepage: https://github.com/actions/toolkit/tree/main/packages/core
License Copyright:
===
The MIT License (MIT)
Copyright 2019 GitHub
@@ -10,20 +18,18 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@actions/exec
MIT
The MIT License (MIT)
---
Copyright 2019 GitHub
Name: @actions/http-client
Version: 2.2.3
License: MIT
Private: false
Description: Actions Http Client
Repository: git+https://github.com/actions/toolkit.git
Homepage: https://github.com/actions/toolkit/tree/main/packages/http-client
License Copyright:
===
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@actions/http-client
MIT
Actions Http Client for Node.js
Copyright (c) GitHub, Inc.
@@ -46,21 +52,19 @@ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---
@actions/io
MIT
The MIT License (MIT)
Name: tunnel
Version: 0.0.6
License: MIT
Private: false
Description: Node HTTP/HTTPS Agents for tunneling proxies
Repository: https://github.com/koichik/node-tunnel.git
Homepage: https://github.com/koichik/node-tunnel/
Author: Koichi Kobayashi <koichik@improvement.jp>
License Copyright:
===
Copyright 2019 GitHub
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
tunnel
MIT
The MIT License (MIT)
Copyright (c) 2012 Koichi Kobayashi
@@ -82,3 +86,124 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
---
Name: undici
Version: 5.28.5
License: MIT
Private: false
Description: An HTTP/1.1 client, written from scratch for Node.js
Repository: git+https://github.com/nodejs/undici.git
Homepage: https://undici.nodejs.org
Contributors:
Daniele Belardi (https://github.com/dnlup)
Ethan Arrowood (https://github.com/ethan-arrowood)
Matteo Collina (https://github.com/mcollina)
Matthew Aitken (https://github.com/KhafraDev)
Robert Nagy (https://github.com/ronag)
Szymon Marczak (https://github.com/szmarczak)
Tomas Della Vedova (https://github.com/delvedor)
License Copyright:
===
MIT License
Copyright (c) Matteo Collina and Undici contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
---
Name: @fastify/busboy
Version: 2.1.1
License: MIT
Private: false
Description: A streaming parser for HTML form data for node.js
Repository: git+https://github.com/fastify/busboy.git
Author: Brian White <mscdex@mscdex.net>
Contributors:
Igor Savin <kibertoad@gmail.com> (https://github.com/kibertoad)
Aras Abbasi <aras.abbasi@gmail.com> (https://github.com/uzlopak)
License Copyright:
===
Copyright Brian White. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
---
Name: @actions/exec
Version: 1.1.1
License: MIT
Private: false
Description: Actions exec lib
Repository: git+https://github.com/actions/toolkit.git
Homepage: https://github.com/actions/toolkit/tree/main/packages/exec
License Copyright:
===
The MIT License (MIT)
Copyright 2019 GitHub
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---
Name: @actions/io
Version: 1.1.3
License: MIT
Private: false
Description: Actions io lib
Repository: git+https://github.com/actions/toolkit.git
Homepage: https://github.com/actions/toolkit/tree/main/packages/io
License Copyright:
===
The MIT License (MIT)
Copyright 2019 GitHub
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

1
dist/sourcemap-register.js generated vendored

File diff suppressed because one or more lines are too long

61
eslint.config.mjs Normal file
View File

@@ -0,0 +1,61 @@
// See: https://eslint.org/docs/latest/use/configure/configuration-files
import { fixupPluginRules } from '@eslint/compat'
import { FlatCompat } from '@eslint/eslintrc'
import js from '@eslint/js'
import _import from 'eslint-plugin-import'
import jest from 'eslint-plugin-jest'
import prettier from 'eslint-plugin-prettier'
import globals from 'globals'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
})
export default [
{
ignores: ['**/coverage', '**/dist', '**/linter', '**/node_modules']
},
...compat.extends(
'eslint:recommended',
'plugin:jest/recommended',
'plugin:prettier/recommended'
),
{
plugins: {
import: fixupPluginRules(_import),
jest,
prettier
},
languageOptions: {
globals: {
...globals.node,
...globals.jest,
Atomics: 'readonly',
SharedArrayBuffer: 'readonly'
},
ecmaVersion: 2023,
sourceType: 'module'
},
rules: {
camelcase: 'off',
'eslint-comments/no-use': 'off',
'eslint-comments/no-unused-disable': 'off',
'i18n-text/no-en': 'off',
'import/no-namespace': 'off',
'no-console': 'off',
'no-shadow': 'off',
'no-unused-vars': 'off',
'prettier/prettier': 'error'
}
}
]

30
jest.config.js Normal file
View File

@@ -0,0 +1,30 @@
// See: https://jestjs.io/docs/configuration
/** @type {import('jest').Config} */
const jestConfig = {
clearMocks: true,
collectCoverage: true,
collectCoverageFrom: ['./src/**'],
coverageDirectory: './coverage',
coveragePathIgnorePatterns: ['/node_modules/', '/dist/'],
coverageReporters: ['json-summary', 'text', 'lcov'],
// Uncomment the below lines if you would like to enforce a coverage threshold
// for your action. This will fail the build if the coverage is below the
// specified thresholds.
// coverageThreshold: {
// global: {
// branches: 100,
// functions: 100,
// lines: 100,
// statements: 100
// }
// },
moduleFileExtensions: ['js'],
reporters: ['default'],
testEnvironment: 'node',
testMatch: ['**/*.test.js'],
testPathIgnorePatterns: ['/dist/', '/node_modules/'],
verbose: true
}
export default jestConfig

12266
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -3,6 +3,7 @@
"description": "GitHub Actions JavaScript Template",
"version": "0.0.0",
"author": "",
"type": "module",
"private": true,
"homepage": "https://github.com/actions/javascript-action#readme",
"repository": {
@@ -13,9 +14,7 @@
"url": "https://github.com/actions/javascript-action/issues"
},
"keywords": [
"GitHub",
"Actions",
"JavaScript"
"actions"
],
"exports": {
".": "./dist/index.js"
@@ -25,59 +24,40 @@
},
"scripts": {
"bundle": "npm run format:write && npm run package",
"ci-test": "npx jest",
"ci-test": "NODE_OPTIONS=--experimental-vm-modules NODE_NO_WARNINGS=1 npx jest",
"coverage": "npx make-coverage-badge --output-path ./badges/coverage.svg",
"format:write": "npx prettier --write .",
"format:check": "npx prettier --check .",
"lint": "npx eslint . -c ./.github/linters/.eslintrc.yml",
"package": "npx ncc build src/index.js -o dist --source-map --license licenses.txt",
"lint": "npx eslint .",
"local-action": "npx local-action . src/main.js .env",
"package": "npx rollup --config rollup.config.js",
"package:watch": "npm run package -- --watch",
"test": "npx jest",
"test": "NODE_OPTIONS=--experimental-vm-modules NODE_NO_WARNINGS=1 npx jest",
"all": "npm run format:write && npm run lint && npm run test && npm run coverage && npm run package"
},
"license": "MIT",
"eslintConfig": {
"extends": "./.github/linters/.eslintrc.yml"
},
"jest": {
"verbose": true,
"clearMocks": true,
"testEnvironment": "node",
"moduleFileExtensions": [
"js"
],
"testMatch": [
"**/*.test.js"
],
"testPathIgnorePatterns": [
"/node_modules/",
"/dist/"
],
"coverageReporters": [
"json-summary",
"text",
"lcov"
],
"collectCoverage": true,
"collectCoverageFrom": [
"./src/**"
]
},
"dependencies": {
"@actions/core": "^1.11.1"
},
"devDependencies": {
"@babel/core": "^7.26.0",
"@babel/eslint-parser": "^7.25.9",
"@babel/preset-env": "^7.26.0",
"@github/local-action": "^2.1.2",
"@vercel/ncc": "^0.38.2",
"babel-preset-jest": "^29.6.3",
"eslint": "^8.57.1",
"eslint-plugin-github": "^5.0.2",
"eslint-plugin-jest": "^28.8.3",
"@eslint/compat": "^1.2.6",
"@github/local-action": "^2.6.1",
"@jest/globals": "^29.7.0",
"@rollup/plugin-commonjs": "^28.0.2",
"@rollup/plugin-node-resolve": "^16.0.0",
"eslint": "^9.20.1",
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jest": "^28.11.0",
"eslint-plugin-prettier": "^5.2.3",
"jest": "^29.7.0",
"make-coverage-badge": "^1.2.0",
"prettier": "^3.3.3"
"prettier": "^3.5.0",
"prettier-eslint": "^16.3.0",
"rollup": "^4.34.6",
"rollup-plugin-license": "^3.5.3"
},
"optionalDependencies": {
"@rollup/rollup-linux-x64-gnu": "*"
}
}

27
rollup.config.js Normal file
View File

@@ -0,0 +1,27 @@
// See: https://rollupjs.org/introduction/
import commonjs from '@rollup/plugin-commonjs'
import { nodeResolve } from '@rollup/plugin-node-resolve'
import license from 'rollup-plugin-license'
const config = {
input: 'src/index.js',
output: {
esModule: true,
file: 'dist/index.js',
format: 'es',
sourcemap: true
},
plugins: [
commonjs(),
nodeResolve({ preferBuiltins: true }),
license({
sourcemap: true,
thirdParty: {
output: 'dist/licenses.txt'
}
})
]
}
export default config

View File

@@ -1,6 +1,8 @@
/**
* The entrypoint for the action.
* The entrypoint for the action. This file simply imports and runs the action's
* main logic.
*/
const { run } = require('./main')
import { run } from './main.js'
/* istanbul ignore next */
run()

View File

@@ -1,13 +1,14 @@
const core = require('@actions/core')
const { wait } = require('./wait')
import * as core from '@actions/core'
import { wait } from './wait.js'
/**
* The main function for the action.
*
* @returns {Promise<void>} Resolves when the action is complete.
*/
async function run() {
export async function run() {
try {
const ms = core.getInput('milliseconds', { required: true })
const ms = core.getInput('milliseconds')
// Debug logs are only output if the `ACTIONS_STEP_DEBUG` secret is true
core.debug(`Waiting ${ms} milliseconds ...`)
@@ -21,10 +22,6 @@ async function run() {
core.setOutput('time', new Date().toTimeString())
} catch (error) {
// Fail the workflow run if an error occurs
core.setFailed(error.message)
if (error instanceof Error) core.setFailed(error.message)
}
}
module.exports = {
run
}

View File

@@ -1,17 +1,13 @@
/**
* Wait for a number of milliseconds.
* Waits for a number of milliseconds.
*
* @param {number} milliseconds The number of milliseconds to wait.
* @returns {Promise<string>} Resolves with 'done!' after the wait is over.
*/
async function wait(milliseconds) {
return new Promise(resolve => {
if (isNaN(milliseconds)) {
throw new Error('milliseconds not a number')
}
export async function wait(milliseconds) {
return new Promise((resolve) => {
if (isNaN(milliseconds)) throw new Error('milliseconds is not a number')
setTimeout(() => resolve('done!'), milliseconds)
})
}
module.exports = { wait }