Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dojo/cli-create-widget

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dojo/cli-create-widget - npm Package Compare versions

Comparing version 5.0.0 to 6.0.0-rc.1

templates/ClassComponent.ts

4

package.json
{
"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 @@ });

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc