-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add comment-json for parsing tsconfig (#154)
When generating new TypeScript projects, the TSConfig.json file will often contain comments. This was causing an error with the default JSON parser. This PR switches to `comments-json` to parse the TSConfig file in `bootstrap.mts`.
- Loading branch information
Showing
12 changed files
with
155 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ACTIONS_STEP_DEBUG=false | ||
INPUT_MILLISECONDS=2400 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: The name of your action here | ||
description: Provide a description here | ||
author: Your name or organization here | ||
|
||
inputs: | ||
milliseconds: | ||
description: Your input description here | ||
required: true | ||
default: '1000' | ||
|
||
outputs: | ||
time: | ||
description: Your output description here | ||
|
||
runs: | ||
using: node20 | ||
main: dist/index.js |
Empty file.
17 changes: 17 additions & 0 deletions
17
__fixtures__/typescript-esm/tsconfig-comments/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "typescript-action", | ||
"description": "GitHub Actions TypeScript template", | ||
"version": "0.0.0", | ||
"type": "module", | ||
"engines": { | ||
"node": ">=20" | ||
}, | ||
"dependencies": { | ||
"@actions/core": "^1.10.1" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^20.14.7", | ||
"ts-node": "^10.9.2", | ||
"typescript": "^5.5.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { run } from './main.js' | ||
|
||
run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { getInput, info, setOutput } from '@actions/core' | ||
|
||
export async function run(): Promise<void> { | ||
const myInput: string = getInput('myInput') | ||
|
||
setOutput('myOutput', myInput) | ||
|
||
info('TypeScript ESM Action Succeeded!') | ||
} |
21 changes: 21 additions & 0 deletions
21
__fixtures__/typescript-esm/tsconfig-comments/tsconfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
/* Visit https://aka.ms/tsconfig to read more about this file */ | ||
"$schema": "https://json.schemastore.org/tsconfig", | ||
"compilerOptions": { | ||
"target": "ES2022" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, | ||
"module": "NodeNext" /* Specify what module code is generated. */, | ||
"rootDir": "./src", | ||
"moduleResolution": "NodeNext" /* Specify how TypeScript looks up a file from a given module specifier. */, | ||
"baseUrl": "./", | ||
"sourceMap": true, | ||
"outDir": "./dist" /* Specify an output folder for all emitted files. */, | ||
"noImplicitAny": true, | ||
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */, | ||
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, | ||
"strict": true /* Enable all strict type-checking options. */, | ||
"skipLibCheck": true /* Skip type checking all .d.ts files. */, | ||
"newLine": "lf" | ||
}, | ||
"exclude": ["node_modules"], | ||
"include": ["src"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters