Introduce `AGENTS.md` file support in `shopify theme init`
WHY are these changes introduced?
This pull request updates the shopify theme init to consistently use AGENTS.md files. For consistency and compatibility, we are keeping symlinks with each editor standard.
Additionally, this pull request introduces a new "All" option to create symlinks for all editors:
WHAT is this pull request doing?
This pull request:
- Updates the
inittheme service to handle the feature mentioned above - Updates
cli-kitto expose the symlink creation API
How to test your changes?
- Run
shopify theme init
Post-release steps
None
Measuring impact
How do we know this change was effective? Please choose one:
- [ ] n/a - this doesn't need measurement, e.g., a linting rule or a bug-fix
- [x] Existing analytics will cater for this addition
- [ ] PR includes analytics changes to measure impact
Checklist
- [x] I've considered possible cross-platform impacts (Mac, Linux, Windows).
- [x] I've considered possible documentation changes.
We detected some changes at packages/*/src and there are no updates in the .changeset.
If the changes are user-facing, run pnpm changeset add to track your changes and include them in the next release CHANGELOG.
[!CAUTION] DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release.
Coverage report
St.:grey_question: |
Category | Percentage | Covered / Total |
|---|---|---|---|
| π‘ | Statements | 79.14% (-0.08% π») |
13817/17458 |
| π‘ | Branches | 73.08% (-0.03% π») |
6739/9221 |
| π‘ | Functions | 79.31% (-0.06% π») |
3546/4471 |
| π‘ | Lines | 79.51% (-0.07% π») |
13058/16423 |
Show new covered files π£
St.:grey_question: |
File | Statements | Branches | Functions | Lines |
|---|---|---|---|---|---|
| π’ | ... / admin-as-app.ts |
100% | 100% | 100% | 100% |
| π’ | ... / bulk-operation-run-mutation.ts |
100% | 100% | 100% | 100% |
| π’ | ... / bulk-operation-run-query.ts |
100% | 100% | 100% | 100% |
| π’ | ... / get-bulk-operation-by-id.ts |
100% | 100% | 100% | 100% |
| π’ | ... / staged-uploads-create.ts |
100% | 100% | 100% | 100% |
| π΄ | ... / status.ts |
0% | 100% | 0% | 0% |
| π΄ | ... / pull.ts |
0% | 100% | 0% | 0% |
| π΄ | ... / pull.ts |
0% | 0% | 0% | 0% |
| π’ | ... / bulk-operation-status.ts |
96% | 85.71% | 100% | 100% |
| π’ | ... / download-bulk-operation-results.ts |
100% | 100% | 100% | 100% |
| π’ | ... / execute-bulk-operation.ts |
90.91% | 80.56% | 100% | 92.31% |
| π’ | ... / format-bulk-operation-status.ts |
100% | 100% | 100% | 100% |
| π’ | ... / run-mutation.ts |
100% | 100% | 100% | 100% |
| π’ | ... / run-query.ts |
100% | 100% | 100% | 100% |
| π‘ | ... / stage-file.ts |
72.73% | 62.5% | 83.33% | 71.88% |
| π’ | ... / watch-bulk-operation.ts |
100% | 100% | 100% | 100% |
| π΄ | ... / promiseWithResolvers.ts |
33.33% | 50% | 50% | 33.33% |
Show files with reduced coverage π»
St.:grey_question: |
File | Statements | Branches | Functions | Lines |
|---|---|---|---|---|---|
| π΄ | ... / execute.ts |
0% | 0% (-100% π») |
0% | 0% |
| π’ | ... / extension-instance.ts |
84.8% (+0.23% πΌ) |
77.6% (-0.91% π») |
92.06% (+0.13% πΌ) |
85.11% (+0.24% πΌ) |
| π‘ | ... / specification.ts |
69.09% | 75.61% (+2.44% πΌ) |
76.47% (-1.31% π») |
68.75% |
| π’ | ... / ui_extension.ts |
85.38% (-9.44% π») |
72.34% (-8.91% π») |
84% (-16% π») |
88% (-8.46% π») |
| π’ | ... / developer-platform-client.ts |
84.62% (-1.5% π») |
73.68% (+3.1% πΌ) |
81.82% (+1.82% πΌ) |
90.63% (-2.71% π») |
| π’ | ... / api.ts |
87.07% (-0.43% π») |
76.71% (-0.1% π») |
100% | 86.49% (-0.43% π») |
| π’ | ... / ConcurrentOutput.tsx |
98.36% (-1.64% π») |
92% (-4% π») |
100% | 98.33% (-1.67% π») |
| π΄ | ... / ui.tsx |
50.82% (-0.79% π») |
42.86% (-5.53% π») |
54.55% (+1.42% πΌ) |
50% (-0.82% π») |
| π’ | ... / console.ts |
81.82% (+15.15% πΌ) |
75% (-25% π») |
100% (+33.33% πΌ) |
81.82% (+15.15% πΌ) |
| π΄ | ... / dev.ts |
14.29% (+0.95% πΌ) |
3.13% (+0.18% πΌ) |
50% (-7.14% π») |
14.29% (+0.95% πΌ) |
| π’ | ... / init.ts |
88% (-0.89% π») |
71.43% (+4.76% πΌ) |
86.67% (+4.85% πΌ) |
88% (-0.89% π») |
| π‘ | ... / theme-polling.ts |
67.12% (-0.93% π») |
68.75% | 78.57% | 66.67% (-0.98% π») |
Test suite run success
3442 tests passing in 1395 suites.
Report generated by π§ͺjest coverage report action from 313b9bfdb55cd9834a577a5814d7c1e3775661b5
/snapit
π«°β¨ Thanks @aswamy! Your snapshot has been published to npm.
Test the snapshot by installing your package globally:
npm i -g --@shopify:registry=https://registry.npmjs.org @shopify/[email protected]
[!CAUTION] After installing, validate the version by running just
shopifyin your terminal. If the versions don't match, you might have multiple global instances installed. Usewhich shopifyto find out which one you are running and uninstall it.
/snapit
π«°β¨ Thanks @karreiro! Your snapshot has been published to npm.
Test the snapshot by installing your package globally:
npm i -g --@shopify:registry=https://registry.npmjs.org @shopify/[email protected]
[!CAUTION] After installing, validate the version by running just
shopifyin your terminal. If the versions don't match, you might have multiple global instances installed. Usewhich shopifyto find out which one you are running and uninstall it.
Thanks a lot for the review, @aswamy!
Windows require some specific permissions to create symbolic links, that's the reason we faced some errors. Now, we've update this PR to fallback to file creation (with a warning) when symbolic links can't be created:
This PR is ready for re-review. Thanks again for the review!
Differences in type declarations
We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:
- Some seemingly private modules might be re-exported through public modules.
- If the branch is behind
mainyou might see odd diffs, rebasemaininto this branch.
New type declarations
We found no new type declarations in this PR
Existing type declarations
packages/cli-kit/dist/public/node/fs.d.ts
@@ -126,6 +126,13 @@ export declare function removeFile(path: string): Promise<void>;
* @param to - New path for the file.
*/
export declare function renameFile(from: string, to: string): Promise<void>;
+/**
+ * Creates a symbolic link.
+ *
+ * @param target - Path that the symlink points to.
+ * @param path - Path where the symlink will be created.
+ */
+export declare function symlink(target: string, path: string): Promise<void>;
/**
* Synchronously removes a file at the given path.
*
π @Shopify/app-inner-loop could you please take a look when you have a moment?