Skip to content
Open
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: 1 addition & 0 deletions packages/ai/package-scripts.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const options = {
portStep: 2,
aiPackage: true,
noWatchTS: true,
standalone: false,
cssVariablesTarget: "host",
dev: true,
internal: {
Expand Down
1 change: 1 addition & 0 deletions packages/compat/package-scripts.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const options = {
portStep: 2,
compatPackage: true,
noWatchTS: true,
standalone: false,
cssVariablesTarget: "host",
dev: true,
internal: {
Expand Down
1 change: 1 addition & 0 deletions packages/create-package/template/package-scripts.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const getScripts = require("@ui5/webcomponents-tools/components-package/nps.js")

const options = {
port: 8080,
standalone: false,
};

const scripts = getScripts(options);
Expand Down
1 change: 1 addition & 0 deletions packages/fiori/package-scripts.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const options = {
dev: true,
fioriPackage: true,
noWatchTS: true,
standalone: false,
internal: {
cypress_code_coverage: false,
},
Expand Down
1 change: 1 addition & 0 deletions packages/main/package-scripts.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const options = {
portStep: 2,
noWatchTS: true,
dev: true,
standalone: false,
cssVariablesTarget: "host",
internal: {
cypress_code_coverage: false,
Expand Down
16 changes: 14 additions & 2 deletions packages/tools/components-package/nps.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const getScripts = (options) => {
createIllustrationsLoadersScript[`generate-${illustrations.set}-${illustrations.collection}`] = `ui5nps-script ${LIB}generate-js-imports/illustrations.js ${illustrations.path} ${illustrations.dynamicImports.outputFile} ${illustrations.set} ${illustrations.collection} ${illustrations.dynamicImports.location} ${illustrations.dynamicImports.filterOut.join(",")}`
});


const standalone = options.standalone ?? true;
const tsOption = !!(!options.legacy || options.jsx);
const tsCommandOld = tsOption ? "tsc" : "";
let tsWatchCommandStandalone = tsOption ? "tsc --watch" : "";
Expand Down Expand Up @@ -66,6 +66,17 @@ const getScripts = (options) => {
viteConfig = `-c "${require.resolve("@ui5/webcomponents-tools/components-package/vite.config.js")}"`;
}


const getPrepareDefault = () => {
let result = `ui5nps clean prepare.all copy copyProps prepare.typescript`

if (standalone) {
result = `${result} generateAPI`;
}

return result;
}

const scripts = {
__ui5envs: {
UI5_CEM_MODE: typeof options.dev === "boolean" ? (options.dev ? "dev" : undefined) : options.dev,
Expand All @@ -86,7 +97,7 @@ const getScripts = (options) => {
styleRelated: "ui5nps build.styles build.jsonImports build.jsImports",
},
prepare: {
default: `ui5nps clean prepare.all copy copyProps prepare.typescript`,
default: getPrepareDefault(),
all: `ui5nps-p build.templates build.i18n prepare.styleRelated build.illustrations`, // concurently
styleRelated: "ui5nps build.styles build.jsonImports build.jsImports",
typescript: tsCommandOld,
Expand Down Expand Up @@ -165,6 +176,7 @@ const getScripts = (options) => {
bundle: `ui5nps-script ${LIB}dev-server/dev-server.mjs ${viteConfig}`,
},
generateAPI: {
"default": tsOption ? "ui5nps generateAPI.generateCEM generateAPI.validateCEM generateAPI.mergeCEM" : "",
generateCEM: `ui5nps-script "${LIB}cem/cem.js" analyze --config "${LIB}cem/custom-elements-manifest.config.mjs"`,
validateCEM: `ui5nps-script "${LIB}cem/validate.js"`,
mergeCEM: `ui5nps-script "${LIB}cem/merge.mjs"`,
Expand Down
Loading