From 2382a426b695ffdeb1fedfa6b6007a52437758a4 Mon Sep 17 00:00:00 2001 From: Korobeinikov Evgeny Date: Fri, 16 Aug 2024 16:55:10 +0300 Subject: [PATCH 1/3] using ets and memo tsc --- arkoala/arkts-loader/package.json | 4 ++-- arkoala/arkui-common/package.json | 4 ++-- arkoala/arkui/package.json | 4 ++-- arkoala/ets-plugin/package.json | 10 ++++------ arkoala/ets-plugin/src/AbilityTransformer.ts | 2 +- arkoala/ets-plugin/src/AbstractVisitor.ts | 2 +- arkoala/ets-plugin/src/ApiUtils.ts | 2 +- arkoala/ets-plugin/src/ArkExpander.ts | 2 +- arkoala/ets-plugin/src/CallExpressionCollector.ts | 2 +- arkoala/ets-plugin/src/CallTransformer.ts | 2 +- arkoala/ets-plugin/src/CustomBuilderTransformer.ts | 2 +- arkoala/ets-plugin/src/DiagnosticFilter.ts | 2 +- arkoala/ets-plugin/src/DollarTransformer.ts | 2 +- arkoala/ets-plugin/src/EntryTracker.ts | 2 +- arkoala/ets-plugin/src/ExtensionStylesTransformer.ts | 2 +- arkoala/ets-plugin/src/Importer.ts | 2 +- arkoala/ets-plugin/src/LazyTransformer.ts | 2 +- arkoala/ets-plugin/src/LegacyCallTransformer.ts | 2 +- arkoala/ets-plugin/src/NameCollector.ts | 2 +- arkoala/ets-plugin/src/NewTransformer.ts | 2 +- arkoala/ets-plugin/src/PropertyTranslators.ts | 2 +- arkoala/ets-plugin/src/StructTransformer.ts | 2 +- arkoala/ets-plugin/src/StyleTransformer.ts | 2 +- arkoala/ets-plugin/src/import-export.ts | 2 +- arkoala/ets-plugin/src/utils.ts | 2 +- arkoala/extension-component/package.json | 2 +- arkoala/framework/package.json | 8 ++++---- arkoala/loader/package.json | 12 ++++++------ arkoala/package.json | 7 ++----- arkoala/tests/package.json | 4 ++-- 30 files changed, 46 insertions(+), 51 deletions(-) diff --git a/arkoala/arkts-loader/package.json b/arkoala/arkts-loader/package.json index 37ecb726c..b6ed9b0a9 100644 --- a/arkoala/arkts-loader/package.json +++ b/arkoala/arkts-loader/package.json @@ -6,9 +6,9 @@ "scripts": { "clean": "rimraf generated unmemoized", "compile:plugin": "cd ../ets-plugin && npm run compile", - "compile:ets": "npm run compile:plugin && cd src/ets && ../../../node_modules/ohos-typescript/bin/tsc -p ./tsconfig.ets.json", + "compile:ets": "npm run compile:plugin && cd src/ets && ets-tsc -p ./tsconfig.ets.json", "panda:sdk:install": "cd ../../incremental/tools/panda && npm run panda:sdk:install", - "unmemoize": "npm run compile:ets && ../node_modules/typescript/bin/tsc -b tsconfig-unmemoize.json", + "unmemoize": "npm run compile:ets && memo-tsc -b tsconfig-unmemoize.json", "run": "npm run unmemoize && bash ../../incremental/tools/panda/arkts/arktsc --arktsconfig ./arktsconfig-run-unmemoized.json" }, "keywords": [], diff --git a/arkoala/arkui-common/package.json b/arkoala/arkui-common/package.json index 639dd5468..9767cf938 100644 --- a/arkoala/arkui-common/package.json +++ b/arkoala/arkui-common/package.json @@ -26,13 +26,13 @@ ], "scripts": { "docs": "typedoc", - "compile": "npm run ohos-sdk && tsc -b .", + "compile": "npm run ohos-sdk && memo-tsc -b .", "compile:arkts": "bash ../tools/panda/arkts/arktsc --arktsconfig arktsconfig.json", "clean": "rimraf build dist ; npm run ets:clean", "ohos-sdk:download": "node scripts/download-oh-sdk.mjs", "ohos-sdk:patch": "node scripts/patch-oh-sdk.mjs", "ohos-sdk": "npm run ohos-sdk:download && npm run ohos-sdk:patch", - "ets:test": "cd test/ets; ../../../node_modules/ohos-typescript/bin/tsc", + "ets:test": "cd test/ets; ets-tsc", "test-gen": "npm run compile && npm run ets:test && mocha --gen-golden=$npm_config_gdir", "ets:clean": "rimraf test/generated/*.ts test/ets/js_output", "test": "npm run compile && TS_NODE_PROJECT=./test/tsconfig.json mocha -r tsconfig-paths/register", diff --git a/arkoala/arkui/package.json b/arkoala/arkui/package.json index e09428f06..9dfe53815 100644 --- a/arkoala/arkui/package.json +++ b/arkoala/arkui/package.json @@ -25,10 +25,10 @@ ], "scripts": { "docs": "typedoc", - "compile": "npm run ohos-sdk --prefix ../arkui-common && tsc -b .", + "compile": "npm run ohos-sdk --prefix ../arkui-common && memo-tsc -b .", "compile:arkts": "bash ../tools/panda/arkts/arktsc --arktsconfig arktsconfig.json", "clean": "rimraf build dist ; npm run ets:clean", - "ets:test": "cd test/ets; ../../../node_modules/ohos-typescript/bin/tsc", + "ets:test": "cd test/ets; ets-tsc", "test-gen": "npm run compile && npm run ets:test && mocha --gen-golden=$npm_config_gdir", "ets:clean": "rimraf test/generated/*.ts test/ets/js_output", "test": "npm run compile && npm run ets:test && mocha", diff --git a/arkoala/ets-plugin/package.json b/arkoala/ets-plugin/package.json index 794f88b0e..c451250ed 100644 --- a/arkoala/ets-plugin/package.json +++ b/arkoala/ets-plugin/package.json @@ -9,19 +9,17 @@ "build/lib/**/*.d.ts" ], "scripts": { - "patch-ts-patch": "node ../tools/patch-ts-patch.mjs ../node_modules/ts-patch", - "patch-ohos-typescript": "cd ../node_modules/ohos-typescript && ts-patch install", - "compile": "npm run patch-ts-patch && npm run patch-ohos-typescript && node ../node_modules/ohos-typescript/bin/tsc -b .", + "compile": "memo-tsc -b .", "clean": "rimraf build dist test/dump test/generated test/ets/specification test/specification/ets2bundle", - "ets:test": "cd test/ets; ../../../node_modules/ohos-typescript/bin/tsc -p ./tsconfig.ets.json", + "ets:test": "cd test/ets; ets-tsc -p ./tsconfig.ets.json", "test": "npm run compile && npm run ets:test && mocha --reporter-option maxDiffSize=0", "test:coverage": "nyc mocha", "test:all": "npm run test:spec; npm run test", "canonize": "npm run test:all; cp -r test/generated/. test/golden/", - "compile:spec": "cd test/ets && ../../../node_modules/ohos-typescript/bin/tsc -p spec-tsconfig.ets.json", + "compile:spec": "cd test/ets && ets-tsc -p spec-tsconfig.ets.json", "test:spec": "npm run compile && npm run sync:spec && npm run compile:spec && mocha --config spec.mocharc.json", - "compile:sync:spec": "cd test/scripts && ../../../node_modules/typescript/bin/tsc -p tsconfig-sync-specification.json", + "compile:sync:spec": "cd test/scripts && memo-tsc -p tsconfig-sync-specification.json", "sync:spec": "npm run compile:sync:spec && cd build/test/scripts && node sync-specification.js" }, "keywords": [], diff --git a/arkoala/ets-plugin/src/AbilityTransformer.ts b/arkoala/ets-plugin/src/AbilityTransformer.ts index 2a55450e1..981eb598d 100644 --- a/arkoala/ets-plugin/src/AbilityTransformer.ts +++ b/arkoala/ets-plugin/src/AbilityTransformer.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from 'ohos-typescript' +import * as ts from '@koalaui/ets-tsc' import { AbstractVisitor } from './AbstractVisitor' import { Importer } from './Importer' import { isDefined } from "./utils"; diff --git a/arkoala/ets-plugin/src/AbstractVisitor.ts b/arkoala/ets-plugin/src/AbstractVisitor.ts index 453c6e5ce..035db10b0 100644 --- a/arkoala/ets-plugin/src/AbstractVisitor.ts +++ b/arkoala/ets-plugin/src/AbstractVisitor.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from 'ohos-typescript' +import * as ts from '@koalaui/ets-tsc' import { asString } from './utils' export abstract class AbstractVisitor { diff --git a/arkoala/ets-plugin/src/ApiUtils.ts b/arkoala/ets-plugin/src/ApiUtils.ts index e15a9d40a..218f990cf 100644 --- a/arkoala/ets-plugin/src/ApiUtils.ts +++ b/arkoala/ets-plugin/src/ApiUtils.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from "ohos-typescript" +import * as ts from "@koalaui/ets-tsc" import { filterDecorators } from "./utils" export function parameter( diff --git a/arkoala/ets-plugin/src/ArkExpander.ts b/arkoala/ets-plugin/src/ArkExpander.ts index fe1068375..48327c6c3 100644 --- a/arkoala/ets-plugin/src/ArkExpander.ts +++ b/arkoala/ets-plugin/src/ArkExpander.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from 'ohos-typescript' +import * as ts from '@koalaui/ets-tsc' import * as fs from "fs" import * as path from "path" import { Importer } from './Importer' diff --git a/arkoala/ets-plugin/src/CallExpressionCollector.ts b/arkoala/ets-plugin/src/CallExpressionCollector.ts index 7648479e2..f7456a4f5 100644 --- a/arkoala/ets-plugin/src/CallExpressionCollector.ts +++ b/arkoala/ets-plugin/src/CallExpressionCollector.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from 'ohos-typescript' +import * as ts from '@koalaui/ets-tsc' import { AbstractVisitor } from './AbstractVisitor' export class CallExpressionCollector extends AbstractVisitor { diff --git a/arkoala/ets-plugin/src/CallTransformer.ts b/arkoala/ets-plugin/src/CallTransformer.ts index cd0747d84..9afacf763 100644 --- a/arkoala/ets-plugin/src/CallTransformer.ts +++ b/arkoala/ets-plugin/src/CallTransformer.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from 'ohos-typescript' +import * as ts from '@koalaui/ets-tsc' import { AbstractVisitor } from './AbstractVisitor' import { getDeclarationsByNode, hasDecorator } from './ApiUtils' import { asString, CallTable, findBuilderLambdaRedirect, isGlobalBuilder, hasLocalDeclaration, isBuiltinComponentName, CustomDialogDecorator, ComponentDecorator } from './utils' diff --git a/arkoala/ets-plugin/src/CustomBuilderTransformer.ts b/arkoala/ets-plugin/src/CustomBuilderTransformer.ts index 5653139f9..bd2ba6d69 100644 --- a/arkoala/ets-plugin/src/CustomBuilderTransformer.ts +++ b/arkoala/ets-plugin/src/CustomBuilderTransformer.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from 'ohos-typescript' +import * as ts from '@koalaui/ets-tsc' import { AbstractVisitor } from "./AbstractVisitor" import { asString, CallTable, isBuilder, isGlobalBuilder, prependMemoComment } from './utils' import { Void, getDeclarationsByNode, prependComment } from './ApiUtils' diff --git a/arkoala/ets-plugin/src/DiagnosticFilter.ts b/arkoala/ets-plugin/src/DiagnosticFilter.ts index 19ab849ea..df3be9be6 100644 --- a/arkoala/ets-plugin/src/DiagnosticFilter.ts +++ b/arkoala/ets-plugin/src/DiagnosticFilter.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from "ohos-typescript"; +import * as ts from "@koalaui/ets-tsc"; import { IssueTable, NameTable } from "./utils"; import { getLineNumber } from "./ApiUtils"; diff --git a/arkoala/ets-plugin/src/DollarTransformer.ts b/arkoala/ets-plugin/src/DollarTransformer.ts index 874c69e62..caac6830f 100644 --- a/arkoala/ets-plugin/src/DollarTransformer.ts +++ b/arkoala/ets-plugin/src/DollarTransformer.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from "ohos-typescript" +import * as ts from "@koalaui/ets-tsc" import { AbstractVisitor } from "./AbstractVisitor"; import { NameTable } from "./utils"; diff --git a/arkoala/ets-plugin/src/EntryTracker.ts b/arkoala/ets-plugin/src/EntryTracker.ts index c8972e1d4..1f3933625 100644 --- a/arkoala/ets-plugin/src/EntryTracker.ts +++ b/arkoala/ets-plugin/src/EntryTracker.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from 'ohos-typescript' +import * as ts from '@koalaui/ets-tsc' import * as path from 'path' export class EntryTracker { diff --git a/arkoala/ets-plugin/src/ExtensionStylesTransformer.ts b/arkoala/ets-plugin/src/ExtensionStylesTransformer.ts index 185300f33..9c5900649 100644 --- a/arkoala/ets-plugin/src/ExtensionStylesTransformer.ts +++ b/arkoala/ets-plugin/src/ExtensionStylesTransformer.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from 'ohos-typescript' +import * as ts from '@koalaui/ets-tsc' import { AbstractVisitor } from './AbstractVisitor' import { Importer } from './Importer' import { diff --git a/arkoala/ets-plugin/src/Importer.ts b/arkoala/ets-plugin/src/Importer.ts index 1c877ba63..0736a080c 100644 --- a/arkoala/ets-plugin/src/Importer.ts +++ b/arkoala/ets-plugin/src/Importer.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from 'ohos-typescript' +import * as ts from '@koalaui/ets-tsc' import { id } from './ApiUtils' import { assertUnreachable } from "./utils"; diff --git a/arkoala/ets-plugin/src/LazyTransformer.ts b/arkoala/ets-plugin/src/LazyTransformer.ts index 6740687cc..7ec432a8a 100644 --- a/arkoala/ets-plugin/src/LazyTransformer.ts +++ b/arkoala/ets-plugin/src/LazyTransformer.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from 'ohos-typescript' +import * as ts from '@koalaui/ets-tsc' import { AbstractVisitor } from './AbstractVisitor' import { Importer } from './Importer' import { id } from './ApiUtils' diff --git a/arkoala/ets-plugin/src/LegacyCallTransformer.ts b/arkoala/ets-plugin/src/LegacyCallTransformer.ts index e597fb1d1..e8fcf623f 100644 --- a/arkoala/ets-plugin/src/LegacyCallTransformer.ts +++ b/arkoala/ets-plugin/src/LegacyCallTransformer.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from 'ohos-typescript' +import * as ts from '@koalaui/ets-tsc' import { AbstractVisitor } from "./AbstractVisitor" import { asString, CallTable } from './utils' import { Importer } from './Importer' diff --git a/arkoala/ets-plugin/src/NameCollector.ts b/arkoala/ets-plugin/src/NameCollector.ts index 52389d354..3c06be72a 100644 --- a/arkoala/ets-plugin/src/NameCollector.ts +++ b/arkoala/ets-plugin/src/NameCollector.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from 'ohos-typescript' +import * as ts from '@koalaui/ets-tsc' import { AbstractVisitor } from './AbstractVisitor' import { getLineNumber, isCallDecorator } from './ApiUtils' import { NameTable, asString, isBuilderLambda, IssueTable, BuilderLambdaDecorator, filterDecorators } from './utils' diff --git a/arkoala/ets-plugin/src/NewTransformer.ts b/arkoala/ets-plugin/src/NewTransformer.ts index d7c9e64c4..3e5e44380 100644 --- a/arkoala/ets-plugin/src/NewTransformer.ts +++ b/arkoala/ets-plugin/src/NewTransformer.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from 'ohos-typescript' +import * as ts from '@koalaui/ets-tsc' import { AbstractVisitor } from "./AbstractVisitor" import { Importer } from './Importer' import { IssueTable, adaptorComponentName } from './utils' diff --git a/arkoala/ets-plugin/src/PropertyTranslators.ts b/arkoala/ets-plugin/src/PropertyTranslators.ts index a26948e22..0dcd23d97 100644 --- a/arkoala/ets-plugin/src/PropertyTranslators.ts +++ b/arkoala/ets-plugin/src/PropertyTranslators.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from "ohos-typescript" +import * as ts from "@koalaui/ets-tsc" import { Any, assignment, diff --git a/arkoala/ets-plugin/src/StructTransformer.ts b/arkoala/ets-plugin/src/StructTransformer.ts index 729a97031..6ee6828d4 100644 --- a/arkoala/ets-plugin/src/StructTransformer.ts +++ b/arkoala/ets-plugin/src/StructTransformer.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from 'ohos-typescript' +import * as ts from '@koalaui/ets-tsc' import { AbstractVisitor } from './AbstractVisitor' import { CallExpressionCollector } from './CallExpressionCollector' import { EntryTracker } from './EntryTracker' diff --git a/arkoala/ets-plugin/src/StyleTransformer.ts b/arkoala/ets-plugin/src/StyleTransformer.ts index 7d76bfa48..cd7871de0 100644 --- a/arkoala/ets-plugin/src/StyleTransformer.ts +++ b/arkoala/ets-plugin/src/StyleTransformer.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from 'ohos-typescript' +import * as ts from '@koalaui/ets-tsc' import { AbstractVisitor } from './AbstractVisitor' import { ExtensionStylesTransformer } from './ExtensionStylesTransformer' import { Importer } from './Importer' diff --git a/arkoala/ets-plugin/src/import-export.ts b/arkoala/ets-plugin/src/import-export.ts index 872a5476f..da3542d41 100644 --- a/arkoala/ets-plugin/src/import-export.ts +++ b/arkoala/ets-plugin/src/import-export.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from 'ohos-typescript'; +import * as ts from '@koalaui/ets-tsc'; import { getDeclarationsByNode } from "./ApiUtils" diff --git a/arkoala/ets-plugin/src/utils.ts b/arkoala/ets-plugin/src/utils.ts index 9294b70f8..b316457b9 100644 --- a/arkoala/ets-plugin/src/utils.ts +++ b/arkoala/ets-plugin/src/utils.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from 'ohos-typescript' +import * as ts from '@koalaui/ets-tsc' import * as path from 'path' import { getDeclarationsByNode, getDecorator, hasDecorator, id, isCallDecorator, isDecorator, prependComment, Void } from './ApiUtils' import { Importer } from "./Importer"; diff --git a/arkoala/extension-component/package.json b/arkoala/extension-component/package.json index 2b3b118c9..09655f904 100644 --- a/arkoala/extension-component/package.json +++ b/arkoala/extension-component/package.json @@ -12,7 +12,7 @@ "keywords": [], "scripts": { "compile": "tsc", - "unmemoize": "tsc && tsc -b tsconfig-unmemoize.json" + "unmemoize": "memo-tsc && memo-tsc -b tsconfig-unmemoize.json" }, "author": "", "license": "ISC" diff --git a/arkoala/framework/package.json b/arkoala/framework/package.json index 107ed100a..740d6fffb 100644 --- a/arkoala/framework/package.json +++ b/arkoala/framework/package.json @@ -39,10 +39,10 @@ "configure:native-hzvm-ohos-arm32": "npm run --prefix ../ohos-sdk download && cd native && node ../scripts/configure.mjs hzvm-ohos-arm32", "compile:native-hzvm-ohos-arm32": "npm run configure:native-hzvm-ohos-arm32 && cd native && meson compile -C build-hzvm-ohos-arm32 && meson install -C build-hzvm-ohos-arm32", "configure:native-hzvm-ohos": "npm run configure:native-hzvm-ohos-arm64", - "compile:native-hzvm-ohos": "tsc -b . && npm run compile:native-hzvm-ohos-arm64", - "compile:node-host": "tsc -b . && npm run compile:native-node-host", + "compile:native-hzvm-ohos": "memo-tsc -b . && npm run compile:native-hzvm-ohos-arm64", + "compile:node-host": "memo-tsc -b . && npm run compile:native-node-host", "compile": "npm run compile:node-host", - "compile:hzvm-host": "tsc -b . && npm run compile:native-hzvm-host", - "compile:hzvm-ohos": "tsc -b . && npm run compile:native-hzvm-ohos" + "compile:hzvm-host": "memo-tsc -b . && npm run compile:native-hzvm-host", + "compile:hzvm-ohos": "memo-tsc -b . && npm run compile:native-hzvm-ohos" } } diff --git a/arkoala/loader/package.json b/arkoala/loader/package.json index 8e1297900..cd1d7e056 100644 --- a/arkoala/loader/package.json +++ b/arkoala/loader/package.json @@ -14,21 +14,21 @@ "test:loader": "npm run compile:node-test-host && node ./lib/js/loader.js", "test:loader:unmemoizing": "npm run compile:node-test-host:unmemoizing && node ./lib/unmemoized/js/loader.js", "plugins:compile": "cd ../; npm run compile -w koala-arkui && npm run compiler:plugin:compile && npm run ets:plugin:compile", - "ets": "cd src/ets; ../../../node_modules/ohos-typescript/bin/tsc", + "ets": "cd src/ets; ets-tsc", "test:hzvm:loader": "npm run compile:hzvm-host", - "clean": "tsc -b . --clean && rimraf build dist lib generated unmemoized", - "compile:node-test-host": "npm run gen-resources && tsc -b ../extension-component && npm run ets && npm run compile:node-test", - "compile:node-test-host:unmemoizing": "npm run gen-resources && npm run unmemoize --prefix ../extension-component && npm run ets && tsc -b tsconfig-unmemoize.json && npm run compile:node-test:unmemoizing", + "clean": "memo-tsc -b . --clean && rimraf build dist lib generated unmemoized", + "compile:node-test-host": "npm run gen-resources && memo-tsc -b ../extension-component && npm run ets && npm run compile:node-test", + "compile:node-test-host:unmemoizing": "npm run gen-resources && npm run unmemoize --prefix ../extension-component && npm run ets && memo-tsc -b tsconfig-unmemoize.json && npm run compile:node-test:unmemoizing", "compile:node-test": "WEBPACK_NO_MINIMIZE=true webpack --config webpack.config.node-test.js", "compile:node-test:unmemoizing": "WEBPACK_NO_MINIMIZE=true webpack --config webpack.config.node-test.js --env tsconfig=tsconfig-run-unmemoized.json --env unmemoized=unmemoized", "compile:node-test:unmemoizing:arkts": "bash ../external/incremental/tools/panda/arkts/arktsc --extension sts unmemoized/generated/ets/page.ts --arktsconfig arktsconfig-run-unmemoized.json", - "compile:perf-ets": "npm run plugins:compile && HOS_SDK_HOME='../ohos-sdk/ohos-sdk/HarmonyOS-NEXT-DB1/openharmony' npm run gen-resources && tsc -p ../extension-component && npm run ets", + "compile:perf-ets": "npm run plugins:compile && HOS_SDK_HOME='../ohos-sdk/ohos-sdk/HarmonyOS-NEXT-DB1/openharmony' npm run gen-resources && memo-tsc -p ../extension-component && npm run ets", "compile:perf-node": "WEBPACK_NO_MINIMIZE=true webpack --config webpack.config.node-perf.js", "compile:web": "WEBPACK_NO_MINIMIZE=true webpack serve --open --config webpack.config.web.js", "pack:perf": "npm run compile:perf-ets && npm run compile:perf-node && webpack ./lib/index-perf.js && echo 'Packed to dist/main.js'", "run:perf-node": "npm run compile:perf-ets && npm run compile:perf-node && node --expose-gc ./lib/js/arkoala-perf-node.js", "run:web": "npm run compile:perf-ets && npm run compile:web", - "compile-gen-resources": "npm run --prefix ../ohos-sdk download; cd scripts; tsc gen-resources.ts --target es6 --module commonjs; cd ..", + "compile-gen-resources": "npm run --prefix ../ohos-sdk download; cd scripts; memo-tsc gen-resources.ts --target es6 --module commonjs; cd ..", "gen-resources": "npm run compile-gen-resources && node ./scripts/gen-resources.js", "compile:hzvm-host": "npm run gen-resources && npm run ets && npm run compile:hzvm", "compile:hzvm-ohos": "npm run gen-resources && npm run ets && npm run compile:hzvm -- --env os=ohos --env arch=arm64", diff --git a/arkoala/package.json b/arkoala/package.json index 5b7d4081b..2ed458105 100644 --- a/arkoala/package.json +++ b/arkoala/package.json @@ -20,11 +20,10 @@ "../arkoala-arkts/arkui" ], "devDependencies": { - "ohos-typescript": "4.9.5-r4", - "typescript": "4.9.5", + "@koalaui/ets-tsc": "4.9.5-r4", + "@koalaui/memo-tsc": "4.9.5", "bin-links": "^4.0.4", "read-package-json-fast": "^3.0.2", - "ts-patch": "^2.1.0", "tslib": "^2.3.1", "ts-node": "^10.7.0", "chai": "^4.3.6", @@ -42,7 +41,5 @@ "commander": "10.0.1" }, "scripts": { - "prepare": "cd node_modules/typescript && ts-patch install", - "postinstall": "node tools/force_tsc.js" } } diff --git a/arkoala/tests/package.json b/arkoala/tests/package.json index 5222f5c8e..d8f812358 100644 --- a/arkoala/tests/package.json +++ b/arkoala/tests/package.json @@ -11,8 +11,8 @@ "scripts": { "patch-ts-patch": "node ../tools/patch-ts-patch.mjs ../node_modules/ts-patch", "patch-ohos-typescript": "cd ../node_modules/ohos-typescript && ts-patch install", - "ets:test": "npm run patch-ts-patch && npm run patch-ohos-typescript && cd src/ets-tests && ../../../node_modules/ohos-typescript/bin/tsc", - "clean": "tsc -b . --clean && rimraf build dist lib generated unmemoized", + "ets:test": "npm run patch-ts-patch && npm run patch-ohos-typescript && cd src/ets-tests && memo-tsc", + "clean": "memo-tsc -b . --clean && rimraf build dist lib generated unmemoized", "compile-arkui": "cd ../arkui; npm run compile", "compile:test-node": "npm run ets:test && WEBPACK_NO_MINIMIZE=true webpack --config webpack.config.node-test.js", "run:test-node": "npm run compile:test-node && node lib/js/arkoala-test-node.js", -- Gitee From 3dca7d7af4337ba13aaf9a297c32b7390ba2ade2 Mon Sep 17 00:00:00 2001 From: Korobeinikov Evgeny Date: Fri, 16 Aug 2024 18:48:50 +0300 Subject: [PATCH 2/3] add memo-tsc --- arkoala/framework/package.json | 4 ++-- arkoala/tests/package.json | 4 +--- incremental/common/package.json | 2 +- incremental/compat/package.json | 4 ++-- incremental/compiler-plugin/package.json | 3 +-- incremental/demo-playground/package.json | 2 +- incremental/package.json | 5 ++--- incremental/runtime/package.json | 8 ++++---- interop/package.json | 6 +++--- 9 files changed, 17 insertions(+), 21 deletions(-) diff --git a/arkoala/framework/package.json b/arkoala/framework/package.json index 740d6fffb..c09905edd 100644 --- a/arkoala/framework/package.json +++ b/arkoala/framework/package.json @@ -18,14 +18,14 @@ "keywords": [], "dependencies": { "node-addon-api": "^8.0.0", - "typescript": "4.9.5", "@types/node": "^18.0.0" }, "devDependencies": { + "@koalaui/memo-tsc": "4.9.5", "@koalaui/node-api-headers": "1.0.0" }, "scripts": { - "clean": "tsc -b . --clean && rimraf build dist lib generated native/build-* native/*.ini", + "clean": "memo-tsc -b . --clean && rimraf build dist lib generated native/build-* native/*.ini", "configure:native-node-host": "cd native && meson setup -D vm_kind=node build-node-host", "compile:native-node-host": "npm run configure:native-node-host && cd native && meson compile -C build-node-host && meson install -C build-node-host", "configure:native-hzvm-host": "cd native && meson setup -D vm_kind=hzvm build-hzvm-host", diff --git a/arkoala/tests/package.json b/arkoala/tests/package.json index d8f812358..e846ac591 100644 --- a/arkoala/tests/package.json +++ b/arkoala/tests/package.json @@ -9,9 +9,7 @@ }, "keywords": [], "scripts": { - "patch-ts-patch": "node ../tools/patch-ts-patch.mjs ../node_modules/ts-patch", - "patch-ohos-typescript": "cd ../node_modules/ohos-typescript && ts-patch install", - "ets:test": "npm run patch-ts-patch && npm run patch-ohos-typescript && cd src/ets-tests && memo-tsc", + "ets:test": "cd src/ets-tests && ets-tsc", "clean": "memo-tsc -b . --clean && rimraf build dist lib generated unmemoized", "compile-arkui": "cd ../arkui; npm run compile", "compile:test-node": "npm run ets:test && WEBPACK_NO_MINIMIZE=true webpack --config webpack.config.node-test.js", diff --git a/incremental/common/package.json b/incremental/common/package.json index b2d4eccc0..e3396e15b 100644 --- a/incremental/common/package.json +++ b/incremental/common/package.json @@ -26,7 +26,7 @@ } }, "scripts": { - "compile": "tsc -b .", + "compile": "memo-tsc -b .", "clean": "rimraf build dist", "test": "mocha", "test:coverage": "nyc mocha", diff --git a/incremental/compat/package.json b/incremental/compat/package.json index cbae1d54c..8af5baf76 100644 --- a/incremental/compat/package.json +++ b/incremental/compat/package.json @@ -22,8 +22,8 @@ }, "scripts": { "clean": "rimraf build dist", - "compile": "tsc -b .", - "compile:ohos": "tsc -b ./tsconfig-ohos.json", + "compile": "memo-tsc -b .", + "compile:ohos": "memo-tsc -b ./tsconfig-ohos.json", "compile:arkts": "bash ../tools/panda/arkts/arktsc --arktsconfig arktsconfig.json --ets-module", "compile:all": "npm run compile && npm run compile:ohos" }, diff --git a/incremental/compiler-plugin/package.json b/incremental/compiler-plugin/package.json index 67a553067..7cc206c78 100644 --- a/incremental/compiler-plugin/package.json +++ b/incremental/compiler-plugin/package.json @@ -25,8 +25,7 @@ "source-map-support": "^0.5.21" }, "scripts": { - "prepare": "ts-patch install", - "compile": "tsc -b .", + "compile": "memo-tsc -b .", "clean": "rimraf build dist test/dump", "unmemoize:tests": "cd test && tsc -p tsconfig-unmemoize.json && rimraf build", "test": "npm run unmemoize:tests && npm run compile && mocha", diff --git a/incremental/demo-playground/package.json b/incremental/demo-playground/package.json index c43217fd2..a30fd5b65 100644 --- a/incremental/demo-playground/package.json +++ b/incremental/demo-playground/package.json @@ -16,7 +16,7 @@ }, "scripts": { "compile": "WEBPACK_NO_MINIMIZE=true webpack --config webpack.config.node.js", - "compile:unmemoize": "tsc -b tsconfig-unmemoize.json", + "compile:unmemoize": "memo-tsc -b tsconfig-unmemoize.json", "compile:run-unmemoized": "npm run compile -- --env tsconfig=tsconfig-run-unmemoized.json --env unmemoized=unmemoized", "compile:unmemoizing": "npm run compile:unmemoize && npm run compile:run-unmemoized", "compile:arkts": "bash ../tools/panda/arkts/arktsc --arktsconfig arktsconfig.json", diff --git a/incremental/package.json b/incremental/package.json index 8c38f9c67..324643e99 100644 --- a/incremental/package.json +++ b/incremental/package.json @@ -10,17 +10,16 @@ "compiler-plugin" ], "devDependencies": { + "@koalaui/memo-tsc": "4.9.5", "@types/chai": "4.3.10", "chai": "4.3.10", "ts-node": "^10.7.0", "ts-patch": "^2.1.0", - "tslib": "^2.3.1", - "typescript": "4.9.5" + "tslib": "^2.3.1" }, "scripts": { "all:clean": "npm run clean --ws --if-present -s", "all:clean:unmemoized": "npm run clean:unmemoized --ws --if-present -s", - "prepare": "cd node_modules/typescript && ts-patch install", "compile": "npm run compile -w ./compat && npm run compile -w ./common && npm run compile -w ./runtime && npm run compile -w ./demo-playground && npm run compile -w ./compiler-plugin" }, "dependencies": { diff --git a/incremental/runtime/package.json b/incremental/runtime/package.json index f72d92916..87723b368 100644 --- a/incremental/runtime/package.json +++ b/incremental/runtime/package.json @@ -10,16 +10,16 @@ "oh-package.json5" ], "scripts": { - "compile": "tsc -b .", - "compile:unmemoize": "../node_modules/typescript/bin/tsc -b tsconfig-unmemoize.json", - "compile:test": "tsc -b tsconfig-test.json", + "compile": "memo-tsc -b .", + "compile:unmemoize": "memo-tsc -b tsconfig-unmemoize.json", + "compile:test": "memo-tsc -b tsconfig-test.json", "clean": "rimraf build unmemoized", "clean:unmemoized": "rimraf unmemoized", "test": "mocha", "test:coverage": "nyc mocha", "panda:sdk:install": "cd ../tools/panda && npm run panda:sdk:install", "compile:arkts": "bash ../tools/panda/arkts/arktsc --arktsconfig arktsconfig.json --ets-module", - "compile:arkts:unmemoize": "../node_modules/typescript/bin/tsc -b arktsconfig-unmemoize.json", + "compile:arkts:unmemoize": "memo-tsc -b arktsconfig-unmemoize.json", "compile:arkts:unmemoizing": "npm run compile:arkts:unmemoize && bash ../tools/panda/arkts/arktsc --arktsconfig arktsconfig-run-unmemoized.json --ets-module", "arkts:compile:test:lib": "bash ../tools/panda/arkts/arktsc --arktsconfig arktsconfig-test-lib.json --ets-module", "arkts:compile:test:app": "find unmemoized/test-arkts -name '*.test.ts' -exec mkdir -p build/test/app/{} \\; -exec bash ../tools/panda/arkts/arktsc --arktsconfig arktsconfig-test-app.json --output build/test/app/{}/test.abc {} \\;", diff --git a/interop/package.json b/interop/package.json index 666b65369..257b56014 100644 --- a/interop/package.json +++ b/interop/package.json @@ -36,8 +36,8 @@ } }, "scripts": { - "clean": "tsc -b . --clean && rimraf dist build types", - "compile": "tsc -b .", + "clean": "memo-tsc -b . --clean && rimraf dist build types", + "compile": "memo-tsc -b .", "compile:arkts": "bash ../tools/panda/arkts/arktsc --arktsconfig arktsconfig.json", "lint": "eslint src test components", "test:wasm:coverage": "NODE_OPTIONS='--conditions browser --no-experimental-fetch' nyc mocha", @@ -46,7 +46,7 @@ "test:node": "mocha", "test:coverage": "npm run test:node:coverage", "test": "npm run test:node", - "watch": "tsc -b . --watch" + "watch": "memo-tsc -b . --watch" }, "keywords": [], "dependencies": { -- Gitee From 2af180d31f02ee448aaa4a40894756e3f095960f Mon Sep 17 00:00:00 2001 From: Korobeinikov Evgeny Date: Fri, 16 Aug 2024 19:17:27 +0300 Subject: [PATCH 3/3] more --- arkoala/tools/arkoala-transformer/index.ts | 2 +- incremental/compiler-plugin/src/AbstractVisitor.ts | 2 +- incremental/compiler-plugin/src/MemoArgumentDetector.ts | 2 +- incremental/compiler-plugin/src/ScopedVisitor.ts | 2 +- incremental/compiler-plugin/src/analysis-visitor.ts | 2 +- incremental/compiler-plugin/src/diagnostics-visitor.ts | 2 +- incremental/compiler-plugin/src/dump-visitor.ts | 2 +- incremental/compiler-plugin/src/function-transformer.ts | 2 +- incremental/compiler-plugin/src/import-export.ts | 2 +- incremental/compiler-plugin/src/koala-transformer.ts | 2 +- incremental/compiler-plugin/src/parameter-transformer.ts | 2 +- incremental/compiler-plugin/src/return-transformer.ts | 2 +- incremental/compiler-plugin/src/this-transformer.ts | 2 +- incremental/compiler-plugin/src/transformation-context.ts | 2 +- incremental/compiler-plugin/src/util.ts | 2 +- incremental/compiler-plugin/src/variable-type-transformer.ts | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/arkoala/tools/arkoala-transformer/index.ts b/arkoala/tools/arkoala-transformer/index.ts index 96db4bd1c..96f2577dd 100644 --- a/arkoala/tools/arkoala-transformer/index.ts +++ b/arkoala/tools/arkoala-transformer/index.ts @@ -1,6 +1,6 @@ import memoPlugin from "@koalaui/compiler-plugin"; import { makeEtsExpander } from "@koalaui/ets-plugin"; -import type * as ts from "typescript" +import type * as ts from "@koalaui/memo-tsc" import * as fs from "fs" import chalk from "chalk" diff --git a/incremental/compiler-plugin/src/AbstractVisitor.ts b/incremental/compiler-plugin/src/AbstractVisitor.ts index b0e7e279d..876feee5d 100644 --- a/incremental/compiler-plugin/src/AbstractVisitor.ts +++ b/incremental/compiler-plugin/src/AbstractVisitor.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from 'typescript'; +import * as ts from '@koalaui/memo-tsc'; export abstract class AbstractVisitor { constructor( diff --git a/incremental/compiler-plugin/src/MemoArgumentDetector.ts b/incremental/compiler-plugin/src/MemoArgumentDetector.ts index 8f35a3021..9c8a2eaf2 100644 --- a/incremental/compiler-plugin/src/MemoArgumentDetector.ts +++ b/incremental/compiler-plugin/src/MemoArgumentDetector.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from 'typescript' +import * as ts from '@koalaui/memo-tsc' import { Rewrite } from './transformation-context'; import { AbstractVisitor } from './AbstractVisitor' import { FunctionKind, isAnyMemoKind } from './util'; diff --git a/incremental/compiler-plugin/src/ScopedVisitor.ts b/incremental/compiler-plugin/src/ScopedVisitor.ts index 5df96aff6..e704bea75 100644 --- a/incremental/compiler-plugin/src/ScopedVisitor.ts +++ b/incremental/compiler-plugin/src/ScopedVisitor.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from 'typescript'; +import * as ts from '@koalaui/memo-tsc'; import { AbstractVisitor } from "./AbstractVisitor" import { FunctionKind, isAnyMemoKind, isMemoKind } from "./util" diff --git a/incremental/compiler-plugin/src/analysis-visitor.ts b/incremental/compiler-plugin/src/analysis-visitor.ts index f8d75d9a9..f4ebdb1c5 100644 --- a/incremental/compiler-plugin/src/analysis-visitor.ts +++ b/incremental/compiler-plugin/src/analysis-visitor.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from 'typescript'; +import * as ts from '@koalaui/memo-tsc'; import { AbstractVisitor } from "./AbstractVisitor" import { Rewrite } from './transformation-context'; import { diff --git a/incremental/compiler-plugin/src/diagnostics-visitor.ts b/incremental/compiler-plugin/src/diagnostics-visitor.ts index 10d1f943c..770b12473 100644 --- a/incremental/compiler-plugin/src/diagnostics-visitor.ts +++ b/incremental/compiler-plugin/src/diagnostics-visitor.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from 'typescript'; +import * as ts from '@koalaui/memo-tsc'; import { MemoArgumentDetector } from './MemoArgumentDetector'; import { ScopedVisitor } from './ScopedVisitor'; import { Rewrite } from './transformation-context'; diff --git a/incremental/compiler-plugin/src/dump-visitor.ts b/incremental/compiler-plugin/src/dump-visitor.ts index 4aafe2278..1d4b82247 100644 --- a/incremental/compiler-plugin/src/dump-visitor.ts +++ b/incremental/compiler-plugin/src/dump-visitor.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from "typescript" +import * as ts from "@koalaui/memo-tsc" import { AbstractVisitor } from "./AbstractVisitor"; import { FunctionKind, FunctionTable, isAnyMemoKind, isFunctionOrMethod, Tracer } from "./util"; diff --git a/incremental/compiler-plugin/src/function-transformer.ts b/incremental/compiler-plugin/src/function-transformer.ts index 711fa2838..75bf20cc1 100644 --- a/incremental/compiler-plugin/src/function-transformer.ts +++ b/incremental/compiler-plugin/src/function-transformer.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from 'typescript'; +import * as ts from '@koalaui/memo-tsc'; import { AbstractVisitor } from "./AbstractVisitor" import { Rewrite } from './transformation-context'; import { diff --git a/incremental/compiler-plugin/src/import-export.ts b/incremental/compiler-plugin/src/import-export.ts index 6ead61791..a5a1a08b1 100644 --- a/incremental/compiler-plugin/src/import-export.ts +++ b/incremental/compiler-plugin/src/import-export.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from 'typescript'; +import * as ts from '@koalaui/memo-tsc'; import { arrayAt, error, diff --git a/incremental/compiler-plugin/src/koala-transformer.ts b/incremental/compiler-plugin/src/koala-transformer.ts index 70252c974..41b54064a 100644 --- a/incremental/compiler-plugin/src/koala-transformer.ts +++ b/incremental/compiler-plugin/src/koala-transformer.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from 'typescript'; +import * as ts from '@koalaui/memo-tsc'; import * as path from "path" import { AnalysisVisitor } from './analysis-visitor'; import { DiagnosticsVisitor } from './diagnostics-visitor'; diff --git a/incremental/compiler-plugin/src/parameter-transformer.ts b/incremental/compiler-plugin/src/parameter-transformer.ts index 6bc8bf28c..e2e0d7a12 100644 --- a/incremental/compiler-plugin/src/parameter-transformer.ts +++ b/incremental/compiler-plugin/src/parameter-transformer.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from 'typescript'; +import * as ts from '@koalaui/memo-tsc'; import { ScopedVisitor } from './ScopedVisitor'; import { FunctionKind, diff --git a/incremental/compiler-plugin/src/return-transformer.ts b/incremental/compiler-plugin/src/return-transformer.ts index b8cf1933d..1e638aa74 100644 --- a/incremental/compiler-plugin/src/return-transformer.ts +++ b/incremental/compiler-plugin/src/return-transformer.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from 'typescript'; +import * as ts from '@koalaui/memo-tsc'; import { ScopedVisitor } from "./ScopedVisitor" import { FunctionKind, isFunctionOrMethod, isMemoKind, isVoidOrNotSpecified, runtimeIdentifier, RuntimeNames } from './util' diff --git a/incremental/compiler-plugin/src/this-transformer.ts b/incremental/compiler-plugin/src/this-transformer.ts index d76876859..8e8bedc71 100644 --- a/incremental/compiler-plugin/src/this-transformer.ts +++ b/incremental/compiler-plugin/src/this-transformer.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from 'typescript'; +import * as ts from '@koalaui/memo-tsc'; import { ScopedVisitor } from './ScopedVisitor'; import { FunctionKind, diff --git a/incremental/compiler-plugin/src/transformation-context.ts b/incremental/compiler-plugin/src/transformation-context.ts index 73c7ae48b..792c5c157 100644 --- a/incremental/compiler-plugin/src/transformation-context.ts +++ b/incremental/compiler-plugin/src/transformation-context.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from "typescript" +import * as ts from "@koalaui/memo-tsc" import { CallTable, EntryTable, FunctionKind, FunctionTable, PositionalIdTracker, TransformerOptions, VariableTable } from "./util" export class Rewrite { diff --git a/incremental/compiler-plugin/src/util.ts b/incremental/compiler-plugin/src/util.ts index 88d57bbd8..e71c7b2e2 100644 --- a/incremental/compiler-plugin/src/util.ts +++ b/incremental/compiler-plugin/src/util.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from 'typescript'; +import * as ts from '@koalaui/memo-tsc'; import * as fs from "fs" import { UniqueId } from "@koalaui/common" import { Rewrite } from './transformation-context'; diff --git a/incremental/compiler-plugin/src/variable-type-transformer.ts b/incremental/compiler-plugin/src/variable-type-transformer.ts index c2541b2e5..705bc5beb 100644 --- a/incremental/compiler-plugin/src/variable-type-transformer.ts +++ b/incremental/compiler-plugin/src/variable-type-transformer.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as ts from "typescript" +import * as ts from "@koalaui/memo-tsc" import { AbstractVisitor } from "./AbstractVisitor"; import { Rewrite } from "./transformation-context"; import { asString, createContextTypeImport, FunctionKind, hiddenParameters, skipParenthesizedType, Tracer } from "./util"; -- Gitee