Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let testDefault = scripts[`test`];
if (testDefault) {
// prefix it
scripts[`test`] = `${postinstallWeb} && ${testDefault}`;
} else {
scripts[`test`] = `${postinstallWeb} && nx test`;
}
let e2eDefault = scripts[`e2e`];
if (e2eDefault) {
// prefix it
scripts[`e2e`] = `${postinstallWeb} && ${e2eDefault}`;
} else {
scripts[`e2e`] = `${postinstallWeb} && nx e2e`;
}
return updatePackageScripts(tree, scripts);
};
}
(tree: Tree) => {
if (options.builderModule) {
return noop();
} else {
const scripts = {};
scripts[
`build.web.elements`
] = `ng build web-elements --prod --output-hashing=none --single-bundle=true --keep-polyfills=true`;
scripts[`preview.web.elements`] = `http-server dist/ngelements`;
return updatePackageScripts(tree, scripts);
}
},
(tree: Tree, context: SchematicContext) => {
scripts[
`clean`
] = `npx rimraf -- hooks node_modules package-lock.json && npm i`;
scripts[
`start.${platformApp}.ios`
] = `cd apps/${directory}${options.name} && tns run ios --emulator`;
scripts[
`start.${platformApp}.android`
] = `cd apps/${directory}${options.name} && tns run android --emulator`;
scripts[
`start.${platformApp}.preview`
] = `cd apps/${directory}${options.name} && tns preview`;
scripts[
`clean.${platformApp}`
] = `cd apps/${directory}${options.name} && npx rimraf -- hooks node_modules platforms package-lock.json && npm i && npx rimraf -- package-lock.json`;
return updatePackageScripts(tree, scripts);
},
(tree: Tree, context: SchematicContext) => {
scripts[
`prepare.${platformApp}.android`
] = `npm run prepare.${platformApp} && cd apps/${directory}${options.name} && npm run cap.add.android`;
scripts[
`open.${platformApp}.ios`
] = `cd apps/${directory}${options.name} && npm run cap.ios`;
scripts[
`open.${platformApp}.android`
] = `cd apps/${directory}${options.name} && npm run cap.android`;
scripts[
`sync.${platformApp}`
] = `cd apps/${directory}${options.name} && npm run cap.copy`;
scripts[
`clean.${platformApp}`
] = `cd apps/${directory}${options.name} && npx rimraf -- hooks node_modules platforms www plugins ios android package-lock.json && npm i && rimraf -- package-lock.json`;
return updatePackageScripts(tree, scripts);
},
(tree: Tree, context: SchematicContext) => {
(tree: Tree) => {
const platformApp = options.name.replace('-', '.');
const scripts = {};
scripts[
`clean`
] = `npx rimraf hooks node_modules package-lock.json && npm i`;
scripts[`start.${platformApp}`] = `nx serve ${options.name}`;
return updatePackageScripts(tree, scripts);
},
formatFiles({ skipFormat: options.skipFormat })
scripts[
`clean`
] = `npx rimraf -- hooks node_modules package-lock.json && npm i`;
scripts[
`start.${platformApp}.ios`
] = `cd apps/${directory}${options.name} && tns run ios --emulator`;
scripts[
`start.${platformApp}.android`
] = `cd apps/${directory}${options.name} && tns run android --emulator`;
scripts[
`start.${platformApp}.preview`
] = `cd apps/${directory}${options.name} && tns preview`;
scripts[
`clean.${platformApp}`
] = `cd apps/${directory}${options.name} && npx rimraf -- hooks node_modules platforms package-lock.json && npm i && npx rimraf -- package-lock.json`;
return updatePackageScripts(tree, scripts);
},
(tree: Tree, context: SchematicContext) => {