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

[Generator feature request] Add a flat toggle to the UI #317

Open
trusktr opened this issue Nov 19, 2023 · 5 comments
Open

[Generator feature request] Add a flat toggle to the UI #317

trusktr opened this issue Nov 19, 2023 · 5 comments

Comments

@trusktr
Copy link

trusktr commented Nov 19, 2023

The CLI generator can generate a flat import map, but there's no option in the Generator ui at https://generator.jspm.io/#U2VhYGBkDM0rySzJSU1hcMgpzU3VT81JzU3NK3Ew0DM01DMAAFjZa1gjAA.

It would be really useful to have this option in the UI.

@trusktr trusktr changed the title [Generator] Add a flat toggle to the UI [Generator feature request] Add a flat toggle to the UI Nov 19, 2023
@guybedford
Copy link
Member

The flatten operation is automatically called on all import maps generated on generator.jspm.io.

@trusktr
Copy link
Author

trusktr commented Nov 19, 2023

I can't get Generator to generate anything right now for previous versions of Lume that worked before

I was expecting something like this

  {
    "imports": {
      "lume": "https://ga.jspm.io/npm:lume@0.3.0-alpha.28/dist/index.js"
    },
    "scopes": {
      "https://ga.jspm.io/": {
        "@lume/autolayout": "https://ga.jspm.io/npm:@lume/autolayout@0.10.1/dist/AutoLayout.js",
        "@lume/custom-attributes/dist/index.js": "https://ga.jspm.io/npm:@lume/custom-attributes@0.2.1/dist/index.js",
        "@lume/element": "https://ga.jspm.io/npm:@lume/element@0.10.1/dist/index.js",
        // ... etc ...
      }
    }
  }

to come out more like this after flattening:

  {
    "imports": {
      "lume": "https://ga.jspm.io/npm:lume@0.3.0-alpha.28/dist/index.js",
      "@lume/autolayout": "https://ga.jspm.io/npm:@lume/autolayout@0.10.1/dist/AutoLayout.js",
      "@lume/custom-attributes/dist/index.js": "https://ga.jspm.io/npm:@lume/custom-attributes@0.2.1/dist/index.js",
      "@lume/element": "https://ga.jspm.io/npm:@lume/element@0.10.1/dist/index.js",
      // ... etc ...
    },
  }

I'd like the simplest import maps when possible, like a basic one someone would write by hand. It is less cognitive overhead, especially for people new to web development with no experience with build tools or command lines.

I'm trying to make things easy here:

https://docs.lume.io/guide/install/?id=cdn-easiest

@guybedford
Copy link
Member

If you really want this, define your dependencies as peerDependencies not dependencies....

@trusktr
Copy link
Author

trusktr commented Nov 19, 2023

Yeah right! 😆

@trusktr
Copy link
Author

trusktr commented Nov 19, 2023

For the use case, it was simple to add all the dependencies to the list to flatten it:

https://generator.jspm.io/#U2NhYGDhD80rySzJSU1hcMgpzU3VT81JzU3NK3Ew0DM01DNgSM5JLC6u1C3Oz8lMAYoZA4XAbN2sYgdDPQs9UzSufkZJbg4Ai1Yl4FkA

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

No branches or pull requests

2 participants