Skip to content

Commit

Permalink
update node versions and script targets
Browse files Browse the repository at this point in the history
  • Loading branch information
smac89 committed Nov 18, 2023
1 parent cd3ff6f commit 0e581bd
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 19 deletions.
13 changes: 8 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
name: 'Actions Tagger'
author: 'smac89'
description:
'Keep your action versions up-to-date by automatically promoting a major version each time a minor
release is created'
'Keep your action versions up-to-date by automatically promoting a major
version each time a minor release is created'
inputs:
# TODO v3: rename this to publish_latest and latest will not
# default to a tag, but will follow `prefer_branch_release`
Expand All @@ -14,7 +14,8 @@ inputs:
required: false
default: false
prefer_branch_releases:
description: 'Do you prefer creating major branches as opposed to major tags?'
description:
'Do you prefer creating major branches as opposed to major tags?'
required: false
default: false
token:
Expand All @@ -24,9 +25,11 @@ outputs:
tag:
description: 'The major version that was created/updated. ex v1'
latest:
description: "Either 'true' or 'false' depending on whether the 'latest' tag was created"
description:
"Either 'true' or 'false' depending on whether the 'latest' tag was
created"
runs:
using: 'node16'
using: 'node20'
main: 'lib/index.js'
branding:
icon: 'tag'
Expand Down
13 changes: 10 additions & 3 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,18 @@ import type { JestConfigWithTsJest } from 'ts-jest';

// https://kulshekhar.github.io/ts-jest/docs/getting-started/paths-mapping
// https://jestjs.io/docs/en/configuration

// https://docs.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables
const config: JestConfigWithTsJest = {
bail: process.env.CI == 'true' ? 0 : 1,
preset: 'ts-jest',
transform: {
// '^.+\\.[tj]sx?$' to process js/ts with `ts-jest`
// '^.+\\.m?[tj]sx?$' to process js/ts/mjs/mts with `ts-jest`
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: 'tests/tsconfig.json',
},
],
},
testEnvironment: 'node',
roots: ['<rootDir>'],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
Expand Down
14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
{
"name": "actions-tagger",
"name": "actionstagger",
"version": "2.1.0-rc1",
"repository": {
"type": "git",
"url": "git+https://github.com/Actions-R-Us/actions-tagger.git"
},
"main": "lib/index.js",
"engines": {
"node": ">=20"
},
"main": "./lib/index.js",
"scripts": {
"watch": "ncc build src/main.ts --watch",
"build": "ncc build src/main.ts --license LICENSE --minify --out lib",
"lint": "tsc --noEmit --skipLibCheck",
"watch": "ncc build src/index.ts --watch",
"build": "ncc build src/index.ts --license LICENSE --minify --out lib",
"lint": "tsc && tsc -p ./tests",
"test": "jest"
},
"author": {
Expand All @@ -24,6 +27,7 @@
"semver": "^7.5.4"
},
"devDependencies": {
"@octokit/webhooks-types": "^7.3.1",
"@types/jest": "~29.5.8",
"@types/node": "~20.9.0",
"@types/semver": "^7.5.5",
Expand Down
9 changes: 9 additions & 0 deletions tests/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../tsconfig",
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "Node"
},
"include": ["*.ts"]
}
15 changes: 9 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"outDir": "lib",
"target": "ES2022",
"module": "NodeNext",
"outDir": "./lib",
"moduleResolution": "NodeNext",
"sourceMap": true,
"alwaysStrict": true,
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"noEmit": true,
"skipLibCheck": true,
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
"noImplicitAny": true,
"isolatedModules": true,
"esModuleInterop": true,
Expand All @@ -16,5 +18,6 @@
"@actionstagger/*": ["./src/*"],
"@actionstagger": ["./src"]
}
}
},
"include": ["src/**/*", "jest.config.ts"]
}
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,11 @@
dependencies:
"@octokit/openapi-types" "^19.0.2"

"@octokit/webhooks-types@^7.3.1":
version "7.3.1"
resolved "https://registry.yarnpkg.com/@octokit/webhooks-types/-/webhooks-types-7.3.1.tgz#bbf259ba1a4d623cbc300096e84d6f07f3095688"
integrity sha512-u6355ZsZnHwmxen30SrqnYb1pXieBFkYgkNzt+Ed4Ao5tupN1OErHfzwiV6hq6duGkDAYASbq7/uVJQ69PjLEg==

"@sinclair/typebox@^0.24.1":
version "0.24.51"
resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.51.tgz#645f33fe4e02defe26f2f5c0410e1c094eac7f5f"
Expand Down

0 comments on commit 0e581bd

Please sign in to comment.