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: add cem analyzer #50

Merged
merged 9 commits into from
Aug 18, 2021
Merged

feat: add cem analyzer #50

merged 9 commits into from
Aug 18, 2021

Conversation

bennypowers
Copy link
Member

@bennypowers bennypowers commented Aug 17, 2021

closes #48

What I did

  1. add cem/a as a devdependency in common
  2. add analyze script in common
  3. add customElements package.json key in common
  4. add custom-elements.json to gitignore in common
  5. add analyze to build and publish steps in various packages
  6. add scriptRunCommand to all templates
  7. analyze the generated package after installing deps
  8. add test
  9. require node >= 14
  10. add --help switch
  11. remove "extends" docs from README (see docs: add "extending" docs to generator page open-wc#2270)
  12. add args table to README

TODO

  • tests

--help output

        _.,,,,,,,,,._
     .d''           ``b.       Open Web Components Recommendations
   .p'      Open       `q.
 .d'    Web Components  `b.    Start or upgrade your web component project with
 .d'                     `b.   ease. All our recommendations at your fingertips.
 ::   .................   ::
 `p.                     .q'
  `p.    open-wc.org    .q'
   `b.     @openWc     .d'
     `q..            ..,'      See more details at https://open-wc.org/init/
        '',,,,,,,,,,''



Usage

  $ npm init @open-wc [<options>]

Options

  --destinationPath path                        The path the generator will write files to
  --type scaffold|upgrade                       Choose scaffold to create a new project or upgrade to add features to an
                                                existing project
  --scaffoldType wc|app                         The type of project to scaffold. wc for a single published component, app for
                                                an application
  --features linting|testing|demoing|building   Which features to include. linting, testing, demoing, or building
  --typescript true|false                       Whether to use TypeScript in your project
  --tagName string                              The tag name for the web component or app shell element
  --installDependencies yarn|npm|false          Whether to install dependencies. Choose npm or yarn to install with those
                                                package managers, or false to skip installation
  --writeToDisk true|false                      Whether or not to actually write the files to disk
  --help                                        This help message

Questions

  • should the step which analyzes the package after install happen in every case (e.g. via npx)? even if not installing?
  • under this pr, analyzer is not optional, everyone always gets it. cool?

@bennypowers bennypowers marked this pull request as ready for review August 17, 2021 14:34
@bennypowers
Copy link
Member Author

@thepassle fails in node 12 b/c of optional chaining in cem/a
so either we bump requirements to 14 or build/refactor cem/a, right?

@thepassle
Copy link
Member

Is there any particular reason why we use node 12? I think we can just upgrade right?

Im really averse to adding a build step to cem/a

@bennypowers
Copy link
Member Author

upgrading means requiring users to be on node 14

this allows us to use the analyzer without a build
Also removes "extending" docs from README (see open-wc/open-wc#2270)
@bennypowers
Copy link
Member Author

bennypowers commented Aug 18, 2021

⚠️ ⚠️ ⚠️ WARNING ⚠️ ⚠️ ⚠️ : either don't squash, or make sure the merge commit is a feat!:

@bennypowers bennypowers merged commit e7f138c into master Aug 18, 2021
@bennypowers bennypowers deleted the feat/analyzer branch August 18, 2021 11:54
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.

[feat]: add custom-elements-manifest analyzer
2 participants