Skip to content

Commit 89fa5ca

Browse files
authored
fix(build): fix issue with legacy dev setup (#12706)
- Not supported syntax: `'ui5nps "copy.src --watch --safe --skip-initial-copy"'` into two steps: ```sh 'ui5nps copySrcWithWatch' copySrcWithWatch: `ui5nps-script "${LIB}copy-and-watch/index.js" --silent "src/**/*.{js,json}" dist/ --watch --safe --skip-initial-copy` ``` - Allow creation of json asset for non-supported language or language script, but log a warning to inform component devs (some library creators could handle such scenarios on their own).
1 parent 94bae79 commit 89fa5ca

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/tools/components-package/nps.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ const getScripts = (options) => {
129129
},
130130
copyProps: `ui5nps-script "${LIB}copy-and-watch/index.js" --silent "src/i18n/*.properties" dist/`,
131131
copyPropsWithWatch: `ui5nps-script "${LIB}copy-and-watch/index.js" --silent "src/i18n/*.properties" dist/ --watch --safe --skip-initial-copy`,
132+
copySrcWithWatch: `ui5nps-script "${LIB}copy-and-watch/index.js" --silent "src/**/*.{js,json}" dist/ --watch --safe --skip-initial-copy`,
132133
copy: {
133134
default: options.legacy ? "ui5nps copy.src copy.props" : "",
134135
src: options.legacy ? `ui5nps-script "${LIB}copy-and-watch/index.js" --silent "src/**/*.{js,json}" dist/` : "",
@@ -137,7 +138,7 @@ const getScripts = (options) => {
137138
watch: {
138139
default: `ui5nps-p watch.templates watch.typescript watch.src watch.styles watch.i18n watch.props`, // concurently
139140
devServer: 'ui5nps-p watch.default watch.bundle', // concurently
140-
src: options.legacy ? 'ui5nps "copy.src --watch --safe --skip-initial-copy"' : "",
141+
src: options.legacy ? 'ui5nps copySrcWithWatch' : "",
141142
typescript: tsWatchCommandStandalone,
142143
props: 'ui5nps copyPropsWithWatch',
143144
bundle: `ui5nps-script ${LIB}dev-server/dev-server.mjs ${viteConfig}`,

packages/tools/lib/i18n/toJSON.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ const convertToJSON = async (file, distPath) => {
1919
const filename = path.basename(file, path.extname(file));
2020
const language = filename.match(/^messagebundle_(.*?)$/)[1];
2121
if (!allLanguages.includes(language)) {
22-
console.log("Not supported language: ", language);
23-
return;
22+
console.warn("Not supported language or script: ", language);
2423
}
2524
const outputFile = path.normalize(`${distPath}/${filename}.json`);
2625

0 commit comments

Comments
 (0)