@dojo/cli-create-widget
Advanced tools
Comparing version 5.0.0 to 6.0.0-rc.1
{ | ||
"name": "@dojo/cli-create-widget", | ||
"version": "5.0.0", | ||
"version": "6.0.0-rc.1", | ||
"description": "Command to scaffold a new widget", | ||
@@ -20,3 +20,3 @@ "homepage": "https://dojo.io", | ||
"devDependencies": { | ||
"@dojo/cli": "^5.0.0", | ||
"@dojo/cli": "6.0.0-rc.1", | ||
"@dojo/scripts": "~3.1.0", | ||
@@ -23,0 +23,0 @@ "@dojo/loader": "^2.0.0", |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function default_1(options) { | ||
options('n', { | ||
alias: 'name', | ||
options('name', { | ||
alias: 'n', | ||
demand: true, | ||
@@ -11,4 +11,4 @@ describe: 'The name of your widget', | ||
}); | ||
options('s', { | ||
alias: 'styles', | ||
options('styles', { | ||
alias: 's', | ||
defaultDescription: '<component_folder>/styles', | ||
@@ -19,4 +19,4 @@ demand: false, | ||
}); | ||
options('t', { | ||
alias: 'tests', | ||
options('tests', { | ||
alias: 't', | ||
defaultDescription: '<component_folder>/tests', | ||
@@ -27,7 +27,7 @@ demand: false, | ||
}); | ||
options('c', { | ||
alias: 'component', | ||
options('class', { | ||
alias: 'c', | ||
default: false, | ||
demand: false, | ||
describe: 'Generate a Custom Element wrapper for your widget', | ||
describe: 'Scaffolds a class-based widget (defaults: function-based)', | ||
type: 'boolean' | ||
@@ -34,0 +34,0 @@ }); |
14
run.js
@@ -10,17 +10,22 @@ "use strict"; | ||
function getRenderFilesConfig(args, folderName, styleRoot, testRoot) { | ||
let module = 'FunctionComponent'; | ||
if (args.class) { | ||
module = 'ClassComponent'; | ||
} | ||
module = args.tsx ? `${module}.tsx` : `${module}.ts`; | ||
return [ | ||
{ | ||
src: path_1.join(packagePath, 'templates', 'Component.ts'), | ||
src: path_1.join(packagePath, 'templates', module), | ||
dest: path_1.join(folderName, `${args.name}.ts`) | ||
}, | ||
{ | ||
src: path_1.join(packagePath, 'templates', 'styles/component.m.css'), | ||
src: path_1.join(packagePath, 'templates', 'styles', 'Component.m.css'), | ||
dest: path_1.join(styleRoot, `${folderName}.m.css`) | ||
}, | ||
{ | ||
src: path_1.join(packagePath, 'templates', 'styles/component.m.css.d.ts'), | ||
src: path_1.join(packagePath, 'templates', 'styles', 'Component.m.css.d.ts'), | ||
dest: path_1.join(styleRoot, `${folderName}.m.css.d.ts`) | ||
}, | ||
{ | ||
src: path_1.join(packagePath, 'templates', 'tests/unit/Component.ts'), | ||
src: path_1.join(packagePath, 'templates', 'tests', 'unit', module), | ||
dest: path_1.join(testRoot, `${args.name}.ts`) | ||
@@ -49,3 +54,2 @@ } | ||
folderName, | ||
includeCustomElement: args.component, | ||
componentStylePath: path_1.posix.relative(folderName, `${styleRoot}/${folderName}.m.css`), | ||
@@ -52,0 +56,0 @@ testStylePath: path_1.posix.relative(testRoot, `${styleRoot}/${folderName}.m.css`), |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17805
14
156
1
1