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

Shared Workspaces and Contexts (Theme Packs) #570

Closed
1 of 5 tasks
thescientist13 opened this issue Apr 24, 2021 · 0 comments · Fixed by #669
Closed
1 of 5 tasks

Shared Workspaces and Contexts (Theme Packs) #570

thescientist13 opened this issue Apr 24, 2021 · 0 comments · Fixed by #669
Assignees
Labels
CLI documentation Greenwood specific docs Plugins Greenwood Plugins question Further information is requested RFC Proposal and changes to workflows, architecture, APIs, etc v0.15.0
Milestone

Comments

@thescientist13
Copy link
Member

thescientist13 commented Apr 24, 2021

Type of Change

  • New Feature Request
  • Documentation / Website
  • Improvement / Suggestion
  • Bug
  • Other (please clarify below)

Summary

There have been a couple discussions and opportunities observed coming out of #508 / #509 and while working on a private project idea of my own

  • plugin-graphql added the support to merge custom schemas provided by users in a data/schema/ directory in the user's work space. Could plugins get that support as well, so plugins can ship custom queries and schemas? This could could allow for entire plugins of functionality like adding a photo gallery that could handle mapping paths to resolvers
  • a private project of mine, where sharing templates and pages would allow plugins to provide entire "theme" packs with templates and styles ready to go out of the box

Details

Off the top of my head, I wonder if this is something that could just be done by using ResourceInterface and hijacking any files that you own? Or would you have to open up "context" to support providing additional directories for Greenwood to look at.

For example, to "share" a custom page template for use in a markdown file from a plugin

---
template: 'acme-themepack-splashpage'
---

## Welcome to my site!

Lorum Ipsum

The page template would be able to resolve to something like node_modules/acme-themepack/src/templates/acme-themepack.html


Not sure if ResourceInterface is enough?

class MyThemePackResource extends ResourceInterface {
  constructor(compilation, options) {
    super(compilation, options);
    
    this.extensions = ['.html'];
    this.contentType = 'text/html';
  }

  // if request matches a file we "own", resolve it
  // ex: `${userWorkspace}/templates/themepackXYZ-splash-page.html`
  async shouldResolve(url) {
    return Promise.resolve(true);
  }

}

Or if Greenwood needs to open up a new API, so creating this issue to track that cases are developed for, and to report back what the developer ergonomics are like and see if something new needs to be made.


For bonus points, we could also look to incorporate #574 ? 💡

@thescientist13 thescientist13 added question Further information is requested RFC Proposal and changes to workflows, architecture, APIs, etc labels Apr 24, 2021
@thescientist13 thescientist13 added this to the 1.0 milestone Apr 24, 2021
@thescientist13 thescientist13 self-assigned this May 20, 2021
@thescientist13 thescientist13 pinned this issue Jun 13, 2021
@thescientist13 thescientist13 changed the title Shared Workspaces and Contexts Shared Workspaces and Contexts (Theme Packs) Jun 30, 2021
@thescientist13 thescientist13 added CLI documentation Greenwood specific docs Plugins Greenwood Plugins labels Jul 16, 2021
@thescientist13 thescientist13 unpinned this issue Oct 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI documentation Greenwood specific docs Plugins Greenwood Plugins question Further information is requested RFC Proposal and changes to workflows, architecture, APIs, etc v0.15.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant