From 0fa1962025646c25c92866a7a0483cf218ace9c7 Mon Sep 17 00:00:00 2001
From: Liam Bigelow <40188355+bglw@users.noreply.github.com>
Date: Thu, 17 Oct 2024 11:46:41 +1300
Subject: [PATCH] Restore SvelteKit tests
---
...veltekit_bookshop_browser_granules.feature | 98 +++++
.../sveltekit_bookshop_live_bindings.feature | 143 +++++++
.../sveltekit_bookshop_live_complex.feature | 29 ++
.../sveltekit_bookshop_live_data.feature | 14 +
...sveltekit_bookshop_live_edge_cases.feature | 2 +
.../sveltekit_bookshop_live_errors.feature | 8 +
.../sveltekit_bookshop_live_filters.feature | 5 +
.../sveltekit_bookshop_live_granules.feature | 23 ++
.../sveltekit_bookshop_live_selective.feature | 8 +
.../sveltekit_bookshop_live_starter.feature | 8 +
.../sveltekit_bookshop_browser.feature | 47 +++
.../sveltekit_bookshop_components.feature | 352 ++++++++++++++++++
.../sveltekit_bookshop_includes.feature | 66 ++++
.../sveltekit/sveltekit_bookshop_live.feature | 5 +
.../integration-tests/package.json | 2 +
javascript-modules/yarn.lock | 184 ++++++++-
16 files changed, 993 insertions(+), 1 deletion(-)
create mode 100644 javascript-modules/integration-tests/features/sveltekit/component_browser/sveltekit_bookshop_browser_granules.feature
create mode 100644 javascript-modules/integration-tests/features/sveltekit/live_editing/sveltekit_bookshop_live_bindings.feature
create mode 100644 javascript-modules/integration-tests/features/sveltekit/live_editing/sveltekit_bookshop_live_complex.feature
create mode 100644 javascript-modules/integration-tests/features/sveltekit/live_editing/sveltekit_bookshop_live_data.feature
create mode 100644 javascript-modules/integration-tests/features/sveltekit/live_editing/sveltekit_bookshop_live_edge_cases.feature
create mode 100644 javascript-modules/integration-tests/features/sveltekit/live_editing/sveltekit_bookshop_live_errors.feature
create mode 100644 javascript-modules/integration-tests/features/sveltekit/live_editing/sveltekit_bookshop_live_filters.feature
create mode 100644 javascript-modules/integration-tests/features/sveltekit/live_editing/sveltekit_bookshop_live_granules.feature
create mode 100644 javascript-modules/integration-tests/features/sveltekit/live_editing/sveltekit_bookshop_live_selective.feature
create mode 100644 javascript-modules/integration-tests/features/sveltekit/live_editing/sveltekit_bookshop_live_starter.feature
create mode 100644 javascript-modules/integration-tests/features/sveltekit/sveltekit_bookshop_browser.feature
create mode 100644 javascript-modules/integration-tests/features/sveltekit/sveltekit_bookshop_components.feature
create mode 100644 javascript-modules/integration-tests/features/sveltekit/sveltekit_bookshop_includes.feature
create mode 100644 javascript-modules/integration-tests/features/sveltekit/sveltekit_bookshop_live.feature
diff --git a/javascript-modules/integration-tests/features/sveltekit/component_browser/sveltekit_bookshop_browser_granules.feature b/javascript-modules/integration-tests/features/sveltekit/component_browser/sveltekit_bookshop_browser_granules.feature
new file mode 100644
index 00000000..ede1f9a7
--- /dev/null
+++ b/javascript-modules/integration-tests/features/sveltekit/component_browser/sveltekit_bookshop_browser_granules.feature
@@ -0,0 +1,98 @@
+@sveltekit
+Feature: SvelteKit Bookshop Component Browser Granular Steps
+
+ Background:
+ Given the file tree:
+ """
+ package.json from starters/generate/package.json # <-- this .json line hurts my syntax highlighting
+ component-lib/
+ bookshop/
+ bookshop.config.js from starters/sveltekit/bookshop.config.js_
+ site/
+ cloudcannon.config.cjs from starters/sveltekit/cloudcannon.config.cjs_
+ svelte.config.js from starters/sveltekit/svelte.config.js_
+ vite.config.js from starters/sveltekit/vite.config.js_
+ package.json from starters/sveltekit/package.json # <-- this .json line hurts my syntax highlighting
+ content/
+ pages/
+ index.md from starters/sveltekit/content/pages/index.md
+ src/
+ app.html from starters/sveltekit/src/app.html
+ routes/
+ +layout.server.js from starters/sveltekit/src/routes/+layout.server.js_
+ +layout.svelte from starters/sveltekit/src/routes/+layout.svelte
+ +page.server.js from starters/sveltekit/src/routes/+page.server.js_
+ +page.svelte from starters/sveltekit/src/routes/+page.svelte
+ """
+ * a component-lib/components/single/single.bookshop.toml file containing:
+ """
+ [spec]
+ structures = [ "content_blocks" ]
+ label = "Single"
+ description = "Single component"
+ icon = "nature_people"
+ tags = ["Basic"]
+
+ [blueprint]
+ title = "Hello There, World"
+ """
+ * a component-lib/components/single/single.svelte file containing:
+ """
+
+
+
{ title }
+ """
+ Given a site/src/routes/index.svelte file containing:
+ """
+
+
+
+ """
+
+ @skip # NYI
+ Scenario: Bookshop adds component browser markup
+ When I run "npm start" in the site directory
+ # Then stderr should be empty
+ * stdout should not be empty
+ * site/build/index.html should contain each row:
+ | text |
+ | |
+ | |
+
+ @skip # NYI
+ Scenario: Bookshop Generate hydrates component browser
+ Given I run "npm start" in the site directory
+ * I run "cloudcannon-reader --output build" in the site directory
+ When I run "npm start" in the . directory
+ # Then stderr should be empty
+ * stdout should contain "Modifying output site at ./site/build"
+ * stdout should contain "Built component browser into 1 page"
+ * site/build/index.html should contain each row:
+ | text |
+ |
+
+ { innards }
+ """
+ Given [boilerplate]:
+ """
+
+ """
+
+ Scenario: Bookshop live renders a simple data binding
+ Given [front_matter]:
+ """
+ hero:
+ _bookshop_name: "TODO: Can only track primitives via _bookshop_name"
+ innards: "Hello World"
+ """
+ And a site/content/pages/index.md file containing:
+ """
+ ---
+ [front_matter]
+ ---
+ """
+ And a site/src/routes/+page.svelte file containing:
+ """
+ [boilerplate]
+
+
+ """
+ And π I have loaded my site in CloudCannon
+ Then π There should be no errors
+ * π There should be no logs
+ Then π The selector h1 should match "Hello World
"
+
+ @skip # TODO: Needs matching test
+ Scenario: Bookshop live renders a nested data binding
+
+ @skip # TODO: Needs matching test
+ Scenario: Bookshop live renders a nested loop data binding
+
+ @skip # TODO: Needs matching test
+ Scenario: Bookshop live renders a data binding through an assign
+
+ @skip # TODO: Needs matching test
+ Scenario: Bookshop live renders a parent data binding over a child
+
+ Scenario: Bookshop live respects the per-component dataBinding flag
+ Given [front_matter]:
+ """
+ hero:
+ _bookshop_name: "TODO: Can only track primitives via _bookshop_name"
+ innards: "Hello World"
+ """
+ And a site/content/pages/index.md file containing:
+ """
+ ---
+ [front_matter]
+ ---
+ """
+ And a site/src/routes/+page.svelte file containing:
+ """
+ [boilerplate]
+
+
+
+
+
+
+
+
+
+ """
+ And π I have loaded my site in CloudCannon
+ Then π There should be no errors
+ * π There should be no logs
+ Then π The selector h1:nth-of-type(1) should match "Hello World
"
+ Then π The selector h1:nth-of-type(2) should match "Hello World
"
+ Then π The selector h1:nth-of-type(3) should match "Hello World
"
+ Then π The selector h1:nth-of-type(4) should match "Hello World
"
+ Then π The selector h1:nth-of-type(5) should match "Hello World
"
+ Then π The selector h1:nth-of-type(6) should match "Hello World
"
+ Then π The selector h1:nth-of-type(7) should match "Hello World
"
+ Then π The selector h1:nth-of-type(8) should match "Hello World
"
+
+ @skip # N/A β omit the trackBookshopData function to achieve this
+ Scenario: Bookshop live respects the global dataBindings flag
diff --git a/javascript-modules/integration-tests/features/sveltekit/live_editing/sveltekit_bookshop_live_complex.feature b/javascript-modules/integration-tests/features/sveltekit/live_editing/sveltekit_bookshop_live_complex.feature
new file mode 100644
index 00000000..c2e7cf85
--- /dev/null
+++ b/javascript-modules/integration-tests/features/sveltekit/live_editing/sveltekit_bookshop_live_complex.feature
@@ -0,0 +1,29 @@
+@sveltekit @web
+Feature: SvelteKit Bookshop CloudCannon Live Editing Selective Re-rendering
+
+ @skip # Handled outside of Bookshop
+ Scenario: Bookshop live renders a subcomponent
+
+ @skip # Handled outside of Bookshop
+ Scenario: Bookshop live renders a subinclude
+
+ @skip # Handled outside of Bookshop
+ Scenario: Bookshop live renders through an assign
+
+ @skip # Handled outside of Bookshop
+ Scenario: Bookshop live renders a top level loop
+
+ @skip # Handled outside of Bookshop
+ Scenario: Bookshop live renders a range loop
+
+ @skip # Handled outside of Bookshop
+ Scenario: Bookshop live renders a dynamic loop
+
+ @skip # Handled outside of Bookshop
+ Scenario: Bookshop live renders a multiline component tag
+
+ @skip # Handled outside of Bookshop
+ Scenario: Bookshop live renders a component without props
+
+ @skip # Handled outside of Bookshop
+ Scenario: Bookshop live renders a nested component path
diff --git a/javascript-modules/integration-tests/features/sveltekit/live_editing/sveltekit_bookshop_live_data.feature b/javascript-modules/integration-tests/features/sveltekit/live_editing/sveltekit_bookshop_live_data.feature
new file mode 100644
index 00000000..fdc96305
--- /dev/null
+++ b/javascript-modules/integration-tests/features/sveltekit/live_editing/sveltekit_bookshop_live_data.feature
@@ -0,0 +1,14 @@
+@sveltekit @web
+Feature: SvelteKit Bookshop CloudCannon Live Editing Site Data
+
+ @skip # NYI
+ Scenario: Bookshop live renders website data
+
+ @skip # NYI
+ Scenario: Bookshop live renders special website config
+
+ @skip # NYI
+ Scenario: Bookshop live renders collections
+
+ @skip # NYI
+ Scenario: Bookshop live renders a warning when using content
diff --git a/javascript-modules/integration-tests/features/sveltekit/live_editing/sveltekit_bookshop_live_edge_cases.feature b/javascript-modules/integration-tests/features/sveltekit/live_editing/sveltekit_bookshop_live_edge_cases.feature
new file mode 100644
index 00000000..e8536da0
--- /dev/null
+++ b/javascript-modules/integration-tests/features/sveltekit/live_editing/sveltekit_bookshop_live_edge_cases.feature
@@ -0,0 +1,2 @@
+@sveltekit @web @bespoke
+Feature: SvelteKit Bookshop CloudCannon Live Editing Edge Cases
diff --git a/javascript-modules/integration-tests/features/sveltekit/live_editing/sveltekit_bookshop_live_errors.feature b/javascript-modules/integration-tests/features/sveltekit/live_editing/sveltekit_bookshop_live_errors.feature
new file mode 100644
index 00000000..68d76a21
--- /dev/null
+++ b/javascript-modules/integration-tests/features/sveltekit/live_editing/sveltekit_bookshop_live_errors.feature
@@ -0,0 +1,8 @@
+@sveltekit @web
+Feature: SvelteKit Bookshop CloudCannon Live Editing Error Boundaries
+
+ @skip # Handled outside of Bookshop
+ Scenario: Bookshop wraps component errors in an error boundary
+
+ @skip # Handled outside of Bookshop
+ Scenario: Bookshop replaces non-existent components in an error boundary
diff --git a/javascript-modules/integration-tests/features/sveltekit/live_editing/sveltekit_bookshop_live_filters.feature b/javascript-modules/integration-tests/features/sveltekit/live_editing/sveltekit_bookshop_live_filters.feature
new file mode 100644
index 00000000..bfb6fb9a
--- /dev/null
+++ b/javascript-modules/integration-tests/features/sveltekit/live_editing/sveltekit_bookshop_live_filters.feature
@@ -0,0 +1,5 @@
+@sveltekit @web
+Feature: SvelteKit Bookshop CloudCannon Live Editing Filters and Functions
+
+ @skip # Handled outside of Bookshop
+ Scenario: Bookshop live renders markdown
diff --git a/javascript-modules/integration-tests/features/sveltekit/live_editing/sveltekit_bookshop_live_granules.feature b/javascript-modules/integration-tests/features/sveltekit/live_editing/sveltekit_bookshop_live_granules.feature
new file mode 100644
index 00000000..0e553e83
--- /dev/null
+++ b/javascript-modules/integration-tests/features/sveltekit/live_editing/sveltekit_bookshop_live_granules.feature
@@ -0,0 +1,23 @@
+@sveltekit
+Feature: SvelteKit Bookshop CloudCannon Live Editing Granular Steps
+
+ @skip # Handled outside of Bookshop
+ Scenario: Bookshop adds live editing markup
+
+ @skip # Handled outside of Bookshop
+ Scenario: Bookshop Generate hydrates live editing
+
+ @skip # Handled outside of Bookshop
+ Scenario: Bookshop live renders when CloudCannon initialises
+
+ @skip # Handled outside of Bookshop
+ Scenario: Bookshop live renders when CloudCannon pushes new data
+
+ @skip # Handled outside of Bookshop
+ Scenario: Bookshop live renders flat components when CloudCannon pushes new data
+
+ @skip # Handled outside of Bookshop
+ Scenario: Bookshop doesn't live render flagged components
+
+ @skip # Handled outside of Bookshop
+ Scenario: Bookshop sets a flag when live editing
diff --git a/javascript-modules/integration-tests/features/sveltekit/live_editing/sveltekit_bookshop_live_selective.feature b/javascript-modules/integration-tests/features/sveltekit/live_editing/sveltekit_bookshop_live_selective.feature
new file mode 100644
index 00000000..8dfb5e44
--- /dev/null
+++ b/javascript-modules/integration-tests/features/sveltekit/live_editing/sveltekit_bookshop_live_selective.feature
@@ -0,0 +1,8 @@
+@sveltekit @web
+Feature: SvelteKit Bookshop CloudCannon Live Editing Selective Re-rendering
+
+ @skip # Handled outside of Bookshop
+ Scenario: Bookshop selectively live renders a loop
+
+ @skip # Handled outside of Bookshop
+ Scenario: Bookshop live renders components depth first
diff --git a/javascript-modules/integration-tests/features/sveltekit/live_editing/sveltekit_bookshop_live_starter.feature b/javascript-modules/integration-tests/features/sveltekit/live_editing/sveltekit_bookshop_live_starter.feature
new file mode 100644
index 00000000..e4b90588
--- /dev/null
+++ b/javascript-modules/integration-tests/features/sveltekit/live_editing/sveltekit_bookshop_live_starter.feature
@@ -0,0 +1,8 @@
+@sveltekit @web
+Feature: SvelteKit Bookshop CloudCannon Starter Template Live Editing
+
+ @skip # Handled outside of Bookshop
+ Scenario: Bookshop live renders updates to the starter template
+
+ @skip # TODO
+ Scenario: Bookshop live renders starter template data bindings
diff --git a/javascript-modules/integration-tests/features/sveltekit/sveltekit_bookshop_browser.feature b/javascript-modules/integration-tests/features/sveltekit/sveltekit_bookshop_browser.feature
new file mode 100644
index 00000000..01e67d3f
--- /dev/null
+++ b/javascript-modules/integration-tests/features/sveltekit/sveltekit_bookshop_browser.feature
@@ -0,0 +1,47 @@
+@sveltekit
+Feature: SvelteKit Bookshop Component Browser
+ As a user of SvelteKit with Bookshop
+ I want my component browser to be preconfigured to my bookshop
+ So that I can view components while developing
+
+ Background:
+ Given the file tree:
+ """
+ component-lib/
+ bookshop/
+ bookshop.config.js from starters/sveltekit/bookshop.config.js_
+ site/
+ svelte.config.js from starters/sveltekit/svelte.config.js_
+ vite.config.js from starters/sveltekit/vite.config.js_
+ package.json from starters/sveltekit/package.json # <-- this .json line hurts my syntax highlighting
+ content/
+ pages/
+ index.md from starters/sveltekit/content/pages/index.md
+ src/
+ app.html from starters/sveltekit/src/app.html
+ routes/
+ +layout.server.js from starters/sveltekit/src/routes/+layout.server.js_
+ +layout.svelte from starters/sveltekit/src/routes/+layout.svelte
+ +page.server.js from starters/sveltekit/src/routes/+page.server.js_
+ +page.svelte from starters/sveltekit/src/routes/+page.svelte
+ """
+
+ Scenario: Bookshop Browser tags
+ Given a site/src/routes/+page.svelte file containing:
+ """
+
+
+
+
+ """
+ When I run "npm start" in the site directory
+ # Then stderr should be empty
+ And stdout should contain "Wrote site to"
+ And site/build/index.html should contain each row:
+ | text |
+ | |
+ | |
+ | |
+
diff --git a/javascript-modules/integration-tests/features/sveltekit/sveltekit_bookshop_components.feature b/javascript-modules/integration-tests/features/sveltekit/sveltekit_bookshop_components.feature
new file mode 100644
index 00000000..7441a69a
--- /dev/null
+++ b/javascript-modules/integration-tests/features/sveltekit/sveltekit_bookshop_components.feature
@@ -0,0 +1,352 @@
+@sveltekit
+Feature: Basic SvelteKit Bookshop
+ As a user of SvelteKit with Bookshop
+ I want to be able to use components
+ So that I can build my site
+
+ Background:
+ Given the file tree:
+ """
+ component-lib/
+ package.json from starters/sveltekit/package.json # <-- this .json line hurts my syntax highlighting
+ bookshop/
+ bookshop.config.js from starters/sveltekit/bookshop.config.js_
+ site/
+ svelte.config.js from starters/sveltekit/svelte.config.js_
+ vite.config.js from starters/sveltekit/vite.config.js_
+ package.json from starters/sveltekit/package.json # <-- this .json line hurts my syntax highlighting
+ content/
+ pages/
+ index.md from starters/sveltekit/content/pages/index.md
+ src/
+ app.html from starters/sveltekit/src/app.html
+ routes/
+ +layout.server.js from starters/sveltekit/src/routes/+layout.server.js_
+ +layout.svelte from starters/sveltekit/src/routes/+layout.svelte
+ +page.server.js from starters/sveltekit/src/routes/+page.server.js_
+ +page.svelte from starters/sveltekit/src/routes/+page.svelte
+ """
+ Given I run "npm i" in the component-lib directory
+
+ Scenario: Tests are functional
+ Given a site/content/pages/index.md file containing:
+ """
+ ---
+ ---
+ # Hello World!
+ """
+ When I run "npm start" in the site directory
+ # Then stderr should be empty
+ And stdout should contain "Wrote site to"
+ And site/build/index.html should contain the text "Hello World!"
+
+ Scenario: Components are rendered from bookshop
+ Given a component-lib/components/title/title.svelte file containing:
+ """
+
+
+ Bookshop: { text }
+ """
+ And a site/src/routes/+page.svelte file containing:
+ """
+
+
+
+
+
+ """
+ When I run "npm start" in the site directory
+ # Then stderr should be empty
+ And stdout should contain "Wrote site to"
+ And site/build/index.html should contain the text "Bookshop: Result π«₯"
+
+ Scenario: Nested components are rendered from bookshop
+ Given a component-lib/components/nested/title/title.svelte file containing:
+ """
+
+
+ Bookshop: { text }
+ """
+ And a site/src/routes/+page.svelte file containing:
+ """
+
+
+
+
+
+ """
+ When I run "npm start" in the site directory
+ # Then stderr should be empty
+ And stdout should contain "Wrote site to"
+ And site/build/index.html should contain the text "Bookshop: Result π«₯"
+
+ Scenario: Flat root components are rendered from bookshop
+ Given a component-lib/components/title.svelte file containing:
+ """
+
+
+ Bookshop: { text }
+ """
+ And a site/src/routes/+page.svelte file containing:
+ """
+
+
+
+
+
+ """
+ When I run "npm start" in the site directory
+ # Then stderr should be empty
+ And stdout should contain "Wrote site to"
+ And site/build/index.html should contain the text "Bookshop: Result π«₯"
+
+ Scenario: Nested flat components are rendered from bookshop
+ Given a component-lib/components/nested/title.svelte file containing:
+ """
+
+
+ Bookshop: { text }
+ """
+ And a site/src/routes/+page.svelte file containing:
+ """
+
+
+
+
+
+ """
+ When I run "npm start" in the site directory
+ # Then stderr should be empty
+ And stdout should contain "Wrote site to"
+ And site/build/index.html should contain the text "Bookshop: Result π«₯"
+
+ Scenario: Standard components take precendence over flat components
+ Given a component-lib/components/nested/title.svelte file containing:
+ """
+
+
+ Flat: { text }
+ """
+ Given a component-lib/components/nested/title/title.svelte file containing:
+ """
+
+
+ Standard: { text }
+ """
+ And a site/src/routes/+page.svelte file containing:
+ """
+
+
+
+
+
+ """
+ When I run "npm start" in the site directory
+ # Then stderr should be empty
+ And stdout should contain "Wrote site to"
+ And site/build/index.html should contain the text "Standard: Result π«₯"
+
+ Scenario: Components can use the page front matter
+ Given a component-lib/components/title/title.svelte file containing:
+ """
+
+
+ Bookshop: { text }
+ """
+ And a site/content/pages/index.md file containing:
+ """
+ ---
+ title_text: "Result β€οΈβπ₯"
+ ---
+ """
+ And a site/src/routes/+page.svelte file containing:
+ """
+
+
+
+
+
+ """
+ When I run "npm start" in the site directory
+ # Then stderr should be empty
+ And stdout should contain "Wrote site to"
+ And site/build/index.html should contain the text "Bookshop: Result β€οΈβπ₯"
+
+ Scenario: Components can use further components
+ Given a component-lib/components/hero/hero.svelte file containing:
+ """
+
+
+ { text }
+
+ """
+ And a component-lib/components/tag/tag.svelte file containing:
+ """
+
+
+ { tagprop.label }
+ """
+ And a site/content/pages/index.md file containing:
+ """
+ ---
+ title_text: "πͺ¬"
+ hero:
+ tag:
+ label: "πͺ€"
+ ---
+ """
+ And a site/src/routes/+page.svelte file containing:
+ """
+
+
+
+
+
+ """
+ When I run "npm start" in the site directory
+ # Then stderr should be empty
+ And stdout should contain "Wrote site to"
+ And site/build/index.html should contain the text "πͺ¬
"
+ And site/build/index.html should contain the text "πͺ€"
+
+ Scenario: Bookshop tags can use the bind syntax
+ Given a component-lib/components/card/card.svelte file containing:
+ """
+
+
+ { title }
+ { description }
+ """
+ And a site/content/pages/index.md file containing:
+ """
+ ---
+ card:
+ title: "π£"
+ description: "π"
+ ---
+ """
+ And a site/src/routes/+page.svelte file containing:
+ """
+
+
+
+
+
+ """
+ When I run "npm start" in the site directory
+ # Then stderr should be empty
+ And stdout should contain "Wrote site to"
+ And site/build/index.html should contain the text "π£
"
+ And site/build/index.html should contain the text "π
"
+
+ @skip # A given
+ Scenario: Bookshop tags should support dynamic names
+
+ @skip # TODO: Worth a test
+ Scenario: Bookshop page building components should work
+
diff --git a/javascript-modules/integration-tests/features/sveltekit/sveltekit_bookshop_includes.feature b/javascript-modules/integration-tests/features/sveltekit/sveltekit_bookshop_includes.feature
new file mode 100644
index 00000000..9a55aa61
--- /dev/null
+++ b/javascript-modules/integration-tests/features/sveltekit/sveltekit_bookshop_includes.feature
@@ -0,0 +1,66 @@
+@sveltekit
+Feature: SvelteKit Bookshop Includes
+ As a user of SvelteKit with Bookshop
+ I want includes scoped to the bookshop
+ So that I can use them on the site or in components
+
+ Background:
+ Given the file tree:
+ """
+ component-lib/
+ package.json from starters/sveltekit/package.json # <-- this .json line hurts my syntax highlighting
+ bookshop/
+ bookshop.config.js from starters/sveltekit/bookshop.config.js_
+ site/
+ svelte.config.js from starters/sveltekit/svelte.config.js_
+ vite.config.js from starters/sveltekit/vite.config.js_
+ package.json from starters/sveltekit/package.json # <-- this .json line hurts my syntax highlighting
+ content/
+ pages/
+ index.md from starters/sveltekit/content/pages/index.md
+ src/
+ app.html from starters/sveltekit/src/app.html
+ routes/
+ +layout.server.js from starters/sveltekit/src/routes/+layout.server.js_
+ +layout.svelte from starters/sveltekit/src/routes/+layout.svelte
+ +page.server.js from starters/sveltekit/src/routes/+page.server.js_
+ +page.svelte from starters/sveltekit/src/routes/+page.svelte
+ """
+ Given I run "npm i" in the component-lib directory
+
+ Scenario: Basic Bookshop Include
+ Given a component-lib/shared/svelte/basic.svelte file containing:
+ """
+
+
+ {label}π
+ """
+ Given a component-lib/components/block/block.svelte file containing:
+ """
+
+
+ -Block
+ """
+ And a site/src/routes/+page.svelte file containing:
+ """
+
+
+
+ -Inline
+ """
+ When I run "npm start" in the site directory
+ # Then stderr should be empty
+ And stdout should contain "Wrote site to"
+ And site/build/index.html should leniently contain each row:
+ | text |
+ | Componentπ -Block |
+ | Siteπ -Inline |
diff --git a/javascript-modules/integration-tests/features/sveltekit/sveltekit_bookshop_live.feature b/javascript-modules/integration-tests/features/sveltekit/sveltekit_bookshop_live.feature
new file mode 100644
index 00000000..d69fc215
--- /dev/null
+++ b/javascript-modules/integration-tests/features/sveltekit/sveltekit_bookshop_live.feature
@@ -0,0 +1,5 @@
+@sveltekit
+Feature: SvelteKit Bookshop CloudCannon Integration
+
+ @skip # SvelteKit implements alternative live rendering
+ Scenario: Bookshop Live schema comments
diff --git a/javascript-modules/integration-tests/package.json b/javascript-modules/integration-tests/package.json
index bc6878f6..fb2b0142 100644
--- a/javascript-modules/integration-tests/package.json
+++ b/javascript-modules/integration-tests/package.json
@@ -33,6 +33,8 @@
"@cloudcannon/svelte-connector": "^1.0.3",
"@cucumber/cucumber": "^7.3.1",
"@sveltejs/adapter-static": "^3.0.5",
+ "@sveltejs/kit": "^2.7.1",
+ "@sveltejs/vite-plugin-svelte": "*",
"@types/react": "^18",
"@types/react-dom": "^18",
"astro": "^4.15.12",
diff --git a/javascript-modules/yarn.lock b/javascript-modules/yarn.lock
index a39dd643..89bc03c9 100644
--- a/javascript-modules/yarn.lock
+++ b/javascript-modules/yarn.lock
@@ -2216,6 +2216,13 @@ __metadata:
languageName: node
linkType: hard
+"@polka/url@npm:^1.0.0-next.24":
+ version: 1.0.0-next.28
+ resolution: "@polka/url@npm:1.0.0-next.28"
+ checksum: 7402aaf1de781d0eb0870d50cbcd394f949aee11b38a267a5c3b4e3cfee117e920693e6e93ce24c87ae2d477a59634f39d9edde8e86471cae756839b07c79af7
+ languageName: node
+ linkType: hard
+
"@puppeteer/browsers@npm:2.4.0":
version: 2.4.0
resolution: "@puppeteer/browsers@npm:2.4.0"
@@ -2473,6 +2480,63 @@ __metadata:
languageName: node
linkType: hard
+"@sveltejs/kit@npm:^2.7.1":
+ version: 2.7.1
+ resolution: "@sveltejs/kit@npm:2.7.1"
+ dependencies:
+ "@types/cookie": ^0.6.0
+ cookie: ^0.6.0
+ devalue: ^5.1.0
+ esm-env: ^1.0.0
+ import-meta-resolve: ^4.1.0
+ kleur: ^4.1.5
+ magic-string: ^0.30.5
+ mrmime: ^2.0.0
+ sade: ^1.8.1
+ set-cookie-parser: ^2.6.0
+ sirv: ^3.0.0
+ tiny-glob: ^0.2.9
+ peerDependencies:
+ "@sveltejs/vite-plugin-svelte": ^3.0.0 || ^4.0.0-next.1
+ svelte: ^4.0.0 || ^5.0.0-next.0
+ vite: ^5.0.3
+ bin:
+ svelte-kit: svelte-kit.js
+ checksum: c0e573c15eb641761921182a1e14e88ee9c298fc75ed5596b8d3fef4fc5d9f71cfb5a554a24fd1b86e36b07b013fc0551c7bfef7908c522336925d4172a37c2b
+ languageName: node
+ linkType: hard
+
+"@sveltejs/vite-plugin-svelte-inspector@npm:^2.1.0":
+ version: 2.1.0
+ resolution: "@sveltejs/vite-plugin-svelte-inspector@npm:2.1.0"
+ dependencies:
+ debug: ^4.3.4
+ peerDependencies:
+ "@sveltejs/vite-plugin-svelte": ^3.0.0
+ svelte: ^4.0.0 || ^5.0.0-next.0
+ vite: ^5.0.0
+ checksum: 8ef577bb58f8b7b9ccc2e9fa556490be167bc1dce1b7585d98a33e12bc289c96e35d992925e2875ceb30864577aa5ba80a71d2f3215dc46a78c44f6377fe4ffe
+ languageName: node
+ linkType: hard
+
+"@sveltejs/vite-plugin-svelte@npm:*":
+ version: 3.1.2
+ resolution: "@sveltejs/vite-plugin-svelte@npm:3.1.2"
+ dependencies:
+ "@sveltejs/vite-plugin-svelte-inspector": ^2.1.0
+ debug: ^4.3.4
+ deepmerge: ^4.3.1
+ kleur: ^4.1.5
+ magic-string: ^0.30.10
+ svelte-hmr: ^0.16.0
+ vitefu: ^0.2.5
+ peerDependencies:
+ svelte: ^4.0.0 || ^5.0.0-next.0
+ vite: ^5.0.0
+ checksum: cd255badccf995510aa61b48f8be2c6624baf36dfefff6e64c54e05aa9f0978c6298cbd7db517c54052dfabba1f31de2b973cecbbeefa7a7679fc02f02d62ce0
+ languageName: node
+ linkType: hard
+
"@tootallnate/once@npm:2":
version: 2.0.0
resolution: "@tootallnate/once@npm:2.0.0"
@@ -4496,6 +4560,13 @@ __metadata:
languageName: node
linkType: hard
+"cookie@npm:^0.6.0":
+ version: 0.6.0
+ resolution: "cookie@npm:0.6.0"
+ checksum: f56a7d32a07db5458e79c726b77e3c2eff655c36792f2b6c58d351fb5f61531e5b1ab7f46987150136e366c65213cbe31729e02a3eaed630c3bf7334635fb410
+ languageName: node
+ linkType: hard
+
"cookie@npm:^0.7.2":
version: 0.7.2
resolution: "cookie@npm:0.7.2"
@@ -4774,6 +4845,13 @@ __metadata:
languageName: node
linkType: hard
+"deepmerge@npm:^4.3.1":
+ version: 4.3.1
+ resolution: "deepmerge@npm:4.3.1"
+ checksum: 2024c6a980a1b7128084170c4cf56b0fd58a63f2da1660dcfe977415f27b17dbe5888668b59d0b063753f3220719d5e400b7f113609489c90160bb9a5518d052
+ languageName: node
+ linkType: hard
+
"default-require-extensions@npm:^3.0.0":
version: 3.0.1
resolution: "default-require-extensions@npm:3.0.1"
@@ -4913,7 +4991,7 @@ __metadata:
languageName: node
linkType: hard
-"devalue@npm:^5.1.1":
+"devalue@npm:^5.1.0, devalue@npm:^5.1.1":
version: 5.1.1
resolution: "devalue@npm:5.1.1"
checksum: 3b6a655e97b59b528d68f89d644b4bd7be9cd502e49ed9ae990caac56b93dc015790e2d099f264b1533d7235e14ec9513e92a7bc1b5031d355064bb37dcc99ca
@@ -5869,6 +5947,13 @@ __metadata:
languageName: node
linkType: hard
+"esm-env@npm:^1.0.0":
+ version: 1.0.0
+ resolution: "esm-env@npm:1.0.0"
+ checksum: 3372b918ebb213b2c31e9a6ebc437e1f20062363413f837b6ca4c47bda38d7ba983c3a1a8eb8d9d8434969e9366bba8632743f1b8c7cf637a9c8a25ae95d865e
+ languageName: node
+ linkType: hard
+
"esm-import-transformer@npm:^3.0.2":
version: 3.0.2
resolution: "esm-import-transformer@npm:3.0.2"
@@ -6740,6 +6825,13 @@ __metadata:
languageName: node
linkType: hard
+"globalyzer@npm:0.1.0":
+ version: 0.1.0
+ resolution: "globalyzer@npm:0.1.0"
+ checksum: 419a0f95ba542534fac0842964d31b3dc2936a479b2b1a8a62bad7e8b61054faa9b0a06ad9f2e12593396b9b2621cac93358d9b3071d33723fb1778608d358a1
+ languageName: node
+ linkType: hard
+
"globby@npm:^14.0.0":
version: 14.0.2
resolution: "globby@npm:14.0.2"
@@ -6754,6 +6846,13 @@ __metadata:
languageName: node
linkType: hard
+"globrex@npm:^0.1.2":
+ version: 0.1.2
+ resolution: "globrex@npm:0.1.2"
+ checksum: adca162494a176ce9ecf4dd232f7b802956bb1966b37f60c15e49d2e7d961b66c60826366dc2649093cad5a0d69970cfa8875bd1695b5a1a2f33dcd2aa88da3c
+ languageName: node
+ linkType: hard
+
"gopd@npm:^1.0.1":
version: 1.0.1
resolution: "gopd@npm:1.0.1"
@@ -7421,6 +7520,8 @@ __metadata:
"@cloudcannon/svelte-connector": ^1.0.3
"@cucumber/cucumber": ^7.3.1
"@sveltejs/adapter-static": ^3.0.5
+ "@sveltejs/kit": ^2.7.1
+ "@sveltejs/vite-plugin-svelte": "*"
"@types/react": ^18
"@types/react-dom": ^18
astro: ^4.15.12
@@ -8491,6 +8592,15 @@ __metadata:
languageName: node
linkType: hard
+"magic-string@npm:^0.30.10, magic-string@npm:^0.30.5":
+ version: 0.30.12
+ resolution: "magic-string@npm:0.30.12"
+ dependencies:
+ "@jridgewell/sourcemap-codec": ^1.5.0
+ checksum: 3f0d23b74371765f0e6cad4284eebba0ac029c7a55e39292de5aa92281afb827138cb2323d24d2924f6b31f138c3783596c5ccaa98653fe9cf122e1f81325b59
+ languageName: node
+ linkType: hard
+
"magic-string@npm:^0.30.11, magic-string@npm:^0.30.4":
version: 0.30.11
resolution: "magic-string@npm:0.30.11"
@@ -9740,6 +9850,13 @@ __metadata:
languageName: node
linkType: hard
+"mri@npm:^1.1.0":
+ version: 1.2.0
+ resolution: "mri@npm:1.2.0"
+ checksum: 83f515abbcff60150873e424894a2f65d68037e5a7fcde8a9e2b285ee9c13ac581b63cfc1e6826c4732de3aeb84902f7c1e16b7aff46cd3f897a0f757a894e85
+ languageName: node
+ linkType: hard
+
"mrmime@npm:^2.0.0":
version: 2.0.0
resolution: "mrmime@npm:2.0.0"
@@ -11897,6 +12014,15 @@ __metadata:
languageName: node
linkType: hard
+"sade@npm:^1.8.1":
+ version: 1.8.1
+ resolution: "sade@npm:1.8.1"
+ dependencies:
+ mri: ^1.1.0
+ checksum: 0756e5b04c51ccdc8221ebffd1548d0ce5a783a44a0fa9017a026659b97d632913e78f7dca59f2496aa996a0be0b0c322afd87ca72ccd909406f49dbffa0f45d
+ languageName: node
+ linkType: hard
+
"safe-buffer@npm:5.2.1, safe-buffer@npm:~5.2.0":
version: 5.2.1
resolution: "safe-buffer@npm:5.2.1"
@@ -12124,6 +12250,13 @@ __metadata:
languageName: node
linkType: hard
+"set-cookie-parser@npm:^2.6.0":
+ version: 2.7.0
+ resolution: "set-cookie-parser@npm:2.7.0"
+ checksum: 1eed43d7b284b727b4e7d35e324a74c493469265488b0c8f464f5224186e7dbbdd1cb35c8822053581f807a10b930a628144041ad453db06548945c61d5a834f
+ languageName: node
+ linkType: hard
+
"set-function-length@npm:^1.2.1":
version: 1.2.2
resolution: "set-function-length@npm:1.2.2"
@@ -12286,6 +12419,17 @@ __metadata:
languageName: node
linkType: hard
+"sirv@npm:^3.0.0":
+ version: 3.0.0
+ resolution: "sirv@npm:3.0.0"
+ dependencies:
+ "@polka/url": ^1.0.0-next.24
+ mrmime: ^2.0.0
+ totalist: ^3.0.0
+ checksum: 04b8036cab13971737dbb12b184a88f3d9aba955eed5600d27250f3dfd0a0ad1ff7a343537511b54d4fda36f629e2ffe25813f900d84cf4e3c08a7292f458af1
+ languageName: node
+ linkType: hard
+
"sisteransi@npm:^1.0.5":
version: 1.0.5
resolution: "sisteransi@npm:1.0.5"
@@ -12831,6 +12975,15 @@ __metadata:
languageName: node
linkType: hard
+"svelte-hmr@npm:^0.16.0":
+ version: 0.16.0
+ resolution: "svelte-hmr@npm:0.16.0"
+ peerDependencies:
+ svelte: ^3.19.0 || ^4.0.0
+ checksum: c99a48df9776f47b4262b4a601bead6d100d7a031b13aa1203b97eb456afde7a9a27c4ddb0a66f8b4655f69cf0d955e96dd26040e54d421d431ae01a6c09b918
+ languageName: node
+ linkType: hard
+
"svelte@npm:4.2.19, svelte@npm:^4.2.19":
version: 4.2.19
resolution: "svelte@npm:4.2.19"
@@ -12980,6 +13133,16 @@ __metadata:
languageName: node
linkType: hard
+"tiny-glob@npm:^0.2.9":
+ version: 0.2.9
+ resolution: "tiny-glob@npm:0.2.9"
+ dependencies:
+ globalyzer: 0.1.0
+ globrex: ^0.1.2
+ checksum: aea5801eb6663ddf77ebb74900b8f8bd9dfcfc9b6a1cc8018cb7421590c00bf446109ff45e4b64a98e6c95ddb1255a337a5d488fb6311930e2a95334151ec9c6
+ languageName: node
+ linkType: hard
+
"tinycolor@npm:0.x":
version: 0.0.1
resolution: "tinycolor@npm:0.0.1"
@@ -13047,6 +13210,13 @@ __metadata:
languageName: node
linkType: hard
+"totalist@npm:^3.0.0":
+ version: 3.0.1
+ resolution: "totalist@npm:3.0.1"
+ checksum: 5132d562cf88ff93fd710770a92f31dbe67cc19b5c6ccae2efc0da327f0954d211bbfd9456389655d726c624f284b4a23112f56d1da931ca7cfabbe1f45e778a
+ languageName: node
+ linkType: hard
+
"tough-cookie@npm:^4.0.0":
version: 4.1.4
resolution: "tough-cookie@npm:4.1.4"
@@ -13673,6 +13843,18 @@ __metadata:
languageName: node
linkType: hard
+"vitefu@npm:^0.2.5":
+ version: 0.2.5
+ resolution: "vitefu@npm:0.2.5"
+ peerDependencies:
+ vite: ^3.0.0 || ^4.0.0 || ^5.0.0
+ peerDependenciesMeta:
+ vite:
+ optional: true
+ checksum: 1a58f3f8b2fe493f595952ad2e8d2876a18e2de16b211c2e795af879863948db838bdcc962d300c7fbd8d827ee616905d7799c30a46206a045aec5f7c8e5031b
+ languageName: node
+ linkType: hard
+
"vitefu@npm:^1.0.2":
version: 1.0.2
resolution: "vitefu@npm:1.0.2"