@bestcheckout/dynamic-component-cli 0.1.7 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,43 @@
1
+ # Local development with the dynamic-component CLI
2
+
3
+ ## Find the project and matching documentation
4
+
5
+ Read the project's `package.json`, lockfile, `dynamic.config.json`, registered entry files and existing changes. Preserve component identity, page type and unrelated work. Use the project's package manager and installed CLI, not a global or silently downloaded latest version. Commands below use npm because CLI starters use npm; adapt to an existing project's package manager.
6
+
7
+ Locate the actual installed `@bestcheckout/dynamic-component-cli` package through the project dependency (normally `node_modules/@bestcheckout/dynamic-component-cli`, following package-manager links). Call this directory the CLI package root. It is not the Skill installation directory. Read its `package.json` for the version, its `README.md` for the protocol, Runtime API, lifecycle examples and import limits, and `types/index.d.ts` for exact public capabilities. Do not import private Renderer/Admin modules or assume the shop-visual checkout exists. Do not reconstruct the package path using `require.resolve(.../package.json)`: that subpath is not exported.
8
+
9
+ Read the relevant `profiles` from `skills/checkout-theme-dynamic-development/references/behaviors.json` under that installed package. Each profile gives required/conditional outcomes and acceptance criteria. Its `settings_contract.source` points to the adjacent `component-catalog.json`, which describes supported built-in settings and Blocks, not this store's current configuration. Both generated files carry `cli_version` and `runtime_types_sha256`; prefer the installed package's copies over a separately downloaded Skill's copies. If the installed package lacks them, use the Skill's bundled copies as implementation evidence only when the version matches and the SHA-256 of the installed `types/index.d.ts` matches that metadata. This also distinguishes unreleased work that still carries an older package version. On mismatch, do not upgrade automatically or treat newer documentation as support: use existing version-matched Runtime docs, continue independent work, and identify what needs matching documentation or Editor verification. A behavior requirement is not proof of an available public action.
10
+
11
+ For a new project, use the existing CLI `init` flow and the user's chosen package version. If no version is specified, a current public release can initialize the project; inspect and retain its pinned dependency afterward. If the CLI/dependencies are absent or cannot be installed, report that concrete environment limitation, not a missing MCP connection. Browser tooling is needed for CLI validation, not for reading or editing source.
12
+
13
+ ## Choose the smallest implementation
14
+
15
+ Use the shared workflow to interpret text, images and reference URLs, clarify consequential choices and check applicable functions. If supported built-in settings already meet the request, explain the specific Editor change or make it through an authorized available Editor interface. The local CLI does not read store configuration or modify built-in sections. Do not generate custom code just to avoid acknowledging that boundary.
16
+
17
+ For a new or combined business component, read the relevant profiles and public capabilities before coding. Page context may come from provided configuration, an accessible Editor or optional MCP reads. Absence of that context does not prove a conditional behavior is unnecessary. Keep dependencies explicit and preserve existing providers until their replacement has been verified. A local preview must use the target Host's supported data and actions; do not invent data persistence, prices, login or payment success.
18
+
19
+ ## Implement and run focused checks
20
+
21
+ Edit the registered source files in place. Use configured `settings`, the public `runtime` and `context`, allowed React imports, and exported `styles`; follow the installed package's type/import/asset limits. Reuse its starter and lifecycle patterns without treating them as complete business implementations. Use the local manifest/runtime spelling `thankYou` and preserve the registered component ID.
22
+
23
+ Use existing project scripts:
24
+
25
+ ```bash
26
+ npm run dev
27
+ npm run validate
28
+ npm run build
29
+ ```
30
+
31
+ Choose the command needed for the current stage; do not run all commands repeatedly. `dev` stays running for Editor preview. `validate` performs TypeScript and browser definition/schema checks without writing artifacts. `build` includes validation and writes artifacts. Neither proves real business interactions. Use the installed CLI's `--help` for options; `doctor` is useful for environment/connection problems, not a mandatory step. Browser installation and executable-path options are documented in the installed README. If unavailable, distinguish completed source work from unrun validation and do not bypass checks to claim success.
32
+
33
+ Review custom source and desktop/mobile rendering proportionally under the shared workflow. For changed transactional or cross-function behavior, examine relevant failed/stale responses, repeated actions, state subscriptions and cleanup. Report independently what code review, local validation, visual review and real Host integration actually established.
34
+
35
+ ## Editor integration and delivery
36
+
37
+ Use the exact Local URL printed by the server for the component. It is a source module, not a standalone rendered page. Connect it in the matching Editor page at **Component source → Local Dev Server source URL**, then inspect HMR and the required states/interactions. Restart the server after adding components or changing `dynamic.config.json`; reconnect if the port changes. Do not infer visual acceptance from loading a JavaScript module URL.
38
+
39
+ With the development server running, Editor **Save** requests the build/upload and saves page configuration; **Publish** makes the saved changes available to shoppers. CLI `build` only produces local artifacts and does not perform either operation. Preserve existing authorization requirements, keep local/source, preview, saved and published states distinct, and read actual results before claiming success. When Editor access is unavailable, deliver the local source/build result and precise remaining integration steps without claiming it is saved to the store.
40
+
41
+ When MCP is also available, use it for relevant reads if helpful; the task remains local development unless the user chooses a different path. Do not call resource creation/update, accept or publish tools to finish a local CLI task. Do not overwrite local work with a remote source just because the component names match. A deliberate handoff must reconcile identity, current full sources and saved revisions, then use one write path.
42
+
43
+ Finish with the implemented behavior, local verification, Editor integration status and remaining gaps. Real order/payment tests require a suitable authorized environment. An inaccessible Editor or unverified optional capability is not evidence that the implementation has completed the full page flow.