@slicemedia/create-devkit 0.2.0 → 0.3.0
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.
- package/dist/scaffold.js +1 -1
- package/dist/template/README.md +25 -2
- package/dist/template/WEBFLOW_PROJECT.md +7 -1
- package/dist/template/devkit.config.json +18 -1
- package/dist/template/package.json +1 -1
- package/dist/versions.generated.d.ts +3 -3
- package/dist/versions.generated.js +3 -3
- package/package.json +1 -1
package/dist/scaffold.js
CHANGED
|
@@ -89,7 +89,7 @@ export function createProjectSlider(
|
|
|
89
89
|
integrationFile: "src/integrations/animations.ts",
|
|
90
90
|
renderIntegration: () => `import { gsap } from "gsap";
|
|
91
91
|
|
|
92
|
-
/** Project-owned GSAP
|
|
92
|
+
/** Project-owned GSAP integration. Import only from the addon/project entry that needs it. */
|
|
93
93
|
export { gsap };
|
|
94
94
|
`,
|
|
95
95
|
},
|
package/dist/template/README.md
CHANGED
|
@@ -11,10 +11,33 @@ starter is deliberately neutral: no optional capability is imported by `src/main
|
|
|
11
11
|
4. Import only the generated files under `src/integrations/` that the project is ready to compose.
|
|
12
12
|
5. Run `pnpm typecheck` and `pnpm build`.
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
Create each public browser entry in `src/addons/<name>.ts` or `src/addons/<name>/index.ts`.
|
|
15
|
+
The build emits separate standalone ES2018 scripts at `dist/addons/<name>.js` and optional
|
|
16
|
+
`dist/addons/<name>.css`. Shared helpers belong outside these entry paths or in `_`-prefixed files.
|
|
17
|
+
New addons are discovered automatically alongside entries configured in `devkit.config.json`.
|
|
18
|
+
`pnpm catalog -- --json` inspects all public entries. Use
|
|
16
19
|
`pnpm devkit -- <command>` for other DevKit commands.
|
|
17
20
|
|
|
21
|
+
Run `pnpm devkit -- explain <name>` for an addon's Webflow setup guide and local testing tags. Add
|
|
22
|
+
`--public-base-url` with the deployed asset base URL for production JS/CSS tags. Load only the
|
|
23
|
+
scripts needed on each page. The optional neutral `src/main.ts` entry builds separately to
|
|
24
|
+
`dist/projects/project.js` and optional CSS; remove its config entry if no shared project script
|
|
25
|
+
is needed. It does not import or collect addon entries.
|
|
26
|
+
|
|
27
|
+
Each addon entry explicitly initializes its behavior and registers its API with the shared
|
|
28
|
+
DevKit runtime. Inline scripts can then use `window.slicemediaDevKit.counter.refresh()` or
|
|
29
|
+
`window.slicemediaDevKit.whenReady("counter", callback)`. Keep package definitions inert; put
|
|
30
|
+
browser initialization in the public entry. The build also writes `dist/webflow-scripts.json`
|
|
31
|
+
with the actual script and stylesheet paths.
|
|
32
|
+
|
|
33
|
+
`pnpm build -- --sourcemap` generates private JavaScript maps in `.slicemedia/sourcemaps/`, outside
|
|
34
|
+
`dist/`. Deploy only `dist/`; keep debugging artifacts private. The production bundle contains no
|
|
35
|
+
map references. Browser JavaScript itself remains publicly inspectable.
|
|
36
|
+
|
|
37
|
+
The repository documentation includes an optional worked example at
|
|
38
|
+
[`docs/examples/on-demand-counter`](https://github.com/slicemedia/devkit/tree/main/docs/examples/on-demand-counter).
|
|
39
|
+
Example features are not copied into generated projects.
|
|
40
|
+
|
|
18
41
|
The project-owned `WEBFLOW_PROJECT.md` is always present. If agent targets were selected, run
|
|
19
42
|
`pnpm agents:generate` after installation. Slice Media Agent Kit preserves that guide and creates
|
|
20
43
|
only the requested Codex, Claude, Cursor, Copilot, or Webflow files; it is maintained in a separate
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
# Webflow project guidance
|
|
2
2
|
|
|
3
3
|
Webflow owns editable structure, components, styles, CMS content, forms, and native interactions.
|
|
4
|
-
This project owns only
|
|
4
|
+
This project owns only explicitly authored browser enhancements. Put each public addon entry in
|
|
5
|
+
`src/addons/<name>.ts` or `src/addons/<name>/index.ts`; each builds to its own
|
|
6
|
+
`dist/addons/<name>.js` and optional stylesheet. Load only the scripts needed on each Webflow page.
|
|
7
|
+
Use `src/main.ts` or `src/projects/` only for optional, deliberately composed project behavior.
|
|
5
8
|
|
|
6
9
|
- Prefer native Webflow features before adding code.
|
|
7
10
|
- Use documented, scoped `data-wft-*` hooks instead of generated classes or guessed identifiers.
|
|
8
11
|
- Keep optional files under `src/integrations/` disconnected until their markup contract is ready.
|
|
9
12
|
- Make initialization idempotent and restore owned DOM, attributes, listeners, observers, and timers
|
|
10
13
|
during teardown.
|
|
14
|
+
- Install the shared DevKit runtime explicitly and register each public addon API after successful
|
|
15
|
+
initialization. Inline scripts can use `window.slicemediaDevKit.whenReady(name, callback)` and
|
|
16
|
+
direct named access such as `window.slicemediaDevKit.counter.refresh()`.
|
|
11
17
|
- Inspect before remote work. Webflow writes and publishing require an explicit request, review,
|
|
12
18
|
read-back, and verification through the official Webflow MCP server.
|
|
13
19
|
|
|
@@ -2,13 +2,30 @@
|
|
|
2
2
|
"entries": [
|
|
3
3
|
{
|
|
4
4
|
"name": "project",
|
|
5
|
+
"kind": "project",
|
|
5
6
|
"input": "src/main.ts",
|
|
6
7
|
"version": "0.1.0",
|
|
7
|
-
"description": "
|
|
8
|
+
"description": "Optional project-wide browser entry; addons build independently.",
|
|
8
9
|
"placement": "body-end",
|
|
9
10
|
"dependencies": [],
|
|
10
11
|
"attributes": [],
|
|
11
12
|
"scriptAttributes": {},
|
|
13
|
+
"bundle": {
|
|
14
|
+
"input": "src/main.ts",
|
|
15
|
+
"scriptFile": "projects/project.js",
|
|
16
|
+
"cssFile": "projects/project.css"
|
|
17
|
+
},
|
|
18
|
+
"usage": {
|
|
19
|
+
"setup": [
|
|
20
|
+
"Author the required markup and data-wft-* hooks in Webflow.",
|
|
21
|
+
"Create standalone browser entries under src/addons/ and document their contracts.",
|
|
22
|
+
"Use src/project.ts only for deliberately shared project behavior; it is optional.",
|
|
23
|
+
"Run the local dev server and test only the scripts needed on an approved Webflow testing page."
|
|
24
|
+
],
|
|
25
|
+
"notes": [
|
|
26
|
+
"The starter has no feature behavior. Remove this entry if no project-wide script is needed; addon discovery remains active."
|
|
27
|
+
]
|
|
28
|
+
},
|
|
12
29
|
"api": {
|
|
13
30
|
"entry": "webflow-project",
|
|
14
31
|
"capabilities": []
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"type": "module",
|
|
7
7
|
"packageManager": "pnpm@11.21.0",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"build": "slicemedia-devkit build
|
|
9
|
+
"build": "slicemedia-devkit build",
|
|
10
10
|
"catalog": "slicemedia-devkit catalog --root .",
|
|
11
11
|
"dev": "slicemedia-devkit dev",
|
|
12
12
|
"sanitize": "slicemedia-devkit sanitize --root .",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** Generated by scripts/sync-versions.mjs. Do not edit by hand. */
|
|
2
|
-
export declare const DEVKIT_PACKAGE_VERSION = "0.
|
|
3
|
-
export declare const DEFAULT_DEVKIT_VERSION_RANGE = "^0.
|
|
2
|
+
export declare const DEVKIT_PACKAGE_VERSION = "0.3.0";
|
|
3
|
+
export declare const DEFAULT_DEVKIT_VERSION_RANGE = "^0.3.0";
|
|
4
4
|
export declare const EXTERNAL_PRODUCT_VERSION_RANGES: {
|
|
5
|
-
readonly agentKit: "^0.
|
|
5
|
+
readonly agentKit: "^0.2.0";
|
|
6
6
|
readonly swiperAdapter: "^0.1.0";
|
|
7
7
|
readonly spacesDeployer: "^0.2.0";
|
|
8
8
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** Generated by scripts/sync-versions.mjs. Do not edit by hand. */
|
|
2
|
-
export const DEVKIT_PACKAGE_VERSION = "0.
|
|
3
|
-
export const DEFAULT_DEVKIT_VERSION_RANGE = "^0.
|
|
2
|
+
export const DEVKIT_PACKAGE_VERSION = "0.3.0";
|
|
3
|
+
export const DEFAULT_DEVKIT_VERSION_RANGE = "^0.3.0";
|
|
4
4
|
export const EXTERNAL_PRODUCT_VERSION_RANGES = {
|
|
5
|
-
agentKit: "^0.
|
|
5
|
+
agentKit: "^0.2.0",
|
|
6
6
|
swiperAdapter: "^0.1.0",
|
|
7
7
|
spacesDeployer: "^0.2.0",
|
|
8
8
|
};
|