Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
example
)
);
}
if (!options.barrel) {
throw new SchematicsException(
missingArgument(
'barrel',
'Provide the name of the workspace barrel where your components live.',
example
)
);
}
if (!options.components) {
throw new SchematicsException(
missingArgument(
'components',
`Provide a comma delimited list of components you'd like to create as custom elements.`,
example
)
);
}
}
return chain([
prerun(options),
(tree: Tree) => {
if (!options.builderModule) {
const workspacePrefix = options.prefix || getPrefix() || '';
const htmlElementList = [];
componentSymbols = [];
// parse component names to standard convention
export default function(options: Schema) {
if (!options.name) {
throw new SchematicsException(
missingArgument(
'name',
'Provide a name for your NativeScript app.',
'nx g @nstudio/nativescript:app name'
)
);
}
// if (options.setupSandbox) {
// // always setup routing with sandbox
// options.routing = true;
// }
return chain([
prerun(options),
// adjust naming convention
XplatHelpers.applyAppNamingConvention(options, 'nativescript'),
// create app files
export default function(options: XplatElectrontHelpers.SchemaApp) {
if (!options.name) {
throw new SchematicsException(
missingArgument(
'name',
'Provide a name for your Electron app.',
'nx g @nstudio/electron-angular:app name'
)
);
}
if (!options.target) {
throw new SchematicsException(
missingArgument(
'target',
'Provide the name of the web app in your workspace to use inside the electron app.',
'nx g @nstudio/electron-angular:app name --target web-myapp'
)
);
}
const packageHandling = [];
if (options.isTesting) {
packageHandling.push(
externalSchematic('@nstudio/electron', 'tools', {
...options
})
);
} else {
// TODO: find a way to unit test schematictask runners with install tasks
export default function(options: Schema) {
if (!options.name) {
throw new SchematicsException(
missingArgument(
'name',
'Provide a name for your app.',
'nx g @nstudio/angular:app my-app'
)
);
}
if (options.useXplat) {
// xplat is configured for sass only (at moment)
options.style = 'scss';
}
return chain([
prerun(options),
// adjust naming convention
XplatHelpers.applyAppNamingConvention(options, 'web'),
// use xplat or not
export default function(options: Schema) {
if (!options.name) {
throw new SchematicsException(
missingArgument(
'name',
'Provide a name for your Ionic app.',
'nx g @nstudio/ionic:app name'
)
);
}
return chain([
prerun(options),
// adjust naming convention
XplatHelpers.applyAppNamingConvention(options, 'ionic'),
// create app files
(tree: Tree, context: SchematicContext) =>
addAppFiles(options, options.name)(tree, context),
// add root package dependencies
XplatIonicHelpers.updateRootDeps(options),
export default function(options: IHelperSchema) {
if (!options.name) {
throw new SchematicsException(
missingArgument(
'name',
'Provide the name of the helper to generate.',
'ng g @nstudio/angular:helpers applitools --target=web-myapp'
)
);
}
const helperChain = [];
const helpers = options.name.split(',');
for (const helper of helpers) {
if (supportedHelpers[helper]) {
buildHelperChain(helper, options, supportedHelpers[helper], helperChain);
} else {
helperChain.push(noop());
}
export default function(options: ElementsOptions) {
if (!options.builderModule) {
const example = `nx g @nstudio/angular:elements menu --barrel=@mycompany/ui --components=menu,footer`;
if (!options.name) {
throw new SchematicsException(
missingArgument(
'name',
'Provide a name for the custom element module.',
example
)
);
}
if (!options.barrel) {
throw new SchematicsException(
missingArgument(
'barrel',
'Provide the name of the workspace barrel where your components live.',
example
)
);
}
if (!options.components) {
throw new SchematicsException(
missingArgument(
'components',
`Provide a comma delimited list of components you'd like to create as custom elements.`,
example
)
);
}
}
export default function(options: XplatElectrontHelpers.SchemaApp) {
if (!options.name) {
throw new SchematicsException(
missingArgument(
'name',
'Provide a name for your Electron app.',
'nx g @nstudio/electron:app name'
)
);
}
if (!options.target) {
throw new SchematicsException(
`Missing target argument. Provide the name of the web app in your workspace to use inside the electron app. ie, web-myapp`
);
}
const packageHandling = [];
if (options.isTesting) {
packageHandling.push(
externalSchematic('@nstudio/electron', 'tools', {
export default function(options: XplatElectrontHelpers.SchemaApp) {
if (!options.name) {
throw new SchematicsException(
missingArgument(
'name',
'Provide a name for your Electron app.',
'nx g @nstudio/electron-angular:app name'
)
);
}
if (!options.target) {
throw new SchematicsException(
missingArgument(
'target',
'Provide the name of the web app in your workspace to use inside the electron app.',
'nx g @nstudio/electron-angular:app name --target web-myapp'
)
);
}
export default function(options: ElementsOptions) {
if (!options.builderModule) {
const example = `nx g @nstudio/angular:elements menu --barrel=@mycompany/ui --components=menu,footer`;
if (!options.name) {
throw new SchematicsException(
missingArgument(
'name',
'Provide a name for the custom element module.',
example
)
);
}
if (!options.barrel) {
throw new SchematicsException(
missingArgument(
'barrel',
'Provide the name of the workspace barrel where your components live.',
example
)
);
}
if (!options.components) {