Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[js] upgrade JS shared dev dependencies #17831

Merged
merged 3 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion js/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ module.exports = {
rules: {
'jsdoc/check-alignment': 'error',
'jsdoc/check-indentation': 'error',
'jsdoc/newline-after-description': 'error',
}
}, {
files: ['common/test/**/*.ts'],
Expand Down
3 changes: 0 additions & 3 deletions js/common/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,3 @@ execSync('npm run build:esm', {shell: true, stdio: 'inherit', cwd: __dirname});
// see also: https://evertpot.com/universal-commonjs-esm-typescript-packages/
writeFileSync(resolve(__dirname, './dist/cjs', 'package.json'), '{"type": "commonjs"}');
writeFileSync(resolve(__dirname, './dist/esm', 'package.json'), '{"type": "module"}');

// launch webpack to generate bundles
execSync('npm run build:bundles', {shell: true, stdio: 'inherit', cwd: __dirname});
2 changes: 1 addition & 1 deletion js/node/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"module": "CommonJS",
"module": "Node16",
"outDir": "dist"
},
"include": ["lib"]
Expand Down
5,487 changes: 1,024 additions & 4,463 deletions js/package-lock.json

Large diffs are not rendered by default.

31 changes: 12 additions & 19 deletions js/package.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,27 @@
{
"devDependencies": {
"@types/fs-extra": "^11.0.1",
"@types/mocha": "^10.0.1",
"@types/fs-extra": "^11.0.2",
"@types/mocha": "^10.0.2",
"@types/node": "^18.14.6",
"@types/npmlog": "^4.1.4",
"@typescript-eslint/eslint-plugin": "^5.54.1",
"@typescript-eslint/parser": "^5.54.1",
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/parser": "^6.7.4",
"clang-format": "^1.8.0",
"dir-compare": "^4.0.0",
"dir-compare": "^4.2.0",
"esbuild": "^0.19.3",
"esbuild-plugin-polyfill-node": "^0.3.0",
"eslint": "^8.35.0",
"eslint": "^8.51.0",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jsdoc": "^40.0.1",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jsdoc": "^46.8.2",
"eslint-plugin-prefer-arrow": "^1.2.3",
"eslint-plugin-unicorn": "^46.0.0",
"fs-extra": "^11.1.0",
"eslint-plugin-unicorn": "^48.0.1",
"fs-extra": "^11.1.1",
"jszip": "^3.10.1",
"mocha": "^10.2.0",
"node-polyfill-webpack-plugin": "^2.0.1",
"npmlog": "^7.0.1",
"prettier": "^3.0.0",
"terser": "^5.16.5",
"ts-loader": "^9.4.2",
"typescript": "^4.9.5",
"webpack": "^5.76.0",
"webpack-bundle-analyzer": "^4.8.0",
"webpack-cli": "^5.0.1",
"worker-loader": "^3.0.8"
"prettier": "^3.0.3",
"typescript": "^5.2.2"
},
"scripts": {
"prepare": "tsc --build scripts",
Expand Down
4 changes: 2 additions & 2 deletions js/react_native/lib/backend.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

import {Backend, InferenceSession, InferenceSessionHandler, SessionHandler, Tensor} from 'onnxruntime-common';
import {type Backend, InferenceSession, type InferenceSessionHandler, type SessionHandler, Tensor} from 'onnxruntime-common';
import {Platform} from 'react-native';

import {binding, Binding, JSIBlob, jsiHelper} from './binding';
import {binding, type Binding, type JSIBlob, jsiHelper} from './binding';

type SupportedTypedArray = Exclude<Tensor.DataType, string[]>;

Expand Down
1 change: 0 additions & 1 deletion js/react_native/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"esModuleInterop": true,
"importsNotUsedAsValues": "error",
"forceConsistentCasingInFileNames": true,
"jsx": "react",
"lib": ["esnext"],
Expand Down
2 changes: 1 addition & 1 deletion js/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"module": "ES2015",
"moduleResolution": "node16",
"moduleResolution": "Node16",
"esModuleInterop": true,
"target": "ES2020",
"lib": ["ES2020", "ESNext.BigInt", "dom"],
Expand Down
2 changes: 1 addition & 1 deletion js/tsconfig.tools.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "CommonJS",
"module": "Node16",
"declaration": false,
"sourceMap": false
}
Expand Down
2 changes: 1 addition & 1 deletion js/web/lib/build-def.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/**
* The interface BuildDefinitions contains a set of flags which are defined at build time.
*
* Those flags are processed in terser for tree shaking to remove unused code.
* Those flags are processed in bundler for tree shaking to remove unused code.
* No flags in this file should present in production build.
*/
interface BuildDefinitions {
Expand Down
4 changes: 2 additions & 2 deletions js/web/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

/* eslint-disable @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports */
// We use "require" instead of "import" here because import statement must be put in top level. Our current code does
// not allow terser to tree-shaking code as expected because some codes are treated as having side effects.
// So we import code inside the if-clause to allow terser remove the code safely.
// not allow bundler to tree-shaking code as expected because some codes are treated as having side effects.
// So we import code inside the if-clause to allow bundler remove the code safely.

export * from 'onnxruntime-common';
import {registerBackend, env} from 'onnxruntime-common';
Expand Down
2 changes: 1 addition & 1 deletion js/web/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"module": "CommonJS",
"module": "Node16",
"downlevelIteration": true,
"declaration": true,
"declarationDir": "./types",
Expand Down
94 changes: 0 additions & 94 deletions js/webpack.shared.mjs

This file was deleted.

Loading