Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(generator): add lockfile and fix styling issues #18073

Merged
merged 3 commits into from
Jan 18, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion docs/src/pages/docs/Contributing/creating-viz-plugins.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ $ yo @superset-ui/superset
To build the viz plugin, run the following commands:

```
npm i --force
npm ci
npm run build
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,24 @@ module.exports = class extends Generator {
type: 'input',
name: 'packageName',
message: 'Package name:',
// Default to current folder name
// superset-plugin-chart-hello-world
default: _.kebabCase(this.appname),
},
{
type: 'input',
name: 'pluginName',
message: 'Plugin name:',
// Hello World
default: _.startCase(
_.camelCase(this.appname.replace('superset plugin chart', '').trim()),
),
},
{
type: 'input',
name: 'description',
message: 'Description:',
// Default to current folder name
default: _.upperFirst(
_.startCase(this.appname.replace('superset plugin chart', '').trim()),
),
default: _.upperFirst(_.startCase(this.appname)),
},
{
type: 'list',
Expand All @@ -62,23 +69,20 @@ module.exports = class extends Generator {
}

writing() {
// 'hello-world' -> 'HelloWorld'
// SupersetPluginChartHelloWorld
const packageLabel = _.upperFirst(_.camelCase(this.answers.packageName));

// 'hello-world' -> 'Hello World'
const pluginName = _.startCase(_.camelCase(this.answers.packageName));

const params = {
...this.answers,
packageLabel,
pluginName,
};

[
['gitignore.erb', '.gitignore'],
['babel.config.erb', 'babel.config.js'],
['jest.config.erb', 'jest.config.js'],
['package.erb', 'package.json'],
['package-lock.erb', 'package-lock.json'],
['README.erb', 'README.md'],
['tsconfig.json', 'tsconfig.json'],
['src/index.erb', 'src/index.ts'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This is the <%= description %> Superset Chart Plugin.
To build the plugin, run the following commands:

```
npm i --force
npm ci
npm run build
```

Expand Down
Loading