Giter VIP home page Giter VIP logo

create's Introduction

Open-wc Logo

Open Web Component Recommendations

Open Web Components provides a set of defaults, recommendations and tools to help facilitate your web component project. Our recommendations include: developing, linting, testing, building, tooling, demoing, publishing and automating.

Usage

# in a new or existing folder:
npm init @open-wc
# requires node 10 & npm 6 or higher

This will kickstart a menu guiding you through all available actions.

$ npm init @open-wc
npx: installed 30 in 1.762s

        _.,,,,,,,,,._
     .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'   See more details at https://open-wc.org/init/
  `p.    open-wc.org    .q'
   `b.     @openWc     .d'
     `q..            ..,'      Note: you can exit any time with Ctrl+C or Esc
        '',,,,,,,,,,''


? What would you like to do today? › - Use arrow-keys. Return to submit.
❯   Scaffold a new project
    Upgrade an existing project

Homepage

For more details please visit us at open-wc.org.

Packages

Package Version Description
building-rollup building-rollup Default configuration for working with rollup.
create create Scaffold web components following open-wc recommendations.
demoing-storybook demoing-storybook Storybook configuration following open-wc recommendations.
eslint-config eslint-config Eslint configuration following open-wc recommendations.
es-dev-server es-dev-server Development server for modern web apps.
polyfills-loader polyfills-loader Load web component polyfills using dynamic imports.
scoped-elements scoped-elements Auto define custom elements to scope them and avoid the name collision.
semantic-dom-diff semantic-dom-diff To compare dom and shadow dom trees. Part of open-wc recommendations.
testing testing Testing following open-wc recommendations.
testing-helpers testing-helpers Testing Helpers following open-wc recommendations.
testing-karma testing-karma Testing with Karma following open-wc recommendations.
testing-karma-bs testing-karma-bs Testing with Karma using Browserstack following open-wc recommendations.
testing-wallaby testing-wallaby Testing with wallaby following open-wc recommendations.

Contact

Feel free to reach out to us on 𝕏 (Twitter) or create a github issue for any feedback or questions you might have.

You can also find us on the Lit & Friends slack in the #open-wc channel.

You can join the Lit & Friends slack by visiting https://lit.dev/slack-invite/.

Sponsored by

Chrome's Web Framework & Tools Performance Fund Logo Divriots Logo

Supported by

Browserstack Logo netlify logo

Guide

# bootstrap/setup
npm install

# linting
npm run lint

# local testing
npm run test

# testing via browserstack
npm run test:bs

# run commands only for a specific scope
lerna run <command> --scope @open-wc/<package-name> --stream

create's People

Contributors

bennypowers avatar btopro avatar dakmor avatar jlengrand avatar jorenbroekema avatar larsdenbakker avatar movrack avatar mservaising avatar renovate-bot avatar renovate[bot] avatar stephenwade avatar thepassle avatar vikerman avatar web-padawan avatar westbrook avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

create's Issues

Storybook Does Not Work Out of the Box

After initializing a new component with the following options:

  • Scaffold a new project
  • Web Component
  • Linting (eslint & prettier)
  • Testing (web-test-runner)
  • Demoing (storybook)
  • Typescript
  • npm

and running npm run storybook, storybook opens, but shows an error saying:

Couldn't find any stories in your Storybook.

- Please check your stories field of your main.js config.
- Also check the browser console and terminal for error messages.

It's unclear to me what is causing the error, as the glob in .storybook/main.js appears to be correct, and the <component-name>.stories.js files are built in dist.

Link in the initial create process leads to a 404

During the create process the initial screen displays a link which leads to a 404, this one https://open-wc.org/init/
I'm currently busy to fix a typo anyways, so I could change it, but to where should the link point?

Should it link to here: https://open-wc.org/docs/development/generator/ ?

I also see that it (the initial screen with the link) is mentioned in the open-wc repository. Is there a link between them or do they need to be updated separately?

Bundle generator

The generator can take some time to install. We can by faster if we bundling the generator with rollup, so that the user just gets a single package to download and run. Perhaps even slim down on the amount of dependencies as well.

Old litElement HMR preset is referenced by template

Thanks for the brilliant server, test runner & templates - they're a pleasure to use!

I was wondering why HMR wasn't working, so I had just started implementing a base class based on this guide: https://open-wc.org/docs/development/hot-module-replacement/

Then I started thinking "surely someone cleverer than me has already done this" and of course they have - the preset just needed changing from presets.litElement to presets.lit in web-dev-server.config.mjs. Would it be worth updating the template here?

// hmr && hmrPlugin({ exclude: ['**/*/node_modules/**/*'], presets: [presets.litElement] }),

[test]: e2e tests

#36 installs some seemingly useless devDependencies:

    "@open-wc/testing": "^2.5.33",
    "@rollup/plugin-babel": "^5.3.0",
    "@web/rollup-plugin-html": "^1.9.1",
    "@web/rollup-plugin-import-meta-assets": "^1.0.7",

and

    "lit": "^2.0.0-rc.2",

These are here because our integration testing writes actual files to the /create package root, therefore eslint import plugin is able to resolve them in /create/node_modules. This is not ideal. Tests which rely on the scaffolded package's node_modules should run e2e in an isolated temp dir that's not affected by create's node_modules, or in a virtual filesystem where deps are stubbed.

Originally posted by @bennypowers in #36 (comment)

[FEATURE REQUEST] Adding template engine rendering

Hello,

We are extending this project to generate our projects bases on frontend form/backend api to configure the content to be generated.

But to writes templates, actually, we can just replace variables.
It means when we have case like loop (for example rendering a list of components), then we have to write/render "ourself" the looped elements inside a variable and then inject the the variable in the template.
It means that the template just content the variable and hide the loop.
-> not clear
-> template content splitted with variable generation and template.

Expected feature

  • Have template engine
  • (ideally) Have linting plugin for templates files
  • Be able to escape tags. Supposing template engine use ${ }, in my case my projects are in litElement and it also use ${} I wouldn't have clash between parsed ${} and rendered ${}.

I don't know which is the best template engine at the moment in JS but here some of them:

  • Nunjuck
  • EJS
  • Mustashe
  • Handlebars

README should be user-facing

The README has a bunch of code in it that's really only useful for contributors.

Our readme should just be an args table with some explanation, and this stuff should go in CONTRIBUTING.md

Utility of common-repo/templates/static/

Hello,
Which is the utility of common-repo/templates/static/ ?
It generate the following files:

  • .editorconfig
  • licence

Concerning editorconfig, all his job is already made with the configuration of prettier and lint from ´https://github.com/open-wc/create/blob/master/src/generators/linting/templates/package.json´

Concerning license, it is dependent of the project user, here a MIT license file is generated but not every body is using it.

  1. can be MIT or other type of license
  2. What for people doing without (private cases)
    In my case we are doing "private" package for the enterprise and we have to remove that file every time we generate a component.

Can't it be removed, or chosen with an option ?

So to resume, does common-repo is necessary since it is the only 2 files added.

consider using validate-element-name package

#53 came up in some UX testing with a new developer running init but just last week when I had a similar issue I came across a package called validate-element-name - https://www.npmjs.com/package/validate-element-name

This would include valid feedback as to the specific issue in question with what someone enters but what I also noted with it is that they also have additional checks in that I previously have not considered as they are going off the spec -- https://html.spec.whatwg.org/multipage/scripting.html#valid-custom-element-name

This has additional names of elements that are not valid because of conflicts with the name space used elsewhere in the web platform.

If there is interest in adding support for this to match the spec I'd be happy to assign this to a student to work into open-wc this semester.

Possible to remove tsc and use plugins instead?

Hi,

Currently the build step first runs tsc before running through either rollup and webpack. For me, this seems like it could be optimised by using the relevant plugins, i.e. @rollup/plugin-typescript for rollup and ts-loader for webpack.

The current issue i'm trying to workaround is static assets (such as css) not being including in the out-tsc folder, requiring an extra build step. I'm assuming this would workaround that issue?

Linting: git add is no longer needed for Husky

The generator adds the following for lint-staged in the package.json

  "lint-staged": {
    "*.js": [
      "eslint --fix",
      "prettier --write",
      "git add"
    ]
  }

However, git add is no longer needed and produces a warning in the console.

Warning produced:

husky > pre-commit (node v14.15.1)
⚠ Some of your tasks use `git add` command. Please remove it from the config since all modifications made by tasks will be automatically added to the git commit index.

Issue on Github:

lint-staged/lint-staged#775

Error on newly-created project

Hello!

I'm trying to use the tool to init a lit / typescript project, but it fails with different errors. This is the full log:

→ npm init @open-wc

        _.,,,,,,,,,._
     .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/
        '',,,,,,,,,,''


Note: you can exit any time with Ctrl+C or Esc
✔ What would you like to do today? › Scaffold a new project
✔ What would you like to scaffold? › Application
✔ What would you like to add? › Linting (eslint & prettier), Testing (web-test-runner), Demoing (storybook), Building (rollup)
✔ Would you like to use typescript? › Yes
✔ What is the tag name of your app shell element? … un-copy-art

./
├── un-copy-art/
│   ├── .storybook/
│   │   ├── main.js
│   │   └── server.mjs
│   ├── .vscode/
│   │   └── extensions.json
│   ├── assets/
│   │   └── open-wc-logo.svg
│   ├── src/
│   │   └── un-copy-art.ts
│   ├── stories/
│   │   └── un-copy-art.stories.ts
│   ├── test/
│   │   └── un-copy-art.test.ts
│   ├── .editorconfig
│   ├── .gitignore
│   ├── custom-elements.json
│   ├── index.html
│   ├── LICENSE
│   ├── package.json
│   ├── README.md
│   ├── rollup.config.js
│   ├── tsconfig.json
│   ├── web-dev-server.config.mjs
│   └── web-test-runner.config.mjs

✔ Do you want to write this file structure to disk? › Yes
Writing..... done
✔ Do you want to install dependencies? › Yes, with npm

Installing dependencies...
This might take some time...
Using npm to install...
npm: npm
npm:  WARN deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser

npm: npm
npm:  WARN deprecated [email protected]: Please use @jridgewell/sourcemap-codec instead

added 1098 packages, and audited 1099 packages in 2m
254 packages are looking for funding
  run `npm fund` for details
8 high severity vulnerabilities

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

> [email protected] analyze
> cem analyze --litelement
[4:18:37 PM] @custom-elements-manifest/analyzer: Created new manifest.

If you want to rerun this exact same generator you can do so by executing:
npm init @open-wc --destinationPath /home/gfurlan/src/un-copy-art --type scaffold --scaffoldType app --features linting testing demoing building --typescript true --tagName un-copy-art --writeToDisk true --installDependencies npm

You are all set up now!

All you need to do is run:
  cd un-copy-art
  npm run start


# gfurlan at CPX-J9LPJETWYHX in ~/src [16:18:37]
→ cd un-copy-art

# gfurlan at CPX-J9LPJETWYHX in ~/src/un-copy-art [16:33:53]
→ npm run start

> [email protected] start
> tsc && concurrently -k -r "tsc --watch --preserveWatchOutput" "wds"

node_modules/@open-wc/scoped-elements/types/src/ScopedElementsMixin.d.ts:1:53 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("@open-wc/dedupe-mixin")' call instead.

1 export type ScopedElementsMixin = <T extends import("@open-wc/dedupe-mixin").Constructor<import("@lit/reactive-element").ReactiveElement>>(superclass: T) => T & import("@open-wc/dedupe-mixin").Constructor<import("./types").ScopedElementsHost> & typeof import("./types").ScopedElementsHost;
                                                      ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@open-wc/scoped-elements/types/src/ScopedElementsMixin.d.ts:1:97 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("@lit/reactive-element")' call instead.

1 export type ScopedElementsMixin = <T extends import("@open-wc/dedupe-mixin").Constructor<import("@lit/reactive-element").ReactiveElement>>(superclass: T) => T & import("@open-wc/dedupe-mixin").Constructor<import("./types").ScopedElementsHost> & typeof import("./types").ScopedElementsHost;
                                                                                                  ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@open-wc/scoped-elements/types/src/ScopedElementsMixin.d.ts:1:169 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("@open-wc/dedupe-mixin")' call instead.

1 export type ScopedElementsMixin = <T extends import("@open-wc/dedupe-mixin").Constructor<import("@lit/reactive-element").ReactiveElement>>(superclass: T) => T & import("@open-wc/dedupe-mixin").Constructor<import("./types").ScopedElementsHost> & typeof import("./types").ScopedElementsHost;

                                                  ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@open-wc/scoped-elements/types/src/ScopedElementsMixin.d.ts:7:56 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("@open-wc/dedupe-mixin")' call instead.

7 export function ScopedElementsMixin<T_1 extends import("@open-wc/dedupe-mixin").Constructor<HTMLElement>>(superclass: T_1): T_1 & import("@open-wc/dedupe-mixin").Constructor<import("./types").ScopedElementsHost>;
                                                         ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@open-wc/scoped-elements/types/src/ScopedElementsMixin.d.ts:7:138 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("@open-wc/dedupe-mixin")' call instead.

7 export function ScopedElementsMixin<T_1 extends import("@open-wc/dedupe-mixin").Constructor<HTMLElement>>(superclass: T_1): T_1 & import("@open-wc/dedupe-mixin").Constructor<import("./types").ScopedElementsHost>;

                   ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@open-wc/scoped-elements/types/src/ScopedElementsMixin.d.ts:16:40 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("@lit/reactive-element")' call instead.

16 export type CSSResultOrNative = import("@lit/reactive-element").CSSResult | CSSStyleSheet;
                                          ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@open-wc/scoped-elements/types/src/types.d.ts:1:29 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("@open-wc/dedupe-mixin")' call instead.

1 import { Constructor } from '@open-wc/dedupe-mixin';
                              ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@open-wc/scoped-elements/types/src/types.d.ts:2:33 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("@lit/reactive-element")' call instead.

2 import { ReactiveElement } from '@lit/reactive-element';
                                  ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@open-wc/semantic-dom-diff/chai-dom-diff-plugin.d.ts:3:29 - error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './get-diffable-html.js'?

3 import { DiffOptions } from "./get-diffable-html";
                              ~~~~~~~~~~~~~~~~~~~~~

node_modules/@open-wc/testing-helpers/types/index.d.ts:2:22 - error TS2307: Cannot find module 'lit-html/static' or its corresponding type declarations.

2 import { html } from "lit-html/static";
                       ~~~~~~~~~~~~~~~~~

node_modules/@open-wc/testing-helpers/types/index.d.ts:3:30 - error TS2307: Cannot find module 'lit-html/static' or its corresponding type declarations.

3 import { unsafeStatic } from "lit-html/static";
                               ~~~~~~~~~~~~~~~~~

node_modules/@open-wc/testing-helpers/types/src/fixture-no-side-effect.d.ts:19:65 - error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path.

19 export function fixtureSync<T extends Element>(template: import('./renderable').LitHTMLRenderable, options?: FixtureOptions): T;
                                                                   ~~~~~~~~~~~~~~

node_modules/@open-wc/testing-helpers/types/src/fixture-no-side-effect.d.ts:41:61 - error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path.

41 export function fixture<T extends Element>(template: import('./renderable').LitHTMLRenderable, options?: FixtureOptions): Promise<T>;
                                                               ~~~~~~~~~~~~~~

node_modules/@open-wc/testing-helpers/types/src/litFixture.d.ts:10:68 - error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path.

10 export function litFixtureSync<T extends Element>(template: import('./renderable').LitHTMLRenderable, options?: import('./fixture-no-side-effect.js').FixtureOptions, getScopedElementsTemplate?: import('./scopedElementsWrapper.js').ScopedElementsTemplateGetter): T;
                                                                      ~~~~~~~~~~~~~~

node_modules/@open-wc/testing-helpers/types/src/litFixture.d.ts:19:64 - error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path.

19 export function litFixture<T extends Element>(template: import('./renderable').LitHTMLRenderable, options?: import('./fixture-no-side-effect.js').FixtureOptions): Promise<T>;
                                                                  ~~~~~~~~~~~~~~

node_modules/@open-wc/testing-helpers/types/src/scopedElementsWrapper.d.ts:8:60 - error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path.

8 export function getScopedElementsTemplate(template: import('./renderable').LitHTMLRenderable, scopedElements: ScopedElementsMap): HTMLElement;
                                                             ~~~~~~~~~~~~~~

test/un-copy-art.test.ts:4:27 - error TS2307: Cannot find module '../src/UnCopyArt.js' or its corresponding type declarations.

4 import { UnCopyArt } from '../src/UnCopyArt.js';
                            ~~~~~~~~~~~~~~~~~~~~~


Found 17 errors in 8 files.

Errors  Files
     6  node_modules/@open-wc/scoped-elements/types/src/ScopedElementsMixin.d.ts:1
     2  node_modules/@open-wc/scoped-elements/types/src/types.d.ts:1
     1  node_modules/@open-wc/semantic-dom-diff/chai-dom-diff-plugin.d.ts:3
     2  node_modules/@open-wc/testing-helpers/types/index.d.ts:2
     2  node_modules/@open-wc/testing-helpers/types/src/fixture-no-side-effect.d.ts:19
     2  node_modules/@open-wc/testing-helpers/types/src/litFixture.d.ts:10
     1  node_modules/@open-wc/testing-helpers/types/src/scopedElementsWrapper.d.ts:8
     1  test/un-copy-art.test.ts:4```

Is it a common problem, or it's my environment? Can you help me please?

Thanks :)

Consider adding a favicon.ico file.

Please consider adding a favicon.ico file, perhaps the open-wc logo, to prevent the console message:

:8000/favicon.ico:1 Failed to load resource: the server responded with a status of 404 (Not Found)

or one of the headers as you have on https://open-wc.org/.

Upgrading an existing project throws

Hello everybody,

I'm trying to add storybook to an App project I previously initialized using the CLI, but it throws the following error:

$ npm init @open-wc
npx: installed 58 in 0.961s

        _.,,,,,,,,,._
     .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/
        '',,,,,,,,,,''


Note: you can exit any time with Ctrl+C or Esc

✔ What would you like to do today? › Upgrade an existing project
✔ What would you like to add? › Demoing (storybook)
✔ Would you like to use typescript? › Yes
✔ What is the tag name of your web component? … my-component
ReferenceError: template:3
    1| {
    2|   "scripts": {
 >> 3|     "storybook": "tsc && <%= scriptRunCommand %> analyze --exclude dist && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wds -c .storybook/server.mjs\"",
    4|     "storybook:build": "tsc && <%= scriptRunCommand %> analyze --exclude dist && build-storybook"
    5|   },
    6|   "devDependencies": {

scriptRunCommand is not defined

Improve feedback when custom element name is not to spec

Feedback when typing a wrong name says two words separated by a dash. I saw someone type Hello-World and not know that the spec has to be lowercase. This can especially be true of friends who have used React / other component approaches which CamelCase things.

PR for the quick fix to add word lowercase

Space in dir breaking on Windows

When running npm init @open-wc on Windows I get the following error:

Error: EPERM: operation not permitted, mkdir 'C:\Users\Mendy'
command not found: create

I tried to reinstall @open-wc/create already but no luck

I think that it has to do with the space in the directory name C:\Users\Mendy Berger\Documents\whatever

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update babel monorepo (patch) (@babel/cli, @babel/core, @babel/preset-env, @babel/register)
  • chore(deps): update dependency @open-wc/building-rollup to ^2.2.3
  • chore(deps): update dependency @open-wc/eslint-config to ^9.2.2
  • chore(deps): update dependency @open-wc/testing to ^3.1.8
  • chore(deps): update dependency @rollup/plugin-babel to ^5.3.1
  • chore(deps): update dependency @web/dev-server to ^0.1.38
  • chore(deps): update dependency @web/rollup-plugin-html to ^1.11.1
  • chore(deps): update dependency @web/rollup-plugin-import-meta-assets to ^1.0.8
  • chore(deps): update dependency @web/test-runner to ^0.14.1
  • chore(deps): update dependency chai to ^4.3.10
  • chore(deps): update dependency eslint-plugin-import to ^2.25.4
  • chore(deps): update dependency eslint-plugin-lit to ^1.8.3
  • chore(deps): update dependency mocha to ^9.1.4
  • chore(deps): update dependency mocha to ^9.2.2
  • chore(deps): update dependency prettier to ^2.8.8
  • chore(deps): update dependency rollup to ^2.60.2
  • chore(deps): update dependency rollup-plugin-workbox to ^6.2.2
  • chore(deps): update dependency typescript to v4.5.5
  • chore(deps): update typescript-eslint monorepo to ^5.48.2 (patch) (@typescript-eslint/eslint-plugin, @typescript-eslint/parser)
  • fix(deps): update dependency command-line-args to ^5.2.1
  • fix(deps): update dependency command-line-usage to ^6.1.3
  • fix(deps): update dependency ejs to ^3.1.10
  • fix(deps): update dependency glob to ^7.2.3
  • fix(deps): update dependency semver to ^7.3.8
  • chore(deps): update babel monorepo (minor) (@babel/cli, @babel/core, @babel/preset-env, @babel/register)
  • chore(deps): update dependency @open-wc/building-rollup to ^2.2.3
  • chore(deps): update dependency @rollup/plugin-node-resolve to ^13.3.0
  • chore(deps): update dependency @web/dev-server to ^0.4.4
  • chore(deps): update dependency @web/dev-server-storybook to ^0.7.4
  • chore(deps): update dependency @web/test-runner to ^0.18.1
  • chore(deps): update dependency chai to ^4.4.1
  • chore(deps): update dependency deepmerge to ^4.3.1
  • chore(deps): update dependency eslint to ^8.57.0
  • chore(deps): update dependency eslint-config-prettier to ^8.10.0
  • chore(deps): update dependency eslint-plugin-import to ^2.29.1
  • chore(deps): update dependency eslint-plugin-lit to ^1.11.0
  • chore(deps): update dependency eslint-plugin-wc to ^1.5.0
  • chore(deps): update dependency prettier to ^2.8.8
  • chore(deps): update dependency rollup to ^2.79.1
  • chore(deps): update dependency tslib to ^2.6.2
  • chore(deps): update dependency typescript to v4.9.5
  • chore(deps): update typescript-eslint monorepo to ^5.62.0 (minor) (@typescript-eslint/eslint-plugin, @typescript-eslint/parser)
  • fix(deps): update dependency lit to ^2.8.0
  • fix(deps): update dependency semver to ^7.6.0
  • chore(deps): update actions/cache action to v3
  • chore(deps): update actions/cache action to v4
  • chore(deps): update actions/checkout action to v3
  • chore(deps): update actions/checkout action to v4
  • chore(deps): update actions/setup-node action to v3
  • chore(deps): update actions/setup-node action to v4
  • chore(deps): update commitlint monorepo to v16 (major) (@commitlint/cli, @commitlint/config-conventional)
  • chore(deps): update commitlint monorepo to v17 (major) (@commitlint/cli, @commitlint/config-conventional)
  • chore(deps): update commitlint monorepo to v18 (major) (@commitlint/cli, @commitlint/config-conventional)
  • chore(deps): update commitlint monorepo to v19 (major) (@commitlint/cli, @commitlint/config-conventional)
  • chore(deps): update dependency @open-wc/building-rollup to v3
  • chore(deps): update dependency @open-wc/eslint-config to v10
  • chore(deps): update dependency @open-wc/eslint-config to v11
  • chore(deps): update dependency @open-wc/eslint-config to v12
  • chore(deps): update dependency @open-wc/testing to v4
  • chore(deps): update dependency @rollup/plugin-babel to v6
  • chore(deps): update dependency @rollup/plugin-node-resolve to v14
  • chore(deps): update dependency @rollup/plugin-node-resolve to v15
  • chore(deps): update dependency @web/dev-server-storybook to v1
  • chore(deps): update dependency @web/dev-server-storybook to v2
  • chore(deps): update dependency @web/rollup-plugin-html to v2
  • chore(deps): update dependency @web/rollup-plugin-import-meta-assets to v2
  • chore(deps): update dependency chai to v5
  • chore(deps): update dependency concurrently to v7
  • chore(deps): update dependency concurrently to v8
  • chore(deps): update dependency eslint to v9
  • chore(deps): update dependency eslint-config-prettier to v9
  • chore(deps): update dependency eslint-plugin-lit-a11y to v3
  • chore(deps): update dependency eslint-plugin-lit-a11y to v4
  • chore(deps): update dependency eslint-plugin-wc to v2
  • chore(deps): update dependency husky to v8
  • chore(deps): update dependency husky to v9
  • chore(deps): update dependency lint-staged to v13
  • chore(deps): update dependency lint-staged to v14
  • chore(deps): update dependency lint-staged to v15
  • chore(deps): update dependency lit-element to v4
  • chore(deps): update dependency mocha to v10
  • chore(deps): update dependency prettier to v3
  • chore(deps): update dependency rimraf to v4
  • chore(deps): update dependency rimraf to v5
  • chore(deps): update dependency rollup to v3
  • chore(deps): update dependency rollup to v4
  • chore(deps): update dependency rollup-plugin-esbuild to v6
  • chore(deps): update dependency rollup-plugin-workbox to v7
  • chore(deps): update dependency rollup-plugin-workbox to v8
  • chore(deps): update dependency typescript to v5
  • chore(deps): update typescript-eslint monorepo to v6 (major) (@typescript-eslint/eslint-plugin, @typescript-eslint/parser)
  • chore(deps): update typescript-eslint monorepo to v7 (major) (@typescript-eslint/eslint-plugin, @typescript-eslint/parser)
  • fix(deps): update dependency chalk to v5
  • fix(deps): update dependency command-line-usage to v7
  • fix(deps): update dependency dedent to v1
  • fix(deps): update dependency glob to v10
  • fix(deps): update dependency glob to v8
  • fix(deps): update dependency glob to v9
  • fix(deps): update dependency lit to v3
  • fix(deps): lock file maintenance
  • 🔐 Create all rate-limited PRs at once 🔐

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/release.yml
  • actions/cache v2
.github/workflows/verify-node.yml
  • actions/checkout v2
  • actions/setup-node v2
.github/workflows/verify-windows.yml
  • actions/checkout v2
  • actions/setup-node v2
npm
package.json
  • chalk ^4.1.2
  • command-line-args ^5.2.0
  • command-line-usage ^6.1.1
  • dedent ^0.7.0
  • deepmerge ^4.2.2
  • ejs ^3.1.6
  • glob ^7.2.0
  • prompts ^2.4.2
  • semver ^7.3.5
  • @babel/cli ^7.16.0
  • @babel/core ^7.16.0
  • @babel/preset-env ^7.16.4
  • @babel/register ^7.16.0
  • @custom-elements-manifest/analyzer ^0.4.17
  • @open-wc/building-rollup ^2.0.2
  • @open-wc/eslint-config ^9.2.1
  • @open-wc/testing ^2.5.33
  • @rollup/plugin-babel ^5.3.0
  • @web/rollup-plugin-html ^1.11.0
  • @web/rollup-plugin-import-meta-assets ^1.0.7
  • babel-plugin-transform-dynamic-import ^2.1.0
  • chai ^4.3.4
  • chai-fs ^2.0.0
  • eslint ^8.30.0
  • eslint-config-prettier ^8.3.0
  • eslint-plugin-import ^2.25.3
  • eslint-plugin-lit ^1.8.2
  • eslint-plugin-lit-a11y ^1.1.0
  • eslint-plugin-wc ^1.3.2
  • lit ^2.0.2
  • lit-element ^2.5.1
  • mocha ^9.1.3
  • onchange ^7.1.0
  • prettier ^2.4.1
  • rollup-plugin-esbuild ^5.0.0
  • standard-version ^9.3.2
src/generators/app-lit-element-ts/templates/package.json
  • lit ^2.0.2
  • @web/dev-server ^0.1.34
  • concurrently ^5.3.0
  • typescript ^4.5.2
  • tslib ^2.3.1
src/generators/app-lit-element/templates/package.json
  • lit ^2.0.2
  • @web/dev-server ^0.1.34
src/generators/building-rollup-ts/templates/package.json
  • @babel/preset-env ^7.16.4
  • @open-wc/building-rollup ^2.0.2
  • @rollup/plugin-babel ^5.3.0
  • @rollup/plugin-node-resolve ^13.0.6
  • @web/rollup-plugin-html ^1.11.0
  • @web/rollup-plugin-import-meta-assets ^1.0.7
  • babel-plugin-template-html-minifier ^4.1.0
  • deepmerge ^4.2.2
  • rimraf ^3.0.2
  • rollup-plugin-esbuild ^5.0.0
  • rollup-plugin-workbox ^6.2.0
  • rollup ^2.60.0
src/generators/building-rollup/templates/package.json
  • @babel/preset-env ^7.16.4
  • @open-wc/building-rollup ^2.0.2
  • @rollup/plugin-babel ^5.3.0
  • @rollup/plugin-node-resolve ^13.0.6
  • @web/rollup-plugin-html ^1.11.0
  • @web/rollup-plugin-import-meta-assets ^1.0.7
  • babel-plugin-template-html-minifier ^4.1.0
  • deepmerge ^4.2.2
  • rimraf ^3.0.2
  • rollup-plugin-esbuild ^5.0.0
  • rollup-plugin-workbox ^6.2.0
  • rollup ^2.60.0
src/generators/common-repo/templates/package.json
  • @custom-elements-manifest/analyzer ^0.4.17
src/generators/demoing-storybook-ts/templates/package.json
  • @web/dev-server-storybook ^0.5.4
src/generators/demoing-storybook/templates/package.json
  • @web/dev-server-storybook ^0.5.4
src/generators/linting-commitlint/templates/package.json
  • @commitlint/cli ^11.0.0
  • @commitlint/config-conventional ^11.0.0
src/generators/linting-eslint-ts/templates/package.json
  • eslint ^8.31.0
  • @open-wc/eslint-config ^9.2.1
  • @typescript-eslint/parser ^5.48.0
  • @typescript-eslint/eslint-plugin ^5.48.0
src/generators/linting-eslint/templates/package.json
  • eslint ^8.31.0
  • @open-wc/eslint-config ^9.2.1
src/generators/linting-prettier-ts/templates/package.json
  • prettier ^2.4.1
  • eslint-config-prettier ^8.3.0
src/generators/linting-prettier/templates/package.json
  • prettier ^2.4.1
  • eslint-config-prettier ^8.3.0
src/generators/linting-ts/templates/package.json
  • husky ^4.3.8
  • lint-staged ^10.5.4
src/generators/linting-types-js/templates/package.json
  • typescript ~4.5.2
src/generators/linting/templates/package.json
  • husky ^4.3.8
  • lint-staged ^10.5.4
src/generators/testing-ts/templates/package.json
  • @open-wc/testing ^3.1.6
src/generators/testing-wallaby/templates/package.json
  • @open-wc/testing-wallaby ^0.1.14
src/generators/testing-wtr-ts/templates/package.json
  • @web/test-runner ^0.14.0
src/generators/testing-wtr/templates/package.json
  • @web/test-runner ^0.14.0
src/generators/testing/templates/package.json
  • @open-wc/testing ^3.1.6
src/generators/wc-lit-element-ts/templates/package.json
  • lit ^2.0.2
  • @web/dev-server ^0.1.34
  • concurrently ^5.3.0
  • typescript ^4.5.2
  • tslib ^2.3.1
src/generators/wc-lit-element/templates/package.json
  • lit ^2.0.2
  • @web/dev-server ^0.1.34

  • Check this box to trigger a request for Renovate to run again on this repository

Adding storybook misses command

When adding storybook to an existing project the workflow fails to ask which of npm or yarn you'd like to use leaving a variable unassigned causing the workflow to fail.

Upgrading and multi-components

Howdy! I really like this project. @thepassle told me to file feedback here.

I was playing around with npm init @open-wc this month and I had two questions/ideas...

  1. It's not clear what Upgrade Existing Project is supposed to do or where I'm supposed to run it. Does that only work for any app? Only project made with open-wc? Do I do run the command outside of the project scope like the Scaffold a new project? Maybe it's related to #58 and it actually does nothing right now, which is why I was confused?
  2. You get the choice to scaffold a component, but if you want to add another component you have to create a whole new folder. Is this for monorepos? Maybe an Add another component option would be nice for building out components in a design system or an application. Then I could get a component file, test file, and a stories file?

Let me know if I'm not making sense.

Error while transforming node_modules/@web/storybook-prebuilt/manager.js: Could not resolve import "react".

Actual Behavior

I used following command to create an application skeleton:

npm init @open-wc --destinationPath /Users/xxx/Desktop/ui-demo --type scaffold --scaffoldType wc --features linting testing demoing --typescript true --tagName ui-demo --writeToDisk true --installDependencies npm 

Starting storybook using npm run storybook leads to:

Error while transforming node_modules/@web/storybook-prebuilt/manager.js: Could not resolve import "react".

Expected Behavior

storybook dev server starts without errors and I can inspect storybook on http://localhost:8000.

[app] Storybook Does Not Work Out of the Box

After initializing a new component with the following options:

Scaffold a new project
Application
Linting (eslint & prettier)
Testing (web-test-runner)
Demoing (storybook)
Typescript
npm
and running npm run storybook, the following error is thrown:

interneuron:st-app kito$ npm run storybook

> [email protected] storybook
> tsc && npm run analyze -- --exclude dist && concurrently -k -r "tsc --watch --preserveWatchOutput" "wds -c .storybook/server.mjs"


> [email protected] analyze
> cem analyze --litelement --exclude dist

[11:38:31 PM] @custom-elements-manifest/analyzer: Created new manifest.
[11:38:31 PM] Starting compilation in watch mode...

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/kito/Core/Projects/focus.speakertrax/vcs/st-speaker-profile/st-app/.storybook/main.js from /Users/kito/Core/Projects/focus.speakertrax/vcs/st-speaker-profile/st-app/node_modules/@web/dev-server-storybook/dist/shared/config/readStorybookConfig.js not supported.
main.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules.
Instead rename main.js to end in .cjs, change the requiring code to use dynamic import() which is available in all CommonJS modules, or change "type": "module" to "type": "commonjs" in /Users/kito/Core/Projects/focus.speakertrax/vcs/st-speaker-profile/st-app/package.json to treat all .js files as CommonJS (using .mjs for all ES modules instead).

    at Object.readStorybookConfig (/Users/kito/Core/Projects/focus.speakertrax/vcs/st-speaker-profile/st-app/node_modules/@web/dev-server-storybook/dist/shared/config/readStorybookConfig.js:56:35)
    at storybookPlugin (/Users/kito/Core/Projects/focus.speakertrax/vcs/st-speaker-profile/st-app/node_modules/@web/dev-server-storybook/dist/serve/storybookPlugin.js:16:51)
    at file:///Users/kito/Core/Projects/focus.speakertrax/vcs/st-speaker-profile/st-app/.storybook/server.mjs:7:13 {
  code: 'ERR_REQUIRE_ESM'
}

This is potentially related to #87.

Storybook not working when create new project in open-wc

When i create new applicaiton using open-wc and try to run the storybook, i am facing below issues.

Error: [@web/dev-server-storybook] The file C:/Users/Ghost/Desktop/Training/web-app/stories/web-app.stories.js is not accessible by the browser because it is outside the root directory C:\Users\Ghost\Desktop\Training\web-app. Change the rootDir option to include this directory.
at createError (C:\Users\Ghost\Desktop\Training\web-app\node_modules@web\dev-server-storybook\dist\shared\utils.js:9:12)
at Object.

When i do the debugging, its look like Root directory and filepath url slash format is different, so facing an issue, the format look like below

RootDir :: C:\Users\Ghost\Desktop\Training\web-app
FilePath :: C:/Users/Ghost/Desktop/Training/web-app/stories/web-app.stories.js

Reduce duplication

There is a lot of duplication between the different parts of the generator, for instance the app and component and JS/TS parts. We should look into a smarter way of reusing code between these parts.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.