Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aafbedb8d3 | ||
|
|
51d59d0348 | ||
|
|
ee1b2d994c | ||
|
|
6cf8f984ce | ||
|
|
61fd4fc5d8 |
@@ -1,4 +0,0 @@
|
|||||||
dist/
|
|
||||||
lib/
|
|
||||||
node_modules/
|
|
||||||
jest.config.js
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
{
|
|
||||||
"plugins": ["jest", "@typescript-eslint"],
|
|
||||||
"extends": ["plugin:github/recommended"],
|
|
||||||
"parser": "@typescript-eslint/parser",
|
|
||||||
"parserOptions": {
|
|
||||||
"ecmaVersion": 9,
|
|
||||||
"sourceType": "module",
|
|
||||||
"project": "./tsconfig.json"
|
|
||||||
},
|
|
||||||
"rules": {
|
|
||||||
"i18n-text/no-en": "off",
|
|
||||||
"eslint-comments/no-use": "off",
|
|
||||||
"import/no-namespace": "off",
|
|
||||||
"no-unused-vars": "off",
|
|
||||||
"@typescript-eslint/no-unused-vars": "error",
|
|
||||||
"@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}],
|
|
||||||
"@typescript-eslint/no-require-imports": "error",
|
|
||||||
"@typescript-eslint/array-type": "error",
|
|
||||||
"@typescript-eslint/await-thenable": "error",
|
|
||||||
"@typescript-eslint/ban-ts-comment": "error",
|
|
||||||
"camelcase": "off",
|
|
||||||
"@typescript-eslint/consistent-type-assertions": "error",
|
|
||||||
"@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}],
|
|
||||||
"@typescript-eslint/func-call-spacing": ["error", "never"],
|
|
||||||
"@typescript-eslint/no-array-constructor": "error",
|
|
||||||
"@typescript-eslint/no-empty-interface": "error",
|
|
||||||
"@typescript-eslint/no-explicit-any": "error",
|
|
||||||
"@typescript-eslint/no-extraneous-class": "error",
|
|
||||||
"@typescript-eslint/no-for-in-array": "error",
|
|
||||||
"@typescript-eslint/no-inferrable-types": "error",
|
|
||||||
"@typescript-eslint/no-misused-new": "error",
|
|
||||||
"@typescript-eslint/no-namespace": "error",
|
|
||||||
"@typescript-eslint/no-non-null-assertion": "warn",
|
|
||||||
"@typescript-eslint/no-unnecessary-qualifier": "error",
|
|
||||||
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
|
||||||
"@typescript-eslint/no-useless-constructor": "error",
|
|
||||||
"@typescript-eslint/no-var-requires": "error",
|
|
||||||
"@typescript-eslint/prefer-for-of": "warn",
|
|
||||||
"@typescript-eslint/prefer-function-type": "warn",
|
|
||||||
"@typescript-eslint/prefer-includes": "error",
|
|
||||||
"@typescript-eslint/prefer-string-starts-ends-with": "error",
|
|
||||||
"@typescript-eslint/promise-function-async": "error",
|
|
||||||
"@typescript-eslint/require-array-sort-compare": "error",
|
|
||||||
"@typescript-eslint/restrict-plus-operands": "error",
|
|
||||||
"semi": "off",
|
|
||||||
"@typescript-eslint/semi": ["error", "never"],
|
|
||||||
"@typescript-eslint/type-annotation-spacing": "error",
|
|
||||||
"@typescript-eslint/unbound-method": "error"
|
|
||||||
},
|
|
||||||
"env": {
|
|
||||||
"node": true,
|
|
||||||
"es6": true,
|
|
||||||
"jest/globals": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
61
.github/workflows/check-dist.yml
vendored
61
.github/workflows/check-dist.yml
vendored
@@ -1,9 +1,13 @@
|
|||||||
# `dist/index.js` is a special file in Actions.
|
# In TypeScript actions, `dist/` is a special directory. When you reference
|
||||||
# When you reference an action with `uses:` in a workflow,
|
# an action with the `uses:` property, `dist/index.js` is the code that will be
|
||||||
# `index.js` is the code that will run.
|
# run. For this project, the `dist/index.js` file is transpiled from other
|
||||||
# For our project, we generate this file through a build process from other source files.
|
# source files. This workflow ensures the `dist/` directory contains the
|
||||||
# We need to make sure the checked-in `index.js` actually matches what we expect it to be.
|
# expected transpiled code.
|
||||||
name: Check dist/
|
#
|
||||||
|
# If this workflow is run from a feature branch, it will act as an additional CI
|
||||||
|
# check and fail if the checked-in `dist/` directory does not match what is
|
||||||
|
# expected from the build.
|
||||||
|
name: Check Transpiled JavaScript
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -16,40 +20,57 @@ on:
|
|||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '**.md'
|
- '**.md'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check-dist:
|
check-dist:
|
||||||
|
name: Check dist/
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout
|
||||||
|
id: checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set Node.js 20.x
|
- name: Setup Node.js
|
||||||
|
id: setup-node
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 20.x
|
node-version-file: .node-version
|
||||||
cache: npm
|
cache: npm
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install Dependencies
|
||||||
|
id: install
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Rebuild the dist/ directory
|
- name: Build dist/ Directory
|
||||||
run: npm run build
|
id: build
|
||||||
|
run: npm run bundle
|
||||||
|
|
||||||
- name: Compare the expected and actual dist/ directories
|
# This will fail the workflow if the `dist/` directory is different than
|
||||||
|
# expected.
|
||||||
|
- name: Compare Directories
|
||||||
|
id: diff
|
||||||
run: |
|
run: |
|
||||||
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
|
if [ ! -d dist/ ]; then
|
||||||
echo "Detected uncommitted changes after build. See status below:"
|
echo "Expected dist/ directory does not exist. See status below:"
|
||||||
git diff
|
ls -la ./
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ "$(git diff --ignore-space-at-eol --text dist/ | wc -l)" -gt "0" ]; then
|
||||||
|
echo "Detected uncommitted changes after build. See status below:"
|
||||||
|
git diff --ignore-space-at-eol --text dist/
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
id: diff
|
|
||||||
|
|
||||||
# If index.js was different than expected, upload the expected version as an artifact
|
# If `dist/` was different than expected, upload the expected version as a
|
||||||
- uses: actions/upload-artifact@v4
|
# workflow artifact.
|
||||||
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
|
- if: ${{ failure() && steps.diff.outcome == 'failure' }}
|
||||||
|
name: Upload Artifact
|
||||||
|
id: upload
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: dist
|
name: dist
|
||||||
path: dist/
|
path: dist/
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
name: 'build-test'
|
name: Continuous Integration
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -8,19 +8,32 @@ on:
|
|||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '**.md'
|
- '**.md'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build: # make sure build/ci work properly
|
test-typescript:
|
||||||
|
name: TypeScript Tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout
|
||||||
- run: |
|
uses: actions/checkout@v4
|
||||||
npm install
|
- name: Setup Node.js
|
||||||
- run: |
|
uses: actions/setup-node@v4
|
||||||
npm run all
|
with:
|
||||||
test:
|
node-version-file: .node-version
|
||||||
|
cache: npm
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: npm clean-install
|
||||||
|
- name: Check Format
|
||||||
|
run: npm run format:check
|
||||||
|
- name: Lint
|
||||||
|
run: npm run lint
|
||||||
|
- name: Test
|
||||||
|
run: npm run test
|
||||||
|
|
||||||
|
test-action:
|
||||||
name: GraalVM
|
name: GraalVM
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
@@ -95,8 +108,9 @@ jobs:
|
|||||||
java --version
|
java --version
|
||||||
native-image --version
|
native-image --version
|
||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows'
|
||||||
test-ce: # make sure the action works on a clean machine without building
|
|
||||||
needs: test
|
test-action-ce: # make sure the action works on a clean machine without building
|
||||||
|
needs: test-action
|
||||||
name: CE ${{ matrix.version }} + JDK${{ matrix.java-version }} on ${{ matrix.os }}
|
name: CE ${{ matrix.version }} + JDK${{ matrix.java-version }} on ${{ matrix.os }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
@@ -164,8 +178,9 @@ jobs:
|
|||||||
native-image --version
|
native-image --version
|
||||||
gu.cmd remove native-image
|
gu.cmd remove native-image
|
||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows'
|
||||||
test-ee:
|
|
||||||
needs: test
|
test-action-ee:
|
||||||
|
needs: test-action
|
||||||
name: EE ${{ matrix.version }} + JDK${{ matrix.java-version }} on ${{ matrix.os }}
|
name: EE ${{ matrix.version }} + JDK${{ matrix.java-version }} on ${{ matrix.os }}
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
@@ -212,8 +227,9 @@ jobs:
|
|||||||
native-image --version
|
native-image --version
|
||||||
gu.cmd remove native-image
|
gu.cmd remove native-image
|
||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows'
|
||||||
test-mandrel:
|
|
||||||
needs: test
|
test-action-mandrel:
|
||||||
|
needs: test-action
|
||||||
name: ${{ matrix.version }} + JDK${{ matrix.java-version }} on ${{ matrix.os }}
|
name: ${{ matrix.version }} + JDK${{ matrix.java-version }} on ${{ matrix.os }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
@@ -256,8 +272,9 @@ jobs:
|
|||||||
java --version
|
java --version
|
||||||
native-image --version
|
native-image --version
|
||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows'
|
||||||
test-liberica:
|
|
||||||
needs: test
|
test-action-liberica:
|
||||||
|
needs: test-action
|
||||||
name: Liberica (${{ matrix.java-version }}, '${{ matrix.java-package }}', ${{ matrix.os }})
|
name: Liberica (${{ matrix.java-version }}, '${{ matrix.java-package }}', ${{ matrix.os }})
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
@@ -298,7 +315,8 @@ jobs:
|
|||||||
exit 24
|
exit 24
|
||||||
}
|
}
|
||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows'
|
||||||
test-native-image-windows:
|
|
||||||
|
test-action-native-image-windows:
|
||||||
name: native-image on windows-latest
|
name: native-image on windows-latest
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
permissions:
|
permissions:
|
||||||
@@ -320,7 +338,8 @@ jobs:
|
|||||||
javac HelloWorld.java
|
javac HelloWorld.java
|
||||||
native-image HelloWorld
|
native-image HelloWorld
|
||||||
./helloworld
|
./helloworld
|
||||||
test-native-image-windows-msvc:
|
|
||||||
|
test-action-native-image-windows-msvc:
|
||||||
name: native-image on windows-2022
|
name: native-image on windows-2022
|
||||||
runs-on: windows-2022
|
runs-on: windows-2022
|
||||||
permissions:
|
permissions:
|
||||||
@@ -342,7 +361,8 @@ jobs:
|
|||||||
javac HelloWorld.java
|
javac HelloWorld.java
|
||||||
native-image HelloWorld
|
native-image HelloWorld
|
||||||
./helloworld
|
./helloworld
|
||||||
test-native-image-musl:
|
|
||||||
|
test-action-native-image-musl:
|
||||||
name: native-image-musl on ubuntu-latest
|
name: native-image-musl on ubuntu-latest
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
@@ -365,7 +385,8 @@ jobs:
|
|||||||
javac HelloWorld.java
|
javac HelloWorld.java
|
||||||
native-image --static --libc=musl HelloWorld
|
native-image --static --libc=musl HelloWorld
|
||||||
./helloworld
|
./helloworld
|
||||||
test-extensive:
|
|
||||||
|
test-action-extensive:
|
||||||
name: extensive tests on ubuntu-latest
|
name: extensive tests on ubuntu-latest
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
@@ -420,7 +441,8 @@ jobs:
|
|||||||
# popd > /dev/null
|
# popd > /dev/null
|
||||||
- name: Remove components
|
- name: Remove components
|
||||||
run: gu remove espresso llvm-toolchain nodejs python ruby wasm
|
run: gu remove espresso llvm-toolchain nodejs python ruby wasm
|
||||||
test-sbom:
|
|
||||||
|
test-action-sbom:
|
||||||
name: test 'native-image-enable-sbom' option
|
name: test 'native-image-enable-sbom' option
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
permissions:
|
permissions:
|
||||||
1
.node-version
Normal file
1
.node-version
Normal file
@@ -0,0 +1 @@
|
|||||||
|
20.9.0
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
dist/
|
dist/
|
||||||
lib/
|
|
||||||
node_modules/
|
node_modules/
|
||||||
|
README.md
|
||||||
|
|||||||
16
.prettierrc.yml
Normal file
16
.prettierrc.yml
Normal 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
|
||||||
@@ -94,7 +94,7 @@ describe('dependency cache', () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyCacheRestore = jest
|
spyCacheRestore = jest
|
||||||
.spyOn(cache, 'restoreCache')
|
.spyOn(cache, 'restoreCache')
|
||||||
.mockImplementation((paths: string[], primaryKey: string) =>
|
.mockImplementation((_paths: string[], _primaryKey: string) =>
|
||||||
Promise.resolve(undefined)
|
Promise.resolve(undefined)
|
||||||
)
|
)
|
||||||
spyWarning.mockImplementation(() => null)
|
spyWarning.mockImplementation(() => null)
|
||||||
@@ -184,7 +184,7 @@ describe('dependency cache', () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyCacheSave = jest
|
spyCacheSave = jest
|
||||||
.spyOn(cache, 'saveCache')
|
.spyOn(cache, 'saveCache')
|
||||||
.mockImplementation((paths: string[], key: string) =>
|
.mockImplementation((_paths: string[], _key: string) =>
|
||||||
Promise.resolve(0)
|
Promise.resolve(0)
|
||||||
)
|
)
|
||||||
spyWarning.mockImplementation(() => null)
|
spyWarning.mockImplementation(() => null)
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ describe('cleanup', () => {
|
|||||||
ReturnType<typeof cache.saveCache>,
|
ReturnType<typeof cache.saveCache>,
|
||||||
Parameters<typeof cache.saveCache>
|
Parameters<typeof cache.saveCache>
|
||||||
>
|
>
|
||||||
let spyJobStatusSuccess: jest.SpyInstance
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyWarning = jest.spyOn(core, 'warning')
|
spyWarning = jest.spyOn(core, 'warning')
|
||||||
@@ -50,7 +49,7 @@ describe('cleanup', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('does not fail nor warn even when the save process throws a ReserveCacheError', async () => {
|
it('does not fail nor warn even when the save process throws a ReserveCacheError', async () => {
|
||||||
spyCacheSave.mockImplementation((paths: string[], key: string) =>
|
spyCacheSave.mockImplementation((_paths: string[], _key: string) =>
|
||||||
Promise.reject(
|
Promise.reject(
|
||||||
new cache.ReserveCacheError(
|
new cache.ReserveCacheError(
|
||||||
'Unable to reserve cache with key, another job may be creating this cache.'
|
'Unable to reserve cache with key, another job may be creating this cache.'
|
||||||
@@ -66,7 +65,7 @@ describe('cleanup', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('does not fail even though the save process throws error', async () => {
|
it('does not fail even though the save process throws error', async () => {
|
||||||
spyCacheSave.mockImplementation((paths: string[], key: string) =>
|
spyCacheSave.mockImplementation((_paths: string[], _key: string) =>
|
||||||
Promise.reject(new Error('Unexpected error'))
|
Promise.reject(new Error('Unexpected error'))
|
||||||
)
|
)
|
||||||
jest.spyOn(core, 'getInput').mockImplementation((name: string) => {
|
jest.spyOn(core, 'getInput').mockImplementation((name: string) => {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ process.env['RUNNER_TOOL_CACHE'] = path.join(__dirname, 'TOOL_CACHE')
|
|||||||
process.env['RUNNER_TEMP'] = path.join(__dirname, 'TEMP')
|
process.env['RUNNER_TEMP'] = path.join(__dirname, 'TEMP')
|
||||||
|
|
||||||
test('request invalid version/javaVersion', async () => {
|
test('request invalid version/javaVersion', async () => {
|
||||||
for (var combination of [
|
for (const combination of [
|
||||||
['22.3.0', '7'],
|
['22.3.0', '7'],
|
||||||
['22.3', '17'],
|
['22.3', '17'],
|
||||||
['22.3', '7']
|
['22.3', '7']
|
||||||
@@ -23,7 +23,7 @@ test('request invalid version/javaVersion', async () => {
|
|||||||
await graalvm.setUpGraalVMRelease('', combination[0], combination[1])
|
await graalvm.setUpGraalVMRelease('', combination[0], combination[1])
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (!(err instanceof Error)) {
|
if (!(err instanceof Error)) {
|
||||||
fail(`Unexpected non-Error: ${err}`)
|
throw new Error(`Unexpected non-Error: ${err}`)
|
||||||
}
|
}
|
||||||
error = err
|
error = err
|
||||||
}
|
}
|
||||||
@@ -36,17 +36,17 @@ test('request invalid version/javaVersion', async () => {
|
|||||||
|
|
||||||
test('find version/javaVersion', async () => {
|
test('find version/javaVersion', async () => {
|
||||||
// Make sure the action can find the latest Java version for known major versions
|
// Make sure the action can find the latest Java version for known major versions
|
||||||
for (var majorJavaVersion of ['17', '20']) {
|
for (const majorJavaVersion of ['17', '20']) {
|
||||||
await graalvm.findLatestGraalVMJDKCEJavaVersion(majorJavaVersion)
|
await graalvm.findLatestGraalVMJDKCEJavaVersion(majorJavaVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
let error = new Error('unexpected')
|
let error = new Error('unexpected')
|
||||||
try {
|
try {
|
||||||
await graalvm.findLatestGraalVMJDKCEJavaVersion('11')
|
await graalvm.findLatestGraalVMJDKCEJavaVersion('11')
|
||||||
fail('Should not find Java version for 11')
|
throw new Error('Should not find Java version for 11')
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (!(err instanceof Error)) {
|
if (!(err instanceof Error)) {
|
||||||
fail(`Unexpected non-Error: ${err}`)
|
throw new Error(`Unexpected non-Error: ${err}`)
|
||||||
}
|
}
|
||||||
error = err
|
error = err
|
||||||
}
|
}
|
||||||
@@ -68,7 +68,7 @@ test('find version/javaVersion', async () => {
|
|||||||
findGraalVMVersion(invalidRelease)
|
findGraalVMVersion(invalidRelease)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (!(err instanceof Error)) {
|
if (!(err instanceof Error)) {
|
||||||
fail(`Unexpected non-Error: ${err}`)
|
throw new Error(`Unexpected non-Error: ${err}`)
|
||||||
}
|
}
|
||||||
error = err
|
error = err
|
||||||
}
|
}
|
||||||
@@ -78,17 +78,17 @@ test('find version/javaVersion', async () => {
|
|||||||
findHighestJavaVersion(latestRelease, 'invalid')
|
findHighestJavaVersion(latestRelease, 'invalid')
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (!(err instanceof Error)) {
|
if (!(err instanceof Error)) {
|
||||||
fail(`Unexpected non-Error: ${err}`)
|
throw new Error(`Unexpected non-Error: ${err}`)
|
||||||
}
|
}
|
||||||
error = err
|
error = err
|
||||||
}
|
}
|
||||||
expect(error.message).toContain('Could not find highest Java version.')
|
expect(error.message).toContain('Could not find highest Java version.')
|
||||||
})
|
})
|
||||||
|
|
||||||
test('find version/javaVersion', async () => {
|
test('find EA version/javaVersion', async () => {
|
||||||
let url22EA = await findLatestEABuildDownloadUrl('22-ea')
|
const url22EA = await findLatestEABuildDownloadUrl('22-ea')
|
||||||
expect(url22EA).not.toBe('')
|
expect(url22EA).not.toBe('')
|
||||||
let urlLatestEA = await findLatestEABuildDownloadUrl('latest-ea')
|
const urlLatestEA = await findLatestEABuildDownloadUrl('latest-ea')
|
||||||
expect(urlLatestEA).not.toBe('')
|
expect(urlLatestEA).not.toBe('')
|
||||||
|
|
||||||
let error = new Error('unexpected')
|
let error = new Error('unexpected')
|
||||||
@@ -96,7 +96,7 @@ test('find version/javaVersion', async () => {
|
|||||||
await findLatestEABuildDownloadUrl('8-ea')
|
await findLatestEABuildDownloadUrl('8-ea')
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (!(err instanceof Error)) {
|
if (!(err instanceof Error)) {
|
||||||
fail(`Unexpected non-Error: ${err}`)
|
throw new Error(`Unexpected non-Error: ${err}`)
|
||||||
}
|
}
|
||||||
error = err
|
error = err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import {expect, test} from '@jest/globals'
|
|||||||
process.env['RUNNER_TOOL_CACHE'] = path.join(__dirname, 'TOOL_CACHE')
|
process.env['RUNNER_TOOL_CACHE'] = path.join(__dirname, 'TOOL_CACHE')
|
||||||
process.env['RUNNER_TEMP'] = path.join(__dirname, 'TEMP')
|
process.env['RUNNER_TEMP'] = path.join(__dirname, 'TEMP')
|
||||||
|
|
||||||
|
/* eslint jest/expect-expect: ["error", { "assertFunctionNames": ["expect", "expectLatestToBe", "expectURL"] }] */
|
||||||
|
|
||||||
test('find latest JDK version', async () => {
|
test('find latest JDK version', async () => {
|
||||||
// Make sure the action can find the latest Java version for known major versions
|
// Make sure the action can find the latest Java version for known major versions
|
||||||
await expectLatestToBe('11', atLeast('11.0.22+12'))
|
await expectLatestToBe('11', atLeast('11.0.22+12'))
|
||||||
@@ -61,8 +63,8 @@ function atLeast(expectedMinVersion: string): verifier {
|
|||||||
return function (
|
return function (
|
||||||
version: string,
|
version: string,
|
||||||
major: number,
|
major: number,
|
||||||
minor: number,
|
_minor: number,
|
||||||
patch: number
|
_patch: number
|
||||||
) {
|
) {
|
||||||
expect(major).toBe(expectedMajor)
|
expect(major).toBe(expectedMajor)
|
||||||
if (semver.compareBuild(version, expectedMinVersion) < 0) {
|
if (semver.compareBuild(version, expectedMinVersion) < 0) {
|
||||||
@@ -90,9 +92,9 @@ function upToBuild(expectedMinVersion: string): verifier {
|
|||||||
function exactly(expectedVersion: string): verifier {
|
function exactly(expectedVersion: string): verifier {
|
||||||
return function (
|
return function (
|
||||||
version: string,
|
version: string,
|
||||||
major: number,
|
_major: number,
|
||||||
minor: number,
|
_minor: number,
|
||||||
patch: number
|
_patch: number
|
||||||
) {
|
) {
|
||||||
if (semver.compareBuild(version, expectedVersion) != 0) {
|
if (semver.compareBuild(version, expectedVersion) != 0) {
|
||||||
throw new Error(`Expected version ${expectedVersion} but got ${version}`)
|
throw new Error(`Expected version ${expectedVersion} but got ${version}`)
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ process.env['RUNNER_TOOL_CACHE'] = path.join(__dirname, 'TOOL_CACHE')
|
|||||||
process.env['RUNNER_TEMP'] = path.join(__dirname, 'TEMP')
|
process.env['RUNNER_TEMP'] = path.join(__dirname, 'TEMP')
|
||||||
|
|
||||||
test('request invalid version/javaVersion combination', async () => {
|
test('request invalid version/javaVersion combination', async () => {
|
||||||
for (var combination of [
|
for (const combination of [
|
||||||
['mandrel-23.1.1.0-Final', '17'],
|
['mandrel-23.1.1.0-Final', '17'],
|
||||||
['mandrel-23.0.2.1-Final', '21']
|
['mandrel-23.0.2.1-Final', '21']
|
||||||
]) {
|
]) {
|
||||||
@@ -16,7 +16,7 @@ test('request invalid version/javaVersion combination', async () => {
|
|||||||
await mandrel.setUpMandrel(combination[0], combination[1])
|
await mandrel.setUpMandrel(combination[0], combination[1])
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (!(err instanceof Error)) {
|
if (!(err instanceof Error)) {
|
||||||
fail(`Unexpected non-Error: ${err}`)
|
throw new Error(`Unexpected non-Error: ${err}`)
|
||||||
}
|
}
|
||||||
error = err
|
error = err
|
||||||
}
|
}
|
||||||
@@ -27,7 +27,7 @@ test('request invalid version/javaVersion combination', async () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
test('request invalid version', async () => {
|
test('request invalid version', async () => {
|
||||||
for (var combination of [
|
for (const combination of [
|
||||||
['mandrel-23.1.1.0', '21'],
|
['mandrel-23.1.1.0', '21'],
|
||||||
['mandrel-23.0.2.1', '17']
|
['mandrel-23.0.2.1', '17']
|
||||||
]) {
|
]) {
|
||||||
@@ -36,7 +36,7 @@ test('request invalid version', async () => {
|
|||||||
await mandrel.setUpMandrel(combination[0], combination[1])
|
await mandrel.setUpMandrel(combination[0], combination[1])
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (!(err instanceof Error)) {
|
if (!(err instanceof Error)) {
|
||||||
fail(`Unexpected non-Error: ${err}`)
|
throw new Error(`Unexpected non-Error: ${err}`)
|
||||||
}
|
}
|
||||||
error = err
|
error = err
|
||||||
}
|
}
|
||||||
@@ -56,7 +56,7 @@ test('find latest', async () => {
|
|||||||
|
|
||||||
test('get known latest Mandrel for specific JDK', async () => {
|
test('get known latest Mandrel for specific JDK', async () => {
|
||||||
// Test deprecated versions that won't get updates anymore
|
// Test deprecated versions that won't get updates anymore
|
||||||
for (var combination of [
|
for (const combination of [
|
||||||
['11', '22.2.0.0-Final'],
|
['11', '22.2.0.0-Final'],
|
||||||
['20', '23.0.1.2-Final']
|
['20', '23.0.1.2-Final']
|
||||||
]) {
|
]) {
|
||||||
@@ -68,7 +68,7 @@ test('get known latest Mandrel for specific JDK', async () => {
|
|||||||
|
|
||||||
test('get latest Mandrel for specific JDK', async () => {
|
test('get latest Mandrel for specific JDK', async () => {
|
||||||
// Test supported versions
|
// Test supported versions
|
||||||
for (var javaVersion of ['17', '21']) {
|
for (const javaVersion of ['17', '21']) {
|
||||||
const latest = await mandrel.getLatestMandrelReleaseUrl(javaVersion)
|
const latest = await mandrel.getLatestMandrelReleaseUrl(javaVersion)
|
||||||
expect(latest).toContain(`mandrel-java${javaVersion}`)
|
expect(latest).toContain(`mandrel-java${javaVersion}`)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ process.env['RUNNER_TOOL_CACHE'] = path.join(__dirname, 'TOOL_CACHE')
|
|||||||
process.env['RUNNER_TEMP'] = path.join(__dirname, 'TEMP')
|
process.env['RUNNER_TEMP'] = path.join(__dirname, 'TEMP')
|
||||||
|
|
||||||
test('decide whether Window env must be set up for GraalVM for JDK', async () => {
|
test('decide whether Window env must be set up for GraalVM for JDK', async () => {
|
||||||
for (var javaVersion of [
|
for (const javaVersion of [
|
||||||
'17',
|
'17',
|
||||||
'17.0.8',
|
'17.0.8',
|
||||||
'17.0',
|
'17.0',
|
||||||
@@ -22,7 +22,7 @@ test('decide whether Window env must be set up for GraalVM for JDK', async () =>
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('decide whether Window env must be set up for legacy GraalVM', async () => {
|
test('decide whether Window env must be set up for legacy GraalVM', async () => {
|
||||||
for (var combination of [
|
for (const combination of [
|
||||||
['7', '22.3.0'],
|
['7', '22.3.0'],
|
||||||
['17', '22.3'],
|
['17', '22.3'],
|
||||||
['7', '22.3'],
|
['7', '22.3'],
|
||||||
|
|||||||
@@ -248,10 +248,13 @@ describe('sbom feature', () => {
|
|||||||
const invalidSBOM = {
|
const invalidSBOM = {
|
||||||
'out-of-spec-field': {}
|
'out-of-spec-field': {}
|
||||||
}
|
}
|
||||||
|
let error
|
||||||
try {
|
try {
|
||||||
await setUpAndProcessSBOM(invalidSBOM)
|
await setUpAndProcessSBOM(invalidSBOM)
|
||||||
fail('Expected an error since invalid JSON was passed')
|
throw new Error('Expected an error since invalid JSON was passed')
|
||||||
} catch (error) {
|
} catch (e) {
|
||||||
|
error = e
|
||||||
|
} finally {
|
||||||
expect(error).toBeInstanceOf(Error)
|
expect(error).toBeInstanceOf(Error)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
import * as path from 'path'
|
|
||||||
import {expect, test} from '@jest/globals'
|
import {expect, test} from '@jest/globals'
|
||||||
import {toSemVer} from '../src/utils'
|
import {toSemVer} from '../src/utils'
|
||||||
|
|
||||||
test('convert version', async () => {
|
test('convert version', async () => {
|
||||||
for (var inputAndExpectedOutput of [
|
for (const inputAndExpectedOutput of [
|
||||||
['22', '22.0.0'],
|
['22', '22.0.0'],
|
||||||
['22.0', '22.0.0'],
|
['22.0', '22.0.0'],
|
||||||
['22.0.0', '22.0.0'],
|
['22.0.0', '22.0.0'],
|
||||||
@@ -17,13 +16,13 @@ test('convert version', async () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('convert invalid version', async () => {
|
test('convert invalid version', async () => {
|
||||||
for (var input of ['dev', 'abc', 'a.b.c']) {
|
for (const input of ['dev', 'abc', 'a.b.c']) {
|
||||||
let error = new Error('unexpected')
|
let error = new Error('unexpected')
|
||||||
try {
|
try {
|
||||||
toSemVer(input)
|
toSemVer(input)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (!(err instanceof Error)) {
|
if (!(err instanceof Error)) {
|
||||||
fail(`Unexpected non-Error: ${err}`)
|
throw new Error(`Unexpected non-Error: ${err}`)
|
||||||
}
|
}
|
||||||
error = err
|
error = err
|
||||||
}
|
}
|
||||||
|
|||||||
66518
dist/cleanup/index.js
generated
vendored
66518
dist/cleanup/index.js
generated
vendored
File diff suppressed because one or more lines are too long
67308
dist/main/index.js
generated
vendored
67308
dist/main/index.js
generated
vendored
File diff suppressed because one or more lines are too long
82
eslint.config.mjs
Normal file
82
eslint.config.mjs
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
// 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 typescriptEslint from '@typescript-eslint/eslint-plugin'
|
||||||
|
import tsParser from '@typescript-eslint/parser'
|
||||||
|
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:@typescript-eslint/eslint-recommended',
|
||||||
|
'plugin:@typescript-eslint/recommended',
|
||||||
|
'plugin:jest/recommended',
|
||||||
|
'plugin:prettier/recommended'
|
||||||
|
),
|
||||||
|
{
|
||||||
|
plugins: {
|
||||||
|
import: fixupPluginRules(_import),
|
||||||
|
jest,
|
||||||
|
prettier,
|
||||||
|
'@typescript-eslint': typescriptEslint
|
||||||
|
},
|
||||||
|
|
||||||
|
languageOptions: {
|
||||||
|
globals: {
|
||||||
|
...globals.node,
|
||||||
|
...globals.jest,
|
||||||
|
Atomics: 'readonly',
|
||||||
|
SharedArrayBuffer: 'readonly'
|
||||||
|
},
|
||||||
|
|
||||||
|
parser: tsParser,
|
||||||
|
ecmaVersion: 2023,
|
||||||
|
sourceType: 'module',
|
||||||
|
|
||||||
|
parserOptions: {
|
||||||
|
project: ['tsconfig.eslint.json'],
|
||||||
|
tsconfigRootDir: '.'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
settings: {
|
||||||
|
'import/resolver': {
|
||||||
|
typescript: {
|
||||||
|
alwaysTryTypes: true,
|
||||||
|
project: 'tsconfig.eslint.json'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
rules: {
|
||||||
|
camelcase: 'off',
|
||||||
|
'eslint-comments/no-use': 'off',
|
||||||
|
'eslint-comments/no-unused-disable': 'off',
|
||||||
|
'@typescript-eslint/no-unused-vars': ['error', {argsIgnorePattern: '^_'}],
|
||||||
|
'i18n-text/no-en': 'off',
|
||||||
|
'import/no-namespace': 'off',
|
||||||
|
'no-console': 'off',
|
||||||
|
'no-shadow': 'off',
|
||||||
|
'no-unused-vars': 'off',
|
||||||
|
'prettier/prettier': 'error'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
3561
package-lock.json
generated
3561
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
28
package.json
28
package.json
@@ -1,18 +1,17 @@
|
|||||||
{
|
{
|
||||||
"name": "setup-graalvm",
|
"name": "setup-graalvm",
|
||||||
"version": "1.2.7",
|
"version": "1.2.8",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "GitHub Action for GraalVM",
|
"description": "GitHub Action for GraalVM",
|
||||||
"main": "lib/main.js",
|
"main": "lib/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc",
|
"bundle": "npm run format:write && npm run package",
|
||||||
"format": "prettier --write '**/*.ts'",
|
"format:write": "npx prettier --write .",
|
||||||
"format-check": "prettier --check '**/*.ts'",
|
"format:check": "npx prettier --check .",
|
||||||
"lint": "eslint src/**/*.ts",
|
"lint": "npx eslint .",
|
||||||
"package": "ncc build -o dist/main src/main.ts && ncc build -o dist/cleanup src/cleanup.ts",
|
"package": "ncc build -o dist/main src/main.ts && ncc build -o dist/cleanup src/cleanup.ts",
|
||||||
"test": "jest",
|
"test": "npx jest",
|
||||||
"all-but-test": "npm run build && npm run format && npm run lint && npm run package",
|
"all": "npm run format:write && npm run lint && npm run test && npm run package"
|
||||||
"all": "npm run all-but-test && npm test"
|
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -42,16 +41,19 @@
|
|||||||
"uuid": "^11.0.5"
|
"uuid": "^11.0.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@eslint/compat": "^1.2.5",
|
||||||
"@types/jest": "^29.5.14",
|
"@types/jest": "^29.5.14",
|
||||||
"@types/node": "^20.17.12",
|
"@types/node": "^20.17.12",
|
||||||
"@types/semver": "^7.5.8",
|
"@types/semver": "^7.5.8",
|
||||||
"@types/uuid": "^10.0.0",
|
"@types/uuid": "^10.0.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^7.2.0",
|
"@typescript-eslint/eslint-plugin": "^8.19.1",
|
||||||
"@typescript-eslint/parser": "^7.2.0",
|
"@typescript-eslint/parser": "^8.19.1",
|
||||||
"@vercel/ncc": "^0.38.3",
|
"@vercel/ncc": "^0.38.3",
|
||||||
"eslint": "^8.57.0",
|
"eslint": "^9.18.0",
|
||||||
"eslint-plugin-github": "^4.10.2",
|
"eslint-config-prettier": "^9.1.0",
|
||||||
"eslint-plugin-jest": "^27.9.0",
|
"eslint-import-resolver-typescript": "^3.6.3",
|
||||||
|
"eslint-plugin-import": "^2.31.0",
|
||||||
|
"eslint-plugin-jest": "^28.10.0",
|
||||||
"eslint-plugin-jsonc": "^2.18.2",
|
"eslint-plugin-jsonc": "^2.18.2",
|
||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"eslint-plugin-prettier": "^5.2.3",
|
"eslint-plugin-prettier": "^5.2.3",
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ async function saveCache(): Promise<void> {
|
|||||||
* @returns Promise that will ignore error reported by the given promise
|
* @returns Promise that will ignore error reported by the given promise
|
||||||
*/
|
*/
|
||||||
async function ignoreErrors(promise: Promise<void>): Promise<unknown> {
|
async function ignoreErrors(promise: Promise<void>): Promise<unknown> {
|
||||||
/* eslint-disable github/no-then */
|
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
promise
|
promise
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as otypes from '@octokit/types'
|
import * as otypes from '@octokit/types'
|
||||||
|
|
||||||
export const ACTION_VERSION = '1.2.7'
|
export const ACTION_VERSION = '1.2.8'
|
||||||
|
|
||||||
export const INPUT_VERSION = 'version'
|
export const INPUT_VERSION = 'version'
|
||||||
export const INPUT_GDS_TOKEN = 'gds-token'
|
export const INPUT_GDS_TOKEN = 'gds-token'
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ export async function findLatestEABuildDownloadUrl(
|
|||||||
response = await getContents(ORACLE_GRAALVM_REPO_EA_BUILDS, filePath)
|
response = await getContents(ORACLE_GRAALVM_REPO_EA_BUILDS, filePath)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Unable to resolve download URL for '${javaEaVersion}'. Please make sure the java-version is set correctly. ${c.ERROR_HINT}`
|
`Unable to resolve download URL for '${javaEaVersion}' (reason: ${error}). Please make sure the java-version is set correctly. ${c.ERROR_HINT}`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as c from './constants'
|
import * as c from './constants'
|
||||||
import * as httpClient from '@actions/http-client'
|
import * as httpClient from '@actions/http-client'
|
||||||
import {downloadExtractAndCacheJDK, getLatestRelease} from './utils'
|
import {downloadExtractAndCacheJDK} from './utils'
|
||||||
import {downloadTool} from '@actions/tool-cache'
|
import {downloadTool} from '@actions/tool-cache'
|
||||||
import {basename} from 'path'
|
import {basename} from 'path'
|
||||||
|
|
||||||
@@ -11,7 +11,9 @@ const DISCO_API_BASE = 'https://api.foojay.io/disco/v3.0/packages/jdks'
|
|||||||
|
|
||||||
interface JdkData {
|
interface JdkData {
|
||||||
message: string
|
message: string
|
||||||
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
result: any
|
result: any
|
||||||
|
/* eslint-enable @typescript-eslint/no-explicit-any */
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function setUpMandrel(
|
export async function setUpMandrel(
|
||||||
@@ -23,6 +25,8 @@ export async function setUpMandrel(
|
|||||||
switch (version) {
|
switch (version) {
|
||||||
case '':
|
case '':
|
||||||
// fetch latest if no version is specified
|
// fetch latest if no version is specified
|
||||||
|
mandrelHome = await setUpMandrelLatest(javaVersion)
|
||||||
|
break
|
||||||
case 'latest':
|
case 'latest':
|
||||||
mandrelHome = await setUpMandrelLatest(javaVersion)
|
mandrelHome = await setUpMandrelLatest(javaVersion)
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import * as core from '@actions/core'
|
import * as core from '@actions/core'
|
||||||
import * as semver from 'semver'
|
|
||||||
import {execSync} from 'child_process'
|
import {execSync} from 'child_process'
|
||||||
import {existsSync} from 'fs'
|
import {existsSync} from 'fs'
|
||||||
import {VERSION_DEV} from './constants'
|
import {VERSION_DEV} from './constants'
|
||||||
|
|||||||
23
tsconfig.base.json
Normal file
23
tsconfig.base.json
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://json.schemastore.org/tsconfig",
|
||||||
|
"compilerOptions": {
|
||||||
|
"allowSyntheticDefaultImports": true,
|
||||||
|
"declaration": false,
|
||||||
|
"declarationMap": false,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"lib": ["ES2022"],
|
||||||
|
"module": "NodeNext",
|
||||||
|
"moduleResolution": "NodeNext",
|
||||||
|
"newLine": "lf",
|
||||||
|
"noImplicitAny": true,
|
||||||
|
"noUnusedLocals": true,
|
||||||
|
"noUnusedParameters": false,
|
||||||
|
"pretty": true,
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"sourceMap": true,
|
||||||
|
"strict": true,
|
||||||
|
"strictNullChecks": true,
|
||||||
|
"target": "ES2022"
|
||||||
|
}
|
||||||
|
}
|
||||||
16
tsconfig.eslint.json
Normal file
16
tsconfig.eslint.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://json.schemastore.org/tsconfig",
|
||||||
|
"extends": "./tsconfig.base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"allowJs": true,
|
||||||
|
"noEmit": true
|
||||||
|
},
|
||||||
|
"exclude": ["dist", "node_modules"],
|
||||||
|
"include": [
|
||||||
|
"__fixtures__",
|
||||||
|
"__tests__",
|
||||||
|
"src",
|
||||||
|
"eslint.config.mjs",
|
||||||
|
"jest.config.js"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,12 +1,11 @@
|
|||||||
{
|
{
|
||||||
|
"$schema": "https://json.schemastore.org/tsconfig",
|
||||||
|
"extends": "./tsconfig.base.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
|
"module": "NodeNext",
|
||||||
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
|
"moduleResolution": "NodeNext",
|
||||||
"outDir": "./lib", /* Redirect output structure to the directory. */
|
"outDir": "./dist"
|
||||||
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
|
||||||
"strict": true, /* Enable all strict type-checking options. */
|
|
||||||
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
|
|
||||||
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
|
|
||||||
},
|
},
|
||||||
"exclude": ["node_modules", "**/*.test.ts"]
|
"exclude": ["__fixtures__", "__tests__", "coverage", "dist", "node_modules"],
|
||||||
|
"include": ["src"]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user