Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Shopify CLI Plugin Integration#272

Merged
montalvomiguelo merged 3 commits intomainfrom
plugin
Dec 29, 2023
Merged

Shopify CLI Plugin Integration#272
montalvomiguelo merged 3 commits intomainfrom
plugin

Conversation

@montalvomiguelo
Copy link
Copy Markdown
Contributor

@montalvomiguelo montalvomiguelo commented Dec 21, 2023

This PR adds the necessary files to create a Shopify CLI plugin for archie.

  • Its package.json does NOT have "type": "module" and it's a CJS plugin. @oclif/core v3 does support ESM plugins, but the Shopify CLI uses @oclif/core v2 and cannot handle ESM plugins.
  • Its package.json is marked as public

archie remains as an ESM package but its package.json is marked as private.

Currently, the only way to interact with archie is through its command. The plugin consumes those functionalities as-is. This could be improved in future iterations. E.g. import {build} from 'archie'; build({options});

@montalvomiguelo montalvomiguelo force-pushed the plugin branch 3 times, most recently from bec16a1 to 3d62192 Compare December 21, 2023 21:03
@t-kelly
Copy link
Copy Markdown
Contributor

t-kelly commented Dec 22, 2023

Nice! Understood. I'm good with this approach. Couple points:

  • Maybe you could throw your explanation into a docs/why-a-monorepo.md
  • If would be cool to somehow set an alert or a watch on the Shopify CLI to know when it gets bumped to v3
  • If we're going mono repo, should we go with a packages/ directory structure so properly separate both codebases?

@montalvomiguelo
Copy link
Copy Markdown
Contributor Author

Yup, we can do that, just wanted to get something working here.

@montalvomiguelo montalvomiguelo force-pushed the plugin branch 7 times, most recently from f17d1a6 to a6d06fb Compare December 28, 2023 19:38
@montalvomiguelo
Copy link
Copy Markdown
Contributor Author

montalvomiguelo commented Dec 28, 2023

@t-kelly I studied more Oclif, and I was able to make our plugin work within the current project setup. We have an ESM plugin that does not need a separate workspace and does not need any build steps/TypeScript 🎉

@montalvomiguelo montalvomiguelo changed the title Add plugin files Shopify CLI Plugin Integration Dec 28, 2023
@montalvomiguelo montalvomiguelo force-pushed the plugin branch 6 times, most recently from 291232c to 36a5ee3 Compare December 29, 2023 15:32
Refactor plugin using vanilla JS

Undo workspaces

Clean up

Linter errors fix

Clean up

Update oclif config

Update lock file

Update run file

Clean up

Update packge.json file

Update bin files

Update commands
Update readme file

Update readme file
const { args } = await this.parse(Install)

const command = 'npm'
// TODO: update archie so it can install a single component
Copy link
Copy Markdown
Contributor

@fleveillee fleveillee Jan 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Archie already has that feature, but it is based on the theme's package.json archie config. We could port this feature to be command-line compatible.

Comment thread package.json
},
"engines": {
"node": ">=18.14.2"
"node": ">=18.12.0"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no objections to that change; I'm just wondering why. Is it to be aligned to the shopify CLI?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup it's the same version the Shopify CLI has

Comment thread README.md
* [`shopify theme component dev [COMPONENT]`](#shopify-theme-component-dev-component)
* [`shopify theme component generate COMPONENT`](#shopify-theme-component-generate-component)
* [`shopify theme component install`](#shopify-theme-component-install)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does that make this PR irrelevant?
#241

Copy link
Copy Markdown
Contributor Author

@montalvomiguelo montalvomiguelo Jan 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#241 is not relevant anymore; I updated our readme file. Oclif can autogenerate documentation for our plugin 🎉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants