mirror of
https://github.com/sparksp/elm-format-action.git
synced 2024-11-24 05:30:45 +03:00
Merge pull request #36 from sparksp/upgrade-outdated
Upgrade outdated packages
This commit is contained in:
commit
c1e0bea196
@ -14,6 +14,7 @@
|
||||
},
|
||||
"rules": {
|
||||
"eslint-comments/no-use": "off",
|
||||
"i18n-text/no-en": "off",
|
||||
"import/no-namespace": "off",
|
||||
"no-unused-vars": "off",
|
||||
"@typescript-eslint/no-unused-vars": "error",
|
||||
@ -72,4 +73,4 @@
|
||||
"es6": true,
|
||||
"jest/globals": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,36 +6,27 @@ test('runs quietly on success', () => {
|
||||
process.env['INPUT_ELM_FORMAT'] = 'elm-format'
|
||||
process.env['INPUT_ELM_FILES'] = '__tests__/elm/Good.elm'
|
||||
const ip = path.join(__dirname, '..', 'lib', 'main.js')
|
||||
const options: cp.ExecSyncOptions = {
|
||||
env: process.env
|
||||
const options: cp.SpawnOptions = {
|
||||
env: process.env,
|
||||
shell: true
|
||||
}
|
||||
|
||||
let status
|
||||
try {
|
||||
cp.execSync(`node ${ip}`, options)
|
||||
} catch (e) {
|
||||
status = e.status
|
||||
}
|
||||
expect(status).toBeUndefined() // Success!
|
||||
let ret = cp.spawnSync(`node ${ip}`, options)
|
||||
expect(ret.status).toBe(0)
|
||||
})
|
||||
|
||||
test('reports errors', () => {
|
||||
process.env['INPUT_ELM_FORMAT'] = 'elm-format'
|
||||
process.env['INPUT_ELM_FILES'] = '__tests__/elm/Bad.elm'
|
||||
const ip = path.join(__dirname, '..', 'lib', 'main.js')
|
||||
const options: cp.ExecSyncOptions = {
|
||||
env: process.env
|
||||
const options: cp.SpawnOptions = {
|
||||
env: process.env,
|
||||
shell: true
|
||||
}
|
||||
|
||||
let stdout, status
|
||||
try {
|
||||
stdout = cp.execSync(`node ${ip}`, options)
|
||||
} catch (e) {
|
||||
status = e.status
|
||||
stdout = e.stdout
|
||||
}
|
||||
expect(status).toBe(1)
|
||||
expect(stdout.toString()).toBe(
|
||||
let ret = cp.spawnSync(`node ${ip}`, options)
|
||||
expect(ret.status).toBe(1)
|
||||
expect(ret.stdout.toString()).toBe(
|
||||
'::error file=__tests__/elm/Bad.elm::File is not formatted with elm-format-0.8.5 --elm-version=0.19\n' +
|
||||
'::error::elm-format reported errors with 1 file\n'
|
||||
)
|
||||
@ -45,19 +36,14 @@ test('handles bad file input', () => {
|
||||
process.env['INPUT_ELM_FORMAT'] = 'elm-format'
|
||||
process.env['INPUT_ELM_FILES'] = '__tests__/elm/Missing.elm'
|
||||
const ip = path.join(__dirname, '..', 'lib', 'main.js')
|
||||
const options: cp.ExecSyncOptions = {
|
||||
env: process.env
|
||||
const options: cp.SpawnOptions = {
|
||||
env: process.env,
|
||||
shell: true
|
||||
}
|
||||
|
||||
let status, stdout
|
||||
try {
|
||||
stdout = cp.execSync(`node ${ip}`, options)
|
||||
} catch (e) {
|
||||
status = e.status
|
||||
stdout = e.stdout
|
||||
}
|
||||
expect(status).toBe(1) // Something went wrong
|
||||
expect(stdout.toString()).toContain('::error::')
|
||||
let ret = cp.spawnSync(`node ${ip}`, options)
|
||||
expect(ret.status).toBe(1) // Something went wrong
|
||||
expect(ret.stdout.toString()).toContain('::error::')
|
||||
})
|
||||
|
||||
test('runs globs', () => {
|
||||
@ -65,17 +51,13 @@ test('runs globs', () => {
|
||||
process.env['INPUT_ELM_FILES'] = '__tests__/**/*.elm\n!**/Bad.elm'
|
||||
process.env['INPUT_ELM_GLOB'] = 'true'
|
||||
const ip = path.join(__dirname, '..', 'lib', 'main.js')
|
||||
const options: cp.ExecSyncOptions = {
|
||||
env: process.env
|
||||
const options: cp.SpawnOptions = {
|
||||
env: process.env,
|
||||
shell: true
|
||||
}
|
||||
|
||||
let status
|
||||
try {
|
||||
cp.execSync(`node ${ip}`, options)
|
||||
} catch (e) {
|
||||
status = e.status
|
||||
}
|
||||
expect(status).toBeUndefined() // Success!
|
||||
let ret = cp.spawnSync(`node ${ip}`, options)
|
||||
expect(ret.status).toBe(0) // Success!
|
||||
})
|
||||
|
||||
test('handles no files input', () => {
|
||||
@ -83,17 +65,12 @@ test('handles no files input', () => {
|
||||
process.env['INPUT_ELM_FILES'] = 'Missing.elm'
|
||||
process.env['INPUT_ELM_GLOB'] = 'true'
|
||||
const ip = path.join(__dirname, '..', 'lib', 'main.js')
|
||||
const options: cp.ExecSyncOptions = {
|
||||
env: process.env
|
||||
const options: cp.SpawnOptions = {
|
||||
env: process.env,
|
||||
shell: true
|
||||
}
|
||||
|
||||
let status, stdout
|
||||
try {
|
||||
stdout = cp.execSync(`node ${ip}`, options)
|
||||
} catch (e) {
|
||||
status = e.status
|
||||
stdout = e.stdout
|
||||
}
|
||||
expect(status).toBe(1) // Something went wrong
|
||||
expect(stdout.toString()).toContain('::error::No Elm files found')
|
||||
let ret = cp.spawnSync(`node ${ip}`, options)
|
||||
expect(ret.status).toBe(1) // Something went wrong
|
||||
expect(ret.stdout.toString()).toContain('::error::No Elm files found')
|
||||
})
|
||||
|
8846
dist/index.js
vendored
8846
dist/index.js
vendored
File diff suppressed because it is too large
Load Diff
34
package.json
34
package.json
@ -28,26 +28,26 @@
|
||||
"author": "Phill Sparks <me@phills.me.uk> (https://github.com/sparksp)",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.9.1",
|
||||
"@actions/exec": "^1.0.4",
|
||||
"@actions/glob": "^0.1.1"
|
||||
"@actions/core": "^1.10.0",
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/glob": "^0.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^26.0.20",
|
||||
"@types/node": "^14.14.20",
|
||||
"@typescript-eslint/parser": "^4.12.0",
|
||||
"@zeit/ncc": "^0.22.3",
|
||||
"@types/jest": "^29.2.4",
|
||||
"@types/node": "^18.11.13",
|
||||
"@typescript-eslint/parser": "^5.46.0",
|
||||
"@vercel/ncc": "^0.36.0",
|
||||
"elm-tooling": "^1.10.0",
|
||||
"eslint": "^7.17.0",
|
||||
"eslint-plugin-github": "^4.1.1",
|
||||
"eslint-plugin-jest": "^24.1.3",
|
||||
"eslint-plugin-prettier": "^3.3.1",
|
||||
"jest": "^26.6.3",
|
||||
"jest-circus": "^26.6.3",
|
||||
"js-yaml": "^4.0.0",
|
||||
"eslint": "^8.29.0",
|
||||
"eslint-plugin-github": "^4.6.0",
|
||||
"eslint-plugin-jest": "^27.1.6",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"jest": "^29.3.1",
|
||||
"jest-circus": "^29.3.1",
|
||||
"js-yaml": "^4.1.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "^2.2.1",
|
||||
"ts-jest": "^26.4.4",
|
||||
"typescript": "^4.1.3"
|
||||
"prettier": "^2.8.1",
|
||||
"ts-jest": "^29.0.3",
|
||||
"typescript": "^4.9.4"
|
||||
}
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ async function run(): Promise<void> {
|
||||
const report = await runElmFormat()
|
||||
reportFailure(issueErrors(report))
|
||||
} catch (error) {
|
||||
core.setFailed(error.message)
|
||||
core.setFailed((error as Error).message)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,13 +1,12 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
|
||||
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
|
||||
"outDir": "./lib", /* Redirect output structure to the directory. */
|
||||
"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"]
|
||||
}
|
||||
|
||||
"compilerOptions": {
|
||||
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
|
||||
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
|
||||
"outDir": "./lib", /* Redirect output structure to the directory. */
|
||||
"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"]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user