mirror of
https://github.com/actions/typescript-action.git
synced 2025-04-05 14:59:47 +00:00
fix: bump up NodeJS to v16
also follow the Recommended Node TSConfig settings for NodeJS v16 https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping#node-16
This commit is contained in:
4
.github/workflows/check-dist.yml
vendored
4
.github/workflows/check-dist.yml
vendored
@ -23,10 +23,10 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Set Node.js 12.x
|
||||
- name: Set Node.js 16.x
|
||||
uses: actions/setup-node@v2.5.1
|
||||
with:
|
||||
node-version: 12.x
|
||||
node-version: 16.x
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
@ -7,5 +7,5 @@ inputs:
|
||||
description: 'input description here'
|
||||
default: 'default value if applicable'
|
||||
runs:
|
||||
using: 'node12'
|
||||
using: 'node16'
|
||||
main: 'dist/index.js'
|
||||
|
62
dist/index.js
generated
vendored
62
dist/index.js
generated
vendored
@ -25,33 +25,22 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
const core = __importStar(__nccwpck_require__(186));
|
||||
const wait_1 = __nccwpck_require__(817);
|
||||
function run() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
const ms = core.getInput('milliseconds');
|
||||
core.debug(`Waiting ${ms} milliseconds ...`); // debug is only output if you set the secret `ACTIONS_STEP_DEBUG` to true
|
||||
core.debug(new Date().toTimeString());
|
||||
yield (0, wait_1.wait)(parseInt(ms, 10));
|
||||
core.debug(new Date().toTimeString());
|
||||
core.setOutput('time', new Date().toTimeString());
|
||||
}
|
||||
catch (error) {
|
||||
if (error instanceof Error)
|
||||
core.setFailed(error.message);
|
||||
}
|
||||
});
|
||||
async function run() {
|
||||
try {
|
||||
const ms = core.getInput('milliseconds');
|
||||
core.debug(`Waiting ${ms} milliseconds ...`); // debug is only output if you set the secret `ACTIONS_STEP_DEBUG` to true
|
||||
core.debug(new Date().toTimeString());
|
||||
await (0, wait_1.wait)(parseInt(ms, 10));
|
||||
core.debug(new Date().toTimeString());
|
||||
core.setOutput('time', new Date().toTimeString());
|
||||
}
|
||||
catch (error) {
|
||||
if (error instanceof Error)
|
||||
core.setFailed(error.message);
|
||||
}
|
||||
}
|
||||
run();
|
||||
|
||||
@ -59,29 +48,18 @@ run();
|
||||
/***/ }),
|
||||
|
||||
/***/ 817:
|
||||
/***/ (function(__unused_webpack_module, exports) {
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.wait = void 0;
|
||||
function wait(milliseconds) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
return new Promise(resolve => {
|
||||
if (isNaN(milliseconds)) {
|
||||
throw new Error('milliseconds not a number');
|
||||
}
|
||||
setTimeout(() => resolve('done!'), milliseconds);
|
||||
});
|
||||
async function wait(milliseconds) {
|
||||
return new Promise(resolve => {
|
||||
if (isNaN(milliseconds)) {
|
||||
throw new Error('milliseconds not a number');
|
||||
}
|
||||
setTimeout(() => resolve('done!'), milliseconds);
|
||||
});
|
||||
}
|
||||
exports.wait = wait;
|
||||
|
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
9817
package-lock.json
generated
9817
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
|
||||
"target": "ES2021", /* 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. */
|
||||
|
Reference in New Issue
Block a user