Skip to content

Commit

Permalink
feat: add support for TypeScript 5.0's array extends in tsconfig (#1105)
Browse files Browse the repository at this point in the history
- add support for TypeScript 5.0's array extends in tsconfig
- drop support for Node.js 14
- remove tests for Tensorflow
- update most dependencies

---------

Signed-off-by: Sora Morimoto <sora@morimoto.io>
Co-authored-by: Steven <steven@ceriously.com>
  • Loading branch information
smorimoto and styfle authored Sep 6, 2023
1 parent 2a1437b commit f898f8e
Show file tree
Hide file tree
Showing 32 changed files with 1,365 additions and 776 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,34 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node: [14, 16, 18]
node: [16, 18, 20]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# https://github.com/nodejs/node-gyp#installation
- name: Use Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
with:
cache: yarn
node-version: ${{ matrix.node }}
check-latest: true
- name: Install Dependencies
run: yarn install
run: yarn global add node-gyp && yarn install --frozen-lockfile
- name: Build Test Binary
run: yarn build-test-binary
- name: Build
run: yarn build
- name: Run Tests
run: yarn test
- name: Coverage
if: matrix.os == 'ubuntu-latest' && matrix.node == 14 # only run once
if: matrix.os == 'ubuntu-latest' && matrix.node == 20 # only run once
run: yarn test-coverage
- name: Maybe Release
if: matrix.os == 'ubuntu-latest' && matrix.node == 18 && github.event_name == 'push' && github.ref == 'refs/heads/main'
if: matrix.os == 'ubuntu-latest' && matrix.node == 20 && github.event_name == 'push' && github.ref == 'refs/heads/main'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }}
Expand Down
63 changes: 31 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,49 +19,48 @@
"prepublishOnly": "node scripts/build.js --no-cache"
},
"devDependencies": {
"@azure/cosmos": "^3.12.3",
"@bugsnag/js": "^7.11.0",
"@azure/cosmos": "^3.17.3",
"@bugsnag/js": "^7.21.0",
"@ffmpeg-installer/ffmpeg": "^1.0.17",
"@google-cloud/bigquery": "^5.7.0",
"@google-cloud/firestore": "^6.4.1",
"@sentry/node": "^7.17.3",
"@slack/web-api": "^6.3.0",
"@tensorflow/tfjs-node": "^3.12.0",
"@vercel/webpack-asset-relocator-loader": "1.7.2",
"analytics-node": "^6.0.0",
"@google-cloud/firestore": "^6.7.0",
"@sentry/node": "^7.66.0",
"@slack/web-api": "^6.9.0",
"@vercel/webpack-asset-relocator-loader": "1.7.3",
"analytics-node": "^6.2.0",
"apollo-server-express": "^2.2.2",
"arg": "^5.0.0",
"arg": "^5.0.2",
"auth0": "^2.14.0",
"aws-sdk": "^2.356.0",
"aws-sdk": "^2.1448.0",
"axios": "^0.21.1",
"azure-storage": "^2.10.2",
"browserify-middleware": "^8.1.1",
"bytes": "^3.0.0",
"canvas": "^2.10.2",
"bytes": "^3.1.2",
"canvas": "^2.11.2",
"chromeless": "^1.5.2",
"consolidate": "^0.16.0",
"copy": "^0.3.2",
"core-js": "^2.5.7",
"cowsay": "^1.3.1",
"esm": "^3.2.22",
"express": "^4.16.4",
"fetch-h2": "^3.0.0",
"express": "^4.18.2",
"fetch-h2": "^3.0.2",
"firebase": "^7.24.0",
"firebase-admin": "^11.3.0",
"firebase-admin": "^11.10.1",
"fluent-ffmpeg": "^2.1.2",
"fontkit": "^1.7.7",
"get-folder-size": "^2.0.0",
"glob": "^8.0.3",
"got": "^12.5.2",
"graceful-fs": "^4.1.15",
"graceful-fs": "^4.2.11",
"graphql": "^15.5.1",
"hot-shots": "^8.5.0",
"ioredis": "^5.1.0",
"ioredis": "^5.3.2",
"isomorphic-unfetch": "^3.0.0",
"jest": "^27.5.1",
"jimp": "^0.16.1",
"jugglingdb": "2.0.1",
"koa": "^2.6.2",
"koa": "^2.14.2",
"leveldown": "^6.0.0",
"license-webpack-plugin": "^4.0.2",
"lighthouse": "^8.1.0",
Expand All @@ -73,37 +72,37 @@
"mkdirp": "^1.0.4",
"mongoose": "^5.3.12",
"mysql": "^2.16.0",
"node-gyp": "^8.4.1",
"node-gyp": "^9.4.0",
"npm": "^6.13.4",
"oracledb": "^4.2.0",
"oracledb": "^6.1.0",
"passport": "^0.6.0",
"passport-google-oauth": "^2.0.0",
"path-platform": "^0.11.15",
"pdfkit": "^0.13.0",
"pg": "^8.7.1",
"pg": "^8.11.3",
"pug": "^3.0.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"redis": "^3.1.1",
"request": "^2.88.0",
"rxjs": "^7.3.0",
"rxjs": "^7.8.1",
"saslprep": "^1.0.2",
"sequelize": "^6.6.5",
"sharp": "^0.30.5",
"sequelize": "^6.32.1",
"sharp": "^0.32.5",
"shebang-loader": "^0.0.1",
"socket.io": "^4.1.3",
"socket.io": "^4.7.2",
"source-map-support": "^0.5.9",
"stripe": "^8.167.0",
"swig": "^1.4.2",
"terser": "^5.6.1",
"terser": "^5.19.3",
"the-answer": "^1.0.0",
"tiny-json-http": "^7.0.2",
"ts-loader": "^9.3.0",
"tsconfig-paths": "^3.7.0",
"tsconfig-paths-webpack-plugin": "^3.5.2",
"tiny-json-http": "^7.5.1",
"ts-loader": "^9.4.4",
"tsconfig-paths": "^4.2.0",
"tsconfig-paths-webpack-plugin": "^4.1.0",
"twilio": "^3.23.2",
"typescript": "^4.4.2",
"vm2": "^3.6.6",
"typescript": "^5.2.2",
"vm2": "^3.9.19",
"vue": "^2.5.17",
"vue-server-renderer": "^2.5.17",
"web-vitals": "^0.2.4",
Expand Down
1 change: 0 additions & 1 deletion scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ async function main() {
writeFileSync(__dirname + "/../dist/ncc/LICENSES.txt", cliAssets["LICENSES.txt"].source);
writeFileSync(__dirname + "/../dist/ncc/cli.js.cache", cliAssets["cli.js.cache"].source);
writeFileSync(__dirname + "/../dist/ncc/index.js.cache", indexAssets["index.js.cache"].source);
writeFileSync(__dirname + "/../dist/ncc/mappings.wasm", indexAssets["mappings.wasm"].source);
writeFileSync(__dirname + "/../dist/ncc/sourcemap-register.js.cache", sourcemapAssets["sourcemap-register.js.cache"].source);
writeFileSync(__dirname + "/../dist/ncc/loaders/relocate-loader.js.cache", relocateLoaderAssets["relocate-loader.js.cache"].source);
writeFileSync(__dirname + "/../dist/ncc/loaders/shebang-loader.js.cache", shebangLoaderAssets["shebang-loader.js.cache"].source);
Expand Down
2 changes: 0 additions & 2 deletions test/integration/tensorflow.js

This file was deleted.

4 changes: 2 additions & 2 deletions test/unit/bundle-subasset/output-coverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/******/ "use strict";
/******/ var __webpack_modules__ = ({

/***/ 622:
/***/ 17:
/***/ ((module) => {

module.exports = require("path");
Expand Down Expand Up @@ -91,7 +91,7 @@ var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
(() => {
__nccwpck_require__.r(__webpack_exports__);
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(622);
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(17);
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nccwpck_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);


Expand Down
4 changes: 2 additions & 2 deletions test/unit/custom-emit/output-coverage.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({

/***/ 747:
/***/ 147:
/***/ ((module) => {

"use strict";
Expand Down Expand Up @@ -50,7 +50,7 @@ module.exports = require("fs");
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
(() => {
const { readFileSync } = __nccwpck_require__(747);
const { readFileSync } = __nccwpck_require__(147);
console.log(readFileSync(__dirname + './test.json'));


Expand Down
4 changes: 2 additions & 2 deletions test/unit/double-nested-builds/output-coverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
/***/ ((module) => {

"use strict";
module.exports = __nccwpck_require__(622);
module.exports = __nccwpck_require__(17);

/***/ })

Expand Down Expand Up @@ -182,7 +182,7 @@ module.exports = __nccwpck_require__(622);

/***/ }),

/***/ 622:
/***/ 17:
/***/ ((module) => {

"use strict";
Expand Down
1 change: 0 additions & 1 deletion test/unit/exports-nomodule/output-coverage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/******/ "use strict";
/******/ /* webpack/runtime/compat */
/******/
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/) ? 1 : 0, -1) + "/";
Expand Down
1 change: 0 additions & 1 deletion test/unit/exports-wildcard/output-coverage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/******/ "use strict";
/******/ /* webpack/runtime/compat */
/******/
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/) ? 1 : 0, -1) + "/";
Expand Down
19 changes: 14 additions & 5 deletions test/unit/externals/output-coverage.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({

/***/ 306:
/***/ 378:
/***/ ((module) => {

"use strict";
module.exports = require("external-replace/replaced/some-file");

/***/ }),

/***/ 830:
/***/ ((module) => {

"use strict";
module.exports = require("externalmapped");

/***/ }),

/***/ 196:
/***/ 958:
/***/ ((module) => {

"use strict";
Expand Down Expand Up @@ -58,12 +66,13 @@ module.exports = require("regexexternal");
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
(() => {
const external = __nccwpck_require__(306);
const regexpExternal = __nccwpck_require__(196);
const external = __nccwpck_require__(830);
const regexpExternal = __nccwpck_require__(958);
const regexpExternalMatch = __nccwpck_require__(378)

console.log(external);
console.log(regexpExternal);

console.log(regexpExternalMatch);

})();

Expand Down
1 change: 0 additions & 1 deletion test/unit/imports/output-coverage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/******/ "use strict";
/******/ /* webpack/runtime/compat */
/******/
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/) ? 1 : 0, -1) + "/";
Expand Down
2 changes: 2 additions & 0 deletions test/unit/minify-sourcemap-register/output-coverage.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions test/unit/minify-sourcemap-register/output-coverage.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/unit/minify-sourcemap-register/output.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require('./sourcemap-register.js');const { readFileSync, writeFileSync } = require('fs'), { Script } = require('vm'), { wrap } = require('module');
const basename = __dirname + '/index.js';
const source = readFileSync(basename + '.cache.js', 'utf-8');
const cachedData = !process.pkg && require('process').platform !== 'win32' && readFileSync(basename + '.cache');
const scriptOpts = { filename: basename + '.cache.js', columnOffset: -62 }
const script = new Script(wrap(source), cachedData ? Object.assign({ cachedData }, scriptOpts) : scriptOpts);
(script.runInThisContext())(exports, require, module, __filename, __dirname);
if (cachedData) process.on('exit', () => { try { writeFileSync(basename + '.cache', script.createCachedData()); } catch(e) {} });

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/unit/minify-v8cache-sourcemap-register/output.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/unit/minify/output-coverage.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/unit/minify/output.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions test/unit/nested-builds/output-coverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/***/ 622:
/***/ ((module) => {

module.exports = __nccwpck_require__(622);
module.exports = __nccwpck_require__(17);

/***/ })

Expand Down Expand Up @@ -118,7 +118,7 @@

/***/ }),

/***/ 622:
/***/ 17:
/***/ ((module) => {

"use strict";
Expand Down
4 changes: 2 additions & 2 deletions test/unit/ts-exts/output-coverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.default = {};
exports["default"] = {};


/***/ }),
Expand All @@ -17,7 +17,7 @@ exports.default = {};


Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.default = void 0;
exports["default"] = void 0;
var dep_dep_js_1 = __nccwpck_require__(119);
Object.defineProperty(exports, "default", ({ enumerable: true, get: function () { return dep_dep_js_1.default; } }));

Expand Down
3 changes: 3 additions & 0 deletions test/unit/tsconfig-paths-array-extends/input.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import module from '@module';

console.log(module);
1 change: 1 addition & 0 deletions test/unit/tsconfig-paths-array-extends/module.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default {};
Loading

0 comments on commit f898f8e

Please sign in to comment.