From abff6336abd48b877bae3022d691e843a204654b Mon Sep 17 00:00:00 2001 From: Xc Date: Tue, 15 Aug 2023 20:38:47 +0800 Subject: [PATCH] =?UTF-8?q?make:locales=E7=9A=84=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/build.js | 2 +- lib/makeLocale.d.ts | 2 +- lib/makeLocale.js | 2 +- scripts/make-locale.js | 1 + src/build.ts | 2 +- src/makeLocale.ts | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/build.js b/lib/build.js index 99c1108..d2f62ed 100644 --- a/lib/build.js +++ b/lib/build.js @@ -10,7 +10,7 @@ async function build(cmd) { return; } // 先makeLocale - (0, makeLocale_1.default)(); + (0, makeLocale_1.default)('', true); //ts类型检查 waring 还是error, //主要web受影响,error级别的话 控制台和网页都报错,warning级别的话 控制台报错 const TSC_COMPILE_ON_ERROR = cmd.check !== 'error'; diff --git a/lib/makeLocale.d.ts b/lib/makeLocale.d.ts index b5203dc..df5e8a6 100644 --- a/lib/makeLocale.d.ts +++ b/lib/makeLocale.d.ts @@ -1 +1 @@ -export default function make(watch?: boolean): Promise; +export default function make(cmd: any, watch?: boolean): Promise; diff --git a/lib/makeLocale.js b/lib/makeLocale.js index e3048b8..2e8956d 100644 --- a/lib/makeLocale.js +++ b/lib/makeLocale.js @@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const tip_style_1 = require("./tip-style"); const cross_spawn_1 = tslib_1.__importDefault(require("cross-spawn")); -async function make(watch) { +async function make(cmd, watch) { (0, tip_style_1.Success)(`${(0, tip_style_1.success)(`make locales`)}`); // ts-node scripts/build-app-domain & npm link ./app-domain const args = [require.resolve('../scripts/' + 'make-locale.js')]; diff --git a/scripts/make-locale.js b/scripts/make-locale.js index 516f210..4b0abd0 100644 --- a/scripts/make-locale.js +++ b/scripts/make-locale.js @@ -1,4 +1,5 @@ const watch = process.argv[2]; const LocaleBuilder = require('oak-domain/lib/compiler/localeBuilder').default; const builder = new LocaleBuilder(false); + builder.build(!!watch); \ No newline at end of file diff --git a/src/build.ts b/src/build.ts index 07e8f87..28f5668 100644 --- a/src/build.ts +++ b/src/build.ts @@ -20,7 +20,7 @@ export default async function build(cmd: any) { return; } // 先makeLocale - makeLocale(); + makeLocale('', true); //ts类型检查 waring 还是error, //主要web受影响,error级别的话 控制台和网页都报错,warning级别的话 控制台报错 const TSC_COMPILE_ON_ERROR = cmd.check !== 'error'; diff --git a/src/makeLocale.ts b/src/makeLocale.ts index 859065f..9c3f71b 100644 --- a/src/makeLocale.ts +++ b/src/makeLocale.ts @@ -9,7 +9,7 @@ import { } from './tip-style'; import spawn from 'cross-spawn'; -export default async function make(watch?: boolean) { +export default async function make(cmd: any, watch?: boolean) { Success(`${success(`make locales`)}`); // ts-node scripts/build-app-domain & npm link ./app-domain const args = [require.resolve('../scripts/' + 'make-locale.js')];