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: adds support for package.json merging #18

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jbottigliero
Copy link
Member

This will, in theory, will add support for downstream codebases to include arbitrary dependencies and devDependencies into a generator context. Using this functionality, in combination with content or overrides means you can easily include package-based code in custom content.

The below example shows how this would look to downstream codebases – the key thing to note is that this appears no different than installing and using a dependency as you would in any project using NPM.

content/
 index.mdx
static.json
package.json
// static.json
{
  "_static": {
    "generator": {
      "name": "@globus/static-search-portal"
    }
  },
  "data": {
    "version": "1.0.0",
    "attributes": { /* ... */ } 
   }
}
// package.json
{
    "dependencies": {
        "@globus/static-search-portal": "1.5.0",
        "d3": "^7.9.0"
    }
}
// content/index.mdx
import * as d3 from 'd3';

# Welcome!

{{(function(){ console.log(d3);}()}}

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.

1 participant