-
Notifications
You must be signed in to change notification settings - Fork 80
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: command to help generate integration patches #1192
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
6 Skipped Deployments
|
🦋 Changeset detectedLatest commit: 4f6c67f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
6c82100
to
111a365
Compare
111a365
to
3114956
Compare
3114956
to
7fad603
Compare
7fad603
to
476aea7
Compare
e0c0b8b
to
fb7f5d3
Compare
fb7f5d3
to
db995ea
Compare
const envVars: string[] = []; | ||
const lines = envVarDiff.split('\n'); | ||
const envPattern = /^\+([A-Z_]+)=/; | ||
|
||
lines.forEach((line) => { | ||
const match = line.match(envPattern); | ||
|
||
if (match) { | ||
envVars.push(match[1]); | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing here. You could git show
the file and drop it into dotenv.parse
I believe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This parses out just the new additions - what happens if an integration developer for some reason deletes some other env vars from their example that diverge from main?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately importing dotenv.parse
throws:
Error: Dynamic require of "fs" is not supported
This can be fixed by adding external: ['dotenv'],
to the tsup
config, but not sure if that's something we want to do, or if we just keep the regex approach
db995ea
to
2093721
Compare
2093721
to
d449930
Compare
d449930
to
d378aca
Compare
d378aca
to
d4a3ef4
Compare
d4a3ef4
to
4f6c67f
Compare
⚡️🏠 Lighthouse reportLighthouse ran against https://catalyst-latest-n75e1l1n0-bigcommerce-platform.vercel.app 🖥️ DesktopWe ran Lighthouse against the changes on a desktop and produced this report. Here's the summary:
📱 MobileWe ran Lighthouse against the changes on a mobile and produced this report. Here's the summary:
|
spaces: 2, | ||
}); | ||
|
||
console.log('Integration created successfully.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🍹 Be cool to log the integration name (in a branded/readable form, maybe just the name
from the manifest?) eventually
What/Why?
Adds a command to the
create-catalyst
CLI that can be executed by running[npm|pnpm|yarn] create @bigcommerce/catalyst@latest integration
once published. Also updates thepackages/create-catalyst/README.md
with some documentation that partners interested in developing integrations can follow.When you execute this new command following the steps below, the command will create a folder with two new files:
integration.patch
manifest.json
The expectation is that the folder containing these two files will be committed to a branch, and that branch will then be used to open a PR into
bigcommerce/catalyst:main
. Once merged, thepnpm create @bigcommerce/catalyst@latest create
CLI will then be able to accept an argument for which integration you want to scaffold your Catalyst project with, check that the argument you passed exists in theintegrations
folder onbigcommerce/catalyst:main
, read themanifest.json
to, install dependencies, devDependencies, add environment variables, and then read theintegration.patch
file to apply the patch.Testing
Clone https://github.com/bigcommerce/catalyst and run the following commands to test this command with the Makeswift integration:
git fetch --all
git switch integrations/create-patch
pnpm install
pnpm -F @bigcommerce/create-catalyst build
git branch integrations/makeswift origin/integrations/makeswift
node packages/create-catalyst/dist/index.js integration --integration-name "Makeswift" --source-branch "integrations/makeswift"