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

feat: make plugin generator 3PP friendly #104

Merged
merged 7 commits into from
Aug 30, 2022
Merged

Conversation

mdonnalley
Copy link
Collaborator

What does this PR do?

Makes plugin generator 3PP friendly:

What issues does this PR fix or reference?

@W-11653212@
@W-11652178@

@mdonnalley mdonnalley self-assigned this Aug 25, 2022
@cristiand391
Copy link
Member

cristiand391 commented Aug 29, 2022

QA notes:

if building for a 3PP (not internal):
✅ plugin name isn't required to start with plugin-
✅ no git2gus/github, schema-related code
✅ can publish to verdaccio and install it with sf
✅ 3pp friendly circle config (no references to internal Circle context/env vars)

if building a 2PP (internal):

✅ enforces name to start with plugin-
✅ git2gus/github, schema-related code/config exists
✅ json schemas are generated

⚠️ for 3PP plugin, the files key in the pjson references the schemas folder, I tried publishing the plugin to verdaccio and didn't get a warning so not blocking but could be removed.
⚠️ what does internal mean in this context (people new to sf/sfdx plugins)? Should this be Salesforce internal team?
Screen Shot 2022-08-29 at 12 33 14

❌ for both cases git hooks don't work.
dev-scripts generates the husky folder and hooks but needs to run husky install to initialize it, when the plugin is created and the generator runs yarn install it makes dev-scripts bump engines.node and swallows dev-script output (it asks to run yarn install again after a modification, this one would initialize husky). PR: salesforcecli/plugin-template-sf#149

@cristiand391
Copy link
Member

cristiand391 commented Aug 29, 2022

⚠️ for 3PP plugin, the files key in the pjson references the schemas folder, I tried publishing the plugin to verdaccio and didn't get a warning so not blocking but could be removed.
⚠️ what does internal mean in this context (people new to sf/sfdx plugins)? Should this be Salesforce internal team?
❌ for both cases git hooks don't work.

fixed ✅

oclif.topics is updated when adding a new command (`sf dev generate command --name 'walter:white')

yarn lint fails when a NUT was generated:

  28:11  error  Unsafe assignment of an `any` value             @typescript-eslint/no-unsafe-assignment
  28:20  error  Unsafe member access .stdout on an `any` value  @typescript-eslint/no-unsafe-member-access

I removed @types/shelljs here: salesforcecli/plugin-template-sf#149
the plugin shouldn't have to specify the shelljs types in its pjson anyway, this should fix it: salesforcecli/cli-plugins-testkit#274
fixed in the template ✅

❌ nyc doesn't pick up settings in .nycrc, seems it's a valid json but not for nyc.
Whatever code coverage threshold I choose, nyc always pass.

✅ generated a 3PP plugin, selected 100% code cov and generated a new command (no UT), nyc throws error about new command code with no tests.

⚠️ default nyc config (from dev-config) doesn't work, nyc always pass.
this is a known issue with dev-config.

@cristiand391 cristiand391 merged commit 301a36b into main Aug 30, 2022
@cristiand391 cristiand391 deleted the mdonnalley/3pp-friendly branch August 30, 2022 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants