diff --git a/.editorconfig b/.editorconfig
index ed2a319d58..90846de5ee 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -13,4 +13,3 @@ insert_final_newline = false
[{package.json,.travis.yml,.eslintrc.json}]
indent_style = space
-indent_size = 2
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000000..a299a4435a
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,3 @@
+/site/** -linguist-detectable
+/test/**/samples/** -linguist-detectable
+/**/*.svelte linguist-detectable
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
new file mode 100644
index 0000000000..d632634540
--- /dev/null
+++ b/.github/FUNDING.yml
@@ -0,0 +1 @@
+open_collective: svelte
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
deleted file mode 100644
index f5369e9991..0000000000
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ /dev/null
@@ -1,52 +0,0 @@
----
-name: Bug report
-about: Create a report to help us improve
-title: ''
-labels: 'Bug'
-assignees: ''
-
----
-
-**Describe the bug**
-A clear and concise description of what the bug is.
-
-**Logs**
-Please include browser console and server logs around the time this bug occurred.
-
-**To Reproduce**
-To help us help you, if you've found a bug please consider the following:
-
-* If you can demonstrate the bug using https://svelte.dev/repl, please do.
-* If that's not possible, we recommend creating a small repo that illustrates the problem.
-* Reproductions should be small, self-contained, correct examples – http://sscce.org.
-
-Occasionally, this won't be possible, and that's fine – we still appreciate you raising the issue. But please understand that Svelte is run by unpaid volunteers in their free time, and issues that follow these instructions will get fixed faster.
-
-**Expected behavior**
-A clear and concise description of what you expected to happen.
-
-**Stacktraces**
-If you have a stack trace to include, we recommend putting inside a `` block for the sake of the thread's readability:
-
-
- Stack trace
-
- Stack trace goes here...
-
-
-**Information about your Svelte project:**
-- Your browser and the version: (e.x. Chrome 52.1, Firefox 48.0, IE 10)
-
-- Your operating system: (e.x. OS X 10, Ubuntu Linux 19.10, Windows XP, etc)
-
-- Svelte version (Please check you can reproduce the issue with the latest release!)
-
-- Whether your project uses Webpack or Rollup
-
-**Severity**
-How severe an issue is this bug to you? Is this annoying, blocking some users, blocking an upgrade or blocking your usage of Svelte entirely?
-
-Note: the more honest and specific you are here the more we will take you seriously.
-
-**Additional context**
-Add any other context about the problem here.
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
new file mode 100644
index 0000000000..38a971864b
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -0,0 +1,50 @@
+name: "\U0001F41E Bug report"
+description: Report an issue with Svelte
+labels: ["triage: bug"]
+body:
+ - type: markdown
+ attributes:
+ value: |
+ Thanks for taking the time to fill out this bug report!
+ - type: textarea
+ id: bug-description
+ attributes:
+ label: Describe the bug
+ description: A clear and concise description of what the bug is. If you intend to submit a PR for this issue, tell us in the description. Thanks!
+ placeholder: Bug description
+ validations:
+ required: true
+ - type: textarea
+ id: reproduction
+ attributes:
+ label: Reproduction
+ description: Please provide a link to a repo or REPL that can reproduce the problem you ran into. If a report is vague (e.g. just a generic error message) and has no reproduction, it will receive a "need reproduction" label. If no reproduction is provided within a reasonable time-frame, the issue will be closed.
+ placeholder: Reproduction
+ validations:
+ required: true
+ - type: textarea
+ id: logs
+ attributes:
+ label: Logs
+ description: "Please include browser console and server logs around the time this bug occurred. Optional if provided reproduction. Please try not to insert an image but copy paste the log text."
+ render: shell
+ - type: textarea
+ id: system-info
+ attributes:
+ label: System Info
+ description: Output of `npx envinfo --system --npmPackages svelte,rollup,webpack --binaries --browsers`
+ render: shell
+ placeholder: System, Binaries, Browsers
+ validations:
+ required: true
+ - type: dropdown
+ id: severity
+ attributes:
+ label: Severity
+ description: Select the severity of this issue
+ options:
+ - annoyance
+ - blocking an upgrade
+ - blocking all usage of svelte
+ validations:
+ required: true
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 0000000000..ee3e5a41b9
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,5 @@
+blank_issues_enabled: false
+contact_links:
+ - name: Discord Chat
+ url: https://svelte.dev/chat
+ about: Ask questions and discuss with other Svelte users in real time.
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
deleted file mode 100644
index 923bfdb50c..0000000000
--- a/.github/ISSUE_TEMPLATE/feature_request.md
+++ /dev/null
@@ -1,28 +0,0 @@
----
-name: Feature request
-about: Suggest an idea for this project
-title: ''
-labels: 'New Feature'
-assignees: ''
-
----
-
-
-
-**Is your feature request related to a problem? Please describe.**
-A clear and concise description of what the problem is. For example: I'm always frustrated when [...]
-
-**Describe the solution you'd like**
-A clear and concise description of what you want to happen.
-
-**Describe alternatives you've considered**
-A clear and concise description of any alternative solutions or features you've considered.
-
-**How important is this feature to you?**
-Note: the more honest and specific you are here the more we will take you seriously.
-
-**Additional context**
-Add any other context or screenshots about the feature request here.
diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml
new file mode 100644
index 0000000000..2174f851a0
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.yml
@@ -0,0 +1,42 @@
+name: "Feature Request"
+description: Request a new Svelte feature
+labels: [enhancement]
+body:
+ - type: markdown
+ attributes:
+ value: |
+ Thanks for taking the time to request this feature! If your feature request is complex or substantial enough to warrant in-depth discussion, maintainers may close the issue and ask you to open an [RFC](https://github.com/sveltejs/rfcs).
+ - type: textarea
+ id: problem
+ attributes:
+ label: Describe the problem
+ description: Please provide a clear and concise description the problem this feature would solve. The more information you can provide here, the better.
+ placeholder: I'm always frustrated when...
+ validations:
+ required: true
+ - type: textarea
+ id: solution
+ attributes:
+ label: Describe the proposed solution
+ description: Please provide a clear and concise description of what you would like to happen.
+ placeholder: I would like to see...
+ validations:
+ required: true
+ - type: textarea
+ id: alternatives
+ attributes:
+ label: Alternatives considered
+ description: "Please provide a clear and concise description of any alternative solutions or features you've considered."
+ validations:
+ required: true
+ - type: dropdown
+ id: importance
+ attributes:
+ label: Importance
+ description: How important is this feature to you?
+ options:
+ - nice to have
+ - would make my life easier
+ - i cannot use svelte without it
+ validations:
+ required: true
diff --git a/.github/ISSUE_TEMPLATE/questions-and-help.md b/.github/ISSUE_TEMPLATE/questions-and-help.md
deleted file mode 100644
index a6e0dc6e19..0000000000
--- a/.github/ISSUE_TEMPLATE/questions-and-help.md
+++ /dev/null
@@ -1,12 +0,0 @@
----
-name: Questions and help
-about: If you think you need help with something related to Svelte
-title: ''
-labels: 'Question'
-assignees: ''
-
----
-
-This issue tracker is intended to collect bug reports and feature requests.
-
-For help with installation, information on how features work, or questions about specific features of Svelte, please come and join us in the [Svelte Discord](https://svelte.dev/chat), or ask your question on [Stack Overflow](https://stackoverflow.com/questions/tagged/svelte). Any issues open for help requests will be closed to keep from clogging up the issue tracker.
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index d14a0f9fe4..7de5a35e13 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -1,5 +1,6 @@
### Before submitting the PR, please make sure you do the following
- [ ] It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
+- [ ] Prefix your PR title with `[feat]`, `[fix]`, `[chore]`, or `[docs]`.
- [ ] This message body should clearly illustrate what problems it solves.
- [ ] Ideally, include a test that fails without this PR but passes with it.
diff --git a/.github/stale.yml b/.github/stale.yml
new file mode 100644
index 0000000000..3bc3fa6b99
--- /dev/null
+++ b/.github/stale.yml
@@ -0,0 +1,52 @@
+# Configuration for probot-stale - https://github.com/probot/stale
+
+# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
+onlyLabels: []
+
+# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
+exemptLabels:
+ - popular
+ - pinned
+ - security
+ - bug
+ - "[Status] Maybe Later"
+
+# Set to true to ignore issues in a project (defaults to false)
+exemptProjects: false
+
+# Set to true to ignore issues in a milestone (defaults to false)
+exemptMilestones: false
+
+# Set to true to ignore issues with an assignee (defaults to false)
+exemptAssignees: false
+
+# Label to use when marking as stale
+staleLabel: stale-bot
+
+# Comment to post when removing the stale label.
+# unmarkComment: >
+# Your comment here.
+
+# Limit the number of actions per hour, from 1-30. Default is 30
+limitPerRun: 30
+
+# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
+pulls:
+ daysUntilStale: 210
+ daysUntilClose: 25
+ markComment: >
+ This pull request has been automatically marked as stale because it has not had
+ recent activity. It will be closed if no further activity occurs. Thank you
+ for your contributions.
+ closeComment: >
+ This pull request has been closed as it was previously marked as stale and saw no subsequent activity.
+
+issues:
+ daysUntilStale: 180
+ daysUntilClose: 14
+ markComment: >
+ This issue has been automatically marked as stale because it has not had
+ recent activity. It will be closed if no further activity occurs. Thank you
+ for your contributions.
+ closeComment: >
+ This issue has been closed as it was previously marked as stale and saw no subsequent activity.
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 4e04386fcc..bbfde04f67 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -3,34 +3,39 @@ on: [push, pull_request]
jobs:
Tests:
runs-on: ${{ matrix.os }}
- timeout-minutes: 10
+ timeout-minutes: 15
strategy:
matrix:
- node-version: [8, 10, 12, 14]
+ node-version: [8, 10, 12, 14, 16]
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- - uses: actions/checkout@v1
- - uses: actions/setup-node@v1
- with:
- node-version: ${{ matrix.node-version }}
- - run: npm install
- - run: npm test
- env:
- CI: true
+ - uses: actions/checkout@v1
+ - uses: actions/setup-node@v2
+ with:
+ node-version: ${{ matrix.node-version }}
+ cache: npm
+ - run: npm install
+ - run: npm test
+ env:
+ CI: true
Lint:
runs-on: ubuntu-latest
- timeout-minutes: 2
+ timeout-minutes: 5
steps:
- - uses: actions/checkout@v1
- - uses: actions/setup-node@v1
- - run: 'npm i && npm run lint'
+ - uses: actions/checkout@v1
+ - uses: actions/setup-node@v2
+ with:
+ cache: npm
+ - run: 'npm i && npm run lint'
Unit:
runs-on: ${{ matrix.os }}
- timeout-minutes: 5
+ timeout-minutes: 10
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- - uses: actions/checkout@v1
- - uses: actions/setup-node@v1
- - run: 'npm i && npm run test:unit'
+ - uses: actions/checkout@v1
+ - uses: actions/setup-node@v2
+ with:
+ cache: npm
+ - run: 'npm i && npm run test:unit'
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
new file mode 100644
index 0000000000..ea6e0f5a60
--- /dev/null
+++ b/.github/workflows/docs.yml
@@ -0,0 +1,28 @@
+name: Docs
+
+on:
+ push:
+ branches:
+ - master
+ paths:
+ - site/content/**
+
+jobs:
+ release:
+ name: Deploy docs
+ runs-on: ubuntu-latest
+ steps:
+ - name: my-app-install token
+ id: github-app
+ uses: getsentry/action-github-app-token@v1
+ with:
+ app_id: ${{ secrets.GH_APP_ID }}
+ private_key: ${{ secrets.GH_APP_PRIVATE_KEY }}
+
+ - name: run deploy docs workflow
+ uses: 'sveltejs/action-deploy-docs/dispatch@main'
+ with:
+ repo: 'svelte'
+ branch: 'master'
+ docs_path: 'site/content'
+ token: ${{ steps.github-app.outputs.token }}
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index f7fac04eba..32582b2774 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,6 +8,7 @@ node_modules
/compiler.d.ts
/compiler.*js
/index.*js
+/ssr.*js
/internal
/store
/easing
@@ -18,24 +19,18 @@ node_modules
/coverage/
/coverage.lcov
/test/*/samples/_
-/test/sourcemaps/samples/*/output.js
-/test/sourcemaps/samples/*/output.js.map
-/test/sourcemaps/samples/*/output.css
-/test/sourcemaps/samples/*/output.css.map
/yarn-error.log
_actual*.*
_output
/types
-/site/cypress/screenshots/
-/site/__sapper__/
+/site/.svelte-kit/
+/site/build/
/site/.env
-/site/.sessions
/site/static/svelte-app.json
/site/static/contributors.jpg
-/site/static/workers
-/site/static/organisations
-/site/scripts/svelte-app
-/site/scripts/community
+/site/static/donors.jpg
+/site/static/workers/
+/site/scripts/svelte-app/
/site/src/routes/_contributors.js
-/site/src/routes/_components/WhosUsingSvelte.svelte
+/site/src/routes/_donors.js
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5c1fd83e52..24eb142803 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,9 +1,302 @@
# Svelte changelog
-## Unreleased
+## 3.44.2
+* Fix overly restrictive preprocessor types ([#6904](https://github.com/sveltejs/svelte/pull/6904))
+* More specific typing for crossfade function - returns a tuple, not an array ([#6926](https://github.com/sveltejs/svelte/issues/6926))
+* Add `URLSearchParams` as a known global ([#6938](https://github.com/sveltejs/svelte/pull/6938))
+* Add `types` field to `exports` map ([#6939](https://github.com/sveltejs/svelte/issues/6939))
+
+## 3.44.1
+
+* Fix code generation when a multi-line `return` statement contains comments ([code-red#36](https://github.com/Rich-Harris/code-red/issues/36))
+* Fix code generation when `for`/`if`/`while` statements have empty bodies ([#6884](https://github.com/sveltejs/svelte/issues/6884))
+
+## 3.44.0
+
+* Add `enableSourcemap` compiler option ([#6835](https://github.com/sveltejs/svelte/pull/6835))
+
+## 3.43.2
+
+* Fix regression where user-specified `import`s were not rewritten according to the `sveltePath` option ([#6834](https://github.com/sveltejs/svelte/issues/6834))
+
+## 3.43.1
+
+* Prevent a rejecting promise used in `{#await}` during SSR from appearing as an unhandled rejection ([#6789](https://github.com/sveltejs/svelte/issues/6789))
+
+## 3.43.0
+
+* Use export map to expose no-op versions of lifecycle functions for SSR ([#6743](https://github.com/sveltejs/svelte/pull/6743))
+* Prefer `context` passed to component constructor, even when running synchronously in another component ([#6753](https://github.com/sveltejs/svelte/issues/6753))
+* Handle preprocessors that return empty sourcemaps ([#6757](https://github.com/sveltejs/svelte/pull/6757))
+
+## 3.42.6
+
+* Hide private preprocess typings ([#6622](https://github.com/sveltejs/svelte/issues/6622))
+* Fix reactive function in `{:else if}` expression not being properly re-run ([#6727](https://github.com/sveltejs/svelte/pull/6727))
+
+## 3.42.5
+
+* In `draw` transition, account for `stroke-linecap` in determining length ([#4540](https://github.com/sveltejs/svelte/issues/4540))
+* Fix regression with destructuring assignments with default values ([#6699](https://github.com/sveltejs/svelte/issues/6699))
+
+## 3.42.4
+
+* Only apply optimized `src` attribute handling when in an `html` namespace ([#6575](https://github.com/sveltejs/svelte/issues/6575))
+* Fix styles for transitions and animations being attached to the wrong `document` in `
-{/if}
+{/if}
\ No newline at end of file
diff --git a/site/content/tutorial/06-bindings/04-group-inputs/app-b/App.svelte b/site/content/tutorial/06-bindings/04-group-inputs/app-b/App.svelte
index a46c61c7e7..d97db41f0b 100644
--- a/site/content/tutorial/06-bindings/04-group-inputs/app-b/App.svelte
+++ b/site/content/tutorial/06-bindings/04-group-inputs/app-b/App.svelte
@@ -17,17 +17,17 @@
Size
-
+
One scoop
-
+
Two scoops
-
+
Three scoops
@@ -35,7 +35,7 @@
{#each menu as flavour}
-
+
{flavour}
{/each}
@@ -49,4 +49,4 @@
You ordered {scoops} {scoops === 1 ? 'scoop' : 'scoops'}
of {join(flavours)}
-{/if}
+{/if}
\ No newline at end of file
diff --git a/site/content/tutorial/06-bindings/04-group-inputs/text.md b/site/content/tutorial/06-bindings/04-group-inputs/text.md
index 97edb8db76..b48b23921f 100644
--- a/site/content/tutorial/06-bindings/04-group-inputs/text.md
+++ b/site/content/tutorial/06-bindings/04-group-inputs/text.md
@@ -7,7 +7,7 @@ If you have multiple inputs relating to the same value, you can use `bind:group`
Add `bind:group` to each input:
```html
-
+
```
In this case, we could make the code simpler by moving the checkbox inputs into an `each` block. First, add a `menu` variable to the `
-
+{@html marked(value)}
-{@html marked(value)}
\ No newline at end of file
+
diff --git a/site/content/tutorial/06-bindings/05-textarea-inputs/app-b/App.svelte b/site/content/tutorial/06-bindings/05-textarea-inputs/app-b/App.svelte
index be338bf47f..dbeaf9b67b 100644
--- a/site/content/tutorial/06-bindings/05-textarea-inputs/app-b/App.svelte
+++ b/site/content/tutorial/06-bindings/05-textarea-inputs/app-b/App.svelte
@@ -1,12 +1,12 @@
-
+{@html marked(value)}
-{@html marked(value)}
\ No newline at end of file
+
diff --git a/site/content/tutorial/06-bindings/06-select-bindings/app-a/App.svelte b/site/content/tutorial/06-bindings/06-select-bindings/app-a/App.svelte
index b6f50b935e..a70b928809 100644
--- a/site/content/tutorial/06-bindings/06-select-bindings/app-a/App.svelte
+++ b/site/content/tutorial/06-bindings/06-select-bindings/app-a/App.svelte
@@ -14,10 +14,6 @@
}
-
-
Insecurity questions
-selected question {selected ? selected.id : '[waiting...]'}
\ No newline at end of file
+selected question {selected ? selected.id : '[waiting...]'}
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/06-bindings/06-select-bindings/app-b/App.svelte b/site/content/tutorial/06-bindings/06-select-bindings/app-b/App.svelte
index 3f1e7fa7e1..c584c95b0e 100644
--- a/site/content/tutorial/06-bindings/06-select-bindings/app-b/App.svelte
+++ b/site/content/tutorial/06-bindings/06-select-bindings/app-b/App.svelte
@@ -14,10 +14,6 @@
}
-
-
Insecurity questions
-selected question {selected ? selected.id : '[waiting...]'}
\ No newline at end of file
+selected question {selected ? selected.id : '[waiting...]'}
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/06-bindings/06-select-bindings/text.md b/site/content/tutorial/06-bindings/06-select-bindings/text.md
index f4972557ab..b9cf2de6ec 100644
--- a/site/content/tutorial/06-bindings/06-select-bindings/text.md
+++ b/site/content/tutorial/06-bindings/06-select-bindings/text.md
@@ -2,7 +2,7 @@
title: Select bindings
---
-We can also use `bind:value` with `` elements. Update line 24:
+We can also use `bind:value` with `` elements. Update line 20:
```html
@@ -10,4 +10,4 @@ We can also use `bind:value` with `` elements. Update line 24:
Note that the `` values are objects rather than strings. Svelte doesn't mind.
-> Because we haven't set an initial value of `selected`, the binding will set it to the default value (the first in the list) automatically. Be careful though — until the binding is initialised, `selected` remains undefined, so we can't blindly reference e.g. `selected.id` in the template.
\ No newline at end of file
+> Because we haven't set an initial value of `selected`, the binding will set it to the default value (the first in the list) automatically. Be careful though — until the binding is initialised, `selected` remains undefined, so we can't blindly reference e.g. `selected.id` in the template.
diff --git a/site/content/tutorial/06-bindings/07-multiple-select-bindings/text.md b/site/content/tutorial/06-bindings/07-multiple-select-bindings/text.md
index f6137d3f1d..42263e5ec1 100644
--- a/site/content/tutorial/06-bindings/07-multiple-select-bindings/text.md
+++ b/site/content/tutorial/06-bindings/07-multiple-select-bindings/text.md
@@ -16,4 +16,6 @@ Returning to our [earlier ice cream example](tutorial/group-inputs), we can repl
{/each}
-```
\ No newline at end of file
+```
+
+> Press and hold the `control` key (or the `command` key on MacOS) for selecting multiple options.
diff --git a/site/content/tutorial/06-bindings/09-each-block-bindings/app-a/App.svelte b/site/content/tutorial/06-bindings/09-each-block-bindings/app-a/App.svelte
index 4a2eae9147..b0323eb00a 100644
--- a/site/content/tutorial/06-bindings/09-each-block-bindings/app-a/App.svelte
+++ b/site/content/tutorial/06-bindings/09-each-block-bindings/app-a/App.svelte
@@ -16,12 +16,6 @@
$: remaining = todos.filter(t => !t.done).length;
-
-
Todos
{#each todos as todo}
@@ -47,3 +41,9 @@
Clear completed
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/06-bindings/09-each-block-bindings/app-b/App.svelte b/site/content/tutorial/06-bindings/09-each-block-bindings/app-b/App.svelte
index ff91612ec5..b42cbe3b0a 100644
--- a/site/content/tutorial/06-bindings/09-each-block-bindings/app-b/App.svelte
+++ b/site/content/tutorial/06-bindings/09-each-block-bindings/app-b/App.svelte
@@ -16,12 +16,6 @@
$: remaining = todos.filter(t => !t.done).length;
-
-
Todos
{#each todos as todo}
@@ -47,3 +41,9 @@
Clear completed
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/06-bindings/09-each-block-bindings/text.md b/site/content/tutorial/06-bindings/09-each-block-bindings/text.md
index 7e50966c32..9c352703f1 100644
--- a/site/content/tutorial/06-bindings/09-each-block-bindings/text.md
+++ b/site/content/tutorial/06-bindings/09-each-block-bindings/text.md
@@ -5,15 +5,17 @@ title: Each block bindings
You can even bind to properties inside an `each` block.
```html
-
+{#each todos as todo}
+
-
+
+{/each}
```
-> Note that interacting with these ` ` elements will mutate the array. If you prefer to work with immutable data, you should avoid these bindings and use event handlers instead.
\ No newline at end of file
+> Note that interacting with these ` ` elements will mutate the array. If you prefer to work with immutable data, you should avoid these bindings and use event handlers instead.
diff --git a/site/content/tutorial/06-bindings/10-media-elements/app-a/App.svelte b/site/content/tutorial/06-bindings/10-media-elements/app-a/App.svelte
index 122b2cf9e9..b48de2f742 100644
--- a/site/content/tutorial/06-bindings/10-media-elements/app-a/App.svelte
+++ b/site/content/tutorial/06-bindings/10-media-elements/app-a/App.svelte
@@ -7,37 +7,35 @@
let showControls = true;
let showControlsTimeout;
- function handleMousemove(e) {
+ // Used to track time of last mouse down event
+ let lastMouseDown;
+
+ function handleMove(e) {
// Make the controls visible, but fade out after
// 2.5 seconds of inactivity
clearTimeout(showControlsTimeout);
showControlsTimeout = setTimeout(() => showControls = false, 2500);
showControls = true;
- if (!(e.buttons & 1)) return; // mouse not down
if (!duration) return; // video not loaded yet
+ if (e.type !== 'touchmove' && !(e.buttons & 1)) return; // mouse not down
+ const clientX = e.type === 'touchmove' ? e.touches[0].clientX : e.clientX;
const { left, right } = this.getBoundingClientRect();
- time = duration * (e.clientX - left) / (right - left);
+ time = duration * (clientX - left) / (right - left);
}
+ // we can't rely on the built-in click event, because it fires
+ // after a drag — we have to listen for clicks ourselves
function handleMousedown(e) {
- // we can't rely on the built-in click event, because it fires
- // after a drag — we have to listen for clicks ourselves
+ lastMouseDown = new Date();
+ }
- function handleMouseup() {
+ function handleMouseup(e) {
+ if (new Date() - lastMouseDown < 300) {
if (paused) e.target.play();
else e.target.pause();
- cancel();
- }
-
- function cancel() {
- e.target.removeEventListener('mouseup', handleMouseup);
}
-
- e.target.addEventListener('mouseup', handleMouseup);
-
- setTimeout(cancel, 200);
}
function format(seconds) {
@@ -51,6 +49,31 @@
}
+Caminandes: Llamigos
+From Blender Open Projects . CC-BY
+
+
+
+
+
+
+
+
+
+
+ {format(time)}
+ click anywhere to {paused ? 'play' : 'pause'} / drag to seek
+ {format(duration)}
+
+
+
+
+<<<<<<< HEAD
Caminandes: Llamigos
From Blender Open Projects . CC-BY
@@ -126,3 +150,5 @@
+=======
+>>>>>>> 67f79dd934659b9a67b3ec57f191115424d2e589
diff --git a/site/content/tutorial/06-bindings/10-media-elements/app-b/App.svelte b/site/content/tutorial/06-bindings/10-media-elements/app-b/App.svelte
index 6135105d6a..8b4438f618 100644
--- a/site/content/tutorial/06-bindings/10-media-elements/app-b/App.svelte
+++ b/site/content/tutorial/06-bindings/10-media-elements/app-b/App.svelte
@@ -7,37 +7,35 @@
let showControls = true;
let showControlsTimeout;
- function handleMousemove(e) {
+ // Used to track time of last mouse down event
+ let lastMouseDown;
+
+ function handleMove(e) {
// Make the controls visible, but fade out after
// 2.5 seconds of inactivity
clearTimeout(showControlsTimeout);
showControlsTimeout = setTimeout(() => showControls = false, 2500);
showControls = true;
- if (!(e.buttons & 1)) return; // mouse not down
if (!duration) return; // video not loaded yet
+ if (e.type !== 'touchmove' && !(e.buttons & 1)) return; // mouse not down
+ const clientX = e.type === 'touchmove' ? e.touches[0].clientX : e.clientX;
const { left, right } = this.getBoundingClientRect();
- time = duration * (e.clientX - left) / (right - left);
+ time = duration * (clientX - left) / (right - left);
}
+ // we can't rely on the built-in click event, because it fires
+ // after a drag — we have to listen for clicks ourselves
function handleMousedown(e) {
- // we can't rely on the built-in click event, because it fires
- // after a drag — we have to listen for clicks ourselves
+ lastMouseDown = new Date();
+ }
- function handleMouseup() {
+ function handleMouseup(e) {
+ if (new Date() - lastMouseDown < 300) {
if (paused) e.target.play();
else e.target.pause();
- cancel();
- }
-
- function cancel() {
- e.target.removeEventListener('mouseup', handleMouseup);
}
-
- e.target.addEventListener('mouseup', handleMouseup);
-
- setTimeout(cancel, 200);
}
function format(seconds) {
@@ -51,6 +49,34 @@
}
+Caminandes: Llamigos
+From Blender Open Projects . CC-BY
+
+
+
+
+
+
+
+
+
+
+ {format(time)}
+ click anywhere to {paused ? 'play' : 'pause'} / drag to seek
+ {format(duration)}
+
+
+
+
+<<<<<<< HEAD
Caminandes: Llamigos
From Blender Open Projects . CC-BY
@@ -128,4 +155,6 @@
{format(duration)}
-
\ No newline at end of file
+
+=======
+>>>>>>> 67f79dd934659b9a67b3ec57f191115424d2e589
diff --git a/site/content/tutorial/06-bindings/10-media-elements/text.md b/site/content/tutorial/06-bindings/10-media-elements/text.md
index 0a854f19e9..b63c5368ff 100644
--- a/site/content/tutorial/06-bindings/10-media-elements/text.md
+++ b/site/content/tutorial/06-bindings/10-media-elements/text.md
@@ -4,18 +4,21 @@ title: Media elements
The `` and `` elements have several properties that you can bind to. This example demonstrates a few of them.
-On line 116, add `currentTime={time}`, `duration` and `paused` bindings:
+On line 62, add `currentTime={time}`, `duration` and `paused` bindings:
```html
+ bind:paused>
+
+
```
> `bind:duration` is equivalent to `bind:duration={duration}`
@@ -41,4 +44,4 @@ The complete set of bindings for `` and `` is as follows — six *
* `volume` — a value between 0 and 1
* `muted` — a boolean value where true is muted
-Videos additionally have readonly `videoWidth` and `videoHeight` bindings.
\ No newline at end of file
+Videos additionally have readonly `videoWidth` and `videoHeight` bindings.
diff --git a/site/content/tutorial/06-bindings/11-dimensions/app-a/App.svelte b/site/content/tutorial/06-bindings/11-dimensions/app-a/App.svelte
index 62e92cd536..67bb5db8af 100644
--- a/site/content/tutorial/06-bindings/11-dimensions/app-a/App.svelte
+++ b/site/content/tutorial/06-bindings/11-dimensions/app-a/App.svelte
@@ -5,12 +5,6 @@
let text = 'edit me';
-
-
@@ -18,4 +12,10 @@
{text}
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/06-bindings/11-dimensions/app-b/App.svelte b/site/content/tutorial/06-bindings/11-dimensions/app-b/App.svelte
index 920c74d276..fbed44dadc 100644
--- a/site/content/tutorial/06-bindings/11-dimensions/app-b/App.svelte
+++ b/site/content/tutorial/06-bindings/11-dimensions/app-b/App.svelte
@@ -5,12 +5,6 @@
let text = 'edit me';
-
-
@@ -18,4 +12,10 @@
{text}
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/06-bindings/12-bind-this/app-a/App.svelte b/site/content/tutorial/06-bindings/12-bind-this/app-a/App.svelte
index d40c45ef6c..cf08455942 100644
--- a/site/content/tutorial/06-bindings/12-bind-this/app-a/App.svelte
+++ b/site/content/tutorial/06-bindings/12-bind-this/app-a/App.svelte
@@ -5,9 +5,9 @@
onMount(() => {
const ctx = canvas.getContext('2d');
- let frame;
+ let frame = requestAnimationFrame(loop);
- (function loop() {
+ function loop(t) {
frame = requestAnimationFrame(loop);
const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
@@ -15,9 +15,7 @@
for (let p = 0; p < imageData.data.length; p += 4) {
const i = p / 4;
const x = i % canvas.width;
- const y = i / canvas.height >>> 0;
-
- const t = window.performance.now();
+ const y = i / canvas.width >>> 0;
const r = 64 + (128 * x / canvas.width) + (64 * Math.sin(t / 1000));
const g = 64 + (128 * y / canvas.height) + (64 * Math.cos(t / 1000));
@@ -30,7 +28,7 @@
}
ctx.putImageData(imageData, 0, 0);
- }());
+ }
return () => {
cancelAnimationFrame(frame);
@@ -38,6 +36,11 @@
});
+
+
-
-
diff --git a/site/content/tutorial/06-bindings/12-bind-this/app-b/App.svelte b/site/content/tutorial/06-bindings/12-bind-this/app-b/App.svelte
index 8e4b3c5bef..0e53c533ac 100644
--- a/site/content/tutorial/06-bindings/12-bind-this/app-b/App.svelte
+++ b/site/content/tutorial/06-bindings/12-bind-this/app-b/App.svelte
@@ -5,9 +5,9 @@
onMount(() => {
const ctx = canvas.getContext('2d');
- let frame;
+ let frame = requestAnimationFrame(loop);
- (function loop() {
+ function loop(t) {
frame = requestAnimationFrame(loop);
const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
@@ -15,9 +15,7 @@
for (let p = 0; p < imageData.data.length; p += 4) {
const i = p / 4;
const x = i % canvas.width;
- const y = i / canvas.height >>> 0;
-
- const t = window.performance.now();
+ const y = i / canvas.width >>> 0;
const r = 64 + (128 * x / canvas.width) + (64 * Math.sin(t / 1000));
const g = 64 + (128 * y / canvas.height) + (64 * Math.cos(t / 1000));
@@ -30,7 +28,7 @@
}
ctx.putImageData(imageData, 0, 0);
- }());
+ }
return () => {
cancelAnimationFrame(frame);
@@ -38,6 +36,12 @@
});
+
+
-
-
diff --git a/site/content/tutorial/06-bindings/13-component-bindings/app-a/Keypad.svelte b/site/content/tutorial/06-bindings/13-component-bindings/app-a/Keypad.svelte
index c457a15cb5..631f7964e2 100644
--- a/site/content/tutorial/06-bindings/13-component-bindings/app-a/Keypad.svelte
+++ b/site/content/tutorial/06-bindings/13-component-bindings/app-a/Keypad.svelte
@@ -10,19 +10,6 @@
const submit = () => dispatch('submit');
-
-
1
2
@@ -37,4 +24,17 @@
clear
0
submit
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/06-bindings/13-component-bindings/app-b/Keypad.svelte b/site/content/tutorial/06-bindings/13-component-bindings/app-b/Keypad.svelte
index c457a15cb5..631f7964e2 100644
--- a/site/content/tutorial/06-bindings/13-component-bindings/app-b/Keypad.svelte
+++ b/site/content/tutorial/06-bindings/13-component-bindings/app-b/Keypad.svelte
@@ -10,19 +10,6 @@
const submit = () => dispatch('submit');
-
-
1
2
@@ -37,4 +24,17 @@
clear
0
submit
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/06-bindings/14-component-this/app-a/App.svelte b/site/content/tutorial/06-bindings/14-component-this/app-a/App.svelte
new file mode 100644
index 0000000000..41a6a10d3d
--- /dev/null
+++ b/site/content/tutorial/06-bindings/14-component-this/app-a/App.svelte
@@ -0,0 +1,5 @@
+
+
+
diff --git a/site/content/tutorial/06-bindings/14-component-this/app-a/InputField.svelte b/site/content/tutorial/06-bindings/14-component-this/app-a/InputField.svelte
new file mode 100644
index 0000000000..e2b04b93ed
--- /dev/null
+++ b/site/content/tutorial/06-bindings/14-component-this/app-a/InputField.svelte
@@ -0,0 +1,9 @@
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/06-bindings/14-component-this/app-b/App.svelte b/site/content/tutorial/06-bindings/14-component-this/app-b/App.svelte
new file mode 100644
index 0000000000..f14332b398
--- /dev/null
+++ b/site/content/tutorial/06-bindings/14-component-this/app-b/App.svelte
@@ -0,0 +1,9 @@
+
+
+
+
+ field.focus()}>Focus field
diff --git a/site/content/tutorial/06-bindings/14-component-this/app-b/InputField.svelte b/site/content/tutorial/06-bindings/14-component-this/app-b/InputField.svelte
new file mode 100644
index 0000000000..e2b04b93ed
--- /dev/null
+++ b/site/content/tutorial/06-bindings/14-component-this/app-b/InputField.svelte
@@ -0,0 +1,9 @@
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/06-bindings/14-component-this/text.md b/site/content/tutorial/06-bindings/14-component-this/text.md
new file mode 100644
index 0000000000..e389dbbacf
--- /dev/null
+++ b/site/content/tutorial/06-bindings/14-component-this/text.md
@@ -0,0 +1,23 @@
+---
+title: Binding to component instances
+---
+
+Just as you can bind to DOM elements, you can bind to component instances themselves. For example, we can bind the instance of `` to a variable named `field` in the same way we did when binding DOM Elements
+
+```html
+
+
+
+```
+
+Now we can programmatically interact with this component using `field`.
+
+```html
+
+ Focus field
+
+```
+
+> Note that we can't do `{field.focus}` since field is undefined when the button is first rendered and throws an error.
diff --git a/site/content/tutorial/07-lifecycle/01-onmount/app-a/App.svelte b/site/content/tutorial/07-lifecycle/01-onmount/app-a/App.svelte
index e8306d1957..f76c377ad3 100644
--- a/site/content/tutorial/07-lifecycle/01-onmount/app-a/App.svelte
+++ b/site/content/tutorial/07-lifecycle/01-onmount/app-a/App.svelte
@@ -2,20 +2,6 @@
let photos = [];
-
-
Photo album
@@ -28,4 +14,18 @@
loading...
{/each}
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/07-lifecycle/01-onmount/app-b/App.svelte b/site/content/tutorial/07-lifecycle/01-onmount/app-b/App.svelte
index 1b83727627..831914fa6a 100644
--- a/site/content/tutorial/07-lifecycle/01-onmount/app-b/App.svelte
+++ b/site/content/tutorial/07-lifecycle/01-onmount/app-b/App.svelte
@@ -9,20 +9,6 @@
});
-
-
Photo album
@@ -35,4 +21,18 @@
loading...
{/each}
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/07-lifecycle/02-ondestroy/app-a/App.svelte b/site/content/tutorial/07-lifecycle/02-ondestroy/app-a/App.svelte
index 28cdb73d0d..8fdca8d81d 100644
--- a/site/content/tutorial/07-lifecycle/02-ondestroy/app-a/App.svelte
+++ b/site/content/tutorial/07-lifecycle/02-ondestroy/app-a/App.svelte
@@ -1,10 +1,20 @@
-
- The page has been open for
- {seconds} {seconds === 1 ? 'second' : 'seconds'}
-
\ No newline at end of file
+
+
{open ? 'Close' : 'Open'} Timer
+
+ The Timer component has been open for
+ {seconds} {seconds === 1 ? 'second' : 'seconds'}
+
+ {#if open}
+
+ {/if}
+
diff --git a/site/content/tutorial/07-lifecycle/02-ondestroy/app-a/Timer.svelte b/site/content/tutorial/07-lifecycle/02-ondestroy/app-a/Timer.svelte
new file mode 100644
index 0000000000..0eb5a7461d
--- /dev/null
+++ b/site/content/tutorial/07-lifecycle/02-ondestroy/app-a/Timer.svelte
@@ -0,0 +1,20 @@
+
+
+
+ This component executes a callback every
+ {interval} millisecond{interval === 1 ? '' : 's'}
+
+
+
diff --git a/site/content/tutorial/07-lifecycle/02-ondestroy/app-a/utils.js b/site/content/tutorial/07-lifecycle/02-ondestroy/app-a/utils.js
index 7b65e75c8c..64ab7e50c7 100644
--- a/site/content/tutorial/07-lifecycle/02-ondestroy/app-a/utils.js
+++ b/site/content/tutorial/07-lifecycle/02-ondestroy/app-a/utils.js
@@ -1,5 +1,9 @@
import { onDestroy } from 'svelte';
export function onInterval(callback, milliseconds) {
- // implementation goes here
+ const interval = setInterval(callback, milliseconds);
+
+ onDestroy(() => {
+ // Fix the memory leak here
+ });
}
\ No newline at end of file
diff --git a/site/content/tutorial/07-lifecycle/02-ondestroy/app-b/App.svelte b/site/content/tutorial/07-lifecycle/02-ondestroy/app-b/App.svelte
index 93a721ef44..49936b6617 100644
--- a/site/content/tutorial/07-lifecycle/02-ondestroy/app-b/App.svelte
+++ b/site/content/tutorial/07-lifecycle/02-ondestroy/app-b/App.svelte
@@ -1,11 +1,20 @@
-
- The page has been open for
- {seconds} {seconds === 1 ? 'second' : 'seconds'}
-
\ No newline at end of file
+
+
{open ? 'Close' : 'Open'} Timer
+
+ The Timer component has been open for
+ {seconds} {seconds === 1 ? 'second' : 'seconds'}
+
+ {#if open}
+
+ {/if}
+
diff --git a/site/content/tutorial/07-lifecycle/02-ondestroy/app-b/Timer.svelte b/site/content/tutorial/07-lifecycle/02-ondestroy/app-b/Timer.svelte
new file mode 100644
index 0000000000..0eb5a7461d
--- /dev/null
+++ b/site/content/tutorial/07-lifecycle/02-ondestroy/app-b/Timer.svelte
@@ -0,0 +1,20 @@
+
+
+
+ This component executes a callback every
+ {interval} millisecond{interval === 1 ? '' : 's'}
+
+
+
diff --git a/site/content/tutorial/07-lifecycle/02-ondestroy/text.md b/site/content/tutorial/07-lifecycle/02-ondestroy/text.md
index 647fbaa160..34bbf83cbf 100644
--- a/site/content/tutorial/07-lifecycle/02-ondestroy/text.md
+++ b/site/content/tutorial/07-lifecycle/02-ondestroy/text.md
@@ -10,8 +10,8 @@ For example, we can add a `setInterval` function when our component initialises,
@@ -37,7 +37,9 @@ export function onInterval(callback, milliseconds) {
-```
\ No newline at end of file
+```
+
+Open and close the timer a few times and make sure the counter keeps ticking and the CPU load increases. This is due to a memory leak as the previous timers are not deleted. Don't forget to refresh the page before solving the example.
\ No newline at end of file
diff --git a/site/content/tutorial/07-lifecycle/03-update/text.md b/site/content/tutorial/07-lifecycle/03-update/text.md
index 40e071630a..0255e845a8 100644
--- a/site/content/tutorial/07-lifecycle/03-update/text.md
+++ b/site/content/tutorial/07-lifecycle/03-update/text.md
@@ -2,7 +2,7 @@
title: beforeUpdate and afterUpdate
---
-The `beforeUpdate` function schedules work to happen immediately before the DOM has been updated. `afterUpdate` is its counterpart, used for running code once the DOM is in sync with your data.
+The `beforeUpdate` function schedules work to happen immediately before the DOM is updated. `afterUpdate` is its counterpart, used for running code once the DOM is in sync with your data.
Together, they're useful for doing things imperatively that are difficult to achieve in a purely state-driven way, like updating the scroll position of an element.
@@ -21,4 +21,4 @@ afterUpdate(() => {
});
```
-Note that `beforeUpdate` will first run before the component has mounted, so we need to check for the existence of `div` before reading its properties.
\ No newline at end of file
+Note that `beforeUpdate` will first run before the component has mounted, so we need to check for the existence of `div` before reading its properties.
diff --git a/site/content/tutorial/08-stores/01-writable-stores/app-a/App.svelte b/site/content/tutorial/08-stores/01-writable-stores/app-a/App.svelte
index ee542f789d..f2a4023f25 100644
--- a/site/content/tutorial/08-stores/01-writable-stores/app-a/App.svelte
+++ b/site/content/tutorial/08-stores/01-writable-stores/app-a/App.svelte
@@ -6,7 +6,7 @@
let count_value;
- const unsubscribe = count.subscribe(value => {
+ count.subscribe(value => {
count_value = value;
});
@@ -15,4 +15,4 @@
-
\ No newline at end of file
+
diff --git a/site/content/tutorial/08-stores/01-writable-stores/app-b/App.svelte b/site/content/tutorial/08-stores/01-writable-stores/app-b/App.svelte
index ee542f789d..c77563e354 100644
--- a/site/content/tutorial/08-stores/01-writable-stores/app-b/App.svelte
+++ b/site/content/tutorial/08-stores/01-writable-stores/app-b/App.svelte
@@ -6,7 +6,7 @@
let count_value;
- const unsubscribe = count.subscribe(value => {
+ count.subscribe(value => {
count_value = value;
});
diff --git a/site/content/tutorial/08-stores/01-writable-stores/text.md b/site/content/tutorial/08-stores/01-writable-stores/text.md
index 57c27411ea..247ef86e8d 100644
--- a/site/content/tutorial/08-stores/01-writable-stores/text.md
+++ b/site/content/tutorial/08-stores/01-writable-stores/text.md
@@ -24,4 +24,4 @@ Finally, in `Resetter.svelte`, implement `reset`:
function reset() {
count.set(0);
}
-```
\ No newline at end of file
+```
diff --git a/site/content/tutorial/08-stores/02-auto-subscriptions/app-a/App.svelte b/site/content/tutorial/08-stores/02-auto-subscriptions/app-a/App.svelte
index ee542f789d..f2a4023f25 100644
--- a/site/content/tutorial/08-stores/02-auto-subscriptions/app-a/App.svelte
+++ b/site/content/tutorial/08-stores/02-auto-subscriptions/app-a/App.svelte
@@ -6,7 +6,7 @@
let count_value;
- const unsubscribe = count.subscribe(value => {
+ count.subscribe(value => {
count_value = value;
});
@@ -15,4 +15,4 @@
-
\ No newline at end of file
+
diff --git a/site/content/tutorial/08-stores/02-auto-subscriptions/text.md b/site/content/tutorial/08-stores/02-auto-subscriptions/text.md
index af584261f4..27d3251c6e 100644
--- a/site/content/tutorial/08-stores/02-auto-subscriptions/text.md
+++ b/site/content/tutorial/08-stores/02-auto-subscriptions/text.md
@@ -2,9 +2,18 @@
title: Auto-subscriptions
---
-The app in the previous example works, but there's a subtle bug — the `unsubscribe` function never gets called. If the component was instantiated and destroyed many times, this would result in a *memory leak*.
+The app in the previous example works, but there's a subtle bug — the store is subscribed to, but never unsubscribed. If the component was instantiated and destroyed many times, this would result in a *memory leak*.
-One way to fix it would be to use the `onDestroy` [lifecycle hook](tutorial/ondestroy):
+Start by declaring `unsubscribe` in `App.svelte`:
+
+```js
+const unsubscribe = count.subscribe(value => {
+ count_value = value;
+});
+```
+> Calling a `subscribe` method returns an `unsubscribe` function.
+
+You now declared `unsubscribe`, but it still needs to be called, for example through the `onDestroy` [lifecycle hook](tutorial/ondestroy):
```html
-
-
@@ -31,4 +24,11 @@
100%
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/09-motion/01-tweened/app-b/App.svelte b/site/content/tutorial/09-motion/01-tweened/app-b/App.svelte
index 83f3b50a04..ee3c7a1b5d 100644
--- a/site/content/tutorial/09-motion/01-tweened/app-b/App.svelte
+++ b/site/content/tutorial/09-motion/01-tweened/app-b/App.svelte
@@ -8,13 +8,6 @@
});
-
-
@@ -35,4 +28,11 @@
100%
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/09-motion/02-spring/app-a/App.svelte b/site/content/tutorial/09-motion/02-spring/app-a/App.svelte
index 813c6366b1..aa8a406c2b 100644
--- a/site/content/tutorial/09-motion/02-spring/app-a/App.svelte
+++ b/site/content/tutorial/09-motion/02-spring/app-a/App.svelte
@@ -5,11 +5,6 @@
let size = writable(10);
-
-
stiffness ({coords.stiffness})
@@ -28,4 +23,15 @@
on:mouseup="{() => size.set(10)}"
>
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/09-motion/02-spring/app-b/App.svelte b/site/content/tutorial/09-motion/02-spring/app-b/App.svelte
index 2cb0fd1eb7..d8a0287c2c 100644
--- a/site/content/tutorial/09-motion/02-spring/app-b/App.svelte
+++ b/site/content/tutorial/09-motion/02-spring/app-b/App.svelte
@@ -9,11 +9,6 @@
let size = spring(10);
-
-
stiffness ({coords.stiffness})
@@ -32,4 +27,14 @@
on:mouseup="{() => size.set(10)}"
>
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/10-transitions/04-custom-css-transitions/app-a/App.svelte b/site/content/tutorial/10-transitions/04-custom-css-transitions/app-a/App.svelte
index d1f044360d..872c2e4aa3 100644
--- a/site/content/tutorial/10-transitions/04-custom-css-transitions/app-a/App.svelte
+++ b/site/content/tutorial/10-transitions/04-custom-css-transitions/app-a/App.svelte
@@ -11,6 +11,17 @@
}
+
+
+ visible
+
+
+{#if visible}
+
+ transitions!
+
+{/if}
+
-
-
-
- visible
-
-
-{#if visible}
-
- transitions!
-
-{/if}
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/10-transitions/04-custom-css-transitions/app-b/App.svelte b/site/content/tutorial/10-transitions/04-custom-css-transitions/app-b/App.svelte
index 6e8dfcaf08..4bb475157c 100644
--- a/site/content/tutorial/10-transitions/04-custom-css-transitions/app-b/App.svelte
+++ b/site/content/tutorial/10-transitions/04-custom-css-transitions/app-b/App.svelte
@@ -13,7 +13,7 @@
return `
transform: scale(${eased}) rotate(${eased * 1080}deg);
color: hsl(
- ${~~(t * 360)},
+ ${Math.trunc(t * 360)},
${Math.min(100, 1000 - 1000 * t)}%,
${Math.min(50, 500 - 500 * t)}%
);`
@@ -22,6 +22,17 @@
}
+
+
+ visible
+
+
+{#if visible}
+
+ transitions!
+
+{/if}
+
-
-
-
- visible
-
-
-{#if visible}
-
- transitions!
-
-{/if}
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/10-transitions/04-custom-css-transitions/text.md b/site/content/tutorial/10-transitions/04-custom-css-transitions/text.md
index 0745a5924d..b9b062302a 100644
--- a/site/content/tutorial/10-transitions/04-custom-css-transitions/text.md
+++ b/site/content/tutorial/10-transitions/04-custom-css-transitions/text.md
@@ -59,7 +59,7 @@ We can get a lot more creative though. Let's make something truly gratuitous:
return `
transform: scale(${eased}) rotate(${eased * 1080}deg);
color: hsl(
- ${~~(t * 360)},
+ ${Math.trunc(t * 360)},
${Math.min(100, 1000 - 1000 * t)}%,
${Math.min(50, 500 - 500 * t)}%
);`
diff --git a/site/content/tutorial/10-transitions/05-custom-js-transitions/app-a/App.svelte b/site/content/tutorial/10-transitions/05-custom-js-transitions/app-a/App.svelte
index 11a8ec3ef5..7ce4a86e92 100644
--- a/site/content/tutorial/10-transitions/05-custom-js-transitions/app-a/App.svelte
+++ b/site/content/tutorial/10-transitions/05-custom-js-transitions/app-a/App.svelte
@@ -16,7 +16,7 @@
{#if visible}
-
+
The quick brown fox jumps over the lazy dog
-{/if}
\ No newline at end of file
+{/if}
diff --git a/site/content/tutorial/10-transitions/05-custom-js-transitions/app-b/App.svelte b/site/content/tutorial/10-transitions/05-custom-js-transitions/app-b/App.svelte
index 396c793639..563803387b 100644
--- a/site/content/tutorial/10-transitions/05-custom-js-transitions/app-b/App.svelte
+++ b/site/content/tutorial/10-transitions/05-custom-js-transitions/app-b/App.svelte
@@ -1,7 +1,7 @@
-
-
show list
@@ -29,4 +22,11 @@
{item}
{/each}
-{/if}
\ No newline at end of file
+{/if}
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/10-transitions/07-local-transitions/app-b/App.svelte b/site/content/tutorial/10-transitions/07-local-transitions/app-b/App.svelte
index 3d569cfcbb..46603a8b53 100644
--- a/site/content/tutorial/10-transitions/07-local-transitions/app-b/App.svelte
+++ b/site/content/tutorial/10-transitions/07-local-transitions/app-b/App.svelte
@@ -6,13 +6,6 @@
let items = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten'];
-
-
show list
@@ -29,4 +22,11 @@
{item}
{/each}
-{/if}
\ No newline at end of file
+{/if}
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/10-transitions/07-local-transitions/text.md b/site/content/tutorial/10-transitions/07-local-transitions/text.md
index 400fbcaacb..7b9b0ce7f4 100644
--- a/site/content/tutorial/10-transitions/07-local-transitions/text.md
+++ b/site/content/tutorial/10-transitions/07-local-transitions/text.md
@@ -6,7 +6,7 @@ Ordinarily, transitions will play on elements when any container block is added
Instead, we'd like transitions to play only when individual items are added and removed — in other words, when the user drags the slider.
-We can achieve this with a *local* transition, which only plays when the immediate parent block is added or removed:
+We can achieve this with a *local* transition, which only plays when the block with the transition itself is added or removed:
```html
diff --git a/site/content/tutorial/10-transitions/08-deferred-transitions/app-a/App.svelte b/site/content/tutorial/10-transitions/08-deferred-transitions/app-a/App.svelte
index f05c581390..3b6c6776a6 100644
--- a/site/content/tutorial/10-transitions/08-deferred-transitions/app-a/App.svelte
+++ b/site/content/tutorial/10-transitions/08-deferred-transitions/app-a/App.svelte
@@ -145,4 +145,4 @@
label:hover button {
opacity: 1;
}
-
+
\ No newline at end of file
diff --git a/site/content/tutorial/10-transitions/08-deferred-transitions/app-b/App.svelte b/site/content/tutorial/10-transitions/08-deferred-transitions/app-b/App.svelte
index b7447ca7de..f3a26915a3 100644
--- a/site/content/tutorial/10-transitions/08-deferred-transitions/app-b/App.svelte
+++ b/site/content/tutorial/10-transitions/08-deferred-transitions/app-b/App.svelte
@@ -152,4 +152,4 @@
label:hover button {
opacity: 1;
}
-
+
\ No newline at end of file
diff --git a/site/content/tutorial/10-transitions/09-key-blocks/app-a/App.svelte b/site/content/tutorial/10-transitions/09-key-blocks/app-a/App.svelte
new file mode 100644
index 0000000000..3385a02339
--- /dev/null
+++ b/site/content/tutorial/10-transitions/09-key-blocks/app-a/App.svelte
@@ -0,0 +1,19 @@
+
+
+
+ The number is:
+
+ {number}
+
+
+
+
{
+ number += 1;
+ }}>
+ Increment
+
diff --git a/site/content/tutorial/10-transitions/09-key-blocks/app-b/App.svelte b/site/content/tutorial/10-transitions/09-key-blocks/app-b/App.svelte
new file mode 100644
index 0000000000..0e40dc57d1
--- /dev/null
+++ b/site/content/tutorial/10-transitions/09-key-blocks/app-b/App.svelte
@@ -0,0 +1,21 @@
+
+
+
+ The number is:
+ {#key number}
+
+ {number}
+
+ {/key}
+
+
+
{
+ number += 1;
+ }}>
+ Increment
+
diff --git a/site/content/tutorial/10-transitions/09-key-blocks/text.md b/site/content/tutorial/10-transitions/09-key-blocks/text.md
new file mode 100644
index 0000000000..05a54d592a
--- /dev/null
+++ b/site/content/tutorial/10-transitions/09-key-blocks/text.md
@@ -0,0 +1,16 @@
+---
+title: Key blocks
+---
+
+Key blocks destroy and recreate their contents when the value of an expression changes.
+
+```html
+{#key value}
+
{value}
+{/key}
+```
+
+This is useful if you want an element to play its transition whenever a value changes instead of only when the element enters or leaves the DOM.
+
+Wrap the `
` element in a key block depending on `number`. This will make the
+animation play whenever you press the increment button.
diff --git a/site/content/tutorial/11-animations/01-animate/app-a/App.svelte b/site/content/tutorial/11-animations/01-animate/app-a/App.svelte
index b7447ca7de..f3a26915a3 100644
--- a/site/content/tutorial/11-animations/01-animate/app-a/App.svelte
+++ b/site/content/tutorial/11-animations/01-animate/app-a/App.svelte
@@ -152,4 +152,4 @@
label:hover button {
opacity: 1;
}
-
+
\ No newline at end of file
diff --git a/site/content/tutorial/11-animations/01-animate/app-b/App.svelte b/site/content/tutorial/11-animations/01-animate/app-b/App.svelte
index 0d232bf02b..5c5e76331d 100644
--- a/site/content/tutorial/11-animations/01-animate/app-b/App.svelte
+++ b/site/content/tutorial/11-animations/01-animate/app-b/App.svelte
@@ -155,4 +155,4 @@
label:hover button {
opacity: 1;
}
-
+
\ No newline at end of file
diff --git a/site/content/tutorial/12-actions/01-actions/app-a/App.svelte b/site/content/tutorial/12-actions/01-actions/app-a/App.svelte
index feacc44c52..40b4ea2673 100644
--- a/site/content/tutorial/12-actions/01-actions/app-a/App.svelte
+++ b/site/content/tutorial/12-actions/01-actions/app-a/App.svelte
@@ -1,29 +1,16 @@
+ (showModal = true)}>Show Modal
+{#if showModal}
+ (showModal = false)}>
+ Click outside me!
+
+{/if}
+
-
-
\ No newline at end of file
diff --git a/site/content/tutorial/12-actions/01-actions/app-a/pannable.js b/site/content/tutorial/12-actions/01-actions/app-a/click_outside.js
similarity index 69%
rename from site/content/tutorial/12-actions/01-actions/app-a/pannable.js
rename to site/content/tutorial/12-actions/01-actions/app-a/click_outside.js
index 332cd3e147..c406f6e95c 100644
--- a/site/content/tutorial/12-actions/01-actions/app-a/pannable.js
+++ b/site/content/tutorial/12-actions/01-actions/app-a/click_outside.js
@@ -1,4 +1,4 @@
-export function pannable(node) {
+export function clickOutside(node) {
// setup work goes here...
return {
@@ -6,4 +6,4 @@ export function pannable(node) {
// ...cleanup goes here
}
};
-}
\ No newline at end of file
+}
diff --git a/site/content/tutorial/12-actions/01-actions/app-b/App.svelte b/site/content/tutorial/12-actions/01-actions/app-b/App.svelte
index 171f82762c..bd990a5360 100644
--- a/site/content/tutorial/12-actions/01-actions/app-b/App.svelte
+++ b/site/content/tutorial/12-actions/01-actions/app-b/App.svelte
@@ -1,30 +1,16 @@
+ (showModal = true)}>Show Modal
+{#if showModal}
+ (showModal = false)}>
+ Click outside me!
+
+{/if}
+
-
-
\ No newline at end of file
diff --git a/site/content/tutorial/12-actions/01-actions/app-b/click_outside.js b/site/content/tutorial/12-actions/01-actions/app-b/click_outside.js
new file mode 100644
index 0000000000..e8983c1457
--- /dev/null
+++ b/site/content/tutorial/12-actions/01-actions/app-b/click_outside.js
@@ -0,0 +1,15 @@
+export function clickOutside(node) {
+ const handleClick = (event) => {
+ if (!node.contains(event.target)) {
+ node.dispatchEvent(new CustomEvent("outclick"));
+ }
+ };
+
+ document.addEventListener("click", handleClick, true);
+
+ return {
+ destroy() {
+ document.removeEventListener("click", handleClick, true);
+ }
+ };
+}
diff --git a/site/content/tutorial/12-actions/01-actions/app-b/pannable.js b/site/content/tutorial/12-actions/01-actions/app-b/pannable.js
deleted file mode 100644
index f7d15328be..0000000000
--- a/site/content/tutorial/12-actions/01-actions/app-b/pannable.js
+++ /dev/null
@@ -1,47 +0,0 @@
-export function pannable(node) {
- let x;
- let y;
-
- function handleMousedown(event) {
- x = event.clientX;
- y = event.clientY;
-
- node.dispatchEvent(new CustomEvent('panstart', {
- detail: { x, y }
- }));
-
- window.addEventListener('mousemove', handleMousemove);
- window.addEventListener('mouseup', handleMouseup);
- }
-
- function handleMousemove(event) {
- const dx = event.clientX - x;
- const dy = event.clientY - y;
- x = event.clientX;
- y = event.clientY;
-
- node.dispatchEvent(new CustomEvent('panmove', {
- detail: { x, y, dx, dy }
- }));
- }
-
- function handleMouseup(event) {
- x = event.clientX;
- y = event.clientY;
-
- node.dispatchEvent(new CustomEvent('panend', {
- detail: { x, y }
- }));
-
- window.removeEventListener('mousemove', handleMousemove);
- window.removeEventListener('mouseup', handleMouseup);
- }
-
- node.addEventListener('mousedown', handleMousedown);
-
- return {
- destroy() {
- node.removeEventListener('mousedown', handleMousedown);
- }
- };
-}
\ No newline at end of file
diff --git a/site/content/tutorial/12-actions/01-actions/text.md b/site/content/tutorial/12-actions/01-actions/text.md
index 3706b31e7c..dfe75c192f 100644
--- a/site/content/tutorial/12-actions/01-actions/text.md
+++ b/site/content/tutorial/12-actions/01-actions/text.md
@@ -4,85 +4,45 @@ title: The use directive
Actions are essentially element-level lifecycle functions. They're useful for things like:
-* interfacing with third-party libraries
-* lazy-loaded images
-* tooltips
-* adding custom event handlers
+- interfacing with third-party libraries
+- lazy-loaded images
+- tooltips
+- adding custom event handlers
-In this app, we want to make the orange box 'pannable'. It has event handlers for the `panstart`, `panmove` and `panend` events, but these aren't native DOM events. We have to dispatch them ourselves. First, import the `pannable` function...
+In this app, we want to make the orange modal close when the user clicks outside it. It has an event handler for the `outclick` event, but it isn't a native DOM event. We have to dispatch it ourselves. First, import the `clickOutside` function...
```js
-import { pannable } from './pannable.js';
+import { clickOutside } from "./click_outside.js";
```
...then use it with the element:
```html
-
+
+ Click outside me!
+
```
-Open the `pannable.js` file. Like transition functions, an action function receives a `node` and some optional parameters, and returns an action object. That object can have a `destroy` function, which is called when the element is unmounted.
+Open the `click_outside.js` file. Like transition functions, an action function receives a `node` (which is the element that the action is applied to) and some optional parameters, and returns an action object. That object can have a `destroy` function, which is called when the element is unmounted.
-We want to fire `panstart` event when the user mouses down on the element, `panmove` events (with `dx` and `dy` properties showing how far the mouse moved) when they drag it, and `panend` events when they mouse up. One possible implementation looks like this:
+We want to fire the `outclick` event when the user clicks outside the orange box. One possible implementation looks like this:
```js
-export function pannable(node) {
- let x;
- let y;
-
- function handleMousedown(event) {
- x = event.clientX;
- y = event.clientY;
-
- node.dispatchEvent(new CustomEvent('panstart', {
- detail: { x, y }
- }));
-
- window.addEventListener('mousemove', handleMousemove);
- window.addEventListener('mouseup', handleMouseup);
- }
-
- function handleMousemove(event) {
- const dx = event.clientX - x;
- const dy = event.clientY - y;
- x = event.clientX;
- y = event.clientY;
-
- node.dispatchEvent(new CustomEvent('panmove', {
- detail: { x, y, dx, dy }
- }));
- }
-
- function handleMouseup(event) {
- x = event.clientX;
- y = event.clientY;
-
- node.dispatchEvent(new CustomEvent('panend', {
- detail: { x, y }
- }));
-
- window.removeEventListener('mousemove', handleMousemove);
- window.removeEventListener('mouseup', handleMouseup);
- }
+export function clickOutside(node) {
+ const handleClick = (event) => {
+ if (!node.contains(event.target)) {
+ node.dispatchEvent(new CustomEvent("outclick"));
+ }
+ };
- node.addEventListener('mousedown', handleMousedown);
+ document.addEventListener("click", handleClick, true);
return {
destroy() {
- node.removeEventListener('mousedown', handleMousedown);
- }
+ document.removeEventListener("click", handleClick, true);
+ },
};
}
```
-Update the `pannable` function and try moving the box around.
-
-> This implementation is for demonstration purposes — a more complete one would also consider touch events.
+Update the `clickOutside` function, click the button to show the modal and then click outside it to close it.
diff --git a/site/content/tutorial/13-classes/01-classes/app-a/App.svelte b/site/content/tutorial/13-classes/01-classes/app-a/App.svelte
index baa2543562..f0db8b3214 100644
--- a/site/content/tutorial/13-classes/01-classes/app-a/App.svelte
+++ b/site/content/tutorial/13-classes/01-classes/app-a/App.svelte
@@ -2,17 +2,6 @@
let current = 'foo';
-
-
baz
\ No newline at end of file
+>baz
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/13-classes/01-classes/app-b/App.svelte b/site/content/tutorial/13-classes/01-classes/app-b/App.svelte
index a8861ad537..00851567ef 100644
--- a/site/content/tutorial/13-classes/01-classes/app-b/App.svelte
+++ b/site/content/tutorial/13-classes/01-classes/app-b/App.svelte
@@ -2,17 +2,6 @@
let current = 'foo';
-
-
baz
\ No newline at end of file
+>baz
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/13-classes/02-class-shorthand/app-a/App.svelte b/site/content/tutorial/13-classes/02-class-shorthand/app-a/App.svelte
index 5ff6497230..d944a63313 100644
--- a/site/content/tutorial/13-classes/02-class-shorthand/app-a/App.svelte
+++ b/site/content/tutorial/13-classes/02-class-shorthand/app-a/App.svelte
@@ -2,12 +2,6 @@
let big = false;
-
-
big
@@ -15,4 +9,10 @@
some {big ? 'big' : 'small'} text
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/13-classes/02-class-shorthand/app-b/App.svelte b/site/content/tutorial/13-classes/02-class-shorthand/app-b/App.svelte
index 0f4e0d9f24..c91385e4e5 100644
--- a/site/content/tutorial/13-classes/02-class-shorthand/app-b/App.svelte
+++ b/site/content/tutorial/13-classes/02-class-shorthand/app-b/App.svelte
@@ -2,12 +2,6 @@
let big = false;
-
-
big
@@ -15,4 +9,10 @@
some {big ? 'big' : 'small'} text
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/14-composition/01-slots/app-a/Box.svelte b/site/content/tutorial/14-composition/01-slots/app-a/Box.svelte
index 62f0b92dc0..e199b8ce81 100644
--- a/site/content/tutorial/14-composition/01-slots/app-a/Box.svelte
+++ b/site/content/tutorial/14-composition/01-slots/app-a/Box.svelte
@@ -1,3 +1,7 @@
+
+
+
+
-
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/14-composition/01-slots/app-b/Box.svelte b/site/content/tutorial/14-composition/01-slots/app-b/Box.svelte
index 7ed13f386f..b17fdbe60d 100644
--- a/site/content/tutorial/14-composition/01-slots/app-b/Box.svelte
+++ b/site/content/tutorial/14-composition/01-slots/app-b/Box.svelte
@@ -1,3 +1,7 @@
+
+
+
+
-
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/14-composition/02-slot-fallbacks/app-a/Box.svelte b/site/content/tutorial/14-composition/02-slot-fallbacks/app-a/Box.svelte
index 7ed13f386f..b17fdbe60d 100644
--- a/site/content/tutorial/14-composition/02-slot-fallbacks/app-a/Box.svelte
+++ b/site/content/tutorial/14-composition/02-slot-fallbacks/app-a/Box.svelte
@@ -1,3 +1,7 @@
+
+
+
+
-
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/14-composition/02-slot-fallbacks/app-b/Box.svelte b/site/content/tutorial/14-composition/02-slot-fallbacks/app-b/Box.svelte
index 66c580632c..bdaf61b874 100644
--- a/site/content/tutorial/14-composition/02-slot-fallbacks/app-b/Box.svelte
+++ b/site/content/tutorial/14-composition/02-slot-fallbacks/app-b/Box.svelte
@@ -1,3 +1,9 @@
+
+
+ no content was provided
+
+
+
-
-
-
- no content was provided
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/14-composition/03-named-slots/app-a/ContactCard.svelte b/site/content/tutorial/14-composition/03-named-slots/app-a/ContactCard.svelte
index c09404a282..4d8ba30e75 100644
--- a/site/content/tutorial/14-composition/03-named-slots/app-a/ContactCard.svelte
+++ b/site/content/tutorial/14-composition/03-named-slots/app-a/ContactCard.svelte
@@ -1,3 +1,23 @@
+
+
+
+ Unknown name
+
+
+
+
+
+ Unknown address
+
+
+
+
+
+ Unknown email
+
+
+
+
-
-
-
-
- Unknown name
-
-
-
-
-
- Unknown address
-
-
-
-
-
- Unknown email
-
-
-
\ No newline at end of file
+ .address {
+ background-image: url(tutorial/icons/map-marker.svg);
+ }
+ .email {
+ background-image: url(tutorial/icons/email.svg);
+ }
+ .missing {
+ color: #999;
+ }
+
\ No newline at end of file
diff --git a/site/content/tutorial/14-composition/03-named-slots/app-b/ContactCard.svelte b/site/content/tutorial/14-composition/03-named-slots/app-b/ContactCard.svelte
index 1acf290943..0348b70c55 100644
--- a/site/content/tutorial/14-composition/03-named-slots/app-b/ContactCard.svelte
+++ b/site/content/tutorial/14-composition/03-named-slots/app-b/ContactCard.svelte
@@ -1,3 +1,23 @@
+
+
+
+ Unknown name
+
+
+
+
+
+ Unknown address
+
+
+
+
+
+ Unknown email
+
+
+
+
-
-
-
-
- Unknown name
-
-
-
-
-
- Unknown address
-
-
-
-
-
- Unknown email
-
-
-
\ No newline at end of file
+ .address {
+ background-image: url(tutorial/icons/map-marker.svg);
+ }
+ .email {
+ background-image: url(tutorial/icons/email.svg);
+ }
+ .missing {
+ color: #999;
+ }
+
\ No newline at end of file
diff --git a/site/content/tutorial/14-composition/04-optional-slots/app-a/App.svelte b/site/content/tutorial/14-composition/04-optional-slots/app-a/App.svelte
new file mode 100755
index 0000000000..19537cb4b3
--- /dev/null
+++ b/site/content/tutorial/14-composition/04-optional-slots/app-a/App.svelte
@@ -0,0 +1,57 @@
+
+
+
+ Projects
+
+
+
+
+
+
+
+ Those interface tests are now passing.
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/14-composition/04-optional-slots/app-a/Comment.svelte b/site/content/tutorial/14-composition/04-optional-slots/app-a/Comment.svelte
new file mode 100755
index 0000000000..b3c10febf5
--- /dev/null
+++ b/site/content/tutorial/14-composition/04-optional-slots/app-a/Comment.svelte
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/14-composition/04-optional-slots/app-a/Project.svelte b/site/content/tutorial/14-composition/04-optional-slots/app-a/Project.svelte
new file mode 100755
index 0000000000..2d98458966
--- /dev/null
+++ b/site/content/tutorial/14-composition/04-optional-slots/app-a/Project.svelte
@@ -0,0 +1,62 @@
+
+
+
+
+
{title}
+
{tasksCompleted}/{totalTasks} tasks completed
+
+
+
Comments
+
+
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/14-composition/04-optional-slots/app-b/App.svelte b/site/content/tutorial/14-composition/04-optional-slots/app-b/App.svelte
new file mode 100755
index 0000000000..19537cb4b3
--- /dev/null
+++ b/site/content/tutorial/14-composition/04-optional-slots/app-b/App.svelte
@@ -0,0 +1,57 @@
+
+
+
+ Projects
+
+
+
+
+
+
+
+ Those interface tests are now passing.
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/14-composition/04-optional-slots/app-b/Comment.svelte b/site/content/tutorial/14-composition/04-optional-slots/app-b/Comment.svelte
new file mode 100755
index 0000000000..b3c10febf5
--- /dev/null
+++ b/site/content/tutorial/14-composition/04-optional-slots/app-b/Comment.svelte
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/14-composition/04-optional-slots/app-b/Project.svelte b/site/content/tutorial/14-composition/04-optional-slots/app-b/Project.svelte
new file mode 100755
index 0000000000..39f55abd18
--- /dev/null
+++ b/site/content/tutorial/14-composition/04-optional-slots/app-b/Project.svelte
@@ -0,0 +1,64 @@
+
+
+
+
+
{title}
+
{tasksCompleted}/{totalTasks} tasks completed
+
+ {#if $$slots.comments}
+
+
Comments
+
+
+ {/if}
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/14-composition/04-optional-slots/text.md b/site/content/tutorial/14-composition/04-optional-slots/text.md
new file mode 100644
index 0000000000..b875f4c87d
--- /dev/null
+++ b/site/content/tutorial/14-composition/04-optional-slots/text.md
@@ -0,0 +1,28 @@
+---
+title: Checking for slot content
+---
+
+In some cases, you may want to control parts of your component based on whether the parent passes in content for a certain slot. Perhaps you have a wrapper around that slot, and you don't want to render it if the slot is empty. Or perhaps you'd like to apply a class only if the slot is present. You can do this by checking the properties of the special `$$slots` variable.
+
+`$$slots` is an object whose keys are the names of the slots passed in by the parent component. If the parent leaves a slot empty, then `$$slots` will not have an entry for that slot.
+
+Notice that both instances of `` in this example render a container for comments and a notification dot, even though only one has comments. We want to use `$$slots` to make sure we only render these elements when the parent `` passes in content for the `comments` slot.
+
+In `Project.svelte`, update the `class:has-discussion` directive on the ``:
+
+```html
+
+```
+
+Next, wrap the `comments` slot and its wrapping `` in an `if` block that checks `$$slots`:
+
+```html
+{#if $$slots.comments}
+
+
Comments
+
+
+{/if}
+```
+
+Now the comments container and the notification dot won't render when `
` leaves the `comments` slot empty.
diff --git a/site/content/tutorial/14-composition/04-slot-props/app-a/App.svelte b/site/content/tutorial/14-composition/05-slot-props/app-a/App.svelte
similarity index 94%
rename from site/content/tutorial/14-composition/04-slot-props/app-a/App.svelte
rename to site/content/tutorial/14-composition/05-slot-props/app-a/App.svelte
index 65f714f2c5..e95b4cbe93 100644
--- a/site/content/tutorial/14-composition/04-slot-props/app-a/App.svelte
+++ b/site/content/tutorial/14-composition/05-slot-props/app-a/App.svelte
@@ -2,6 +2,16 @@
import Hoverable from './Hoverable.svelte';
+
+
+ {#if hovering}
+
I am being hovered upon.
+ {:else}
+
Hover over me!
+ {/if}
+
+
+
-
-
-
- {#if hovering}
-
I am being hovered upon.
- {:else}
-
Hover over me!
- {/if}
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/14-composition/04-slot-props/app-a/Hoverable.svelte b/site/content/tutorial/14-composition/05-slot-props/app-a/Hoverable.svelte
similarity index 100%
rename from site/content/tutorial/14-composition/04-slot-props/app-a/Hoverable.svelte
rename to site/content/tutorial/14-composition/05-slot-props/app-a/Hoverable.svelte
diff --git a/site/content/tutorial/14-composition/04-slot-props/app-b/App.svelte b/site/content/tutorial/14-composition/05-slot-props/app-b/App.svelte
similarity index 97%
rename from site/content/tutorial/14-composition/04-slot-props/app-b/App.svelte
rename to site/content/tutorial/14-composition/05-slot-props/app-b/App.svelte
index 36772a5077..299cd336a6 100644
--- a/site/content/tutorial/14-composition/04-slot-props/app-b/App.svelte
+++ b/site/content/tutorial/14-composition/05-slot-props/app-b/App.svelte
@@ -2,19 +2,6 @@
import Hoverable from './Hoverable.svelte';
-
-
{#if active}
@@ -43,4 +30,17 @@
Hover over me!
{/if}
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/14-composition/04-slot-props/app-b/Hoverable.svelte b/site/content/tutorial/14-composition/05-slot-props/app-b/Hoverable.svelte
similarity index 100%
rename from site/content/tutorial/14-composition/04-slot-props/app-b/Hoverable.svelte
rename to site/content/tutorial/14-composition/05-slot-props/app-b/Hoverable.svelte
diff --git a/site/content/tutorial/14-composition/04-slot-props/text.md b/site/content/tutorial/14-composition/05-slot-props/text.md
similarity index 100%
rename from site/content/tutorial/14-composition/04-slot-props/text.md
rename to site/content/tutorial/14-composition/05-slot-props/text.md
diff --git a/site/content/tutorial/15-context/01-context-api/app-a/Map.svelte b/site/content/tutorial/15-context/01-context-api/app-a/Map.svelte
index 888f42da39..e94bd3f0cd 100644
--- a/site/content/tutorial/15-context/01-context-api/app-a/Map.svelte
+++ b/site/content/tutorial/15-context/01-context-api/app-a/Map.svelte
@@ -1,5 +1,5 @@
+
+
+
+
+
+
+ {#if map}
+
+ {/if}
+
+
-
-
- {#if map}
-
- {/if}
-
\ No newline at end of file
diff --git a/site/content/tutorial/15-context/01-context-api/app-b/Map.svelte b/site/content/tutorial/15-context/01-context-api/app-b/Map.svelte
index 0282cbc311..bd4010e765 100644
--- a/site/content/tutorial/15-context/01-context-api/app-b/Map.svelte
+++ b/site/content/tutorial/15-context/01-context-api/app-b/Map.svelte
@@ -1,9 +1,9 @@
+
+
+
+
+
+
+ {#if map}
+
+ {/if}
+
+
-
-
- {#if map}
-
- {/if}
-
\ No newline at end of file
diff --git a/site/content/tutorial/15-context/01-context-api/text.md b/site/content/tutorial/15-context/01-context-api/text.md
index 96a716dfb0..dc5f2d7e8b 100644
--- a/site/content/tutorial/15-context/01-context-api/text.md
+++ b/site/content/tutorial/15-context/01-context-api/text.md
@@ -19,7 +19,7 @@ setContext(key, {
});
```
-The context object can be anything you like. Like [lifecycle functions](tutorial/onmount), `setContext` and `getContext` must be called during component initialisation; since `map` isn't created until the component has mounted, our context object contains a `getMap` function rather than `map` itself.
+The context object can be anything you like. Like [lifecycle functions](tutorial/onmount), `setContext` and `getContext` must be called during component initialisation. Calling it afterwards - for example inside `onMount` - will throw an error. In this example, since `map` isn't created until the component has mounted, our context object contains a `getMap` function rather than `map` itself.
On the other side of the equation, in `MapMarker.svelte`, we can now get a reference to the Mapbox instance:
diff --git a/site/content/tutorial/16-special-elements/01-svelte-self/app-a/App.svelte b/site/content/tutorial/16-special-elements/01-svelte-self/app-a/App.svelte
index ff02fa6a42..de0b2e0179 100644
--- a/site/content/tutorial/16-special-elements/01-svelte-self/app-a/App.svelte
+++ b/site/content/tutorial/16-special-elements/01-svelte-self/app-a/App.svelte
@@ -3,39 +3,35 @@
let root = [
{
- type: 'folder',
name: 'Important work stuff',
files: [
- { type: 'file', name: 'quarterly-results.xlsx' }
+ { name: 'quarterly-results.xlsx' }
]
},
{
- type: 'folder',
name: 'Animal GIFs',
files: [
{
- type: 'folder',
name: 'Dogs',
files: [
- { type: 'file', name: 'treadmill.gif' },
- { type: 'file', name: 'rope-jumping.gif' }
+ { name: 'treadmill.gif' },
+ { name: 'rope-jumping.gif' }
]
},
{
- type: 'folder',
name: 'Goats',
files: [
- { type: 'file', name: 'parkour.gif' },
- { type: 'file', name: 'rampage.gif' }
+ { name: 'parkour.gif' },
+ { name: 'rampage.gif' }
]
},
- { type: 'file', name: 'cat-roomba.gif' },
- { type: 'file', name: 'duck-shuffle.gif' },
- { type: 'file', name: 'monkey-on-a-pig.gif' }
+ { name: 'cat-roomba.gif' },
+ { name: 'duck-shuffle.gif' },
+ { name: 'monkey-on-a-pig.gif' }
]
},
- { type: 'file', name: 'TODO.md' }
+ { name: 'TODO.md' }
];
-
\ No newline at end of file
+
diff --git a/site/content/tutorial/16-special-elements/01-svelte-self/app-a/File.svelte b/site/content/tutorial/16-special-elements/01-svelte-self/app-a/File.svelte
index e34686101a..8a0048dd68 100644
--- a/site/content/tutorial/16-special-elements/01-svelte-self/app-a/File.svelte
+++ b/site/content/tutorial/16-special-elements/01-svelte-self/app-a/File.svelte
@@ -3,12 +3,12 @@
$: type = name.slice(name.lastIndexOf('.') + 1);
+{name}
+
-
-{name}
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/01-svelte-self/app-a/Folder.svelte b/site/content/tutorial/16-special-elements/01-svelte-self/app-a/Folder.svelte
index add7fb96d3..1108b3575c 100644
--- a/site/content/tutorial/16-special-elements/01-svelte-self/app-a/Folder.svelte
+++ b/site/content/tutorial/16-special-elements/01-svelte-self/app-a/Folder.svelte
@@ -10,6 +10,22 @@
}
+{name}
+
+{#if expanded}
+
+ {#each files as file}
+
+ {#if file.files}
+
+ {:else}
+
+ {/if}
+
+ {/each}
+
+{/if}
+
-
-{name}
-
-{#if expanded}
-
- {#each files as file}
-
- {#if file.type === 'folder'}
-
- {:else}
-
- {/if}
-
- {/each}
-
-{/if}
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/01-svelte-self/app-b/App.svelte b/site/content/tutorial/16-special-elements/01-svelte-self/app-b/App.svelte
index ff02fa6a42..de0b2e0179 100644
--- a/site/content/tutorial/16-special-elements/01-svelte-self/app-b/App.svelte
+++ b/site/content/tutorial/16-special-elements/01-svelte-self/app-b/App.svelte
@@ -3,39 +3,35 @@
let root = [
{
- type: 'folder',
name: 'Important work stuff',
files: [
- { type: 'file', name: 'quarterly-results.xlsx' }
+ { name: 'quarterly-results.xlsx' }
]
},
{
- type: 'folder',
name: 'Animal GIFs',
files: [
{
- type: 'folder',
name: 'Dogs',
files: [
- { type: 'file', name: 'treadmill.gif' },
- { type: 'file', name: 'rope-jumping.gif' }
+ { name: 'treadmill.gif' },
+ { name: 'rope-jumping.gif' }
]
},
{
- type: 'folder',
name: 'Goats',
files: [
- { type: 'file', name: 'parkour.gif' },
- { type: 'file', name: 'rampage.gif' }
+ { name: 'parkour.gif' },
+ { name: 'rampage.gif' }
]
},
- { type: 'file', name: 'cat-roomba.gif' },
- { type: 'file', name: 'duck-shuffle.gif' },
- { type: 'file', name: 'monkey-on-a-pig.gif' }
+ { name: 'cat-roomba.gif' },
+ { name: 'duck-shuffle.gif' },
+ { name: 'monkey-on-a-pig.gif' }
]
},
- { type: 'file', name: 'TODO.md' }
+ { name: 'TODO.md' }
];
-
\ No newline at end of file
+
diff --git a/site/content/tutorial/16-special-elements/01-svelte-self/app-b/File.svelte b/site/content/tutorial/16-special-elements/01-svelte-self/app-b/File.svelte
index e34686101a..8a0048dd68 100644
--- a/site/content/tutorial/16-special-elements/01-svelte-self/app-b/File.svelte
+++ b/site/content/tutorial/16-special-elements/01-svelte-self/app-b/File.svelte
@@ -3,12 +3,12 @@
$: type = name.slice(name.lastIndexOf('.') + 1);
+{name}
+
-
-{name}
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/01-svelte-self/app-b/Folder.svelte b/site/content/tutorial/16-special-elements/01-svelte-self/app-b/Folder.svelte
index c25bb2a93d..11049c2e52 100644
--- a/site/content/tutorial/16-special-elements/01-svelte-self/app-b/Folder.svelte
+++ b/site/content/tutorial/16-special-elements/01-svelte-self/app-b/Folder.svelte
@@ -10,6 +10,22 @@
}
+{name}
+
+{#if expanded}
+
+ {#each files as file}
+
+ {#if file.files}
+
+ {:else}
+
+ {/if}
+
+ {/each}
+
+{/if}
+
-
-{name}
-
-{#if expanded}
-
- {#each files as file}
-
- {#if file.type === 'folder'}
-
- {:else}
-
- {/if}
-
- {/each}
-
-{/if}
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/01-svelte-self/text.md b/site/content/tutorial/16-special-elements/01-svelte-self/text.md
index c7946f6c6d..894a8efc3d 100644
--- a/site/content/tutorial/16-special-elements/01-svelte-self/text.md
+++ b/site/content/tutorial/16-special-elements/01-svelte-self/text.md
@@ -7,7 +7,7 @@ Svelte provides a variety of built-in elements. The first, ``, allo
It's useful for things like this folder tree view, where folders can contain *other* folders. In `Folder.svelte` we want to be able to do this...
```html
-{#if file.type === 'folder'}
+{#if file.files}
{:else}
@@ -17,7 +17,7 @@ It's useful for things like this folder tree view, where folders can contain *ot
...but that's impossible, because a module can't import itself. Instead, we use ``:
```html
-{#if file.type === 'folder'}
+{#if file.files}
{:else}
diff --git a/site/content/tutorial/16-special-elements/02-svelte-component/app-a/BlueThing.svelte b/site/content/tutorial/16-special-elements/02-svelte-component/app-a/BlueThing.svelte
index f9130d9d65..eb7ba64163 100644
--- a/site/content/tutorial/16-special-elements/02-svelte-component/app-a/BlueThing.svelte
+++ b/site/content/tutorial/16-special-elements/02-svelte-component/app-a/BlueThing.svelte
@@ -1,5 +1,7 @@
-
+Blue thing
-blue thing
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/02-svelte-component/app-a/GreenThing.svelte b/site/content/tutorial/16-special-elements/02-svelte-component/app-a/GreenThing.svelte
index 9cbee235d3..ed2aa49f27 100644
--- a/site/content/tutorial/16-special-elements/02-svelte-component/app-a/GreenThing.svelte
+++ b/site/content/tutorial/16-special-elements/02-svelte-component/app-a/GreenThing.svelte
@@ -1,5 +1,7 @@
-
+Green thing
-green thing
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/02-svelte-component/app-a/RedThing.svelte b/site/content/tutorial/16-special-elements/02-svelte-component/app-a/RedThing.svelte
index 42f5e4c672..365f226492 100644
--- a/site/content/tutorial/16-special-elements/02-svelte-component/app-a/RedThing.svelte
+++ b/site/content/tutorial/16-special-elements/02-svelte-component/app-a/RedThing.svelte
@@ -1,5 +1,7 @@
-
+Red thing
-red thing
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/02-svelte-component/app-b/BlueThing.svelte b/site/content/tutorial/16-special-elements/02-svelte-component/app-b/BlueThing.svelte
index f9130d9d65..eb7ba64163 100644
--- a/site/content/tutorial/16-special-elements/02-svelte-component/app-b/BlueThing.svelte
+++ b/site/content/tutorial/16-special-elements/02-svelte-component/app-b/BlueThing.svelte
@@ -1,5 +1,7 @@
-
+Blue thing
-blue thing
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/02-svelte-component/app-b/GreenThing.svelte b/site/content/tutorial/16-special-elements/02-svelte-component/app-b/GreenThing.svelte
index 9cbee235d3..ed2aa49f27 100644
--- a/site/content/tutorial/16-special-elements/02-svelte-component/app-b/GreenThing.svelte
+++ b/site/content/tutorial/16-special-elements/02-svelte-component/app-b/GreenThing.svelte
@@ -1,5 +1,7 @@
-
+Green thing
-green thing
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/02-svelte-component/app-b/RedThing.svelte b/site/content/tutorial/16-special-elements/02-svelte-component/app-b/RedThing.svelte
index 42f5e4c672..365f226492 100644
--- a/site/content/tutorial/16-special-elements/02-svelte-component/app-b/RedThing.svelte
+++ b/site/content/tutorial/16-special-elements/02-svelte-component/app-b/RedThing.svelte
@@ -1,5 +1,7 @@
-
+Red thing
-red thing
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/03-svelte-window/app-a/App.svelte b/site/content/tutorial/16-special-elements/03-svelte-window/app-a/App.svelte
index 9fe2bf526c..24c9a6368a 100644
--- a/site/content/tutorial/16-special-elements/03-svelte-window/app-a/App.svelte
+++ b/site/content/tutorial/16-special-elements/03-svelte-window/app-a/App.svelte
@@ -8,6 +8,17 @@
}
+
+
+
+ {#if key}
+
{key === ' ' ? 'Space' : key}
+
{keyCode}
+ {:else}
+
Focus this window and press any key
+ {/if}
+
+
-
-
-
-
- {#if key}
-
{key === ' ' ? 'Space' : key}
-
{keyCode}
- {:else}
-
Focus this window and press any key
- {/if}
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/03-svelte-window/app-b/App.svelte b/site/content/tutorial/16-special-elements/03-svelte-window/app-b/App.svelte
index 845d666dff..026dfa94f7 100644
--- a/site/content/tutorial/16-special-elements/03-svelte-window/app-b/App.svelte
+++ b/site/content/tutorial/16-special-elements/03-svelte-window/app-b/App.svelte
@@ -8,6 +8,17 @@
}
+
+
+
+ {#if key}
+
{key === ' ' ? 'Space' : key}
+
{keyCode}
+ {:else}
+
Focus this window and press any key
+ {/if}
+
+
-
-
-
-
- {#if key}
-
{key === ' ' ? 'Space' : key}
-
{keyCode}
- {:else}
-
Focus this window and press any key
- {/if}
-
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/03-svelte-window/text.md b/site/content/tutorial/16-special-elements/03-svelte-window/text.md
index b581b3ada4..3c6c71a730 100644
--- a/site/content/tutorial/16-special-elements/03-svelte-window/text.md
+++ b/site/content/tutorial/16-special-elements/03-svelte-window/text.md
@@ -4,7 +4,7 @@ title:
Just as you can add event listeners to any DOM element, you can add event listeners to the `window` object with ``.
-On line 33, add the `keydown` listener:
+On line 11, add the `keydown` listener:
```html
diff --git a/site/content/tutorial/16-special-elements/04-svelte-window-bindings/app-a/App.svelte b/site/content/tutorial/16-special-elements/04-svelte-window-bindings/app-a/App.svelte
index 04b4de5cf2..ba51140ff4 100644
--- a/site/content/tutorial/16-special-elements/04-svelte-window-bindings/app-a/App.svelte
+++ b/site/content/tutorial/16-special-elements/04-svelte-window-bindings/app-a/App.svelte
@@ -85,4 +85,4 @@
padding: 0;
background-color: rgb(253, 174, 51);
}
-
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/04-svelte-window-bindings/app-b/App.svelte b/site/content/tutorial/16-special-elements/04-svelte-window-bindings/app-b/App.svelte
index 15c2aa0ebc..2fc076b991 100644
--- a/site/content/tutorial/16-special-elements/04-svelte-window-bindings/app-b/App.svelte
+++ b/site/content/tutorial/16-special-elements/04-svelte-window-bindings/app-b/App.svelte
@@ -85,4 +85,4 @@
padding: 0;
background-color: rgb(253, 174, 51);
}
-
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/05-svelte-body/app-a/App.svelte b/site/content/tutorial/16-special-elements/05-svelte-body/app-a/App.svelte
index ad616582e5..d9505bb0c9 100644
--- a/site/content/tutorial/16-special-elements/05-svelte-body/app-a/App.svelte
+++ b/site/content/tutorial/16-special-elements/05-svelte-body/app-a/App.svelte
@@ -5,6 +5,15 @@
const handleMouseleave = () => hereKitty = false;
+
+
+
+
+
-
-
-
-
-
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/05-svelte-body/app-b/App.svelte b/site/content/tutorial/16-special-elements/05-svelte-body/app-b/App.svelte
index ac946962eb..238da2ab18 100644
--- a/site/content/tutorial/16-special-elements/05-svelte-body/app-b/App.svelte
+++ b/site/content/tutorial/16-special-elements/05-svelte-body/app-b/App.svelte
@@ -5,6 +5,18 @@
const handleMouseleave = () => hereKitty = false;
+
+
+
+
+
-
-
-
-
-
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/07-svelte-options/app-a/Todo.svelte b/site/content/tutorial/16-special-elements/07-svelte-options/app-a/Todo.svelte
index 5e0dbca300..57d4dcc79a 100644
--- a/site/content/tutorial/16-special-elements/07-svelte-options/app-a/Todo.svelte
+++ b/site/content/tutorial/16-special-elements/07-svelte-options/app-a/Todo.svelte
@@ -11,15 +11,15 @@
});
-
-
{todo.done ? '👍': ''} {todo.text}
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/07-svelte-options/app-b/Todo.svelte b/site/content/tutorial/16-special-elements/07-svelte-options/app-b/Todo.svelte
index e7ddcedc47..fa81d35989 100644
--- a/site/content/tutorial/16-special-elements/07-svelte-options/app-b/Todo.svelte
+++ b/site/content/tutorial/16-special-elements/07-svelte-options/app-b/Todo.svelte
@@ -13,15 +13,15 @@
});
-
-
{todo.done ? '👍': ''} {todo.text}
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/07-svelte-options/text.md b/site/content/tutorial/16-special-elements/07-svelte-options/text.md
index 60a9d3b0f8..c3f9f50ce0 100644
--- a/site/content/tutorial/16-special-elements/07-svelte-options/text.md
+++ b/site/content/tutorial/16-special-elements/07-svelte-options/text.md
@@ -2,7 +2,7 @@
title:
---
-Lastly, `` allows you to specify compiler options.
+The `` element allows you to specify compiler options.
We'll use the `immutable` option as an example. In this app, the `` component flashes whenever it receives new data. Clicking on one of the items toggles its `done` state by creating an updated `todos` array. This causes the *other* `` items to flash, even though they don't end up making any changes to the DOM.
@@ -27,4 +27,4 @@ The options that can be set here are:
* `namespace="..."` — the namespace where this component will be used, most commonly `"svg"`
* `tag="..."` — the name to use when compiling this component as a custom element
-Consult the [API reference](docs) for more information on these options.
\ No newline at end of file
+Consult the [API reference](docs) for more information on these options.
diff --git a/site/content/tutorial/16-special-elements/08-svelte-fragment/app-a/App.svelte b/site/content/tutorial/16-special-elements/08-svelte-fragment/app-a/App.svelte
new file mode 100644
index 0000000000..442ff07d26
--- /dev/null
+++ b/site/content/tutorial/16-special-elements/08-svelte-fragment/app-a/App.svelte
@@ -0,0 +1,10 @@
+
+
+
+
+
All rights reserved.
+
Copyright (c) 2019 Svelte Industries
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/08-svelte-fragment/app-a/Box.svelte b/site/content/tutorial/16-special-elements/08-svelte-fragment/app-a/Box.svelte
new file mode 100644
index 0000000000..ed389182a7
--- /dev/null
+++ b/site/content/tutorial/16-special-elements/08-svelte-fragment/app-a/Box.svelte
@@ -0,0 +1,20 @@
+
+
No header was provided
+
Some content between header and footer
+
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/08-svelte-fragment/app-b/App.svelte b/site/content/tutorial/16-special-elements/08-svelte-fragment/app-b/App.svelte
new file mode 100644
index 0000000000..e66b026d90
--- /dev/null
+++ b/site/content/tutorial/16-special-elements/08-svelte-fragment/app-b/App.svelte
@@ -0,0 +1,10 @@
+
+
+
+
+ All rights reserved.
+ Copyright (c) 2019 Svelte Industries
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/08-svelte-fragment/app-b/Box.svelte b/site/content/tutorial/16-special-elements/08-svelte-fragment/app-b/Box.svelte
new file mode 100644
index 0000000000..ed389182a7
--- /dev/null
+++ b/site/content/tutorial/16-special-elements/08-svelte-fragment/app-b/Box.svelte
@@ -0,0 +1,20 @@
+
+
No header was provided
+
Some content between header and footer
+
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/16-special-elements/08-svelte-fragment/text.md b/site/content/tutorial/16-special-elements/08-svelte-fragment/text.md
new file mode 100644
index 0000000000..2103404799
--- /dev/null
+++ b/site/content/tutorial/16-special-elements/08-svelte-fragment/text.md
@@ -0,0 +1,35 @@
+---
+title:
+---
+
+The `` element allows you to place content in a named slot without wrapping it in a container DOM element. This keeps the flow layout of your document intact.
+
+In the example notice how we applied a flex layout with a gap of `1em` to the box.
+
+```sv
+
+
+
No header was provided
+
Some content between header and footer
+
+
+
+
+```
+
+However, the content in the footer is not spaced out according to this rhythm because wrapping it in a div created a new flow layout.
+
+We can solve this by changing `` in the `App` component. Replace the `
` with `
`:
+
+```sv
+
+ All rights reserved.
+ Copyright (c) 2019 Svelte Industries
+
+```
diff --git a/site/content/tutorial/17-module-context/01-sharing-code/app-a/AudioPlayer.svelte b/site/content/tutorial/17-module-context/01-sharing-code/app-a/AudioPlayer.svelte
index 12d3a78c41..179bdacffe 100644
--- a/site/content/tutorial/17-module-context/01-sharing-code/app-a/AudioPlayer.svelte
+++ b/site/content/tutorial/17-module-context/01-sharing-code/app-a/AudioPlayer.svelte
@@ -12,13 +12,6 @@
}
-
-
{title}
{composer} / performed by {performer}
@@ -30,4 +23,19 @@
controls
{src}
>
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/17-module-context/01-sharing-code/app-b/AudioPlayer.svelte b/site/content/tutorial/17-module-context/01-sharing-code/app-b/AudioPlayer.svelte
index 609f9f1af0..3352074a2c 100644
--- a/site/content/tutorial/17-module-context/01-sharing-code/app-b/AudioPlayer.svelte
+++ b/site/content/tutorial/17-module-context/01-sharing-code/app-b/AudioPlayer.svelte
@@ -17,13 +17,6 @@
}
-
-
{title}
{composer} / performed by {performer}
@@ -35,4 +28,19 @@
controls
{src}
>
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/17-module-context/02-module-exports/app-a/AudioPlayer.svelte b/site/content/tutorial/17-module-context/02-module-exports/app-a/AudioPlayer.svelte
index 27dbe1993b..90f3c67551 100644
--- a/site/content/tutorial/17-module-context/02-module-exports/app-a/AudioPlayer.svelte
+++ b/site/content/tutorial/17-module-context/02-module-exports/app-a/AudioPlayer.svelte
@@ -25,13 +25,6 @@
}
-
-
{title}
{composer} / performed by {performer}
@@ -43,4 +36,19 @@
controls
{src}
>
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/17-module-context/02-module-exports/app-b/AudioPlayer.svelte b/site/content/tutorial/17-module-context/02-module-exports/app-b/AudioPlayer.svelte
index 4e3d191dbf..f28e8b0c7f 100644
--- a/site/content/tutorial/17-module-context/02-module-exports/app-b/AudioPlayer.svelte
+++ b/site/content/tutorial/17-module-context/02-module-exports/app-b/AudioPlayer.svelte
@@ -31,13 +31,6 @@
}
-
-
{title}
{composer} / performed by {performer}
@@ -49,4 +42,19 @@
controls
{src}
>
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/site/content/tutorial/19-next-steps/01-congratulations/app-a/App.svelte b/site/content/tutorial/19-next-steps/01-congratulations/app-a/App.svelte
index 2e72fafe23..9ce2dd648d 100644
--- a/site/content/tutorial/19-next-steps/01-congratulations/app-a/App.svelte
+++ b/site/content/tutorial/19-next-steps/01-congratulations/app-a/App.svelte
@@ -33,6 +33,10 @@
});
+{#each confetti as c}
+ {c.character}
+{/each}
+
-
-{#each confetti as c}
- {c.character}
-{/each}
\ No newline at end of file
diff --git a/site/content/tutorial/19-next-steps/01-congratulations/text.md b/site/content/tutorial/19-next-steps/01-congratulations/text.md
index c4436113bc..558cf6bda6 100644
--- a/site/content/tutorial/19-next-steps/01-congratulations/text.md
+++ b/site/content/tutorial/19-next-steps/01-congratulations/text.md
@@ -6,6 +6,6 @@ You've now finished the Svelte tutorial and are ready to start building apps. Yo
To get set up in your local development environment, check out [the quickstart guide](blog/the-easiest-way-to-get-started).
-If you're looking for a more expansive framework that includes routing, server-side rendering and everything else, take a look at [Sapper](https://sapper.svelte.dev).
+If you're looking for a more expansive framework that includes routing, server-side rendering and everything else, take a look at [SvelteKit](https://kit.svelte.dev).
-Most importantly: since you're now a member of the Svelte community, you should [join our friendly Discord chatroom](chat). That's where you'll find fellow Svelte users, and it's where we plan the future of the framework.
\ No newline at end of file
+Most importantly: since you're now a member of the Svelte community, you should [join our friendly Discord chatroom](chat). That's where you'll find fellow Svelte users, and it's where we plan the future of the framework.
diff --git a/site/cypress.json b/site/cypress.json
deleted file mode 100644
index f5622faf90..0000000000
--- a/site/cypress.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "baseUrl": "http://localhost:3000",
- "video": false
-}
\ No newline at end of file
diff --git a/site/docker-compose.yml b/site/docker-compose.yml
new file mode 100644
index 0000000000..910119796a
--- /dev/null
+++ b/site/docker-compose.yml
@@ -0,0 +1,15 @@
+version: "3.0"
+services:
+ postgres:
+ image: postgres:13.4
+ ports:
+ - "5432:5432"
+ environment:
+ - POSTGRES_DB=${PGDATABASE}
+ - POSTGRES_USER=${PGUSER}
+ - POSTGRES_PASSWORD=${PGPASSWORD}
+ adminer:
+ image: adminer
+ restart: always
+ ports:
+ - "4000:8080"
diff --git a/site/migrations/000-create-users.js b/site/migrations/000-create-users.cjs
similarity index 100%
rename from site/migrations/000-create-users.js
rename to site/migrations/000-create-users.cjs
diff --git a/site/migrations/001-create-gists.js b/site/migrations/001-create-gists.cjs
similarity index 100%
rename from site/migrations/001-create-gists.js
rename to site/migrations/001-create-gists.cjs
diff --git a/site/migrations/002-create-sessions.js b/site/migrations/002-create-sessions.cjs
similarity index 100%
rename from site/migrations/002-create-sessions.js
rename to site/migrations/002-create-sessions.cjs
diff --git a/site/package-lock.json b/site/package-lock.json
index 93932806f8..e0594e86e6 100644
--- a/site/package-lock.json
+++ b/site/package-lock.json
@@ -1,978 +1,2318 @@
{
"name": "svelte.dev",
"version": "1.0.0",
- "lockfileVersion": 1,
+ "lockfileVersion": 2,
"requires": true,
- "dependencies": {
- "@babel/code-frame": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz",
- "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==",
+ "packages": {
+ "": {
+ "name": "svelte.dev",
+ "version": "1.0.0",
+ "dependencies": {
+ "cookie": "^0.4.0",
+ "devalue": "^2.0.0",
+ "do-not-zip": "^1.0.0",
+ "flru": "^1.0.2",
+ "httpie": "^1.1.2",
+ "jsonwebtoken": "^8.5.1",
+ "marked": "^4.0.6",
+ "pg": "^8.7.1",
+ "prism-svelte": "^0.4.3",
+ "prismjs": "^1.25.0"
+ },
+ "devDependencies": {
+ "@sindresorhus/slugify": "^0.9.1",
+ "@sveltejs/adapter-node": "next",
+ "@sveltejs/kit": "next",
+ "@sveltejs/site-kit": "^1.4.1",
+ "@sveltejs/svelte-repl": "^0.4.1",
+ "degit": "^2.1.4",
+ "dotenv": "^10.0.0",
+ "jimp": "^0.8.0",
+ "node-fetch": "^2.6.1",
+ "node-pg-migrate": "^6.0.0",
+ "shelljs": "^0.8.3",
+ "svelte": "^3.39.0",
+ "uvu": "^0.5.2"
+ }
+ },
+ "node_modules/@jimp/bmp": {
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/bmp/-/bmp-0.8.5.tgz",
+ "integrity": "sha512-o/23j1RODQGGjvb2xg+9ZQCHc9uXa5XIoJuXHN8kh8AJBGD7JZYiHMwNHaxJRJvadimCKUeA5udZUJAoaPwrYg==",
"dev": true,
- "requires": {
- "@babel/highlight": "^7.0.0"
+ "dependencies": {
+ "@jimp/utils": "^0.8.5",
+ "bmp-js": "^0.1.0",
+ "core-js": "^2.5.7"
+ },
+ "peerDependencies": {
+ "@jimp/custom": ">=0.3.5"
}
},
- "@babel/core": {
- "version": "7.6.0",
- "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.6.0.tgz",
- "integrity": "sha512-FuRhDRtsd6IptKpHXAa+4WPZYY2ZzgowkbLBecEDDSje1X/apG7jQM33or3NdOmjXBKWGOg4JmSiRfUfuTtHXw==",
+ "node_modules/@jimp/core": {
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/core/-/core-0.8.5.tgz",
+ "integrity": "sha512-Jto1IdL5HYg7uE15rpQjK6dfZJ6d6gRjUsVCPW50nIfXgWizaTibFEov90W9Bj+irwKrX2ntG3e3pZUyOC0COg==",
"dev": true,
- "requires": {
- "@babel/code-frame": "^7.5.5",
- "@babel/generator": "^7.6.0",
- "@babel/helpers": "^7.6.0",
- "@babel/parser": "^7.6.0",
- "@babel/template": "^7.6.0",
- "@babel/traverse": "^7.6.0",
- "@babel/types": "^7.6.0",
- "convert-source-map": "^1.1.0",
- "debug": "^4.1.0",
- "json5": "^2.1.0",
- "lodash": "^4.17.13",
- "resolve": "^1.3.2",
- "semver": "^5.4.1",
- "source-map": "^0.5.0"
- },
"dependencies": {
- "@babel/code-frame": {
- "version": "7.5.5",
- "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz",
- "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==",
- "dev": true,
- "requires": {
- "@babel/highlight": "^7.0.0"
- }
- },
- "@babel/types": {
- "version": "7.6.1",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.1.tgz",
- "integrity": "sha512-X7gdiuaCmA0uRjCmRtYJNAVCc/q+5xSgsfKJHqMN4iNLILX39677fJE1O40arPMh0TTtS9ItH67yre6c7k6t0g==",
- "dev": true,
- "requires": {
- "esutils": "^2.0.2",
- "lodash": "^4.17.13",
- "to-fast-properties": "^2.0.0"
- }
- }
+ "@jimp/utils": "^0.8.5",
+ "any-base": "^1.1.0",
+ "buffer": "^5.2.0",
+ "core-js": "^2.5.7",
+ "exif-parser": "^0.1.12",
+ "file-type": "^9.0.0",
+ "load-bmfont": "^1.3.1",
+ "mkdirp": "0.5.1",
+ "phin": "^2.9.1",
+ "pixelmatch": "^4.0.2",
+ "tinycolor2": "^1.4.1"
}
},
- "@babel/generator": {
- "version": "7.6.0",
- "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.6.0.tgz",
- "integrity": "sha512-Ms8Mo7YBdMMn1BYuNtKuP/z0TgEIhbcyB8HVR6PPNYp4P61lMsABiS4A3VG1qznjXVCf3r+fVHhm4efTYVsySA==",
+ "node_modules/@jimp/custom": {
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/custom/-/custom-0.8.5.tgz",
+ "integrity": "sha512-hS4qHOcOIL+N93IprsIhFgr8F4XnC2oYd+lRaOKEOg3ptS2vQnceSTtcXsC0//mhq8AV6lNjpbfs1iseEZuTqg==",
"dev": true,
- "requires": {
- "@babel/types": "^7.6.0",
- "jsesc": "^2.5.1",
- "lodash": "^4.17.13",
- "source-map": "^0.5.0",
- "trim-right": "^1.0.1"
- },
"dependencies": {
- "@babel/types": {
- "version": "7.6.1",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.1.tgz",
- "integrity": "sha512-X7gdiuaCmA0uRjCmRtYJNAVCc/q+5xSgsfKJHqMN4iNLILX39677fJE1O40arPMh0TTtS9ItH67yre6c7k6t0g==",
- "dev": true,
- "requires": {
- "esutils": "^2.0.2",
- "lodash": "^4.17.13",
- "to-fast-properties": "^2.0.0"
- }
- }
+ "@jimp/core": "^0.8.5",
+ "core-js": "^2.5.7"
}
},
- "@babel/helper-annotate-as-pure": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz",
- "integrity": "sha512-3UYcJUj9kvSLbLbUIfQTqzcy5VX7GRZ/CCDrnOaZorFFM01aXp1+GJwuFGV4NDDoAS+mOUyHcO6UD/RfqOks3Q==",
+ "node_modules/@jimp/gif": {
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/gif/-/gif-0.8.5.tgz",
+ "integrity": "sha512-Mj8jmv4AS76OY+Hx/Xoyihj02SUZ2ELk+O5x89pODz1+NeGtSWHHjZjnSam9HYAjycvVI/lGJdk/7w0nWIV/yQ==",
"dev": true,
- "requires": {
- "@babel/types": "^7.0.0"
+ "dependencies": {
+ "@jimp/utils": "^0.8.5",
+ "core-js": "^2.5.7",
+ "omggif": "^1.0.9"
+ },
+ "peerDependencies": {
+ "@jimp/custom": ">=0.3.5"
}
},
- "@babel/helper-builder-binary-assignment-operator-visitor": {
- "version": "7.1.0",
- "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.1.0.tgz",
- "integrity": "sha512-qNSR4jrmJ8M1VMM9tibvyRAHXQs2PmaksQF7c1CGJNipfe3D8p+wgNwgso/P2A2r2mdgBWAXljNWR0QRZAMW8w==",
+ "node_modules/@jimp/jpeg": {
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/jpeg/-/jpeg-0.8.5.tgz",
+ "integrity": "sha512-7kjTY0BiCpwRywk+oPfpLto7cLI+9G0mf4N1bv1Hn+VLQwcXFy2fHyl4qjqLbbY6u4cyZgqN+R8Pg6GRRzv0kw==",
"dev": true,
- "requires": {
- "@babel/helper-explode-assignable-expression": "^7.1.0",
- "@babel/types": "^7.0.0"
+ "dependencies": {
+ "@jimp/utils": "^0.8.5",
+ "core-js": "^2.5.7",
+ "jpeg-js": "^0.3.4"
+ },
+ "peerDependencies": {
+ "@jimp/custom": ">=0.3.5"
}
},
- "@babel/helper-call-delegate": {
- "version": "7.4.4",
- "resolved": "https://registry.npmjs.org/@babel/helper-call-delegate/-/helper-call-delegate-7.4.4.tgz",
- "integrity": "sha512-l79boDFJ8S1c5hvQvG+rc+wHw6IuH7YldmRKsYtpbawsxURu/paVy57FZMomGK22/JckepaikOkY0MoAmdyOlQ==",
+ "node_modules/@jimp/plugin-blit": {
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugin-blit/-/plugin-blit-0.8.5.tgz",
+ "integrity": "sha512-r8Z1CwazaJwZCRbucQgrfprlGyH91tX7GubUsbWr+zy5/dRJAAgaPj/hcoHDwbh3zyiXp5BECKKzKW0x4reL4w==",
"dev": true,
- "requires": {
- "@babel/helper-hoist-variables": "^7.4.4",
- "@babel/traverse": "^7.4.4",
- "@babel/types": "^7.4.4"
+ "dependencies": {
+ "@jimp/utils": "^0.8.5",
+ "core-js": "^2.5.7"
+ },
+ "peerDependencies": {
+ "@jimp/custom": ">=0.3.5"
}
},
- "@babel/helper-define-map": {
- "version": "7.5.5",
- "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.5.5.tgz",
- "integrity": "sha512-fTfxx7i0B5NJqvUOBBGREnrqbTxRh7zinBANpZXAVDlsZxYdclDp467G1sQ8VZYMnAURY3RpBUAgOYT9GfzHBg==",
+ "node_modules/@jimp/plugin-blur": {
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugin-blur/-/plugin-blur-0.8.5.tgz",
+ "integrity": "sha512-UH5ywpV4YooUh9HXEsrNKDtojLCvIAAV0gywqn8EQeFyzwBJyXAvRNARJp7zr5OPLr9uGXkRLDCO9YyzdlXZng==",
"dev": true,
- "requires": {
- "@babel/helper-function-name": "^7.1.0",
- "@babel/types": "^7.5.5",
- "lodash": "^4.17.13"
- },
"dependencies": {
- "@babel/types": {
- "version": "7.6.1",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.1.tgz",
- "integrity": "sha512-X7gdiuaCmA0uRjCmRtYJNAVCc/q+5xSgsfKJHqMN4iNLILX39677fJE1O40arPMh0TTtS9ItH67yre6c7k6t0g==",
- "dev": true,
- "requires": {
- "esutils": "^2.0.2",
- "lodash": "^4.17.13",
- "to-fast-properties": "^2.0.0"
- }
- }
+ "@jimp/utils": "^0.8.5",
+ "core-js": "^2.5.7"
+ },
+ "peerDependencies": {
+ "@jimp/custom": ">=0.3.5"
}
},
- "@babel/helper-explode-assignable-expression": {
- "version": "7.1.0",
- "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.1.0.tgz",
- "integrity": "sha512-NRQpfHrJ1msCHtKjbzs9YcMmJZOg6mQMmGRB+hbamEdG5PNpaSm95275VD92DvJKuyl0s2sFiDmMZ+EnnvufqA==",
+ "node_modules/@jimp/plugin-color": {
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugin-color/-/plugin-color-0.8.5.tgz",
+ "integrity": "sha512-7XHqcTQ8Y1zto1b9P1y8m1dzSjnOpBsD9OZG0beTpeJ5bgPX+hF5ZLmvcM6c5ljkINw5EUF1it07BYbkCxiGQA==",
"dev": true,
- "requires": {
- "@babel/traverse": "^7.1.0",
- "@babel/types": "^7.0.0"
+ "dependencies": {
+ "@jimp/utils": "^0.8.5",
+ "core-js": "^2.5.7",
+ "tinycolor2": "^1.4.1"
+ },
+ "peerDependencies": {
+ "@jimp/custom": ">=0.3.5"
}
},
- "@babel/helper-function-name": {
- "version": "7.1.0",
- "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz",
- "integrity": "sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==",
+ "node_modules/@jimp/plugin-contain": {
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugin-contain/-/plugin-contain-0.8.5.tgz",
+ "integrity": "sha512-ZkiPFx9L0yITiKtYTYLWyBsSIdxo/NARhNPRZXyVF9HmTWSLDUw1c2c1uvETKxDZTAVK+souYT14DwFWWdhsYA==",
"dev": true,
- "requires": {
- "@babel/helper-get-function-arity": "^7.0.0",
- "@babel/template": "^7.1.0",
- "@babel/types": "^7.0.0"
+ "dependencies": {
+ "@jimp/utils": "^0.8.5",
+ "core-js": "^2.5.7"
+ },
+ "peerDependencies": {
+ "@jimp/custom": ">=0.3.5",
+ "@jimp/plugin-blit": ">=0.3.5",
+ "@jimp/plugin-resize": ">=0.3.5",
+ "@jimp/plugin-scale": ">=0.3.5"
}
},
- "@babel/helper-get-function-arity": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz",
- "integrity": "sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ==",
+ "node_modules/@jimp/plugin-cover": {
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugin-cover/-/plugin-cover-0.8.5.tgz",
+ "integrity": "sha512-OdT4YAopLOhbhTUQV3R1v5ZZqIaUt3n3vJi/OfTbsak1t9UkPBVdmYPyhoont8zJdtdkF5dW16Ro1FTshytcww==",
"dev": true,
- "requires": {
- "@babel/types": "^7.0.0"
+ "dependencies": {
+ "@jimp/utils": "^0.8.5",
+ "core-js": "^2.5.7"
+ },
+ "peerDependencies": {
+ "@jimp/custom": ">=0.3.5",
+ "@jimp/plugin-crop": ">=0.3.5",
+ "@jimp/plugin-resize": ">=0.3.5",
+ "@jimp/plugin-scale": ">=0.3.5"
}
},
- "@babel/helper-hoist-variables": {
- "version": "7.4.4",
- "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.4.4.tgz",
- "integrity": "sha512-VYk2/H/BnYbZDDg39hr3t2kKyifAm1W6zHRfhx8jGjIHpQEBv9dry7oQ2f3+J703TLu69nYdxsovl0XYfcnK4w==",
+ "node_modules/@jimp/plugin-crop": {
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugin-crop/-/plugin-crop-0.8.5.tgz",
+ "integrity": "sha512-E1Hb+gfu2k74Gkqh96apAyVljsP5MjCH4TY6lECAAEcYKGH/XRhz6lY2dSEjCYE7KtiqjTZzWwYkgAvkwojj9Q==",
"dev": true,
- "requires": {
- "@babel/types": "^7.4.4"
+ "dependencies": {
+ "@jimp/utils": "^0.8.5",
+ "core-js": "^2.5.7"
+ },
+ "peerDependencies": {
+ "@jimp/custom": ">=0.3.5"
}
},
- "@babel/helper-member-expression-to-functions": {
- "version": "7.5.5",
- "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.5.5.tgz",
- "integrity": "sha512-5qZ3D1uMclSNqYcXqiHoA0meVdv+xUEex9em2fqMnrk/scphGlGgg66zjMrPJESPwrFJ6sbfFQYUSa0Mz7FabA==",
+ "node_modules/@jimp/plugin-displace": {
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugin-displace/-/plugin-displace-0.8.5.tgz",
+ "integrity": "sha512-fVgVYTS1HZzAXkg8Lg06PuirSUG5oXYaYYGL+3ZU4tmZn1pyZ+mZyfejpwtymETEYZnmymHoCT4xto19E/IRvA==",
"dev": true,
- "requires": {
- "@babel/types": "^7.5.5"
- },
"dependencies": {
- "@babel/types": {
- "version": "7.6.1",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.1.tgz",
- "integrity": "sha512-X7gdiuaCmA0uRjCmRtYJNAVCc/q+5xSgsfKJHqMN4iNLILX39677fJE1O40arPMh0TTtS9ItH67yre6c7k6t0g==",
- "dev": true,
- "requires": {
- "esutils": "^2.0.2",
- "lodash": "^4.17.13",
- "to-fast-properties": "^2.0.0"
- }
- }
+ "@jimp/utils": "^0.8.5",
+ "core-js": "^2.5.7"
+ },
+ "peerDependencies": {
+ "@jimp/custom": ">=0.3.5"
}
},
- "@babel/helper-module-imports": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.0.0.tgz",
- "integrity": "sha512-aP/hlLq01DWNEiDg4Jn23i+CXxW/owM4WpDLFUbpjxe4NS3BhLVZQ5i7E0ZrxuQ/vwekIeciyamgB1UIYxxM6A==",
+ "node_modules/@jimp/plugin-dither": {
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugin-dither/-/plugin-dither-0.8.5.tgz",
+ "integrity": "sha512-KSj2y8E3yK7tldjT/8ejqAWw5HFBjtWW6QkcxfW7FdV4c/nsXZXDkMbhqMZ7FkDuSYoAPeWUFeddrH4yipC5iA==",
"dev": true,
- "requires": {
- "@babel/types": "^7.0.0"
+ "dependencies": {
+ "@jimp/utils": "^0.8.5",
+ "core-js": "^2.5.7"
+ },
+ "peerDependencies": {
+ "@jimp/custom": ">=0.3.5"
}
},
- "@babel/helper-module-transforms": {
- "version": "7.5.5",
- "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.5.5.tgz",
- "integrity": "sha512-jBeCvETKuJqeiaCdyaheF40aXnnU1+wkSiUs/IQg3tB85up1LyL8x77ClY8qJpuRJUcXQo+ZtdNESmZl4j56Pw==",
+ "node_modules/@jimp/plugin-flip": {
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugin-flip/-/plugin-flip-0.8.5.tgz",
+ "integrity": "sha512-2QbGDkurPNAXZUeHLo/UA3tjh+AbAXWZKSdtoa1ArlASovRz8rqtA45YIRIkKrMH82TA3PZk8bgP2jaLKLrzww==",
"dev": true,
- "requires": {
- "@babel/helper-module-imports": "^7.0.0",
- "@babel/helper-simple-access": "^7.1.0",
- "@babel/helper-split-export-declaration": "^7.4.4",
- "@babel/template": "^7.4.4",
- "@babel/types": "^7.5.5",
- "lodash": "^4.17.13"
- },
"dependencies": {
- "@babel/types": {
- "version": "7.6.1",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.1.tgz",
- "integrity": "sha512-X7gdiuaCmA0uRjCmRtYJNAVCc/q+5xSgsfKJHqMN4iNLILX39677fJE1O40arPMh0TTtS9ItH67yre6c7k6t0g==",
- "dev": true,
- "requires": {
- "esutils": "^2.0.2",
- "lodash": "^4.17.13",
- "to-fast-properties": "^2.0.0"
- }
- }
+ "@jimp/utils": "^0.8.5",
+ "core-js": "^2.5.7"
+ },
+ "peerDependencies": {
+ "@jimp/custom": ">=0.3.5",
+ "@jimp/plugin-rotate": ">=0.3.5"
}
},
- "@babel/helper-optimise-call-expression": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.0.0.tgz",
- "integrity": "sha512-u8nd9NQePYNQV8iPWu/pLLYBqZBa4ZaY1YWRFMuxrid94wKI1QNt67NEZ7GAe5Kc/0LLScbim05xZFWkAdrj9g==",
+ "node_modules/@jimp/plugin-gaussian": {
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugin-gaussian/-/plugin-gaussian-0.8.5.tgz",
+ "integrity": "sha512-2zReC5GJcVAXtf3UgzFcHSYN277i02K9Yrhc1xJf3mti00s43uD++B5Ho7/mIo+HrntVvWhxqar7PARdq0lVIg==",
"dev": true,
- "requires": {
- "@babel/types": "^7.0.0"
+ "dependencies": {
+ "@jimp/utils": "^0.8.5",
+ "core-js": "^2.5.7"
+ },
+ "peerDependencies": {
+ "@jimp/custom": ">=0.3.5"
}
},
- "@babel/helper-plugin-utils": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz",
- "integrity": "sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA==",
- "dev": true
- },
- "@babel/helper-regex": {
- "version": "7.5.5",
- "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.5.5.tgz",
- "integrity": "sha512-CkCYQLkfkiugbRDO8eZn6lRuR8kzZoGXCg3149iTk5se7g6qykSpy3+hELSwquhu+TgHn8nkLiBwHvNX8Hofcw==",
+ "node_modules/@jimp/plugin-invert": {
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugin-invert/-/plugin-invert-0.8.5.tgz",
+ "integrity": "sha512-GyMXPGheHdS14xfDceuZ9hrGm6gE9UG3PfTEjQbJmHMWippLC6yf8kombSudJlUf8q72YYSSXsSFKGgkHa67vA==",
"dev": true,
- "requires": {
- "lodash": "^4.17.13"
+ "dependencies": {
+ "@jimp/utils": "^0.8.5",
+ "core-js": "^2.5.7"
+ },
+ "peerDependencies": {
+ "@jimp/custom": ">=0.3.5"
}
},
- "@babel/helper-remap-async-to-generator": {
- "version": "7.1.0",
- "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.1.0.tgz",
- "integrity": "sha512-3fOK0L+Fdlg8S5al8u/hWE6vhufGSn0bN09xm2LXMy//REAF8kDCrYoOBKYmA8m5Nom+sV9LyLCwrFynA8/slg==",
+ "node_modules/@jimp/plugin-mask": {
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugin-mask/-/plugin-mask-0.8.5.tgz",
+ "integrity": "sha512-inD/++XO+MkmwXl9JGYQ8X2deyOZuq9i+dmugH/557p16B9Q6tvUQt5X1Yg5w7hhkLZ00BKOAJI9XoyCC1NFvQ==",
"dev": true,
- "requires": {
- "@babel/helper-annotate-as-pure": "^7.0.0",
- "@babel/helper-wrap-function": "^7.1.0",
- "@babel/template": "^7.1.0",
- "@babel/traverse": "^7.1.0",
- "@babel/types": "^7.0.0"
+ "dependencies": {
+ "@jimp/utils": "^0.8.5",
+ "core-js": "^2.5.7"
+ },
+ "peerDependencies": {
+ "@jimp/custom": ">=0.3.5"
}
},
- "@babel/helper-replace-supers": {
- "version": "7.5.5",
- "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.5.5.tgz",
- "integrity": "sha512-XvRFWrNnlsow2u7jXDuH4jDDctkxbS7gXssrP4q2nUD606ukXHRvydj346wmNg+zAgpFx4MWf4+usfC93bElJg==",
+ "node_modules/@jimp/plugin-normalize": {
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugin-normalize/-/plugin-normalize-0.8.5.tgz",
+ "integrity": "sha512-8YRWJWBT4NoSAbPhnjQJXGeaeWVrJAlGDv39A54oNH8Ry47fHcE0EN6zogQNpBuM34M6hRnZl4rOv1FIisaWdg==",
"dev": true,
- "requires": {
- "@babel/helper-member-expression-to-functions": "^7.5.5",
- "@babel/helper-optimise-call-expression": "^7.0.0",
- "@babel/traverse": "^7.5.5",
- "@babel/types": "^7.5.5"
- },
"dependencies": {
- "@babel/types": {
- "version": "7.6.1",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.1.tgz",
- "integrity": "sha512-X7gdiuaCmA0uRjCmRtYJNAVCc/q+5xSgsfKJHqMN4iNLILX39677fJE1O40arPMh0TTtS9ItH67yre6c7k6t0g==",
- "dev": true,
- "requires": {
- "esutils": "^2.0.2",
- "lodash": "^4.17.13",
- "to-fast-properties": "^2.0.0"
- }
- }
+ "@jimp/utils": "^0.8.5",
+ "core-js": "^2.5.7"
+ },
+ "peerDependencies": {
+ "@jimp/custom": ">=0.3.5"
}
},
- "@babel/helper-simple-access": {
- "version": "7.1.0",
- "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.1.0.tgz",
- "integrity": "sha512-Vk+78hNjRbsiu49zAPALxTb+JUQCz1aolpd8osOF16BGnLtseD21nbHgLPGUwrXEurZgiCOUmvs3ExTu4F5x6w==",
+ "node_modules/@jimp/plugin-print": {
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugin-print/-/plugin-print-0.8.5.tgz",
+ "integrity": "sha512-BviNpCiA/fEieOqsrWr1FkqyFuiG2izdyyg7zUqyeUTHPwqrTLvXO9cfP/ThG4hZpu5wMQ5QClWSqhZu1fAwxA==",
"dev": true,
- "requires": {
- "@babel/template": "^7.1.0",
- "@babel/types": "^7.0.0"
+ "dependencies": {
+ "@jimp/utils": "^0.8.5",
+ "core-js": "^2.5.7",
+ "load-bmfont": "^1.4.0"
+ },
+ "peerDependencies": {
+ "@jimp/custom": ">=0.3.5",
+ "@jimp/plugin-blit": ">=0.3.5"
}
},
- "@babel/helper-split-export-declaration": {
- "version": "7.4.4",
- "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz",
- "integrity": "sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q==",
+ "node_modules/@jimp/plugin-resize": {
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugin-resize/-/plugin-resize-0.8.5.tgz",
+ "integrity": "sha512-gIdmISuNmZQ1QwprnRC5VXVWQfKIiWineVQGebpMAG/aoFOLDXrVl939Irg7Fb/uOlSFTzpAbt1zpJ8YG/Mi2w==",
"dev": true,
- "requires": {
- "@babel/types": "^7.4.4"
+ "dependencies": {
+ "@jimp/utils": "^0.8.5",
+ "core-js": "^2.5.7"
+ },
+ "peerDependencies": {
+ "@jimp/custom": ">=0.3.5"
}
},
- "@babel/helper-validator-identifier": {
- "version": "7.10.4",
- "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz",
- "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==",
- "dev": true
- },
- "@babel/helper-wrap-function": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.2.0.tgz",
- "integrity": "sha512-o9fP1BZLLSrYlxYEYyl2aS+Flun5gtjTIG8iln+XuEzQTs0PLagAGSXUcqruJwD5fM48jzIEggCKpIfWTcR7pQ==",
+ "node_modules/@jimp/plugin-rotate": {
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugin-rotate/-/plugin-rotate-0.8.5.tgz",
+ "integrity": "sha512-8T9wnL3gb+Z0ogMZmtyI6h3y7TuqW2a5SpFbzFUVF+lTZoAabXjEfX3CAozizCLaT+Duc5H2FJVemAHiyr+Dbw==",
"dev": true,
- "requires": {
- "@babel/helper-function-name": "^7.1.0",
- "@babel/template": "^7.1.0",
- "@babel/traverse": "^7.1.0",
- "@babel/types": "^7.2.0"
+ "dependencies": {
+ "@jimp/utils": "^0.8.5",
+ "core-js": "^2.5.7"
+ },
+ "peerDependencies": {
+ "@jimp/custom": ">=0.3.5",
+ "@jimp/plugin-blit": ">=0.3.5",
+ "@jimp/plugin-crop": ">=0.3.5",
+ "@jimp/plugin-resize": ">=0.3.5"
}
},
- "@babel/helpers": {
- "version": "7.6.0",
- "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.6.0.tgz",
- "integrity": "sha512-W9kao7OBleOjfXtFGgArGRX6eCP0UEcA2ZWEWNkJdRZnHhW4eEbeswbG3EwaRsnQUAEGWYgMq1HsIXuNNNy2eQ==",
+ "node_modules/@jimp/plugin-scale": {
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugin-scale/-/plugin-scale-0.8.5.tgz",
+ "integrity": "sha512-G+CDH9s7BsxJ4b+mKZ5SsiXwTAynBJ+7/9SwZFnICZJJvLd79Tws6VPXfSaKJZuWnGIX++L8jTGmFORCfLNkdg==",
"dev": true,
- "requires": {
- "@babel/template": "^7.6.0",
- "@babel/traverse": "^7.6.0",
- "@babel/types": "^7.6.0"
- },
"dependencies": {
- "@babel/types": {
- "version": "7.6.1",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.1.tgz",
- "integrity": "sha512-X7gdiuaCmA0uRjCmRtYJNAVCc/q+5xSgsfKJHqMN4iNLILX39677fJE1O40arPMh0TTtS9ItH67yre6c7k6t0g==",
- "dev": true,
- "requires": {
- "esutils": "^2.0.2",
- "lodash": "^4.17.13",
- "to-fast-properties": "^2.0.0"
- }
- }
+ "@jimp/utils": "^0.8.5",
+ "core-js": "^2.5.7"
+ },
+ "peerDependencies": {
+ "@jimp/custom": ">=0.3.5",
+ "@jimp/plugin-resize": ">=0.3.5"
}
},
- "@babel/highlight": {
- "version": "7.5.0",
- "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz",
- "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==",
+ "node_modules/@jimp/plugins": {
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugins/-/plugins-0.8.5.tgz",
+ "integrity": "sha512-52na0wqfQ3uItIA+C9cJ1EXffhSmABgK7ETClDseUh9oGtynHzxZ97smnFf1ydLjXLrF89Gt+YBxWLyiBGgiZQ==",
"dev": true,
- "requires": {
- "chalk": "^2.0.0",
- "esutils": "^2.0.2",
- "js-tokens": "^4.0.0"
+ "dependencies": {
+ "@jimp/plugin-blit": "^0.8.5",
+ "@jimp/plugin-blur": "^0.8.5",
+ "@jimp/plugin-color": "^0.8.5",
+ "@jimp/plugin-contain": "^0.8.5",
+ "@jimp/plugin-cover": "^0.8.5",
+ "@jimp/plugin-crop": "^0.8.5",
+ "@jimp/plugin-displace": "^0.8.5",
+ "@jimp/plugin-dither": "^0.8.5",
+ "@jimp/plugin-flip": "^0.8.5",
+ "@jimp/plugin-gaussian": "^0.8.5",
+ "@jimp/plugin-invert": "^0.8.5",
+ "@jimp/plugin-mask": "^0.8.5",
+ "@jimp/plugin-normalize": "^0.8.5",
+ "@jimp/plugin-print": "^0.8.5",
+ "@jimp/plugin-resize": "^0.8.5",
+ "@jimp/plugin-rotate": "^0.8.5",
+ "@jimp/plugin-scale": "^0.8.5",
+ "core-js": "^2.5.7",
+ "timm": "^1.6.1"
+ },
+ "peerDependencies": {
+ "@jimp/custom": ">=0.3.5"
}
},
- "@babel/parser": {
- "version": "7.6.0",
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.6.0.tgz",
- "integrity": "sha512-+o2q111WEx4srBs7L9eJmcwi655eD8sXniLqMB93TBK9GrNzGrxDWSjiqz2hLU0Ha8MTXFIP0yd9fNdP+m43ZQ==",
- "dev": true
- },
- "@babel/plugin-proposal-async-generator-functions": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.2.0.tgz",
- "integrity": "sha512-+Dfo/SCQqrwx48ptLVGLdE39YtWRuKc/Y9I5Fy0P1DDBB9lsAHpjcEJQt+4IifuSOSTLBKJObJqMvaO1pIE8LQ==",
+ "node_modules/@jimp/png": {
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/png/-/png-0.8.5.tgz",
+ "integrity": "sha512-zT89ucu8I2rsD3FIMIPLgr1OyKn4neD+5umwD3MY8AOB8+6tX5bFtnmTm3FzGJaJuibkK0wFl87eiaxnb+Megw==",
"dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.0.0",
- "@babel/helper-remap-async-to-generator": "^7.1.0",
- "@babel/plugin-syntax-async-generators": "^7.2.0"
+ "dependencies": {
+ "@jimp/utils": "^0.8.5",
+ "core-js": "^2.5.7",
+ "pngjs": "^3.3.3"
+ },
+ "peerDependencies": {
+ "@jimp/custom": ">=0.3.5"
}
},
- "@babel/plugin-proposal-dynamic-import": {
- "version": "7.5.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.5.0.tgz",
- "integrity": "sha512-x/iMjggsKTFHYC6g11PL7Qy58IK8H5zqfm9e6hu4z1iH2IRyAp9u9dL80zA6R76yFovETFLKz2VJIC2iIPBuFw==",
+ "node_modules/@jimp/tiff": {
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/tiff/-/tiff-0.8.5.tgz",
+ "integrity": "sha512-Z7uzDcbHuwDg+hy2+UJQ2s5O6sqYXmv6H1fmSf/2dxBrlGMzl8yTc2/BxLrGREeoidDDMcKmXYGAOp4uCsdJjw==",
"dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.0.0",
- "@babel/plugin-syntax-dynamic-import": "^7.2.0"
+ "dependencies": {
+ "core-js": "^2.5.7",
+ "utif": "^2.0.1"
+ },
+ "peerDependencies": {
+ "@jimp/custom": ">=0.3.5"
}
},
- "@babel/plugin-proposal-json-strings": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.2.0.tgz",
- "integrity": "sha512-MAFV1CA/YVmYwZG0fBQyXhmj0BHCB5egZHCKWIFVv/XCxAeVGIHfos3SwDck4LvCllENIAg7xMKOG5kH0dzyUg==",
+ "node_modules/@jimp/types": {
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/types/-/types-0.8.5.tgz",
+ "integrity": "sha512-XUvpyebZGd1vyFiJyxUT4H9A3mKD7MV2MxjXnay3fNTrcow0UJJspmFw/w+G3TP/1dgrVC4K++gntjR6QWTzvg==",
"dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.0.0",
- "@babel/plugin-syntax-json-strings": "^7.2.0"
+ "dependencies": {
+ "@jimp/bmp": "^0.8.5",
+ "@jimp/gif": "^0.8.5",
+ "@jimp/jpeg": "^0.8.5",
+ "@jimp/png": "^0.8.5",
+ "@jimp/tiff": "^0.8.5",
+ "core-js": "^2.5.7",
+ "timm": "^1.6.1"
+ },
+ "peerDependencies": {
+ "@jimp/custom": ">=0.3.5"
}
},
- "@babel/plugin-proposal-object-rest-spread": {
- "version": "7.5.5",
- "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.5.5.tgz",
- "integrity": "sha512-F2DxJJSQ7f64FyTVl5cw/9MWn6naXGdk3Q3UhDbFEEHv+EilCPoeRD3Zh/Utx1CJz4uyKlQ4uH+bJPbEhMV7Zw==",
+ "node_modules/@jimp/utils": {
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/utils/-/utils-0.8.5.tgz",
+ "integrity": "sha512-D3+H4BiopDkhUKvKkZTPPJ53voqOkfMuk3r7YZNcLtXGLkchjjukC4056lNo7B0DzjBgowTYsQM3JjKnYNIYeg==",
"dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.0.0",
- "@babel/plugin-syntax-object-rest-spread": "^7.2.0"
+ "dependencies": {
+ "core-js": "^2.5.7"
}
},
- "@babel/plugin-proposal-optional-catch-binding": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.2.0.tgz",
- "integrity": "sha512-mgYj3jCcxug6KUcX4OBoOJz3CMrwRfQELPQ5560F70YQUBZB7uac9fqaWamKR1iWUzGiK2t0ygzjTScZnVz75g==",
+ "node_modules/@rollup/pluginutils": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.1.1.tgz",
+ "integrity": "sha512-clDjivHqWGXi7u+0d2r2sBi4Ie6VLEAzWMIkvJLnDmxoOhBYOTfzGbOQBA32THHm11/LiJbd01tJUpJsbshSWQ==",
"dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.0.0",
- "@babel/plugin-syntax-optional-catch-binding": "^7.2.0"
+ "dependencies": {
+ "estree-walker": "^2.0.1",
+ "picomatch": "^2.2.2"
+ },
+ "engines": {
+ "node": ">= 8.0.0"
}
},
- "@babel/plugin-proposal-unicode-property-regex": {
- "version": "7.4.4",
- "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.4.4.tgz",
- "integrity": "sha512-j1NwnOqMG9mFUOH58JTFsA/+ZYzQLUZ/drqWUqxCYLGeu2JFZL8YrNC9hBxKmWtAuOCHPcRpgv7fhap09Fb4kA==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.0.0",
- "@babel/helper-regex": "^7.4.4",
- "regexpu-core": "^4.5.4"
- }
+ "node_modules/@rollup/pluginutils/node_modules/estree-walker": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
+ "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",
+ "dev": true
},
- "@babel/plugin-syntax-async-generators": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.2.0.tgz",
- "integrity": "sha512-1ZrIRBv2t0GSlcwVoQ6VgSLpLgiN/FVQUzt9znxo7v2Ov4jJrs8RY8tv0wvDmFN3qIdMKWrmMMW6yZ0G19MfGg==",
+ "node_modules/@sindresorhus/slugify": {
+ "version": "0.9.1",
+ "resolved": "https://registry.npmjs.org/@sindresorhus/slugify/-/slugify-0.9.1.tgz",
+ "integrity": "sha512-b6heYM9dzZD13t2GOiEQTDE0qX+I1GyOotMwKh9VQqzuNiVdPVT8dM43fe9HNb/3ul+Qwd5oKSEDrDIfhq3bnQ==",
"dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.0.0"
+ "dependencies": {
+ "escape-string-regexp": "^1.0.5",
+ "lodash.deburr": "^4.1.0"
+ },
+ "engines": {
+ "node": ">=8"
}
},
- "@babel/plugin-syntax-dynamic-import": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.2.0.tgz",
- "integrity": "sha512-mVxuJ0YroI/h/tbFTPGZR8cv6ai+STMKNBq0f8hFxsxWjl94qqhsb+wXbpNMDPU3cfR1TIsVFzU3nXyZMqyK4w==",
+ "node_modules/@sveltejs/adapter-node": {
+ "version": "1.0.0-next.55",
+ "resolved": "https://registry.npmjs.org/@sveltejs/adapter-node/-/adapter-node-1.0.0-next.55.tgz",
+ "integrity": "sha512-Kmh8lx8kIY7W6rkqjC78y4dQTyjiAHD9D1WfmUTtYuDW1jAIG+YbZmPC9127kH5KOSGK4+tI8mpReDVB1lgf8g==",
"dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.0.0"
+ "dependencies": {
+ "esbuild": "^0.13.4",
+ "tiny-glob": "^0.2.9"
}
},
- "@babel/plugin-syntax-json-strings": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.2.0.tgz",
- "integrity": "sha512-5UGYnMSLRE1dqqZwug+1LISpA403HzlSfsg6P9VXU6TBjcSHeNlw4DxDx7LgpF+iKZoOG/+uzqoRHTdcUpiZNg==",
+ "node_modules/@sveltejs/kit": {
+ "version": "1.0.0-next.201",
+ "resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-1.0.0-next.201.tgz",
+ "integrity": "sha512-WcYexOEPWgDWOk0oOteTU5QwWykdIcOFJig+akeHqwE/jVtPURLZFtTNx0ymUWXN4S+dUXf60KF6HEMv74FHpA==",
"dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.0.0"
+ "dependencies": {
+ "@sveltejs/vite-plugin-svelte": "^1.0.0-next.30",
+ "cheap-watch": "^1.0.4",
+ "sade": "^1.7.4",
+ "vite": "^2.6.12"
+ },
+ "bin": {
+ "svelte-kit": "svelte-kit.js"
+ },
+ "engines": {
+ "node": ">=14.13"
+ },
+ "peerDependencies": {
+ "svelte": "^3.44.0"
}
},
- "@babel/plugin-syntax-object-rest-spread": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz",
- "integrity": "sha512-t0JKGgqk2We+9may3t0xDdmneaXmyxq0xieYcKHxIsrJO64n1OiMWNUtc5gQK1PA0NpdCRrtZp4z+IUaKugrSA==",
+ "node_modules/@sveltejs/site-kit": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/@sveltejs/site-kit/-/site-kit-1.4.1.tgz",
+ "integrity": "sha512-K2HplwTqWS5Jw38+GB1LwnojVfTJPxZ3d9FtjbjXoaJ8pCHTBJ+khAV8zeWLlOWkYpJuGD04EZTS87sW7mfVDA==",
"dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.0.0"
+ "dependencies": {
+ "@sindresorhus/slugify": "^0.9.1",
+ "golden-fleece": "^1.0.9"
}
},
- "@babel/plugin-syntax-optional-catch-binding": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.2.0.tgz",
- "integrity": "sha512-bDe4xKNhb0LI7IvZHiA13kff0KEfaGX/Hv4lMA9+7TEc63hMNvfKo6ZFpXhKuEp+II/q35Gc4NoMeDZyaUbj9w==",
+ "node_modules/@sveltejs/svelte-repl": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/@sveltejs/svelte-repl/-/svelte-repl-0.4.1.tgz",
+ "integrity": "sha512-NsnWS3emGPKW8oZAekf9DcQlm8RoAivaolxpNT1DvEAwpAqPPaFWtHC5JccqzhHKJGVMmBHq92AcYV1ULCsdhg==",
"dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.0.0"
+ "dependencies": {
+ "codemirror": "^5.49.2",
+ "estree-walker": "^0.9.0",
+ "marked": "^4.0.0",
+ "sourcemap-codec": "^1.4.6",
+ "svelte-json-tree": "0.0.5",
+ "yootils": "0.0.16"
}
},
- "@babel/plugin-transform-arrow-functions": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.2.0.tgz",
- "integrity": "sha512-ER77Cax1+8/8jCB9fo4Ud161OZzWN5qawi4GusDuRLcDbDG+bIGYY20zb2dfAFdTRGzrfq2xZPvF0R64EHnimg==",
+ "node_modules/@sveltejs/vite-plugin-svelte": {
+ "version": "1.0.0-next.30",
+ "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-1.0.0-next.30.tgz",
+ "integrity": "sha512-YQqdMxjL1VgSFk4/+IY3yLwuRRapPafPiZTiaGEq1psbJYSNYUWx9F1zMm32GMsnogg3zn99mGJOqe3ld3HZSg==",
"dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.0.0"
+ "dependencies": {
+ "@rollup/pluginutils": "^4.1.1",
+ "debug": "^4.3.2",
+ "kleur": "^4.1.4",
+ "magic-string": "^0.25.7",
+ "require-relative": "^0.8.7",
+ "svelte-hmr": "^0.14.7"
+ },
+ "engines": {
+ "node": "^14.13.1 || >= 16"
+ },
+ "peerDependencies": {
+ "diff-match-patch": "^1.0.5",
+ "svelte": "^3.44.0",
+ "vite": "^2.6.0"
+ },
+ "peerDependenciesMeta": {
+ "diff-match-patch": {
+ "optional": true
+ }
}
},
- "@babel/plugin-transform-async-to-generator": {
- "version": "7.5.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.5.0.tgz",
- "integrity": "sha512-mqvkzwIGkq0bEF1zLRRiTdjfomZJDV33AH3oQzHVGkI2VzEmXLpKKOBvEVaFZBJdN0XTyH38s9j/Kiqr68dggg==",
- "dev": true,
- "requires": {
- "@babel/helper-module-imports": "^7.0.0",
- "@babel/helper-plugin-utils": "^7.0.0",
- "@babel/helper-remap-async-to-generator": "^7.1.0"
- }
+ "node_modules/@types/node": {
+ "version": "16.11.11",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.11.tgz",
+ "integrity": "sha512-KB0sixD67CeecHC33MYn+eYARkqTheIRNuu97y2XMjR7Wu3XibO1vaY6VBV6O/a89SPI81cEUIYT87UqUWlZNw==",
+ "dev": true
},
- "@babel/plugin-transform-block-scoped-functions": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.2.0.tgz",
- "integrity": "sha512-ntQPR6q1/NKuphly49+QiQiTN0O63uOwjdD6dhIjSWBI5xlrbUFh720TIpzBhpnrLfv2tNH/BXvLIab1+BAI0w==",
+ "node_modules/@types/pg": {
+ "version": "8.6.1",
+ "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.6.1.tgz",
+ "integrity": "sha512-1Kc4oAGzAl7uqUStZCDvaLFqZrW9qWSjXOmBfdgyBP5La7Us6Mg4GBvRlSoaZMhQF/zSj1C8CtKMBkoiT8eL8w==",
"dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.0.0"
+ "dependencies": {
+ "@types/node": "*",
+ "pg-protocol": "*",
+ "pg-types": "^2.2.0"
}
},
- "@babel/plugin-transform-block-scoping": {
- "version": "7.6.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.6.0.tgz",
- "integrity": "sha512-tIt4E23+kw6TgL/edACZwP1OUKrjOTyMrFMLoT5IOFrfMRabCgekjqFd5o6PaAMildBu46oFkekIdMuGkkPEpA==",
+ "node_modules/ansi-regex": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.0.0",
- "lodash": "^4.17.13"
+ "engines": {
+ "node": ">=8"
}
},
- "@babel/plugin-transform-classes": {
- "version": "7.5.5",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.5.5.tgz",
- "integrity": "sha512-U2htCNK/6e9K7jGyJ++1p5XRU+LJjrwtoiVn9SzRlDT2KubcZ11OOwy3s24TjHxPgxNwonCYP7U2K51uVYCMDg==",
+ "node_modules/ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
- "requires": {
- "@babel/helper-annotate-as-pure": "^7.0.0",
- "@babel/helper-define-map": "^7.5.5",
- "@babel/helper-function-name": "^7.1.0",
- "@babel/helper-optimise-call-expression": "^7.0.0",
- "@babel/helper-plugin-utils": "^7.0.0",
- "@babel/helper-replace-supers": "^7.5.5",
- "@babel/helper-split-export-declaration": "^7.4.4",
- "globals": "^11.1.0"
+ "dependencies": {
+ "color-convert": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
- "@babel/plugin-transform-computed-properties": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.2.0.tgz",
- "integrity": "sha512-kP/drqTxY6Xt3NNpKiMomfgkNn4o7+vKxK2DDKcBG9sHj51vHqMBGy8wbDS/J4lMxnqs153/T3+DmCEAkC5cpA==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.0.0"
- }
+ "node_modules/any-base": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/any-base/-/any-base-1.1.0.tgz",
+ "integrity": "sha512-uMgjozySS8adZZYePpaWs8cxB9/kdzmpX6SgJZ+wbz1K5eYk5QMYDVJaZKhxyIHUdnnJkfR7SVgStgH7LkGUyg==",
+ "dev": true
+ },
+ "node_modules/balanced-match": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
+ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
+ "dev": true
},
- "@babel/plugin-transform-destructuring": {
- "version": "7.6.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.6.0.tgz",
- "integrity": "sha512-2bGIS5P1v4+sWTCnKNDZDxbGvEqi0ijeqM/YqHtVGrvG2y0ySgnEEhXErvE9dA0bnIzY9bIzdFK0jFA46ASIIQ==",
+ "node_modules/base64-js": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
+ "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
"dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.0.0"
- }
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ]
+ },
+ "node_modules/bmp-js": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/bmp-js/-/bmp-js-0.1.0.tgz",
+ "integrity": "sha1-4Fpj95amwf8l9Hcex62twUjAcjM=",
+ "dev": true
},
- "@babel/plugin-transform-dotall-regex": {
- "version": "7.4.4",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.4.4.tgz",
- "integrity": "sha512-P05YEhRc2h53lZDjRPk/OektxCVevFzZs2Gfjd545Wde3k+yFDbXORgl2e0xpbq8mLcKJ7Idss4fAg0zORN/zg==",
+ "node_modules/brace-expansion": {
+ "version": "1.1.11",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
+ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.0.0",
- "@babel/helper-regex": "^7.4.4",
- "regexpu-core": "^4.5.4"
+ "dependencies": {
+ "balanced-match": "^1.0.0",
+ "concat-map": "0.0.1"
}
},
- "@babel/plugin-transform-duplicate-keys": {
- "version": "7.5.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.5.0.tgz",
- "integrity": "sha512-igcziksHizyQPlX9gfSjHkE2wmoCH3evvD2qR5w29/Dk0SMKE/eOI7f1HhBdNhR/zxJDqrgpoDTq5YSLH/XMsQ==",
+ "node_modules/buffer": {
+ "version": "5.7.1",
+ "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
+ "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
"dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.0.0"
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "dependencies": {
+ "base64-js": "^1.3.1",
+ "ieee754": "^1.1.13"
}
},
- "@babel/plugin-transform-exponentiation-operator": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.2.0.tgz",
- "integrity": "sha512-umh4hR6N7mu4Elq9GG8TOu9M0bakvlsREEC+ialrQN6ABS4oDQ69qJv1VtR3uxlKMCQMCvzk7vr17RHKcjx68A==",
+ "node_modules/buffer-equal": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-0.0.1.tgz",
+ "integrity": "sha1-kbx0sR6kBbyRa8aqkI+q+ltKrEs=",
"dev": true,
- "requires": {
- "@babel/helper-builder-binary-assignment-operator-visitor": "^7.1.0",
- "@babel/helper-plugin-utils": "^7.0.0"
+ "engines": {
+ "node": ">=0.4.0"
}
},
- "@babel/plugin-transform-for-of": {
- "version": "7.4.4",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.4.4.tgz",
- "integrity": "sha512-9T/5Dlr14Z9TIEXLXkt8T1DU7F24cbhwhMNUziN3hB1AXoZcdzPcTiKGRn/6iOymDqtTKWnr/BtRKN9JwbKtdQ==",
+ "node_modules/buffer-equal-constant-time": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz",
+ "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk="
+ },
+ "node_modules/buffer-writer": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz",
+ "integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/cheap-watch": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/cheap-watch/-/cheap-watch-1.0.4.tgz",
+ "integrity": "sha512-QR/9FrtRL5fjfUJBhAKCdi0lSRQ3rVRRum3GF9wDKp2TJbEIMGhUEr2yU8lORzm9Isdjx7/k9S0DFDx+z5VGtw==",
"dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.0.0"
+ "engines": {
+ "node": ">=8"
}
},
- "@babel/plugin-transform-function-name": {
- "version": "7.4.4",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.4.4.tgz",
- "integrity": "sha512-iU9pv7U+2jC9ANQkKeNF6DrPy4GBa4NWQtl6dHB4Pb3izX2JOEvDTFarlNsBj/63ZEzNNIAMs3Qw4fNCcSOXJA==",
+ "node_modules/cliui": {
+ "version": "7.0.4",
+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",
+ "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==",
"dev": true,
- "requires": {
- "@babel/helper-function-name": "^7.1.0",
- "@babel/helper-plugin-utils": "^7.0.0"
+ "dependencies": {
+ "string-width": "^4.2.0",
+ "strip-ansi": "^6.0.0",
+ "wrap-ansi": "^7.0.0"
}
},
- "@babel/plugin-transform-literals": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.2.0.tgz",
- "integrity": "sha512-2ThDhm4lI4oV7fVQ6pNNK+sx+c/GM5/SaML0w/r4ZB7sAneD/piDJtwdKlNckXeyGK7wlwg2E2w33C/Hh+VFCg==",
+ "node_modules/codemirror": {
+ "version": "5.64.0",
+ "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.64.0.tgz",
+ "integrity": "sha512-fqr6CtDQdJ6iNMbD8NX2gH2G876nNDk+TO1rrYkgWnqQdO3O1Xa9tK6q+psqhJJgE5SpbaDcgdfLmukoUVE8pg==",
+ "dev": true
+ },
+ "node_modules/color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.0.0"
+ "dependencies": {
+ "color-name": "~1.1.4"
+ },
+ "engines": {
+ "node": ">=7.0.0"
+ }
+ },
+ "node_modules/color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+ "dev": true
+ },
+ "node_modules/concat-map": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
+ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
+ "dev": true
+ },
+ "node_modules/cookie": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz",
+ "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/core-js": {
+ "version": "2.6.12",
+ "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz",
+ "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==",
+ "deprecated": "core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.",
+ "dev": true,
+ "hasInstallScript": true
+ },
+ "node_modules/debug": {
+ "version": "4.3.3",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz",
+ "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==",
+ "dev": true,
+ "dependencies": {
+ "ms": "2.1.2"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/decamelize": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-5.0.1.tgz",
+ "integrity": "sha512-VfxadyCECXgQlkoEAjeghAr5gY3Hf+IKjKb+X8tGVDtveCjN+USwprd2q3QXBR9T1+x2DG0XZF5/w+7HAtSaXA==",
+ "dev": true,
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/degit": {
+ "version": "2.8.4",
+ "resolved": "https://registry.npmjs.org/degit/-/degit-2.8.4.tgz",
+ "integrity": "sha512-vqYuzmSA5I50J882jd+AbAhQtgK6bdKUJIex1JNfEUPENCgYsxugzKVZlFyMwV4i06MmnV47/Iqi5Io86zf3Ng==",
+ "dev": true,
+ "bin": {
+ "degit": "degit"
+ },
+ "engines": {
+ "node": ">=8.0.0"
+ }
+ },
+ "node_modules/dequal": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.2.tgz",
+ "integrity": "sha512-q9K8BlJVxK7hQYqa6XISGmBZbtQQWVXSrRrWreHC94rMt1QL/Impruc+7p2CYSYuVIUr+YCt6hjrs1kkdJRTug==",
+ "dev": true,
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/devalue": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/devalue/-/devalue-2.0.1.tgz",
+ "integrity": "sha512-I2TiqT5iWBEyB8GRfTDP0hiLZ0YeDJZ+upDxjBfOC2lebO5LezQMv7QvIUTzdb64jQyAKLf1AHADtGN+jw6v8Q=="
+ },
+ "node_modules/diff": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz",
+ "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.3.1"
+ }
+ },
+ "node_modules/do-not-zip": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/do-not-zip/-/do-not-zip-1.0.0.tgz",
+ "integrity": "sha512-Pgd81ET43bhAGaN2Hq1zluSX1FmD7kl7KcV9ER/lawiLsRUB9pRA5y8r6us29Xk6BrINZETO8TjhYwtwafWUww=="
+ },
+ "node_modules/dom-walk": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.2.tgz",
+ "integrity": "sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w==",
+ "dev": true
+ },
+ "node_modules/dotenv": {
+ "version": "10.0.0",
+ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz",
+ "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==",
+ "dev": true,
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/ecdsa-sig-formatter": {
+ "version": "1.0.11",
+ "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz",
+ "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==",
+ "dependencies": {
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "node_modules/emoji-regex": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
+ "dev": true
+ },
+ "node_modules/esbuild": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.13.15.tgz",
+ "integrity": "sha512-raCxt02HBKv8RJxE8vkTSCXGIyKHdEdGfUmiYb8wnabnaEmHzyW7DCHb5tEN0xU8ryqg5xw54mcwnYkC4x3AIw==",
+ "dev": true,
+ "hasInstallScript": true,
+ "bin": {
+ "esbuild": "bin/esbuild"
+ },
+ "optionalDependencies": {
+ "esbuild-android-arm64": "0.13.15",
+ "esbuild-darwin-64": "0.13.15",
+ "esbuild-darwin-arm64": "0.13.15",
+ "esbuild-freebsd-64": "0.13.15",
+ "esbuild-freebsd-arm64": "0.13.15",
+ "esbuild-linux-32": "0.13.15",
+ "esbuild-linux-64": "0.13.15",
+ "esbuild-linux-arm": "0.13.15",
+ "esbuild-linux-arm64": "0.13.15",
+ "esbuild-linux-mips64le": "0.13.15",
+ "esbuild-linux-ppc64le": "0.13.15",
+ "esbuild-netbsd-64": "0.13.15",
+ "esbuild-openbsd-64": "0.13.15",
+ "esbuild-sunos-64": "0.13.15",
+ "esbuild-windows-32": "0.13.15",
+ "esbuild-windows-64": "0.13.15",
+ "esbuild-windows-arm64": "0.13.15"
+ }
+ },
+ "node_modules/esbuild-android-arm64": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.13.15.tgz",
+ "integrity": "sha512-m602nft/XXeO8YQPUDVoHfjyRVPdPgjyyXOxZ44MK/agewFFkPa8tUo6lAzSWh5Ui5PB4KR9UIFTSBKh/RrCmg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "android"
+ ]
+ },
+ "node_modules/esbuild-darwin-64": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.13.15.tgz",
+ "integrity": "sha512-ihOQRGs2yyp7t5bArCwnvn2Atr6X4axqPpEdCFPVp7iUj4cVSdisgvEKdNR7yH3JDjW6aQDw40iQFoTqejqxvQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
+ },
+ "node_modules/esbuild-darwin-arm64": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.13.15.tgz",
+ "integrity": "sha512-i1FZssTVxUqNlJ6cBTj5YQj4imWy3m49RZRnHhLpefFIh0To05ow9DTrXROTE1urGTQCloFUXTX8QfGJy1P8dQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
+ },
+ "node_modules/esbuild-freebsd-64": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.13.15.tgz",
+ "integrity": "sha512-G3dLBXUI6lC6Z09/x+WtXBXbOYQZ0E8TDBqvn7aMaOCzryJs8LyVXKY4CPnHFXZAbSwkCbqiPuSQ1+HhrNk7EA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "freebsd"
+ ]
+ },
+ "node_modules/esbuild-freebsd-arm64": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.13.15.tgz",
+ "integrity": "sha512-KJx0fzEDf1uhNOZQStV4ujg30WlnwqUASaGSFPhznLM/bbheu9HhqZ6mJJZM32lkyfGJikw0jg7v3S0oAvtvQQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "freebsd"
+ ]
+ },
+ "node_modules/esbuild-linux-32": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.13.15.tgz",
+ "integrity": "sha512-ZvTBPk0YWCLMCXiFmD5EUtB30zIPvC5Itxz0mdTu/xZBbbHJftQgLWY49wEPSn2T/TxahYCRDWun5smRa0Tu+g==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/esbuild-linux-64": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.13.15.tgz",
+ "integrity": "sha512-eCKzkNSLywNeQTRBxJRQ0jxRCl2YWdMB3+PkWFo2BBQYC5mISLIVIjThNtn6HUNqua1pnvgP5xX0nHbZbPj5oA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/esbuild-linux-arm": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.13.15.tgz",
+ "integrity": "sha512-wUHttDi/ol0tD8ZgUMDH8Ef7IbDX+/UsWJOXaAyTdkT7Yy9ZBqPg8bgB/Dn3CZ9SBpNieozrPRHm0BGww7W/jA==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/esbuild-linux-arm64": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.13.15.tgz",
+ "integrity": "sha512-bYpuUlN6qYU9slzr/ltyLTR9YTBS7qUDymO8SV7kjeNext61OdmqFAzuVZom+OLW1HPHseBfJ/JfdSlx8oTUoA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/esbuild-linux-mips64le": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.13.15.tgz",
+ "integrity": "sha512-KlVjIG828uFPyJkO/8gKwy9RbXhCEUeFsCGOJBepUlpa7G8/SeZgncUEz/tOOUJTcWMTmFMtdd3GElGyAtbSWg==",
+ "cpu": [
+ "mips64el"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/esbuild-linux-ppc64le": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.13.15.tgz",
+ "integrity": "sha512-h6gYF+OsaqEuBjeesTBtUPw0bmiDu7eAeuc2OEH9S6mV9/jPhPdhOWzdeshb0BskRZxPhxPOjqZ+/OqLcxQwEQ==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/esbuild-netbsd-64": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.13.15.tgz",
+ "integrity": "sha512-3+yE9emwoevLMyvu+iR3rsa+Xwhie7ZEHMGDQ6dkqP/ndFzRHkobHUKTe+NCApSqG5ce2z4rFu+NX/UHnxlh3w==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "netbsd"
+ ]
+ },
+ "node_modules/esbuild-openbsd-64": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.13.15.tgz",
+ "integrity": "sha512-wTfvtwYJYAFL1fSs8yHIdf5GEE4NkbtbXtjLWjM3Cw8mmQKqsg8kTiqJ9NJQe5NX/5Qlo7Xd9r1yKMMkHllp5g==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "openbsd"
+ ]
+ },
+ "node_modules/esbuild-sunos-64": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.13.15.tgz",
+ "integrity": "sha512-lbivT9Bx3t1iWWrSnGyBP9ODriEvWDRiweAs69vI+miJoeKwHWOComSRukttbuzjZ8r1q0mQJ8Z7yUsDJ3hKdw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "sunos"
+ ]
+ },
+ "node_modules/esbuild-windows-32": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.13.15.tgz",
+ "integrity": "sha512-fDMEf2g3SsJ599MBr50cY5ve5lP1wyVwTe6aLJsM01KtxyKkB4UT+fc5MXQFn3RLrAIAZOG+tHC+yXObpSn7Nw==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/esbuild-windows-64": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.13.15.tgz",
+ "integrity": "sha512-9aMsPRGDWCd3bGjUIKG/ZOJPKsiztlxl/Q3C1XDswO6eNX/Jtwu4M+jb6YDH9hRSUflQWX0XKAfWzgy5Wk54JQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/esbuild-windows-arm64": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.13.15.tgz",
+ "integrity": "sha512-zzvyCVVpbwQQATaf3IG8mu1IwGEiDxKkYUdA4FpoCHi1KtPa13jeScYDjlW0Qh+ebWzpKfR2ZwvqAQkSWNcKjA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/escalade": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
+ "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
+ "dev": true,
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/escape-string-regexp": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
+ "dev": true,
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "node_modules/estree-walker": {
+ "version": "0.9.0",
+ "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.9.0.tgz",
+ "integrity": "sha512-12U47o7XHUX329+x3FzNVjCx3SHEzMF0nkDv7r/HnBzX/xNTKxajBk6gyygaxrAFtLj39219oMfbtxv4KpaOiA==",
+ "dev": true
+ },
+ "node_modules/exif-parser": {
+ "version": "0.1.12",
+ "resolved": "https://registry.npmjs.org/exif-parser/-/exif-parser-0.1.12.tgz",
+ "integrity": "sha1-WKnS1ywCwfbwKg70qRZicrd2CSI=",
+ "dev": true
+ },
+ "node_modules/file-type": {
+ "version": "9.0.0",
+ "resolved": "https://registry.npmjs.org/file-type/-/file-type-9.0.0.tgz",
+ "integrity": "sha512-Qe/5NJrgIOlwijpq3B7BEpzPFcgzggOTagZmkXQY4LA6bsXKTUstK7Wp12lEJ/mLKTpvIZxmIuRcLYWT6ov9lw==",
+ "dev": true,
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/flru": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/flru/-/flru-1.0.2.tgz",
+ "integrity": "sha512-kWyh8ADvHBFz6ua5xYOPnUroZTT/bwWfrCeL0Wj1dzG4/YOmOcfJ99W8dOVyyynJN35rZ9aCOtHChqQovV7yog==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/fs.realpath": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
+ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
+ "dev": true
+ },
+ "node_modules/fsevents": {
+ "version": "2.3.2",
+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
+ "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
+ "dev": true,
+ "hasInstallScript": true,
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
+ }
+ },
+ "node_modules/function-bind": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
+ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
+ "dev": true
+ },
+ "node_modules/get-caller-file": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
+ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
+ "dev": true,
+ "engines": {
+ "node": "6.* || 8.* || >= 10.*"
}
},
- "@babel/plugin-transform-member-expression-literals": {
+ "node_modules/glob": {
"version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.2.0.tgz",
- "integrity": "sha512-HiU3zKkSU6scTidmnFJ0bMX8hz5ixC93b4MHMiYebmk2lUVNGOboPsqQvx5LzooihijUoLR/v7Nc1rbBtnc7FA==",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
+ "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
"dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.0.0"
+ "dependencies": {
+ "fs.realpath": "^1.0.0",
+ "inflight": "^1.0.4",
+ "inherits": "2",
+ "minimatch": "^3.0.4",
+ "once": "^1.3.0",
+ "path-is-absolute": "^1.0.0"
+ },
+ "engines": {
+ "node": "*"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
}
},
- "@babel/plugin-transform-modules-amd": {
- "version": "7.5.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.5.0.tgz",
- "integrity": "sha512-n20UsQMKnWrltocZZm24cRURxQnWIvsABPJlw/fvoy9c6AgHZzoelAIzajDHAQrDpuKFFPPcFGd7ChsYuIUMpg==",
+ "node_modules/global": {
+ "version": "4.4.0",
+ "resolved": "https://registry.npmjs.org/global/-/global-4.4.0.tgz",
+ "integrity": "sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w==",
"dev": true,
- "requires": {
- "@babel/helper-module-transforms": "^7.1.0",
- "@babel/helper-plugin-utils": "^7.0.0",
- "babel-plugin-dynamic-import-node": "^2.3.0"
+ "dependencies": {
+ "min-document": "^2.19.0",
+ "process": "^0.11.10"
}
},
- "@babel/plugin-transform-modules-commonjs": {
- "version": "7.6.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.6.0.tgz",
- "integrity": "sha512-Ma93Ix95PNSEngqomy5LSBMAQvYKVe3dy+JlVJSHEXZR5ASL9lQBedMiCyVtmTLraIDVRE3ZjTZvmXXD2Ozw3g==",
+ "node_modules/globalyzer": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz",
+ "integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==",
+ "dev": true
+ },
+ "node_modules/globrex": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz",
+ "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==",
+ "dev": true
+ },
+ "node_modules/golden-fleece": {
+ "version": "1.0.9",
+ "resolved": "https://registry.npmjs.org/golden-fleece/-/golden-fleece-1.0.9.tgz",
+ "integrity": "sha512-YSwLaGMOgSBx9roJlNLL12c+FRiw7VECphinc6mGucphc/ZxTHgdEz6gmJqH6NOzYEd/yr64hwjom5pZ+tJVpg==",
+ "dev": true
+ },
+ "node_modules/has": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
+ "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
"dev": true,
- "requires": {
- "@babel/helper-module-transforms": "^7.4.4",
- "@babel/helper-plugin-utils": "^7.0.0",
- "@babel/helper-simple-access": "^7.1.0",
- "babel-plugin-dynamic-import-node": "^2.3.0"
+ "dependencies": {
+ "function-bind": "^1.1.1"
+ },
+ "engines": {
+ "node": ">= 0.4.0"
+ }
+ },
+ "node_modules/httpie": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/httpie/-/httpie-1.1.2.tgz",
+ "integrity": "sha512-VQ82oXG95oY1fQw/XecHuvcFBA+lZQ9Vwj1RfLcO8a7HpDd4cc2ukwpJt+TUlFaLUAzZErylxWu6wclJ1rUhUQ==",
+ "engines": {
+ "node": ">=8"
}
},
- "@babel/plugin-transform-modules-systemjs": {
- "version": "7.5.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.5.0.tgz",
- "integrity": "sha512-Q2m56tyoQWmuNGxEtUyeEkm6qJYFqs4c+XyXH5RAuYxObRNz9Zgj/1g2GMnjYp2EUyEy7YTrxliGCXzecl/vJg==",
+ "node_modules/ieee754": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
+ "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
"dev": true,
- "requires": {
- "@babel/helper-hoist-variables": "^7.4.4",
- "@babel/helper-plugin-utils": "^7.0.0",
- "babel-plugin-dynamic-import-node": "^2.3.0"
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ]
+ },
+ "node_modules/inflight": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
+ "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
+ "dev": true,
+ "dependencies": {
+ "once": "^1.3.0",
+ "wrappy": "1"
+ }
+ },
+ "node_modules/inherits": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
+ },
+ "node_modules/interpret": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz",
+ "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==",
+ "dev": true,
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/is-core-module": {
+ "version": "2.8.0",
+ "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.0.tgz",
+ "integrity": "sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw==",
+ "dev": true,
+ "dependencies": {
+ "has": "^1.0.3"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/is-fullwidth-code-point": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/is-function": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.2.tgz",
+ "integrity": "sha512-lw7DUp0aWXYg+CBCN+JKkcE0Q2RayZnSvnZBlwgxHBQhqt5pZNVy4Ri7H9GmmXkdu7LUthszM+Tor1u/2iBcpQ==",
+ "dev": true
+ },
+ "node_modules/jimp": {
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/jimp/-/jimp-0.8.5.tgz",
+ "integrity": "sha512-BW7t/+TCgKpqZw/wHFwqF/A/Tyk43RmzRHyMBdqfOepqunUrajt0RTqowdWyFo4CS2FmD8pFiYfefWjpXFWrCA==",
+ "dev": true,
+ "dependencies": {
+ "@jimp/custom": "^0.8.5",
+ "@jimp/plugins": "^0.8.5",
+ "@jimp/types": "^0.8.5",
+ "core-js": "^2.5.7",
+ "regenerator-runtime": "^0.13.3"
+ }
+ },
+ "node_modules/jpeg-js": {
+ "version": "0.3.7",
+ "resolved": "https://registry.npmjs.org/jpeg-js/-/jpeg-js-0.3.7.tgz",
+ "integrity": "sha512-9IXdWudL61npZjvLuVe/ktHiA41iE8qFyLB+4VDTblEsWBzeg8WQTlktdUK4CdncUqtUgUg0bbOmTE2bKBKaBQ==",
+ "dev": true
+ },
+ "node_modules/jsonwebtoken": {
+ "version": "8.5.1",
+ "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz",
+ "integrity": "sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==",
+ "dependencies": {
+ "jws": "^3.2.2",
+ "lodash.includes": "^4.3.0",
+ "lodash.isboolean": "^3.0.3",
+ "lodash.isinteger": "^4.0.4",
+ "lodash.isnumber": "^3.0.3",
+ "lodash.isplainobject": "^4.0.6",
+ "lodash.isstring": "^4.0.1",
+ "lodash.once": "^4.0.0",
+ "ms": "^2.1.1",
+ "semver": "^5.6.0"
+ },
+ "engines": {
+ "node": ">=4",
+ "npm": ">=1.4.28"
+ }
+ },
+ "node_modules/jwa": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz",
+ "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==",
+ "dependencies": {
+ "buffer-equal-constant-time": "1.0.1",
+ "ecdsa-sig-formatter": "1.0.11",
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "node_modules/jws": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz",
+ "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==",
+ "dependencies": {
+ "jwa": "^1.4.1",
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "node_modules/kleur": {
+ "version": "4.1.4",
+ "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.4.tgz",
+ "integrity": "sha512-8QADVssbrFjivHWQU7KkMgptGTl6WAcSdlbBPY4uNF+mWr6DGcKrvY2w4FQJoXch7+fKMjj0dRrL75vk3k23OA==",
+ "dev": true,
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/load-bmfont": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/load-bmfont/-/load-bmfont-1.4.1.tgz",
+ "integrity": "sha512-8UyQoYmdRDy81Brz6aLAUhfZLwr5zV0L3taTQ4hju7m6biuwiWiJXjPhBJxbUQJA8PrkvJ/7Enqmwk2sM14soA==",
+ "dev": true,
+ "dependencies": {
+ "buffer-equal": "0.0.1",
+ "mime": "^1.3.4",
+ "parse-bmfont-ascii": "^1.0.3",
+ "parse-bmfont-binary": "^1.0.5",
+ "parse-bmfont-xml": "^1.1.4",
+ "phin": "^2.9.1",
+ "xhr": "^2.0.1",
+ "xtend": "^4.0.0"
+ }
+ },
+ "node_modules/lodash.deburr": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/lodash.deburr/-/lodash.deburr-4.1.0.tgz",
+ "integrity": "sha1-3bG7s+8HRYwBd7oH3hRCLLAz/5s=",
+ "dev": true
+ },
+ "node_modules/lodash.includes": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz",
+ "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8="
+ },
+ "node_modules/lodash.isboolean": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz",
+ "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY="
+ },
+ "node_modules/lodash.isinteger": {
+ "version": "4.0.4",
+ "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz",
+ "integrity": "sha1-YZwK89A/iwTDH1iChAt3sRzWg0M="
+ },
+ "node_modules/lodash.isnumber": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz",
+ "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w="
+ },
+ "node_modules/lodash.isplainobject": {
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz",
+ "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs="
+ },
+ "node_modules/lodash.isstring": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz",
+ "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE="
+ },
+ "node_modules/lodash.once": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz",
+ "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w="
+ },
+ "node_modules/magic-string": {
+ "version": "0.25.7",
+ "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz",
+ "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==",
+ "dev": true,
+ "dependencies": {
+ "sourcemap-codec": "^1.4.4"
+ }
+ },
+ "node_modules/marked": {
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.6.tgz",
+ "integrity": "sha512-+H0bTf8DM8zLuFBUm/2VklxaCrwlBFgoJzHJcMZCnZ9cPgsllHwKpL6TPLdDeA38yPluMuVKOL1hO5w6HmG5Mg==",
+ "bin": {
+ "marked": "bin/marked.js"
+ },
+ "engines": {
+ "node": ">= 12"
+ }
+ },
+ "node_modules/mime": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
+ "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
+ "dev": true,
+ "bin": {
+ "mime": "cli.js"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/min-document": {
+ "version": "2.19.0",
+ "resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz",
+ "integrity": "sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=",
+ "dev": true,
+ "dependencies": {
+ "dom-walk": "^0.1.0"
+ }
+ },
+ "node_modules/minimatch": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
+ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
+ "dev": true,
+ "dependencies": {
+ "brace-expansion": "^1.1.7"
+ },
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/minimist": {
+ "version": "0.0.8",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
+ "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
+ "dev": true
+ },
+ "node_modules/mkdirp": {
+ "version": "0.5.1",
+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
+ "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
+ "deprecated": "Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)",
+ "dev": true,
+ "dependencies": {
+ "minimist": "0.0.8"
+ },
+ "bin": {
+ "mkdirp": "bin/cmd.js"
+ }
+ },
+ "node_modules/mri": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz",
+ "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==",
+ "dev": true,
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/ms": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
+ },
+ "node_modules/nanoid": {
+ "version": "3.1.30",
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.30.tgz",
+ "integrity": "sha512-zJpuPDwOv8D2zq2WRoMe1HsfZthVewpel9CAvTfc/2mBD1uUT/agc5f7GHGWXlYkFvi1mVxe4IjvP2HNrop7nQ==",
+ "dev": true,
+ "bin": {
+ "nanoid": "bin/nanoid.cjs"
+ },
+ "engines": {
+ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
+ }
+ },
+ "node_modules/node-fetch": {
+ "version": "2.6.6",
+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.6.tgz",
+ "integrity": "sha512-Z8/6vRlTUChSdIgMa51jxQ4lrw/Jy5SOW10ObaA47/RElsAN2c5Pn8bTgFGWn/ibwzXTE8qwr1Yzx28vsecXEA==",
+ "dev": true,
+ "dependencies": {
+ "whatwg-url": "^5.0.0"
+ },
+ "engines": {
+ "node": "4.x || >=6.0.0"
+ }
+ },
+ "node_modules/node-pg-migrate": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/node-pg-migrate/-/node-pg-migrate-6.0.0.tgz",
+ "integrity": "sha512-mv0qhjENeD/HuGghZCuAcWCrOB77B5dNLMXRz13UeBDDTafsRGFpN+4/IpFM9EZ8g0mcE34/ceVYDLmk4W8/Pw==",
+ "dev": true,
+ "dependencies": {
+ "@types/pg": "^8.0.0",
+ "decamelize": "^5.0.0",
+ "mkdirp": "~1.0.0",
+ "yargs": "~17.1.0"
+ },
+ "bin": {
+ "node-pg-migrate": "bin/node-pg-migrate"
+ },
+ "engines": {
+ "node": ">=12.13.0"
+ },
+ "peerDependencies": {
+ "pg": ">=4.3.0 <9.0.0"
+ }
+ },
+ "node_modules/node-pg-migrate/node_modules/mkdirp": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
+ "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
+ "dev": true,
+ "bin": {
+ "mkdirp": "bin/cmd.js"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/omggif": {
+ "version": "1.0.10",
+ "resolved": "https://registry.npmjs.org/omggif/-/omggif-1.0.10.tgz",
+ "integrity": "sha512-LMJTtvgc/nugXj0Vcrrs68Mn2D1r0zf630VNtqtpI1FEO7e+O9FP4gqs9AcnBaSEeoHIPm28u6qgPR0oyEpGSw==",
+ "dev": true
+ },
+ "node_modules/once": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
+ "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
+ "dev": true,
+ "dependencies": {
+ "wrappy": "1"
+ }
+ },
+ "node_modules/packet-reader": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz",
+ "integrity": "sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ=="
+ },
+ "node_modules/pako": {
+ "version": "1.0.11",
+ "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
+ "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==",
+ "dev": true
+ },
+ "node_modules/parse-bmfont-ascii": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/parse-bmfont-ascii/-/parse-bmfont-ascii-1.0.6.tgz",
+ "integrity": "sha1-Eaw8P/WPfCAgqyJ2kHkQjU36AoU=",
+ "dev": true
+ },
+ "node_modules/parse-bmfont-binary": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/parse-bmfont-binary/-/parse-bmfont-binary-1.0.6.tgz",
+ "integrity": "sha1-0Di0dtPp3Z2x4RoLDlOiJ5K2kAY=",
+ "dev": true
+ },
+ "node_modules/parse-bmfont-xml": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/parse-bmfont-xml/-/parse-bmfont-xml-1.1.4.tgz",
+ "integrity": "sha512-bjnliEOmGv3y1aMEfREMBJ9tfL3WR0i0CKPj61DnSLaoxWR3nLrsQrEbCId/8rF4NyRF0cCqisSVXyQYWM+mCQ==",
+ "dev": true,
+ "dependencies": {
+ "xml-parse-from-string": "^1.0.0",
+ "xml2js": "^0.4.5"
+ }
+ },
+ "node_modules/parse-headers": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.4.tgz",
+ "integrity": "sha512-psZ9iZoCNFLrgRjZ1d8mn0h9WRqJwFxM9q3x7iUjN/YT2OksthDJ5TiPCu2F38kS4zutqfW+YdVVkBZZx3/1aw==",
+ "dev": true
+ },
+ "node_modules/path-is-absolute": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
+ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/path-parse": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
+ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
+ "dev": true
+ },
+ "node_modules/pg": {
+ "version": "8.7.1",
+ "resolved": "https://registry.npmjs.org/pg/-/pg-8.7.1.tgz",
+ "integrity": "sha512-7bdYcv7V6U3KAtWjpQJJBww0UEsWuh4yQ/EjNf2HeO/NnvKjpvhEIe/A/TleP6wtmSKnUnghs5A9jUoK6iDdkA==",
+ "dependencies": {
+ "buffer-writer": "2.0.0",
+ "packet-reader": "1.0.0",
+ "pg-connection-string": "^2.5.0",
+ "pg-pool": "^3.4.1",
+ "pg-protocol": "^1.5.0",
+ "pg-types": "^2.1.0",
+ "pgpass": "1.x"
+ },
+ "engines": {
+ "node": ">= 8.0.0"
+ },
+ "peerDependencies": {
+ "pg-native": ">=2.0.0"
+ },
+ "peerDependenciesMeta": {
+ "pg-native": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/pg-connection-string": {
+ "version": "2.5.0",
+ "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.5.0.tgz",
+ "integrity": "sha512-r5o/V/ORTA6TmUnyWZR9nCj1klXCO2CEKNRlVuJptZe85QuhFayC7WeMic7ndayT5IRIR0S0xFxFi2ousartlQ=="
+ },
+ "node_modules/pg-int8": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz",
+ "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==",
+ "engines": {
+ "node": ">=4.0.0"
+ }
+ },
+ "node_modules/pg-pool": {
+ "version": "3.4.1",
+ "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.4.1.tgz",
+ "integrity": "sha512-TVHxR/gf3MeJRvchgNHxsYsTCHQ+4wm3VIHSS19z8NC0+gioEhq1okDY1sm/TYbfoP6JLFx01s0ShvZ3puP/iQ==",
+ "peerDependencies": {
+ "pg": ">=8.0"
+ }
+ },
+ "node_modules/pg-protocol": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.5.0.tgz",
+ "integrity": "sha512-muRttij7H8TqRNu/DxrAJQITO4Ac7RmX3Klyr/9mJEOBeIpgnF8f9jAfRz5d3XwQZl5qBjF9gLsUtMPJE0vezQ=="
+ },
+ "node_modules/pg-types": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz",
+ "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==",
+ "dependencies": {
+ "pg-int8": "1.0.1",
+ "postgres-array": "~2.0.0",
+ "postgres-bytea": "~1.0.0",
+ "postgres-date": "~1.0.4",
+ "postgres-interval": "^1.1.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/pgpass": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.4.tgz",
+ "integrity": "sha512-YmuA56alyBq7M59vxVBfPJrGSozru8QAdoNlWuW3cz8l+UX3cWge0vTvjKhsSHSJpo3Bom8/Mm6hf0TR5GY0+w==",
+ "dependencies": {
+ "split2": "^3.1.1"
+ }
+ },
+ "node_modules/phin": {
+ "version": "2.9.3",
+ "resolved": "https://registry.npmjs.org/phin/-/phin-2.9.3.tgz",
+ "integrity": "sha512-CzFr90qM24ju5f88quFC/6qohjC144rehe5n6DH900lgXmUe86+xCKc10ev56gRKC4/BkHUoG4uSiQgBiIXwDA==",
+ "dev": true
+ },
+ "node_modules/picocolors": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
+ "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==",
+ "dev": true
+ },
+ "node_modules/picomatch": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz",
+ "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==",
+ "dev": true,
+ "engines": {
+ "node": ">=8.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/jonschlinkert"
+ }
+ },
+ "node_modules/pixelmatch": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/pixelmatch/-/pixelmatch-4.0.2.tgz",
+ "integrity": "sha1-j0fc7FARtHe2fbA8JDvB8wheiFQ=",
+ "dev": true,
+ "dependencies": {
+ "pngjs": "^3.0.0"
+ },
+ "bin": {
+ "pixelmatch": "bin/pixelmatch"
+ }
+ },
+ "node_modules/pngjs": {
+ "version": "3.4.0",
+ "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-3.4.0.tgz",
+ "integrity": "sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w==",
+ "dev": true,
+ "engines": {
+ "node": ">=4.0.0"
+ }
+ },
+ "node_modules/postcss": {
+ "version": "8.4.4",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.4.tgz",
+ "integrity": "sha512-joU6fBsN6EIer28Lj6GDFoC/5yOZzLCfn0zHAn/MYXI7aPt4m4hK5KC5ovEZXy+lnCjmYIbQWngvju2ddyEr8Q==",
+ "dev": true,
+ "dependencies": {
+ "nanoid": "^3.1.30",
+ "picocolors": "^1.0.0",
+ "source-map-js": "^1.0.1"
+ },
+ "engines": {
+ "node": "^10 || ^12 || >=14"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/postcss/"
+ }
+ },
+ "node_modules/postgres-array": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz",
+ "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/postgres-bytea": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz",
+ "integrity": "sha1-AntTPAqokOJtFy1Hz5zOzFIazTU=",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/postgres-date": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz",
+ "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/postgres-interval": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz",
+ "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==",
+ "dependencies": {
+ "xtend": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/prism-svelte": {
+ "version": "0.4.7",
+ "resolved": "https://registry.npmjs.org/prism-svelte/-/prism-svelte-0.4.7.tgz",
+ "integrity": "sha512-yABh19CYbM24V7aS7TuPYRNMqthxwbvx6FF/Rw920YbyBWO3tnyPIqRMgHuSVsLmuHkkBS1Akyof463FVdkeDQ=="
+ },
+ "node_modules/prismjs": {
+ "version": "1.25.0",
+ "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.25.0.tgz",
+ "integrity": "sha512-WCjJHl1KEWbnkQom1+SzftbtXMKQoezOCYs5rECqMN+jP+apI7ftoflyqigqzopSO3hMhTEb0mFClA8lkolgEg=="
+ },
+ "node_modules/process": {
+ "version": "0.11.10",
+ "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
+ "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=",
+ "dev": true,
+ "engines": {
+ "node": ">= 0.6.0"
+ }
+ },
+ "node_modules/readable-stream": {
+ "version": "3.6.0",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
+ "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
+ "dependencies": {
+ "inherits": "^2.0.3",
+ "string_decoder": "^1.1.1",
+ "util-deprecate": "^1.0.1"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/rechoir": {
+ "version": "0.6.2",
+ "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz",
+ "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=",
+ "dev": true,
+ "dependencies": {
+ "resolve": "^1.1.6"
+ },
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/regenerator-runtime": {
+ "version": "0.13.9",
+ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz",
+ "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==",
+ "dev": true
+ },
+ "node_modules/require-directory": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
+ "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/require-relative": {
+ "version": "0.8.7",
+ "resolved": "https://registry.npmjs.org/require-relative/-/require-relative-0.8.7.tgz",
+ "integrity": "sha1-eZlTn8ngR6N5KPoZb44VY9q9Nt4=",
+ "dev": true
+ },
+ "node_modules/resolve": {
+ "version": "1.20.0",
+ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz",
+ "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==",
+ "dev": true,
+ "dependencies": {
+ "is-core-module": "^2.2.0",
+ "path-parse": "^1.0.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/rollup": {
+ "version": "2.60.2",
+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.60.2.tgz",
+ "integrity": "sha512-1Bgjpq61sPjgoZzuiDSGvbI1tD91giZABgjCQBKM5aYLnzjq52GoDuWVwT/cm/MCxCMPU8gqQvkj8doQ5C8Oqw==",
+ "dev": true,
+ "bin": {
+ "rollup": "dist/bin/rollup"
+ },
+ "engines": {
+ "node": ">=10.0.0"
+ },
+ "optionalDependencies": {
+ "fsevents": "~2.3.2"
+ }
+ },
+ "node_modules/sade": {
+ "version": "1.7.4",
+ "resolved": "https://registry.npmjs.org/sade/-/sade-1.7.4.tgz",
+ "integrity": "sha512-y5yauMD93rX840MwUJr7C1ysLFBgMspsdTo4UVrDg3fXDvtwOyIqykhVAAm6fk/3au77773itJStObgK+LKaiA==",
+ "dev": true,
+ "dependencies": {
+ "mri": "^1.1.0"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/safe-buffer": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
+ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ]
+ },
+ "node_modules/sax": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
+ "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==",
+ "dev": true
+ },
+ "node_modules/semver": {
+ "version": "5.7.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
+ "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
+ "bin": {
+ "semver": "bin/semver"
+ }
+ },
+ "node_modules/shelljs": {
+ "version": "0.8.4",
+ "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz",
+ "integrity": "sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==",
+ "dev": true,
+ "dependencies": {
+ "glob": "^7.0.0",
+ "interpret": "^1.0.0",
+ "rechoir": "^0.6.2"
+ },
+ "bin": {
+ "shjs": "bin/shjs"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/source-map-js": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.1.tgz",
+ "integrity": "sha512-4+TN2b3tqOCd/kaGRJ/sTYA0tR0mdXx26ipdolxcwtJVqEnqNYvlCAt1q3ypy4QMlYus+Zh34RNtYLoq2oQ4IA==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/sourcemap-codec": {
+ "version": "1.4.8",
+ "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz",
+ "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==",
+ "dev": true
+ },
+ "node_modules/split2": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz",
+ "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==",
+ "dependencies": {
+ "readable-stream": "^3.0.0"
}
},
- "@babel/plugin-transform-modules-umd": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.2.0.tgz",
- "integrity": "sha512-BV3bw6MyUH1iIsGhXlOK6sXhmSarZjtJ/vMiD9dNmpY8QXFFQTj+6v92pcfy1iqa8DeAfJFwoxcrS/TUZda6sw==",
- "dev": true,
- "requires": {
- "@babel/helper-module-transforms": "^7.1.0",
- "@babel/helper-plugin-utils": "^7.0.0"
+ "node_modules/string_decoder": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
+ "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
+ "dependencies": {
+ "safe-buffer": "~5.2.0"
}
},
- "@babel/plugin-transform-named-capturing-groups-regex": {
- "version": "7.6.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.6.0.tgz",
- "integrity": "sha512-jem7uytlmrRl3iCAuQyw8BpB4c4LWvSpvIeXKpMb+7j84lkx4m4mYr5ErAcmN5KM7B6BqrAvRGjBIbbzqCczew==",
+ "node_modules/string-width": {
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"dev": true,
- "requires": {
- "regexp-tree": "^0.1.13"
+ "dependencies": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=8"
}
},
- "@babel/plugin-transform-new-target": {
- "version": "7.4.4",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.4.4.tgz",
- "integrity": "sha512-r1z3T2DNGQwwe2vPGZMBNjioT2scgWzK9BCnDEh+46z8EEwXBq24uRzd65I7pjtugzPSj921aM15RpESgzsSuA==",
+ "node_modules/strip-ansi": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.0.0"
+ "dependencies": {
+ "ansi-regex": "^5.0.1"
+ },
+ "engines": {
+ "node": ">=8"
}
},
- "@babel/plugin-transform-object-super": {
- "version": "7.5.5",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.5.5.tgz",
- "integrity": "sha512-un1zJQAhSosGFBduPgN/YFNvWVpRuHKU7IHBglLoLZsGmruJPOo6pbInneflUdmq7YvSVqhpPs5zdBvLnteltQ==",
+ "node_modules/svelte": {
+ "version": "3.44.2",
+ "resolved": "https://registry.npmjs.org/svelte/-/svelte-3.44.2.tgz",
+ "integrity": "sha512-jrZhZtmH3ZMweXg1Q15onb8QlWD+a5T5Oca4C1jYvSURp2oD35h4A5TV6t6MEa93K4LlX6BkafZPdQoFjw/ylA==",
"dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.0.0",
- "@babel/helper-replace-supers": "^7.5.5"
+ "engines": {
+ "node": ">= 8"
}
},
- "@babel/plugin-transform-parameters": {
- "version": "7.4.4",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.4.4.tgz",
- "integrity": "sha512-oMh5DUO1V63nZcu/ZVLQFqiihBGo4OpxJxR1otF50GMeCLiRx5nUdtokd+u9SuVJrvvuIh9OosRFPP4pIPnwmw==",
+ "node_modules/svelte-hmr": {
+ "version": "0.14.7",
+ "resolved": "https://registry.npmjs.org/svelte-hmr/-/svelte-hmr-0.14.7.tgz",
+ "integrity": "sha512-pDrzgcWSoMaK6AJkBWkmgIsecW0GChxYZSZieIYfCP0v2oPyx2CYU/zm7TBIcjLVUPP714WxmViE9Thht4etog==",
"dev": true,
- "requires": {
- "@babel/helper-call-delegate": "^7.4.4",
- "@babel/helper-get-function-arity": "^7.0.0",
- "@babel/helper-plugin-utils": "^7.0.0"
+ "peerDependencies": {
+ "svelte": ">=3.19.0"
}
},
- "@babel/plugin-transform-property-literals": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.2.0.tgz",
- "integrity": "sha512-9q7Dbk4RhgcLp8ebduOpCbtjh7C0itoLYHXd9ueASKAG/is5PQtMR5VJGka9NKqGhYEGn5ITahd4h9QeBMylWQ==",
- "dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.0.0"
- }
+ "node_modules/svelte-json-tree": {
+ "version": "0.0.5",
+ "resolved": "https://registry.npmjs.org/svelte-json-tree/-/svelte-json-tree-0.0.5.tgz",
+ "integrity": "sha512-kTcOVlsldI2neszYNQAfFCt+u62OWWAZgpeoW9RN3hjtJCWI5bkVj0gtljZWUlyEWTfgpmag5L5AHDKg8w8ZmQ==",
+ "dev": true
+ },
+ "node_modules/timm": {
+ "version": "1.7.1",
+ "resolved": "https://registry.npmjs.org/timm/-/timm-1.7.1.tgz",
+ "integrity": "sha512-IjZc9KIotudix8bMaBW6QvMuq64BrJWFs1+4V0lXwWGQZwH+LnX87doAYhem4caOEusRP9/g6jVDQmZ8XOk1nw==",
+ "dev": true
},
- "@babel/plugin-transform-regenerator": {
- "version": "7.4.5",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.4.5.tgz",
- "integrity": "sha512-gBKRh5qAaCWntnd09S8QC7r3auLCqq5DI6O0DlfoyDjslSBVqBibrMdsqO+Uhmx3+BlOmE/Kw1HFxmGbv0N9dA==",
+ "node_modules/tiny-glob": {
+ "version": "0.2.9",
+ "resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.9.tgz",
+ "integrity": "sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==",
"dev": true,
- "requires": {
- "regenerator-transform": "^0.14.0"
+ "dependencies": {
+ "globalyzer": "0.1.0",
+ "globrex": "^0.1.2"
}
},
- "@babel/plugin-transform-reserved-words": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.2.0.tgz",
- "integrity": "sha512-fz43fqW8E1tAB3DKF19/vxbpib1fuyCwSPE418ge5ZxILnBhWyhtPgz8eh1RCGGJlwvksHkyxMxh0eenFi+kFw==",
+ "node_modules/tinycolor2": {
+ "version": "1.4.2",
+ "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.4.2.tgz",
+ "integrity": "sha512-vJhccZPs965sV/L2sU4oRQVAos0pQXwsvTLkWYdqJ+a8Q5kPFzJTuOFwy7UniPli44NKQGAglksjvOcpo95aZA==",
"dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.0.0"
+ "engines": {
+ "node": "*"
}
},
- "@babel/plugin-transform-runtime": {
- "version": "7.6.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.6.0.tgz",
- "integrity": "sha512-Da8tMf7uClzwUm/pnJ1S93m/aRXmoYNDD7TkHua8xBDdaAs54uZpTWvEt6NGwmoVMb9mZbntfTqmG2oSzN/7Vg==",
+ "node_modules/totalist": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/totalist/-/totalist-2.0.0.tgz",
+ "integrity": "sha512-+Y17F0YzxfACxTyjfhnJQEe7afPA0GSpYlFkl2VFMxYP7jshQf9gXV7cH47EfToBumFThfKBvfAcoUn6fdNeRQ==",
"dev": true,
- "requires": {
- "@babel/helper-module-imports": "^7.0.0",
- "@babel/helper-plugin-utils": "^7.0.0",
- "resolve": "^1.8.1",
- "semver": "^5.5.1"
+ "engines": {
+ "node": ">=6"
}
},
- "@babel/plugin-transform-shorthand-properties": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.2.0.tgz",
- "integrity": "sha512-QP4eUM83ha9zmYtpbnyjTLAGKQritA5XW/iG9cjtuOI8s1RuL/3V6a3DeSHfKutJQ+ayUfeZJPcnCYEQzaPQqg==",
+ "node_modules/tr46": {
+ "version": "0.0.3",
+ "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
+ "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=",
+ "dev": true
+ },
+ "node_modules/utif": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/utif/-/utif-2.0.1.tgz",
+ "integrity": "sha512-Z/S1fNKCicQTf375lIP9G8Sa1H/phcysstNrrSdZKj1f9g58J4NMgb5IgiEZN9/nLMPDwF0W7hdOe9Qq2IYoLg==",
"dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.0.0"
+ "dependencies": {
+ "pako": "^1.0.5"
}
},
- "@babel/plugin-transform-spread": {
- "version": "7.2.2",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.2.2.tgz",
- "integrity": "sha512-KWfky/58vubwtS0hLqEnrWJjsMGaOeSBn90Ezn5Jeg9Z8KKHmELbP1yGylMlm5N6TPKeY9A2+UaSYLdxahg01w==",
+ "node_modules/util-deprecate": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
+ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
+ },
+ "node_modules/uvu": {
+ "version": "0.5.2",
+ "resolved": "https://registry.npmjs.org/uvu/-/uvu-0.5.2.tgz",
+ "integrity": "sha512-m2hLe7I2eROhh+tm3WE5cTo/Cv3WQA7Oc9f7JB6uWv+/zVKvfAm53bMyOoGOSZeQ7Ov2Fu9pLhFr7p07bnT20w==",
"dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.0.0"
+ "dependencies": {
+ "dequal": "^2.0.0",
+ "diff": "^5.0.0",
+ "kleur": "^4.0.3",
+ "sade": "^1.7.3",
+ "totalist": "^2.0.0"
+ },
+ "bin": {
+ "uvu": "bin.js"
+ },
+ "engines": {
+ "node": ">=8"
}
},
- "@babel/plugin-transform-sticky-regex": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.2.0.tgz",
- "integrity": "sha512-KKYCoGaRAf+ckH8gEL3JHUaFVyNHKe3ASNsZ+AlktgHevvxGigoIttrEJb8iKN03Q7Eazlv1s6cx2B2cQ3Jabw==",
+ "node_modules/vite": {
+ "version": "2.6.14",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-2.6.14.tgz",
+ "integrity": "sha512-2HA9xGyi+EhY2MXo0+A2dRsqsAG3eFNEVIo12olkWhOmc8LfiM+eMdrXf+Ruje9gdXgvSqjLI9freec1RUM5EA==",
"dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.0.0",
- "@babel/helper-regex": "^7.0.0"
+ "dependencies": {
+ "esbuild": "^0.13.2",
+ "postcss": "^8.3.8",
+ "resolve": "^1.20.0",
+ "rollup": "^2.57.0"
+ },
+ "bin": {
+ "vite": "bin/vite.js"
+ },
+ "engines": {
+ "node": ">=12.2.0"
+ },
+ "optionalDependencies": {
+ "fsevents": "~2.3.2"
+ },
+ "peerDependencies": {
+ "less": "*",
+ "sass": "*",
+ "stylus": "*"
+ },
+ "peerDependenciesMeta": {
+ "less": {
+ "optional": true
+ },
+ "sass": {
+ "optional": true
+ },
+ "stylus": {
+ "optional": true
+ }
}
},
- "@babel/plugin-transform-template-literals": {
- "version": "7.4.4",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.4.4.tgz",
- "integrity": "sha512-mQrEC4TWkhLN0z8ygIvEL9ZEToPhG5K7KDW3pzGqOfIGZ28Jb0POUkeWcoz8HnHvhFy6dwAT1j8OzqN8s804+g==",
+ "node_modules/webidl-conversions": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
+ "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=",
+ "dev": true
+ },
+ "node_modules/whatwg-url": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
+ "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=",
"dev": true,
- "requires": {
- "@babel/helper-annotate-as-pure": "^7.0.0",
- "@babel/helper-plugin-utils": "^7.0.0"
+ "dependencies": {
+ "tr46": "~0.0.3",
+ "webidl-conversions": "^3.0.0"
}
},
- "@babel/plugin-transform-typeof-symbol": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.2.0.tgz",
- "integrity": "sha512-2LNhETWYxiYysBtrBTqL8+La0jIoQQnIScUJc74OYvUGRmkskNY4EzLCnjHBzdmb38wqtTaixpo1NctEcvMDZw==",
+ "node_modules/wrap-ansi": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
+ "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
"dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.0.0"
+ "dependencies": {
+ "ansi-styles": "^4.0.0",
+ "string-width": "^4.1.0",
+ "strip-ansi": "^6.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/wrap-ansi?sponsor=1"
}
},
- "@babel/plugin-transform-unicode-regex": {
- "version": "7.4.4",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.4.4.tgz",
- "integrity": "sha512-il+/XdNw01i93+M9J9u4T7/e/Ue/vWfNZE4IRUQjplu2Mqb/AFTDimkw2tdEdSH50wuQXZAbXSql0UphQke+vA==",
+ "node_modules/wrappy": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
+ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
+ "dev": true
+ },
+ "node_modules/xhr": {
+ "version": "2.6.0",
+ "resolved": "https://registry.npmjs.org/xhr/-/xhr-2.6.0.tgz",
+ "integrity": "sha512-/eCGLb5rxjx5e3mF1A7s+pLlR6CGyqWN91fv1JgER5mVWg1MZmlhBvy9kjcsOdRk8RrIujotWyJamfyrp+WIcA==",
"dev": true,
- "requires": {
- "@babel/helper-plugin-utils": "^7.0.0",
- "@babel/helper-regex": "^7.4.4",
- "regexpu-core": "^4.5.4"
+ "dependencies": {
+ "global": "~4.4.0",
+ "is-function": "^1.0.1",
+ "parse-headers": "^2.0.0",
+ "xtend": "^4.0.0"
}
},
- "@babel/preset-env": {
- "version": "7.6.0",
- "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.6.0.tgz",
- "integrity": "sha512-1efzxFv/TcPsNXlRhMzRnkBFMeIqBBgzwmZwlFDw5Ubj0AGLeufxugirwZmkkX/ayi3owsSqoQ4fw8LkfK9SYg==",
+ "node_modules/xml-parse-from-string": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/xml-parse-from-string/-/xml-parse-from-string-1.0.1.tgz",
+ "integrity": "sha1-qQKekp09vN7RafPG4oI42VpdWig=",
+ "dev": true
+ },
+ "node_modules/xml2js": {
+ "version": "0.4.23",
+ "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz",
+ "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==",
"dev": true,
- "requires": {
- "@babel/helper-module-imports": "^7.0.0",
- "@babel/helper-plugin-utils": "^7.0.0",
- "@babel/plugin-proposal-async-generator-functions": "^7.2.0",
- "@babel/plugin-proposal-dynamic-import": "^7.5.0",
- "@babel/plugin-proposal-json-strings": "^7.2.0",
- "@babel/plugin-proposal-object-rest-spread": "^7.5.5",
- "@babel/plugin-proposal-optional-catch-binding": "^7.2.0",
- "@babel/plugin-proposal-unicode-property-regex": "^7.4.4",
- "@babel/plugin-syntax-async-generators": "^7.2.0",
- "@babel/plugin-syntax-dynamic-import": "^7.2.0",
- "@babel/plugin-syntax-json-strings": "^7.2.0",
- "@babel/plugin-syntax-object-rest-spread": "^7.2.0",
- "@babel/plugin-syntax-optional-catch-binding": "^7.2.0",
- "@babel/plugin-transform-arrow-functions": "^7.2.0",
- "@babel/plugin-transform-async-to-generator": "^7.5.0",
- "@babel/plugin-transform-block-scoped-functions": "^7.2.0",
- "@babel/plugin-transform-block-scoping": "^7.6.0",
- "@babel/plugin-transform-classes": "^7.5.5",
- "@babel/plugin-transform-computed-properties": "^7.2.0",
- "@babel/plugin-transform-destructuring": "^7.6.0",
- "@babel/plugin-transform-dotall-regex": "^7.4.4",
- "@babel/plugin-transform-duplicate-keys": "^7.5.0",
- "@babel/plugin-transform-exponentiation-operator": "^7.2.0",
- "@babel/plugin-transform-for-of": "^7.4.4",
- "@babel/plugin-transform-function-name": "^7.4.4",
- "@babel/plugin-transform-literals": "^7.2.0",
- "@babel/plugin-transform-member-expression-literals": "^7.2.0",
- "@babel/plugin-transform-modules-amd": "^7.5.0",
- "@babel/plugin-transform-modules-commonjs": "^7.6.0",
- "@babel/plugin-transform-modules-systemjs": "^7.5.0",
- "@babel/plugin-transform-modules-umd": "^7.2.0",
- "@babel/plugin-transform-named-capturing-groups-regex": "^7.6.0",
- "@babel/plugin-transform-new-target": "^7.4.4",
- "@babel/plugin-transform-object-super": "^7.5.5",
- "@babel/plugin-transform-parameters": "^7.4.4",
- "@babel/plugin-transform-property-literals": "^7.2.0",
- "@babel/plugin-transform-regenerator": "^7.4.5",
- "@babel/plugin-transform-reserved-words": "^7.2.0",
- "@babel/plugin-transform-shorthand-properties": "^7.2.0",
- "@babel/plugin-transform-spread": "^7.2.0",
- "@babel/plugin-transform-sticky-regex": "^7.2.0",
- "@babel/plugin-transform-template-literals": "^7.4.4",
- "@babel/plugin-transform-typeof-symbol": "^7.2.0",
- "@babel/plugin-transform-unicode-regex": "^7.4.4",
- "@babel/types": "^7.6.0",
- "browserslist": "^4.6.0",
- "core-js-compat": "^3.1.1",
- "invariant": "^2.2.2",
- "js-levenshtein": "^1.1.3",
- "semver": "^5.5.0"
- },
"dependencies": {
- "@babel/types": {
- "version": "7.6.1",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.1.tgz",
- "integrity": "sha512-X7gdiuaCmA0uRjCmRtYJNAVCc/q+5xSgsfKJHqMN4iNLILX39677fJE1O40arPMh0TTtS9ItH67yre6c7k6t0g==",
- "dev": true,
- "requires": {
- "esutils": "^2.0.2",
- "lodash": "^4.17.13",
- "to-fast-properties": "^2.0.0"
- }
- }
+ "sax": ">=0.6.0",
+ "xmlbuilder": "~11.0.0"
+ },
+ "engines": {
+ "node": ">=4.0.0"
}
},
- "@babel/runtime": {
- "version": "7.6.0",
- "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.6.0.tgz",
- "integrity": "sha512-89eSBLJsxNxOERC0Op4vd+0Bqm6wRMqMbFtV3i0/fbaWw/mJ8Q3eBvgX0G4SyrOOLCtbu98HspF8o09MRT+KzQ==",
+ "node_modules/xmlbuilder": {
+ "version": "11.0.1",
+ "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz",
+ "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==",
"dev": true,
- "requires": {
- "regenerator-runtime": "^0.13.2"
+ "engines": {
+ "node": ">=4.0"
+ }
+ },
+ "node_modules/xtend": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
+ "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==",
+ "engines": {
+ "node": ">=0.4"
}
},
- "@babel/template": {
- "version": "7.6.0",
- "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.6.0.tgz",
- "integrity": "sha512-5AEH2EXD8euCk446b7edmgFdub/qfH1SN6Nii3+fyXP807QRx9Q73A2N5hNwRRslC2H9sNzaFhsPubkS4L8oNQ==",
+ "node_modules/y18n": {
+ "version": "5.0.8",
+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
+ "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",
"dev": true,
- "requires": {
- "@babel/code-frame": "^7.0.0",
- "@babel/parser": "^7.6.0",
- "@babel/types": "^7.6.0"
- },
- "dependencies": {
- "@babel/types": {
- "version": "7.6.1",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.1.tgz",
- "integrity": "sha512-X7gdiuaCmA0uRjCmRtYJNAVCc/q+5xSgsfKJHqMN4iNLILX39677fJE1O40arPMh0TTtS9ItH67yre6c7k6t0g==",
- "dev": true,
- "requires": {
- "esutils": "^2.0.2",
- "lodash": "^4.17.13",
- "to-fast-properties": "^2.0.0"
- }
- }
+ "engines": {
+ "node": ">=10"
}
},
- "@babel/traverse": {
- "version": "7.6.0",
- "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.6.0.tgz",
- "integrity": "sha512-93t52SaOBgml/xY74lsmt7xOR4ufYvhb5c5qiM6lu4J/dWGMAfAh6eKw4PjLes6DI6nQgearoxnFJk60YchpvQ==",
+ "node_modules/yargs": {
+ "version": "17.1.1",
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.1.1.tgz",
+ "integrity": "sha512-c2k48R0PwKIqKhPMWjeiF6y2xY/gPMUlro0sgxqXpbOIohWiLNXWslsootttv7E1e73QPAMQSg5FeySbVcpsPQ==",
"dev": true,
- "requires": {
- "@babel/code-frame": "^7.5.5",
- "@babel/generator": "^7.6.0",
- "@babel/helper-function-name": "^7.1.0",
- "@babel/helper-split-export-declaration": "^7.4.4",
- "@babel/parser": "^7.6.0",
- "@babel/types": "^7.6.0",
- "debug": "^4.1.0",
- "globals": "^11.1.0",
- "lodash": "^4.17.13"
- },
"dependencies": {
- "@babel/code-frame": {
- "version": "7.5.5",
- "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz",
- "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==",
- "dev": true,
- "requires": {
- "@babel/highlight": "^7.0.0"
- }
- },
- "@babel/types": {
- "version": "7.6.1",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.1.tgz",
- "integrity": "sha512-X7gdiuaCmA0uRjCmRtYJNAVCc/q+5xSgsfKJHqMN4iNLILX39677fJE1O40arPMh0TTtS9ItH67yre6c7k6t0g==",
- "dev": true,
- "requires": {
- "esutils": "^2.0.2",
- "lodash": "^4.17.13",
- "to-fast-properties": "^2.0.0"
- }
- }
+ "cliui": "^7.0.2",
+ "escalade": "^3.1.1",
+ "get-caller-file": "^2.0.5",
+ "require-directory": "^2.1.1",
+ "string-width": "^4.2.0",
+ "y18n": "^5.0.5",
+ "yargs-parser": "^20.2.2"
+ },
+ "engines": {
+ "node": ">=12"
}
},
- "@babel/types": {
- "version": "7.5.0",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.5.0.tgz",
- "integrity": "sha512-UFpDVqRABKsW01bvw7/wSUe56uy6RXM5+VJibVVAybDGxEW25jdwiFJEf7ASvSaC7sN7rbE/l3cLp2izav+CtQ==",
+ "node_modules/yargs-parser": {
+ "version": "20.2.9",
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz",
+ "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==",
"dev": true,
- "requires": {
- "esutils": "^2.0.2",
- "lodash": "^4.17.11",
- "to-fast-properties": "^2.0.0"
+ "engines": {
+ "node": ">=10"
}
},
+ "node_modules/yootils": {
+ "version": "0.0.16",
+ "resolved": "https://registry.npmjs.org/yootils/-/yootils-0.0.16.tgz",
+ "integrity": "sha512-aIVecm5ucOzwhtKbl0zkfg0ZSOUR9c2da0k8cIc9umjjzkvVCWUUX/UHZ1CLPsv4wmJLqt0aWeLB7p9n9JDwYQ==",
+ "dev": true
+ }
+ },
+ "dependencies": {
"@jimp/bmp": {
- "version": "0.8.0",
- "resolved": "https://registry.npmjs.org/@jimp/bmp/-/bmp-0.8.0.tgz",
- "integrity": "sha512-SBM1VzoFpN0kHotXU8Tg2XqxwZEg7IiUCr+W0CQ4Vc1/Weh6pXha8XexaOjjBF1jb9WX5p7AsQcaPjIVpOnR2Q==",
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/bmp/-/bmp-0.8.5.tgz",
+ "integrity": "sha512-o/23j1RODQGGjvb2xg+9ZQCHc9uXa5XIoJuXHN8kh8AJBGD7JZYiHMwNHaxJRJvadimCKUeA5udZUJAoaPwrYg==",
"dev": true,
"requires": {
- "@jimp/utils": "^0.8.0",
+ "@jimp/utils": "^0.8.5",
"bmp-js": "^0.1.0",
"core-js": "^2.5.7"
}
},
"@jimp/core": {
- "version": "0.8.0",
- "resolved": "https://registry.npmjs.org/@jimp/core/-/core-0.8.0.tgz",
- "integrity": "sha512-6fDLRpBzWqq78IuxoWs5Du89qb27P4LS9hSVgPWyZAzkPCH7K4wvcE8cgrMJgbUgvJqelMY1jgBT2qUlululow==",
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/core/-/core-0.8.5.tgz",
+ "integrity": "sha512-Jto1IdL5HYg7uE15rpQjK6dfZJ6d6gRjUsVCPW50nIfXgWizaTibFEov90W9Bj+irwKrX2ntG3e3pZUyOC0COg==",
"dev": true,
"requires": {
- "@jimp/utils": "^0.8.0",
+ "@jimp/utils": "^0.8.5",
"any-base": "^1.1.0",
"buffer": "^5.2.0",
"core-js": "^2.5.7",
@@ -986,251 +2326,251 @@
}
},
"@jimp/custom": {
- "version": "0.8.0",
- "resolved": "https://registry.npmjs.org/@jimp/custom/-/custom-0.8.0.tgz",
- "integrity": "sha512-dv4fO4qFtmdZOdwMTrkVYssgy25fpoOv5Vp5n6kgQUjTRVP5Im0afwzLnzvyOKpgEbUvKHNJ2coOwHmF/G8PZw==",
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/custom/-/custom-0.8.5.tgz",
+ "integrity": "sha512-hS4qHOcOIL+N93IprsIhFgr8F4XnC2oYd+lRaOKEOg3ptS2vQnceSTtcXsC0//mhq8AV6lNjpbfs1iseEZuTqg==",
"dev": true,
"requires": {
- "@jimp/core": "^0.8.0",
+ "@jimp/core": "^0.8.5",
"core-js": "^2.5.7"
}
},
"@jimp/gif": {
- "version": "0.8.0",
- "resolved": "https://registry.npmjs.org/@jimp/gif/-/gif-0.8.0.tgz",
- "integrity": "sha512-uQczNNzkL0CqI3zzZ7A0NTeYTHNFkLcMG9vXHqxTYZtPnK4r7qmbNgyak1DbHgYwP2xwBEEyhcZjnL9fHO4egQ==",
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/gif/-/gif-0.8.5.tgz",
+ "integrity": "sha512-Mj8jmv4AS76OY+Hx/Xoyihj02SUZ2ELk+O5x89pODz1+NeGtSWHHjZjnSam9HYAjycvVI/lGJdk/7w0nWIV/yQ==",
"dev": true,
"requires": {
- "@jimp/utils": "^0.8.0",
+ "@jimp/utils": "^0.8.5",
"core-js": "^2.5.7",
"omggif": "^1.0.9"
}
},
"@jimp/jpeg": {
- "version": "0.8.0",
- "resolved": "https://registry.npmjs.org/@jimp/jpeg/-/jpeg-0.8.0.tgz",
- "integrity": "sha512-LVP1dcx85rMRdZSFEW2ytQdSy2s6evgi60Jdffy5xRyLCw8xu+KpZu6lGnXekgqrEg0F2pV0l5zJQwzPCgEHaA==",
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/jpeg/-/jpeg-0.8.5.tgz",
+ "integrity": "sha512-7kjTY0BiCpwRywk+oPfpLto7cLI+9G0mf4N1bv1Hn+VLQwcXFy2fHyl4qjqLbbY6u4cyZgqN+R8Pg6GRRzv0kw==",
"dev": true,
"requires": {
- "@jimp/utils": "^0.8.0",
+ "@jimp/utils": "^0.8.5",
"core-js": "^2.5.7",
"jpeg-js": "^0.3.4"
}
},
"@jimp/plugin-blit": {
- "version": "0.8.0",
- "resolved": "https://registry.npmjs.org/@jimp/plugin-blit/-/plugin-blit-0.8.0.tgz",
- "integrity": "sha512-0fDnkJ/tmvL1PLpO+zvBfKjyMx5h/a7rV3UkbovbmhAd7P+gv0Gaui7uqTdP/Cseh9QZugqV+opDCBN8SviRdw==",
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugin-blit/-/plugin-blit-0.8.5.tgz",
+ "integrity": "sha512-r8Z1CwazaJwZCRbucQgrfprlGyH91tX7GubUsbWr+zy5/dRJAAgaPj/hcoHDwbh3zyiXp5BECKKzKW0x4reL4w==",
"dev": true,
"requires": {
- "@jimp/utils": "^0.8.0",
+ "@jimp/utils": "^0.8.5",
"core-js": "^2.5.7"
}
},
"@jimp/plugin-blur": {
- "version": "0.8.0",
- "resolved": "https://registry.npmjs.org/@jimp/plugin-blur/-/plugin-blur-0.8.0.tgz",
- "integrity": "sha512-Ctn13ICOeKGVDSxXykTEqrjjtigcKAYj0Loe5+dDvOmc9+BF6haW8okcJ3zA73uY3rxfcOOsqRT89f1awJB4ew==",
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugin-blur/-/plugin-blur-0.8.5.tgz",
+ "integrity": "sha512-UH5ywpV4YooUh9HXEsrNKDtojLCvIAAV0gywqn8EQeFyzwBJyXAvRNARJp7zr5OPLr9uGXkRLDCO9YyzdlXZng==",
"dev": true,
"requires": {
- "@jimp/utils": "^0.8.0",
+ "@jimp/utils": "^0.8.5",
"core-js": "^2.5.7"
}
},
"@jimp/plugin-color": {
- "version": "0.8.0",
- "resolved": "https://registry.npmjs.org/@jimp/plugin-color/-/plugin-color-0.8.0.tgz",
- "integrity": "sha512-2MqafmTW556DhtHQ87Z4QHlTXuwjxkiqPemJi1Vyi+K8us2SYephNcOPySzunBvnx/x0iutlnQ878/9EZWvjGQ==",
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugin-color/-/plugin-color-0.8.5.tgz",
+ "integrity": "sha512-7XHqcTQ8Y1zto1b9P1y8m1dzSjnOpBsD9OZG0beTpeJ5bgPX+hF5ZLmvcM6c5ljkINw5EUF1it07BYbkCxiGQA==",
"dev": true,
"requires": {
- "@jimp/utils": "^0.8.0",
+ "@jimp/utils": "^0.8.5",
"core-js": "^2.5.7",
"tinycolor2": "^1.4.1"
}
},
"@jimp/plugin-contain": {
- "version": "0.8.0",
- "resolved": "https://registry.npmjs.org/@jimp/plugin-contain/-/plugin-contain-0.8.0.tgz",
- "integrity": "sha512-0z8XnUJ2aBAbbE0hUUUhv5F+ZlWOB63IARhoRk0nTcJOCgPMM6+IBL7rE3o5d4TGrmeN8eCJbuevq0J9QFgsig==",
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugin-contain/-/plugin-contain-0.8.5.tgz",
+ "integrity": "sha512-ZkiPFx9L0yITiKtYTYLWyBsSIdxo/NARhNPRZXyVF9HmTWSLDUw1c2c1uvETKxDZTAVK+souYT14DwFWWdhsYA==",
"dev": true,
"requires": {
- "@jimp/utils": "^0.8.0",
+ "@jimp/utils": "^0.8.5",
"core-js": "^2.5.7"
}
},
"@jimp/plugin-cover": {
- "version": "0.8.0",
- "resolved": "https://registry.npmjs.org/@jimp/plugin-cover/-/plugin-cover-0.8.0.tgz",
- "integrity": "sha512-tXydocsy6azQ9BuDpJIoDJnMOTTGMwau6TxD58b98f39FzMUhIBZNoKFlX9tazAYu7YronxPEYUT5M0Jx/mBMw==",
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugin-cover/-/plugin-cover-0.8.5.tgz",
+ "integrity": "sha512-OdT4YAopLOhbhTUQV3R1v5ZZqIaUt3n3vJi/OfTbsak1t9UkPBVdmYPyhoont8zJdtdkF5dW16Ro1FTshytcww==",
"dev": true,
"requires": {
- "@jimp/utils": "^0.8.0",
+ "@jimp/utils": "^0.8.5",
"core-js": "^2.5.7"
}
},
"@jimp/plugin-crop": {
- "version": "0.8.0",
- "resolved": "https://registry.npmjs.org/@jimp/plugin-crop/-/plugin-crop-0.8.0.tgz",
- "integrity": "sha512-dhJV08CuGoG0Dg3dzLrM05HhjahLdVpCNRVv6kXmxEpS3infJ4tIO24mjxmynllSPPBitVgSK1dDixgyZE0FFw==",
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugin-crop/-/plugin-crop-0.8.5.tgz",
+ "integrity": "sha512-E1Hb+gfu2k74Gkqh96apAyVljsP5MjCH4TY6lECAAEcYKGH/XRhz6lY2dSEjCYE7KtiqjTZzWwYkgAvkwojj9Q==",
"dev": true,
"requires": {
- "@jimp/utils": "^0.8.0",
+ "@jimp/utils": "^0.8.5",
"core-js": "^2.5.7"
}
},
"@jimp/plugin-displace": {
- "version": "0.8.0",
- "resolved": "https://registry.npmjs.org/@jimp/plugin-displace/-/plugin-displace-0.8.0.tgz",
- "integrity": "sha512-MdLFx5VosTtitD99jSiuzXR2NVMdK8m/CImz+orrAl+rbe3zXT866hlinoUINuQKwBc8rCNULbTClHsOjvRECw==",
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugin-displace/-/plugin-displace-0.8.5.tgz",
+ "integrity": "sha512-fVgVYTS1HZzAXkg8Lg06PuirSUG5oXYaYYGL+3ZU4tmZn1pyZ+mZyfejpwtymETEYZnmymHoCT4xto19E/IRvA==",
"dev": true,
"requires": {
- "@jimp/utils": "^0.8.0",
+ "@jimp/utils": "^0.8.5",
"core-js": "^2.5.7"
}
},
"@jimp/plugin-dither": {
- "version": "0.8.0",
- "resolved": "https://registry.npmjs.org/@jimp/plugin-dither/-/plugin-dither-0.8.0.tgz",
- "integrity": "sha512-zQ9EhR5mRP90n0+UA4UUpGVgRu6S+jtxMqEocwD2bLE1cB3ZAtvO3TrvjCvBz3NrnsEtGY84giHu14/+VblCcg==",
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugin-dither/-/plugin-dither-0.8.5.tgz",
+ "integrity": "sha512-KSj2y8E3yK7tldjT/8ejqAWw5HFBjtWW6QkcxfW7FdV4c/nsXZXDkMbhqMZ7FkDuSYoAPeWUFeddrH4yipC5iA==",
"dev": true,
"requires": {
- "@jimp/utils": "^0.8.0",
+ "@jimp/utils": "^0.8.5",
"core-js": "^2.5.7"
}
},
"@jimp/plugin-flip": {
- "version": "0.8.0",
- "resolved": "https://registry.npmjs.org/@jimp/plugin-flip/-/plugin-flip-0.8.0.tgz",
- "integrity": "sha512-X7bS/FsE3VM3w6AJRxUNcvtxwUdDBF+gOrw89HuMuwdg8nRT+ULUVAqOO8qw06H9ilscUbccfW6pzHjkKsdjlQ==",
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugin-flip/-/plugin-flip-0.8.5.tgz",
+ "integrity": "sha512-2QbGDkurPNAXZUeHLo/UA3tjh+AbAXWZKSdtoa1ArlASovRz8rqtA45YIRIkKrMH82TA3PZk8bgP2jaLKLrzww==",
"dev": true,
"requires": {
- "@jimp/utils": "^0.8.0",
+ "@jimp/utils": "^0.8.5",
"core-js": "^2.5.7"
}
},
"@jimp/plugin-gaussian": {
- "version": "0.8.0",
- "resolved": "https://registry.npmjs.org/@jimp/plugin-gaussian/-/plugin-gaussian-0.8.0.tgz",
- "integrity": "sha512-GfAwu065NcmOZ5joqWlDln8SCPHkuGmdXWt453KjicsnDbeo+BRNFtR7Qy+RY9TujI6mSGML7BImYOYtRM6Pqw==",
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugin-gaussian/-/plugin-gaussian-0.8.5.tgz",
+ "integrity": "sha512-2zReC5GJcVAXtf3UgzFcHSYN277i02K9Yrhc1xJf3mti00s43uD++B5Ho7/mIo+HrntVvWhxqar7PARdq0lVIg==",
"dev": true,
"requires": {
- "@jimp/utils": "^0.8.0",
+ "@jimp/utils": "^0.8.5",
"core-js": "^2.5.7"
}
},
"@jimp/plugin-invert": {
- "version": "0.8.0",
- "resolved": "https://registry.npmjs.org/@jimp/plugin-invert/-/plugin-invert-0.8.0.tgz",
- "integrity": "sha512-CiJkxXFkeFcv6n2NTFawDZKbflyt3TpQVJpB29yhagL6MXqt+cQu5FPQuFZJ2vtGGkthy73XAGWe3frbDnR17A==",
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugin-invert/-/plugin-invert-0.8.5.tgz",
+ "integrity": "sha512-GyMXPGheHdS14xfDceuZ9hrGm6gE9UG3PfTEjQbJmHMWippLC6yf8kombSudJlUf8q72YYSSXsSFKGgkHa67vA==",
"dev": true,
"requires": {
- "@jimp/utils": "^0.8.0",
+ "@jimp/utils": "^0.8.5",
"core-js": "^2.5.7"
}
},
"@jimp/plugin-mask": {
- "version": "0.8.0",
- "resolved": "https://registry.npmjs.org/@jimp/plugin-mask/-/plugin-mask-0.8.0.tgz",
- "integrity": "sha512-ySBzw7LVWtdLH82nYWKOZvreYpWXfT+AxlYrn6NK8OdsP6A/eS82EJ8Hm3UYfBUFMajcMgsGpknLtoxSTeQesw==",
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugin-mask/-/plugin-mask-0.8.5.tgz",
+ "integrity": "sha512-inD/++XO+MkmwXl9JGYQ8X2deyOZuq9i+dmugH/557p16B9Q6tvUQt5X1Yg5w7hhkLZ00BKOAJI9XoyCC1NFvQ==",
"dev": true,
"requires": {
- "@jimp/utils": "^0.8.0",
+ "@jimp/utils": "^0.8.5",
"core-js": "^2.5.7"
}
},
"@jimp/plugin-normalize": {
- "version": "0.8.0",
- "resolved": "https://registry.npmjs.org/@jimp/plugin-normalize/-/plugin-normalize-0.8.0.tgz",
- "integrity": "sha512-XIuusnK9OVYZ5gl4MGh3J7pgzZVGzjjrBpoKP5dexsbwtDBn+L9TVKp2Kih8Fut/DYI8Vl9AslnaRG293coOXA==",
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugin-normalize/-/plugin-normalize-0.8.5.tgz",
+ "integrity": "sha512-8YRWJWBT4NoSAbPhnjQJXGeaeWVrJAlGDv39A54oNH8Ry47fHcE0EN6zogQNpBuM34M6hRnZl4rOv1FIisaWdg==",
"dev": true,
"requires": {
- "@jimp/utils": "^0.8.0",
+ "@jimp/utils": "^0.8.5",
"core-js": "^2.5.7"
}
},
"@jimp/plugin-print": {
- "version": "0.8.0",
- "resolved": "https://registry.npmjs.org/@jimp/plugin-print/-/plugin-print-0.8.0.tgz",
- "integrity": "sha512-cyKUFQRWISS0feLK4yqdCk/tZ/Cli2gOMiqIiX66pkI7fbNao/b/I1/y7WaHjcBQcv74Tcjq8TlsIvBQuUKKwg==",
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugin-print/-/plugin-print-0.8.5.tgz",
+ "integrity": "sha512-BviNpCiA/fEieOqsrWr1FkqyFuiG2izdyyg7zUqyeUTHPwqrTLvXO9cfP/ThG4hZpu5wMQ5QClWSqhZu1fAwxA==",
"dev": true,
"requires": {
- "@jimp/utils": "^0.8.0",
+ "@jimp/utils": "^0.8.5",
"core-js": "^2.5.7",
"load-bmfont": "^1.4.0"
}
},
"@jimp/plugin-resize": {
- "version": "0.8.0",
- "resolved": "https://registry.npmjs.org/@jimp/plugin-resize/-/plugin-resize-0.8.0.tgz",
- "integrity": "sha512-F1eEA45kusPxSH1VhbUBU4mFmW4JImN7V5Jin2kvC1q2AVvGXsRx5rrA8hw1pnve2/JGf+km2OcVKbb4XAz1lQ==",
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugin-resize/-/plugin-resize-0.8.5.tgz",
+ "integrity": "sha512-gIdmISuNmZQ1QwprnRC5VXVWQfKIiWineVQGebpMAG/aoFOLDXrVl939Irg7Fb/uOlSFTzpAbt1zpJ8YG/Mi2w==",
"dev": true,
"requires": {
- "@jimp/utils": "^0.8.0",
+ "@jimp/utils": "^0.8.5",
"core-js": "^2.5.7"
}
},
"@jimp/plugin-rotate": {
- "version": "0.8.0",
- "resolved": "https://registry.npmjs.org/@jimp/plugin-rotate/-/plugin-rotate-0.8.0.tgz",
- "integrity": "sha512-2YlebGHLY0jnkL7UT9Ht2OIkAvO8L7xIacjPbbcK8bBA5WwTXIRVShVjztMLQH7iFBh7qgl21+uMX97cbX6BSw==",
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugin-rotate/-/plugin-rotate-0.8.5.tgz",
+ "integrity": "sha512-8T9wnL3gb+Z0ogMZmtyI6h3y7TuqW2a5SpFbzFUVF+lTZoAabXjEfX3CAozizCLaT+Duc5H2FJVemAHiyr+Dbw==",
"dev": true,
"requires": {
- "@jimp/utils": "^0.8.0",
+ "@jimp/utils": "^0.8.5",
"core-js": "^2.5.7"
}
},
"@jimp/plugin-scale": {
- "version": "0.8.0",
- "resolved": "https://registry.npmjs.org/@jimp/plugin-scale/-/plugin-scale-0.8.0.tgz",
- "integrity": "sha512-NXw+rl1pJb1g4EWPdT3U+jnPb9S8kr1/DLbBpTYkc34GoTNvEBHcaOmvgqdGpUpO4tAbweHbqMME//ZTEKF7XQ==",
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugin-scale/-/plugin-scale-0.8.5.tgz",
+ "integrity": "sha512-G+CDH9s7BsxJ4b+mKZ5SsiXwTAynBJ+7/9SwZFnICZJJvLd79Tws6VPXfSaKJZuWnGIX++L8jTGmFORCfLNkdg==",
"dev": true,
"requires": {
- "@jimp/utils": "^0.8.0",
+ "@jimp/utils": "^0.8.5",
"core-js": "^2.5.7"
}
},
"@jimp/plugins": {
- "version": "0.8.0",
- "resolved": "https://registry.npmjs.org/@jimp/plugins/-/plugins-0.8.0.tgz",
- "integrity": "sha512-auAyw8nXfhXH6cBejDLdTAMruRUel+zfgWPjILIdDI3FRrAvkyNtnES1yP2iRLF3nluEcO2WvHIlbQ4rdaOqVw==",
- "dev": true,
- "requires": {
- "@jimp/plugin-blit": "^0.8.0",
- "@jimp/plugin-blur": "^0.8.0",
- "@jimp/plugin-color": "^0.8.0",
- "@jimp/plugin-contain": "^0.8.0",
- "@jimp/plugin-cover": "^0.8.0",
- "@jimp/plugin-crop": "^0.8.0",
- "@jimp/plugin-displace": "^0.8.0",
- "@jimp/plugin-dither": "^0.8.0",
- "@jimp/plugin-flip": "^0.8.0",
- "@jimp/plugin-gaussian": "^0.8.0",
- "@jimp/plugin-invert": "^0.8.0",
- "@jimp/plugin-mask": "^0.8.0",
- "@jimp/plugin-normalize": "^0.8.0",
- "@jimp/plugin-print": "^0.8.0",
- "@jimp/plugin-resize": "^0.8.0",
- "@jimp/plugin-rotate": "^0.8.0",
- "@jimp/plugin-scale": "^0.8.0",
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/plugins/-/plugins-0.8.5.tgz",
+ "integrity": "sha512-52na0wqfQ3uItIA+C9cJ1EXffhSmABgK7ETClDseUh9oGtynHzxZ97smnFf1ydLjXLrF89Gt+YBxWLyiBGgiZQ==",
+ "dev": true,
+ "requires": {
+ "@jimp/plugin-blit": "^0.8.5",
+ "@jimp/plugin-blur": "^0.8.5",
+ "@jimp/plugin-color": "^0.8.5",
+ "@jimp/plugin-contain": "^0.8.5",
+ "@jimp/plugin-cover": "^0.8.5",
+ "@jimp/plugin-crop": "^0.8.5",
+ "@jimp/plugin-displace": "^0.8.5",
+ "@jimp/plugin-dither": "^0.8.5",
+ "@jimp/plugin-flip": "^0.8.5",
+ "@jimp/plugin-gaussian": "^0.8.5",
+ "@jimp/plugin-invert": "^0.8.5",
+ "@jimp/plugin-mask": "^0.8.5",
+ "@jimp/plugin-normalize": "^0.8.5",
+ "@jimp/plugin-print": "^0.8.5",
+ "@jimp/plugin-resize": "^0.8.5",
+ "@jimp/plugin-rotate": "^0.8.5",
+ "@jimp/plugin-scale": "^0.8.5",
"core-js": "^2.5.7",
"timm": "^1.6.1"
}
},
"@jimp/png": {
- "version": "0.8.0",
- "resolved": "https://registry.npmjs.org/@jimp/png/-/png-0.8.0.tgz",
- "integrity": "sha512-dnV219zYzqLHlj4kIFSWgI1p6o6jNI1zUxD6KqKXkubKUOwdyb5/EjlzRmPPAIvLz6Oy5ELG4rc0BRcaHAZcbQ==",
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/png/-/png-0.8.5.tgz",
+ "integrity": "sha512-zT89ucu8I2rsD3FIMIPLgr1OyKn4neD+5umwD3MY8AOB8+6tX5bFtnmTm3FzGJaJuibkK0wFl87eiaxnb+Megw==",
"dev": true,
"requires": {
- "@jimp/utils": "^0.8.0",
+ "@jimp/utils": "^0.8.5",
"core-js": "^2.5.7",
"pngjs": "^3.3.3"
}
},
"@jimp/tiff": {
- "version": "0.8.0",
- "resolved": "https://registry.npmjs.org/@jimp/tiff/-/tiff-0.8.0.tgz",
- "integrity": "sha512-mwCExUukFgtx4PVD8okNXpsWpbbwJPciMCz3UpAg692/zXQMWJOcWWDnMz5rfW7yEo1FnYNfXUs6cZhz6u1v9g==",
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/tiff/-/tiff-0.8.5.tgz",
+ "integrity": "sha512-Z7uzDcbHuwDg+hy2+UJQ2s5O6sqYXmv6H1fmSf/2dxBrlGMzl8yTc2/BxLrGREeoidDDMcKmXYGAOp4uCsdJjw==",
"dev": true,
"requires": {
"core-js": "^2.5.7",
@@ -1238,220 +2578,83 @@
}
},
"@jimp/types": {
- "version": "0.8.0",
- "resolved": "https://registry.npmjs.org/@jimp/types/-/types-0.8.0.tgz",
- "integrity": "sha512-/7xBLhBNLYq2Gldz66w3c8O19k85tbH2uFxKCkrVcOzDYY3/1c+wS86JRxoaIMz3UG2YUAOwxqWxWsga3A5sQA==",
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/types/-/types-0.8.5.tgz",
+ "integrity": "sha512-XUvpyebZGd1vyFiJyxUT4H9A3mKD7MV2MxjXnay3fNTrcow0UJJspmFw/w+G3TP/1dgrVC4K++gntjR6QWTzvg==",
"dev": true,
"requires": {
- "@jimp/bmp": "^0.8.0",
- "@jimp/gif": "^0.8.0",
- "@jimp/jpeg": "^0.8.0",
- "@jimp/png": "^0.8.0",
- "@jimp/tiff": "^0.8.0",
+ "@jimp/bmp": "^0.8.5",
+ "@jimp/gif": "^0.8.5",
+ "@jimp/jpeg": "^0.8.5",
+ "@jimp/png": "^0.8.5",
+ "@jimp/tiff": "^0.8.5",
"core-js": "^2.5.7",
"timm": "^1.6.1"
}
},
"@jimp/utils": {
- "version": "0.8.0",
- "resolved": "https://registry.npmjs.org/@jimp/utils/-/utils-0.8.0.tgz",
- "integrity": "sha512-mkn1obBJjL8rPXtPc8Rnm+7kuzrhiioARvZTEgXXH8kRh5LzT+2FVPNkebLlHLVGDumTVPKOaQLPtctx5dEsgA==",
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/@jimp/utils/-/utils-0.8.5.tgz",
+ "integrity": "sha512-D3+H4BiopDkhUKvKkZTPPJ53voqOkfMuk3r7YZNcLtXGLkchjjukC4056lNo7B0DzjBgowTYsQM3JjKnYNIYeg==",
"dev": true,
"requires": {
"core-js": "^2.5.7"
}
},
- "@polka/redirect": {
- "version": "1.0.0-next.7",
- "resolved": "https://registry.npmjs.org/@polka/redirect/-/redirect-1.0.0-next.7.tgz",
- "integrity": "sha512-sHh1oVy9VBVhn41fOlrUdlxFkcbKrYdBcqePTSxvf2NqKu7UcMPZse/wDeQZk17A8cqDArKsR4m0MXd+3/Q83g=="
- },
- "@polka/send": {
- "version": "1.0.0-next.7",
- "resolved": "https://registry.npmjs.org/@polka/send/-/send-1.0.0-next.7.tgz",
- "integrity": "sha512-X/7sxWMfzuHuMXSls3SuOgfwcoNakuaNWciVS/KX3RML8NIPKQYgbhpqYPCujtXK9Z/KvW3/gzr2TUpabIJRMg=="
- },
- "@polka/url": {
- "version": "1.0.0-next.9",
- "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.9.tgz",
- "integrity": "sha512-VZqSaulg2kVQYMulmuZcvapPwH5/y81YHANiFIKz1GNZoG/F4o1JSeLlrvXJ8tC+RPUjxdrebfT3Qn+bnMi0bA=="
- },
- "@rollup/plugin-babel": {
- "version": "5.2.0",
- "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.2.0.tgz",
- "integrity": "sha512-CPABsajaKjINgBQ3it+yMnfVO3ibsrMBxRzbUOUw2cL1hsZJ7aogU8mgglQm3S2hHJgjnAmxPz0Rq7DVdmHsTw==",
- "dev": true,
- "requires": {
- "@babel/helper-module-imports": "^7.10.4",
- "@rollup/pluginutils": "^3.1.0"
- },
- "dependencies": {
- "@babel/helper-module-imports": {
- "version": "7.10.4",
- "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.4.tgz",
- "integrity": "sha512-nEQJHqYavI217oD9+s5MUBzk6x1IlvoS9WTPfgG43CbMEeStE0v+r+TucWdx8KFGowPGvyOkDT9+7DHedIDnVw==",
- "dev": true,
- "requires": {
- "@babel/types": "^7.10.4"
- }
- },
- "@babel/types": {
- "version": "7.11.5",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz",
- "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==",
- "dev": true,
- "requires": {
- "@babel/helper-validator-identifier": "^7.10.4",
- "lodash": "^4.17.19",
- "to-fast-properties": "^2.0.0"
- }
- }
- }
- },
- "@rollup/plugin-commonjs": {
- "version": "15.0.0",
- "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-15.0.0.tgz",
- "integrity": "sha512-8uAdikHqVyrT32w1zB9VhW6uGwGjhKgnDNP4pQJsjdnyF4FgCj6/bmv24c7v2CuKhq32CcyCwRzMPEElaKkn0w==",
+ "@rollup/pluginutils": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.1.1.tgz",
+ "integrity": "sha512-clDjivHqWGXi7u+0d2r2sBi4Ie6VLEAzWMIkvJLnDmxoOhBYOTfzGbOQBA32THHm11/LiJbd01tJUpJsbshSWQ==",
"dev": true,
"requires": {
- "@rollup/pluginutils": "^3.1.0",
- "commondir": "^1.0.1",
"estree-walker": "^2.0.1",
- "glob": "^7.1.6",
- "is-reference": "^1.2.1",
- "magic-string": "^0.25.7",
- "resolve": "^1.17.0"
+ "picomatch": "^2.2.2"
},
"dependencies": {
"estree-walker": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.1.tgz",
- "integrity": "sha512-tF0hv+Yi2Ot1cwj9eYHtxC0jB9bmjacjQs6ZBTj82H8JwUywFuc+7E83NWfNMwHXZc11mjfFcVXPe9gEP4B8dg==",
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
+ "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",
"dev": true
- },
- "glob": {
- "version": "7.1.6",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
- "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
- "dev": true,
- "requires": {
- "fs.realpath": "^1.0.0",
- "inflight": "^1.0.4",
- "inherits": "2",
- "minimatch": "^3.0.4",
- "once": "^1.3.0",
- "path-is-absolute": "^1.0.0"
- }
- },
- "is-reference": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz",
- "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==",
- "dev": true,
- "requires": {
- "@types/estree": "*"
- }
- },
- "magic-string": {
- "version": "0.25.7",
- "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz",
- "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==",
- "dev": true,
- "requires": {
- "sourcemap-codec": "^1.4.4"
- }
- },
- "resolve": {
- "version": "1.17.0",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz",
- "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==",
- "dev": true,
- "requires": {
- "path-parse": "^1.0.6"
- }
- }
- }
- },
- "@rollup/plugin-json": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-4.1.0.tgz",
- "integrity": "sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw==",
- "dev": true,
- "requires": {
- "@rollup/pluginutils": "^3.0.8"
- }
- },
- "@rollup/plugin-node-resolve": {
- "version": "9.0.0",
- "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-9.0.0.tgz",
- "integrity": "sha512-gPz+utFHLRrd41WMP13Jq5mqqzHL3OXrfj3/MkSyB6UBIcuNt9j60GCbarzMzdf1VHFpOxfQh/ez7wyadLMqkg==",
- "dev": true,
- "requires": {
- "@rollup/pluginutils": "^3.1.0",
- "@types/resolve": "1.17.1",
- "builtin-modules": "^3.1.0",
- "deepmerge": "^4.2.2",
- "is-module": "^1.0.0",
- "resolve": "^1.17.0"
- },
- "dependencies": {
- "resolve": {
- "version": "1.17.0",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz",
- "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==",
- "dev": true,
- "requires": {
- "path-parse": "^1.0.6"
- }
}
}
},
- "@rollup/plugin-replace": {
- "version": "2.3.3",
- "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-2.3.3.tgz",
- "integrity": "sha512-XPmVXZ7IlaoWaJLkSCDaa0Y6uVo5XQYHhiMFzOd5qSv5rE+t/UJToPIOE56flKIxBFQI27ONsxb7dqHnwSsjKQ==",
+ "@sindresorhus/slugify": {
+ "version": "0.9.1",
+ "resolved": "https://registry.npmjs.org/@sindresorhus/slugify/-/slugify-0.9.1.tgz",
+ "integrity": "sha512-b6heYM9dzZD13t2GOiEQTDE0qX+I1GyOotMwKh9VQqzuNiVdPVT8dM43fe9HNb/3ul+Qwd5oKSEDrDIfhq3bnQ==",
"dev": true,
"requires": {
- "@rollup/pluginutils": "^3.0.8",
- "magic-string": "^0.25.5"
- },
- "dependencies": {
- "magic-string": {
- "version": "0.25.7",
- "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz",
- "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==",
- "dev": true,
- "requires": {
- "sourcemap-codec": "^1.4.4"
- }
- }
+ "escape-string-regexp": "^1.0.5",
+ "lodash.deburr": "^4.1.0"
}
},
- "@rollup/pluginutils": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz",
- "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==",
+ "@sveltejs/adapter-node": {
+ "version": "1.0.0-next.55",
+ "resolved": "https://registry.npmjs.org/@sveltejs/adapter-node/-/adapter-node-1.0.0-next.55.tgz",
+ "integrity": "sha512-Kmh8lx8kIY7W6rkqjC78y4dQTyjiAHD9D1WfmUTtYuDW1jAIG+YbZmPC9127kH5KOSGK4+tI8mpReDVB1lgf8g==",
"dev": true,
"requires": {
- "@types/estree": "0.0.39",
- "estree-walker": "^1.0.1",
- "picomatch": "^2.2.2"
+ "esbuild": "^0.13.4",
+ "tiny-glob": "^0.2.9"
}
},
- "@sindresorhus/slugify": {
- "version": "0.9.1",
- "resolved": "https://registry.npmjs.org/@sindresorhus/slugify/-/slugify-0.9.1.tgz",
- "integrity": "sha512-b6heYM9dzZD13t2GOiEQTDE0qX+I1GyOotMwKh9VQqzuNiVdPVT8dM43fe9HNb/3ul+Qwd5oKSEDrDIfhq3bnQ==",
+ "@sveltejs/kit": {
+ "version": "1.0.0-next.201",
+ "resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-1.0.0-next.201.tgz",
+ "integrity": "sha512-WcYexOEPWgDWOk0oOteTU5QwWykdIcOFJig+akeHqwE/jVtPURLZFtTNx0ymUWXN4S+dUXf60KF6HEMv74FHpA==",
"dev": true,
"requires": {
- "escape-string-regexp": "^1.0.5",
- "lodash.deburr": "^4.1.0"
+ "@sveltejs/vite-plugin-svelte": "^1.0.0-next.30",
+ "cheap-watch": "^1.0.4",
+ "sade": "^1.7.4",
+ "vite": "^2.6.12"
}
},
"@sveltejs/site-kit": {
- "version": "1.2.5",
- "resolved": "https://registry.npmjs.org/@sveltejs/site-kit/-/site-kit-1.2.5.tgz",
- "integrity": "sha512-fA1YWW4tYOxPRVocx+jF4S2LGamku8xeKx/+J5aY7ZCbwuo/c4VF+T0K7WuQRI8U6Dw3pJqdiCra+xH4TnCGRw==",
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/@sveltejs/site-kit/-/site-kit-1.4.1.tgz",
+ "integrity": "sha512-K2HplwTqWS5Jw38+GB1LwnojVfTJPxZ3d9FtjbjXoaJ8pCHTBJ+khAV8zeWLlOWkYpJuGD04EZTS87sW7mfVDA==",
"dev": true,
"requires": {
"@sindresorhus/slugify": "^0.9.1",
@@ -1459,98 +2662,63 @@
}
},
"@sveltejs/svelte-repl": {
- "version": "0.2.1",
- "resolved": "https://registry.npmjs.org/@sveltejs/svelte-repl/-/svelte-repl-0.2.1.tgz",
- "integrity": "sha512-ShNjMdsEAzGLu2PoogJEuWcV47E+1CsO8dNJ2wZcs7xyPsvuswp6KV1jFsBQmWZ+jLqtnRhlo6w2Mf43XOS/Dg==",
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/@sveltejs/svelte-repl/-/svelte-repl-0.4.1.tgz",
+ "integrity": "sha512-NsnWS3emGPKW8oZAekf9DcQlm8RoAivaolxpNT1DvEAwpAqPPaFWtHC5JccqzhHKJGVMmBHq92AcYV1ULCsdhg==",
"dev": true,
"requires": {
"codemirror": "^5.49.2",
"estree-walker": "^0.9.0",
- "marked": "^0.8.2",
+ "marked": "^4.0.0",
"sourcemap-codec": "^1.4.6",
"svelte-json-tree": "0.0.5",
"yootils": "0.0.16"
- },
- "dependencies": {
- "estree-walker": {
- "version": "0.9.0",
- "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.9.0.tgz",
- "integrity": "sha512-12U47o7XHUX329+x3FzNVjCx3SHEzMF0nkDv7r/HnBzX/xNTKxajBk6gyygaxrAFtLj39219oMfbtxv4KpaOiA==",
- "dev": true
- },
- "marked": {
- "version": "0.8.2",
- "resolved": "https://registry.npmjs.org/marked/-/marked-0.8.2.tgz",
- "integrity": "sha512-EGwzEeCcLniFX51DhTpmTom+dSA/MG/OBUDjnWtHbEnjAH180VzUeAw+oE4+Zv+CoYBWyRlYOTR0N8SO9R1PVw==",
- "dev": true
- },
- "sourcemap-codec": {
- "version": "1.4.8",
- "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz",
- "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==",
- "dev": true
- }
}
},
- "@types/estree": {
- "version": "0.0.39",
- "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz",
- "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==",
- "dev": true
+ "@sveltejs/vite-plugin-svelte": {
+ "version": "1.0.0-next.30",
+ "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-1.0.0-next.30.tgz",
+ "integrity": "sha512-YQqdMxjL1VgSFk4/+IY3yLwuRRapPafPiZTiaGEq1psbJYSNYUWx9F1zMm32GMsnogg3zn99mGJOqe3ld3HZSg==",
+ "dev": true,
+ "requires": {
+ "@rollup/pluginutils": "^4.1.1",
+ "debug": "^4.3.2",
+ "kleur": "^4.1.4",
+ "magic-string": "^0.25.7",
+ "require-relative": "^0.8.7",
+ "svelte-hmr": "^0.14.7"
+ }
},
"@types/node": {
- "version": "12.6.2",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-12.6.2.tgz",
- "integrity": "sha512-gojym4tX0FWeV2gsW4Xmzo5wxGjXGm550oVUII7f7G5o4BV6c7DBdiG1RRQd+y1bvqRyYtPfMK85UM95vsapqQ==",
+ "version": "16.11.11",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.11.tgz",
+ "integrity": "sha512-KB0sixD67CeecHC33MYn+eYARkqTheIRNuu97y2XMjR7Wu3XibO1vaY6VBV6O/a89SPI81cEUIYT87UqUWlZNw==",
"dev": true
},
"@types/pg": {
- "version": "7.11.1",
- "resolved": "https://registry.npmjs.org/@types/pg/-/pg-7.11.1.tgz",
- "integrity": "sha512-ayO8XV0xuJV3cEY4wySyD/7MA1HL75UpvJ5JAme00kNWA5pddlGtN4BRG97xgGe2NHgwxN8AkdjTQUEDypM8Uw==",
+ "version": "8.6.1",
+ "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.6.1.tgz",
+ "integrity": "sha512-1Kc4oAGzAl7uqUStZCDvaLFqZrW9qWSjXOmBfdgyBP5La7Us6Mg4GBvRlSoaZMhQF/zSj1C8CtKMBkoiT8eL8w==",
"dev": true,
"requires": {
"@types/node": "*",
- "@types/pg-types": "*"
- }
- },
- "@types/pg-types": {
- "version": "1.11.4",
- "resolved": "https://registry.npmjs.org/@types/pg-types/-/pg-types-1.11.4.tgz",
- "integrity": "sha512-WdIiQmE347LGc1Vq3Ki8sk3iyCuLgnccqVzgxek6gEHp2H0p3MQ3jniIHt+bRODXKju4kNQ+mp53lmP5+/9moQ==",
- "dev": true,
- "requires": {
- "moment": ">=2.14.0"
+ "pg-protocol": "*",
+ "pg-types": "^2.2.0"
}
},
- "@types/resolve": {
- "version": "1.17.1",
- "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz",
- "integrity": "sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==",
- "dev": true,
- "requires": {
- "@types/node": "*"
- }
- },
- "ansi-colors": {
- "version": "3.2.3",
- "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz",
- "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==",
- "dev": true
- },
"ansi-regex": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
- "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"dev": true
},
"ansi-styles": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
- "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"requires": {
- "color-convert": "^1.9.0"
+ "color-convert": "^2.0.1"
}
},
"any-base": {
@@ -1559,52 +2727,16 @@
"integrity": "sha512-uMgjozySS8adZZYePpaWs8cxB9/kdzmpX6SgJZ+wbz1K5eYk5QMYDVJaZKhxyIHUdnnJkfR7SVgStgH7LkGUyg==",
"dev": true
},
- "argparse": {
- "version": "1.0.10",
- "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
- "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
- "dev": true,
- "requires": {
- "sprintf-js": "~1.0.2"
- }
- },
- "array-filter": {
- "version": "0.0.1",
- "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz",
- "integrity": "sha1-fajPLiZijtcygDWB/SH2fKzS7uw=",
- "dev": true
- },
- "array-map": {
- "version": "0.0.0",
- "resolved": "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz",
- "integrity": "sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI=",
- "dev": true
- },
- "array-reduce": {
- "version": "0.0.0",
- "resolved": "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz",
- "integrity": "sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys=",
- "dev": true
- },
- "babel-plugin-dynamic-import-node": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.0.tgz",
- "integrity": "sha512-o6qFkpeQEBxcqt0XYlWzAVxNCSCZdUgcR8IRlhD/8DylxjjO4foPcvTW0GGKa/cVt3rvxZ7o5ippJ+/0nvLhlQ==",
- "dev": true,
- "requires": {
- "object.assign": "^4.1.0"
- }
- },
"balanced-match": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
- "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
+ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
"dev": true
},
"base64-js": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz",
- "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==",
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
+ "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
"dev": true
},
"bmp-js": {
@@ -1623,31 +2755,14 @@
"concat-map": "0.0.1"
}
},
- "browser-stdout": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz",
- "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==",
- "dev": true
- },
- "browserslist": {
- "version": "4.7.0",
- "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.7.0.tgz",
- "integrity": "sha512-9rGNDtnj+HaahxiVV38Gn8n8Lr8REKsel68v1sPFfIGEK6uSXTY3h9acgiT1dZVtOOUtifo/Dn8daDQ5dUgVsA==",
- "dev": true,
- "requires": {
- "caniuse-lite": "^1.0.30000989",
- "electron-to-chromium": "^1.3.247",
- "node-releases": "^1.1.29"
- }
- },
"buffer": {
- "version": "5.4.2",
- "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.4.2.tgz",
- "integrity": "sha512-iy9koArjAFCzGnx3ZvNA6Z0clIbbFgbdWQ0mKD3hO0krOrZh8UgA6qMKcZvwLJxS+D6iVR76+5/pV56yMNYTag==",
+ "version": "5.7.1",
+ "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
+ "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
"dev": true,
"requires": {
- "base64-js": "^1.0.2",
- "ieee754": "^1.1.4"
+ "base64-js": "^1.3.1",
+ "ieee754": "^1.1.13"
}
},
"buffer-equal": {
@@ -1661,138 +2776,47 @@
"resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz",
"integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk="
},
- "buffer-from": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
- "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
- "dev": true
- },
"buffer-writer": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz",
"integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw=="
},
- "builtin-modules": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.1.0.tgz",
- "integrity": "sha512-k0KL0aWZuBt2lrxrcASWDfwOLMnodeQjodT/1SxEQAXsHANgo6ZC/VEaSEHCXt7aSTZ4/4H5LKa+tBXmW7Vtvw==",
- "dev": true
- },
- "camel-case": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz",
- "integrity": "sha1-yjw2iKTpzzpM2nd9xNy8cTJJz3M=",
- "dev": true,
- "requires": {
- "no-case": "^2.2.0",
- "upper-case": "^1.1.1"
- }
- },
- "camelcase": {
- "version": "5.3.1",
- "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
- "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
- "dev": true
- },
- "caniuse-lite": {
- "version": "1.0.30000989",
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000989.tgz",
- "integrity": "sha512-vrMcvSuMz16YY6GSVZ0dWDTJP8jqk3iFQ/Aq5iqblPwxSVVZI+zxDyTX0VPqtQsDnfdrBDcsmhgTEOh5R8Lbpw==",
- "dev": true
- },
- "chalk": {
- "version": "2.4.2",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
- "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "^3.2.1",
- "escape-string-regexp": "^1.0.5",
- "supports-color": "^5.3.0"
- }
- },
- "chownr": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.2.tgz",
- "integrity": "sha512-GkfeAQh+QNy3wquu9oIZr6SS5x7wGdSgNQvD10X3r+AZr1Oys22HW8kAmDMvNg2+Dm0TeGaEuO8gFwdBXxwO8A==",
+ "cheap-watch": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/cheap-watch/-/cheap-watch-1.0.4.tgz",
+ "integrity": "sha512-QR/9FrtRL5fjfUJBhAKCdi0lSRQ3rVRRum3GF9wDKp2TJbEIMGhUEr2yU8lORzm9Isdjx7/k9S0DFDx+z5VGtw==",
"dev": true
},
- "clean-css": {
- "version": "4.2.3",
- "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.3.tgz",
- "integrity": "sha512-VcMWDN54ZN/DS+g58HYL5/n4Zrqe8vHJpGA8KdgUXFU4fuP/aHNw8eld9SyEIyabIMJX/0RaY/fplOo5hYLSFA==",
- "dev": true,
- "requires": {
- "source-map": "~0.6.0"
- },
- "dependencies": {
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- }
- }
- },
- "clipboard": {
- "version": "2.0.6",
- "resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.6.tgz",
- "integrity": "sha512-g5zbiixBRk/wyKakSwCKd7vQXDjFnAMGHoEyBogG/bw9kTD9GvdAvaoRR1ALcEzt3pVKxZR0pViekPMIS0QyGg==",
- "optional": true,
- "requires": {
- "good-listener": "^1.2.2",
- "select": "^1.1.2",
- "tiny-emitter": "^2.0.0"
- }
- },
"cliui": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz",
- "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==",
+ "version": "7.0.4",
+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",
+ "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==",
"dev": true,
"requires": {
- "string-width": "^2.1.1",
- "strip-ansi": "^4.0.0",
- "wrap-ansi": "^2.0.0"
- }
- },
- "code-point-at": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
- "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
- "dev": true
+ "string-width": "^4.2.0",
+ "strip-ansi": "^6.0.0",
+ "wrap-ansi": "^7.0.0"
+ }
},
"codemirror": {
- "version": "5.57.0",
- "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.57.0.tgz",
- "integrity": "sha512-WGc6UL7Hqt+8a6ZAsj/f1ApQl3NPvHY/UQSzG6fB6l4BjExgVdhFaxd7mRTw1UCiYe/6q86zHP+kfvBQcZGvUg==",
+ "version": "5.64.0",
+ "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.64.0.tgz",
+ "integrity": "sha512-fqr6CtDQdJ6iNMbD8NX2gH2G876nNDk+TO1rrYkgWnqQdO3O1Xa9tK6q+psqhJJgE5SpbaDcgdfLmukoUVE8pg==",
"dev": true
},
"color-convert": {
- "version": "1.9.3",
- "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
- "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"requires": {
- "color-name": "1.1.3"
+ "color-name": "~1.1.4"
}
},
"color-name": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
- "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
- "dev": true
- },
- "commander": {
- "version": "2.20.3",
- "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
- "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
- "dev": true
- },
- "commondir": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
- "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=",
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true
},
"concat-map": {
@@ -1801,137 +2825,53 @@
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
"dev": true
},
- "config": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/config/-/config-3.2.2.tgz",
- "integrity": "sha512-rOsfIOAcG82AWouK4/vBS/OKz3UPl2T/kP0irExmXJJOoWg2CmdfPLdx56bCoMUMFNh+7soQkQWCUC8DyemiwQ==",
- "dev": true,
- "optional": true,
- "requires": {
- "json5": "^1.0.1"
- },
- "dependencies": {
- "json5": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
- "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
- "dev": true,
- "optional": true,
- "requires": {
- "minimist": "^1.2.0"
- }
- }
- }
- },
- "convert-source-map": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz",
- "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==",
- "dev": true,
- "requires": {
- "safe-buffer": "~5.1.1"
- }
- },
"cookie": {
- "version": "0.4.0",
- "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz",
- "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg=="
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz",
+ "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA=="
},
"core-js": {
- "version": "2.6.9",
- "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.9.tgz",
- "integrity": "sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A==",
+ "version": "2.6.12",
+ "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz",
+ "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==",
"dev": true
},
- "core-js-compat": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.2.1.tgz",
- "integrity": "sha512-MwPZle5CF9dEaMYdDeWm73ao/IflDH+FjeJCWEADcEgFSE9TLimFKwJsfmkwzI8eC0Aj0mgvMDjeQjrElkz4/A==",
- "dev": true,
- "requires": {
- "browserslist": "^4.6.6",
- "semver": "^6.3.0"
- },
- "dependencies": {
- "semver": {
- "version": "6.3.0",
- "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
- "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
- "dev": true
- }
- }
- },
- "cross-spawn": {
- "version": "6.0.5",
- "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
- "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
- "dev": true,
- "requires": {
- "nice-try": "^1.0.4",
- "path-key": "^2.0.1",
- "semver": "^5.5.0",
- "shebang-command": "^1.2.0",
- "which": "^1.2.9"
- }
- },
"debug": {
- "version": "4.1.1",
- "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
- "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
+ "version": "4.3.3",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz",
+ "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==",
"dev": true,
"requires": {
- "ms": "^2.1.1"
+ "ms": "2.1.2"
}
},
"decamelize": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
- "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=",
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-5.0.1.tgz",
+ "integrity": "sha512-VfxadyCECXgQlkoEAjeghAr5gY3Hf+IKjKb+X8tGVDtveCjN+USwprd2q3QXBR9T1+x2DG0XZF5/w+7HAtSaXA==",
"dev": true
},
- "deepmerge": {
- "version": "4.2.2",
- "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz",
- "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==",
- "dev": true
- },
- "define-properties": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
- "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==",
- "dev": true,
- "requires": {
- "object-keys": "^1.0.12"
- }
- },
"degit": {
- "version": "2.1.4",
- "resolved": "https://registry.npmjs.org/degit/-/degit-2.1.4.tgz",
- "integrity": "sha512-jshBiyZtnIYljRQf9M6QQB7qcEMs0V6QbEHouufeapFUgFfpkdLB7Mx1mO9d/QYR9DPjV93P4qFhBQZUIczhSg==",
- "dev": true,
- "requires": {
- "chalk": "2.4.2",
- "home-or-tmp": "3.0.0",
- "mri": "1.1.4",
- "sander": "0.6.0",
- "tar": "4.4.10"
- }
+ "version": "2.8.4",
+ "resolved": "https://registry.npmjs.org/degit/-/degit-2.8.4.tgz",
+ "integrity": "sha512-vqYuzmSA5I50J882jd+AbAhQtgK6bdKUJIex1JNfEUPENCgYsxugzKVZlFyMwV4i06MmnV47/Iqi5Io86zf3Ng==",
+ "dev": true
},
- "delegate": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz",
- "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==",
- "optional": true
+ "dequal": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.2.tgz",
+ "integrity": "sha512-q9K8BlJVxK7hQYqa6XISGmBZbtQQWVXSrRrWreHC94rMt1QL/Impruc+7p2CYSYuVIUr+YCt6hjrs1kkdJRTug==",
+ "dev": true
},
"devalue": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/devalue/-/devalue-2.0.0.tgz",
- "integrity": "sha512-6H2FBD5DPnQS75UWJtQjoVeKZlmXoa765UgYS5RQnx6Ay9LUhUld0w1/D6cYdrY+wnu6XQNlpEBfnJUZK0YyPQ=="
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/devalue/-/devalue-2.0.1.tgz",
+ "integrity": "sha512-I2TiqT5iWBEyB8GRfTDP0hiLZ0YeDJZ+upDxjBfOC2lebO5LezQMv7QvIUTzdb64jQyAKLf1AHADtGN+jw6v8Q=="
},
"diff": {
- "version": "3.5.0",
- "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz",
- "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==",
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz",
+ "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==",
"dev": true
},
"do-not-zip": {
@@ -1940,15 +2880,15 @@
"integrity": "sha512-Pgd81ET43bhAGaN2Hq1zluSX1FmD7kl7KcV9ER/lawiLsRUB9pRA5y8r6us29Xk6BrINZETO8TjhYwtwafWUww=="
},
"dom-walk": {
- "version": "0.1.1",
- "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.1.tgz",
- "integrity": "sha1-ZyIm3HTI95mtNTB9+TaroRrNYBg=",
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.2.tgz",
+ "integrity": "sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w==",
"dev": true
},
"dotenv": {
- "version": "8.1.0",
- "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.1.0.tgz",
- "integrity": "sha512-GUE3gqcDCaMltj2++g6bRQ5rBJWtkWTmqmD0fo1RnnMuUqHNCt2oTPeDnS9n6fKYvlhn7AeBkb38lymBtWBQdA==",
+ "version": "10.0.0",
+ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz",
+ "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==",
"dev": true
},
"ecdsa-sig-formatter": {
@@ -1959,60 +2899,161 @@
"safe-buffer": "^5.0.1"
}
},
- "electron-to-chromium": {
- "version": "1.3.252",
- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.252.tgz",
- "integrity": "sha512-NWJ5TztDnjExFISZHFwpoJjMbLUifsNBnx7u2JI0gCw6SbKyQYYWWtBHasO/jPtHym69F4EZuTpRNGN11MT/jg==",
- "dev": true
- },
"emoji-regex": {
- "version": "7.0.3",
- "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz",
- "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==",
- "dev": true
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
+ "dev": true
+ },
+ "esbuild": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.13.15.tgz",
+ "integrity": "sha512-raCxt02HBKv8RJxE8vkTSCXGIyKHdEdGfUmiYb8wnabnaEmHzyW7DCHb5tEN0xU8ryqg5xw54mcwnYkC4x3AIw==",
+ "dev": true,
+ "requires": {
+ "esbuild-android-arm64": "0.13.15",
+ "esbuild-darwin-64": "0.13.15",
+ "esbuild-darwin-arm64": "0.13.15",
+ "esbuild-freebsd-64": "0.13.15",
+ "esbuild-freebsd-arm64": "0.13.15",
+ "esbuild-linux-32": "0.13.15",
+ "esbuild-linux-64": "0.13.15",
+ "esbuild-linux-arm": "0.13.15",
+ "esbuild-linux-arm64": "0.13.15",
+ "esbuild-linux-mips64le": "0.13.15",
+ "esbuild-linux-ppc64le": "0.13.15",
+ "esbuild-netbsd-64": "0.13.15",
+ "esbuild-openbsd-64": "0.13.15",
+ "esbuild-sunos-64": "0.13.15",
+ "esbuild-windows-32": "0.13.15",
+ "esbuild-windows-64": "0.13.15",
+ "esbuild-windows-arm64": "0.13.15"
+ }
+ },
+ "esbuild-android-arm64": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.13.15.tgz",
+ "integrity": "sha512-m602nft/XXeO8YQPUDVoHfjyRVPdPgjyyXOxZ44MK/agewFFkPa8tUo6lAzSWh5Ui5PB4KR9UIFTSBKh/RrCmg==",
+ "dev": true,
+ "optional": true
},
- "end-of-stream": {
- "version": "1.4.1",
- "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz",
- "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==",
+ "esbuild-darwin-64": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.13.15.tgz",
+ "integrity": "sha512-ihOQRGs2yyp7t5bArCwnvn2Atr6X4axqPpEdCFPVp7iUj4cVSdisgvEKdNR7yH3JDjW6aQDw40iQFoTqejqxvQ==",
"dev": true,
- "requires": {
- "once": "^1.4.0"
- }
+ "optional": true
},
- "error-ex": {
- "version": "1.3.2",
- "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
- "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
+ "esbuild-darwin-arm64": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.13.15.tgz",
+ "integrity": "sha512-i1FZssTVxUqNlJ6cBTj5YQj4imWy3m49RZRnHhLpefFIh0To05ow9DTrXROTE1urGTQCloFUXTX8QfGJy1P8dQ==",
"dev": true,
- "requires": {
- "is-arrayish": "^0.2.1"
- }
+ "optional": true
},
- "es-abstract": {
- "version": "1.13.0",
- "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz",
- "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==",
+ "esbuild-freebsd-64": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.13.15.tgz",
+ "integrity": "sha512-G3dLBXUI6lC6Z09/x+WtXBXbOYQZ0E8TDBqvn7aMaOCzryJs8LyVXKY4CPnHFXZAbSwkCbqiPuSQ1+HhrNk7EA==",
"dev": true,
- "requires": {
- "es-to-primitive": "^1.2.0",
- "function-bind": "^1.1.1",
- "has": "^1.0.3",
- "is-callable": "^1.1.4",
- "is-regex": "^1.0.4",
- "object-keys": "^1.0.12"
- }
+ "optional": true
},
- "es-to-primitive": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz",
- "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==",
+ "esbuild-freebsd-arm64": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.13.15.tgz",
+ "integrity": "sha512-KJx0fzEDf1uhNOZQStV4ujg30WlnwqUASaGSFPhznLM/bbheu9HhqZ6mJJZM32lkyfGJikw0jg7v3S0oAvtvQQ==",
"dev": true,
- "requires": {
- "is-callable": "^1.1.4",
- "is-date-object": "^1.0.1",
- "is-symbol": "^1.0.2"
- }
+ "optional": true
+ },
+ "esbuild-linux-32": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.13.15.tgz",
+ "integrity": "sha512-ZvTBPk0YWCLMCXiFmD5EUtB30zIPvC5Itxz0mdTu/xZBbbHJftQgLWY49wEPSn2T/TxahYCRDWun5smRa0Tu+g==",
+ "dev": true,
+ "optional": true
+ },
+ "esbuild-linux-64": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.13.15.tgz",
+ "integrity": "sha512-eCKzkNSLywNeQTRBxJRQ0jxRCl2YWdMB3+PkWFo2BBQYC5mISLIVIjThNtn6HUNqua1pnvgP5xX0nHbZbPj5oA==",
+ "dev": true,
+ "optional": true
+ },
+ "esbuild-linux-arm": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.13.15.tgz",
+ "integrity": "sha512-wUHttDi/ol0tD8ZgUMDH8Ef7IbDX+/UsWJOXaAyTdkT7Yy9ZBqPg8bgB/Dn3CZ9SBpNieozrPRHm0BGww7W/jA==",
+ "dev": true,
+ "optional": true
+ },
+ "esbuild-linux-arm64": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.13.15.tgz",
+ "integrity": "sha512-bYpuUlN6qYU9slzr/ltyLTR9YTBS7qUDymO8SV7kjeNext61OdmqFAzuVZom+OLW1HPHseBfJ/JfdSlx8oTUoA==",
+ "dev": true,
+ "optional": true
+ },
+ "esbuild-linux-mips64le": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.13.15.tgz",
+ "integrity": "sha512-KlVjIG828uFPyJkO/8gKwy9RbXhCEUeFsCGOJBepUlpa7G8/SeZgncUEz/tOOUJTcWMTmFMtdd3GElGyAtbSWg==",
+ "dev": true,
+ "optional": true
+ },
+ "esbuild-linux-ppc64le": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.13.15.tgz",
+ "integrity": "sha512-h6gYF+OsaqEuBjeesTBtUPw0bmiDu7eAeuc2OEH9S6mV9/jPhPdhOWzdeshb0BskRZxPhxPOjqZ+/OqLcxQwEQ==",
+ "dev": true,
+ "optional": true
+ },
+ "esbuild-netbsd-64": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.13.15.tgz",
+ "integrity": "sha512-3+yE9emwoevLMyvu+iR3rsa+Xwhie7ZEHMGDQ6dkqP/ndFzRHkobHUKTe+NCApSqG5ce2z4rFu+NX/UHnxlh3w==",
+ "dev": true,
+ "optional": true
+ },
+ "esbuild-openbsd-64": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.13.15.tgz",
+ "integrity": "sha512-wTfvtwYJYAFL1fSs8yHIdf5GEE4NkbtbXtjLWjM3Cw8mmQKqsg8kTiqJ9NJQe5NX/5Qlo7Xd9r1yKMMkHllp5g==",
+ "dev": true,
+ "optional": true
+ },
+ "esbuild-sunos-64": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.13.15.tgz",
+ "integrity": "sha512-lbivT9Bx3t1iWWrSnGyBP9ODriEvWDRiweAs69vI+miJoeKwHWOComSRukttbuzjZ8r1q0mQJ8Z7yUsDJ3hKdw==",
+ "dev": true,
+ "optional": true
+ },
+ "esbuild-windows-32": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.13.15.tgz",
+ "integrity": "sha512-fDMEf2g3SsJ599MBr50cY5ve5lP1wyVwTe6aLJsM01KtxyKkB4UT+fc5MXQFn3RLrAIAZOG+tHC+yXObpSn7Nw==",
+ "dev": true,
+ "optional": true
+ },
+ "esbuild-windows-64": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.13.15.tgz",
+ "integrity": "sha512-9aMsPRGDWCd3bGjUIKG/ZOJPKsiztlxl/Q3C1XDswO6eNX/Jtwu4M+jb6YDH9hRSUflQWX0XKAfWzgy5Wk54JQ==",
+ "dev": true,
+ "optional": true
+ },
+ "esbuild-windows-arm64": {
+ "version": "0.13.15",
+ "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.13.15.tgz",
+ "integrity": "sha512-zzvyCVVpbwQQATaf3IG8mu1IwGEiDxKkYUdA4FpoCHi1KtPa13jeScYDjlW0Qh+ebWzpKfR2ZwvqAQkSWNcKjA==",
+ "dev": true,
+ "optional": true
+ },
+ "escalade": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
+ "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
+ "dev": true
},
"escape-string-regexp": {
"version": "1.0.5",
@@ -2020,45 +3061,12 @@
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
"dev": true
},
- "esm": {
- "version": "3.2.25",
- "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz",
- "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==",
- "dev": true
- },
- "esprima": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
- "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
- "dev": true
- },
"estree-walker": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz",
- "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==",
- "dev": true
- },
- "esutils": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz",
- "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=",
+ "version": "0.9.0",
+ "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.9.0.tgz",
+ "integrity": "sha512-12U47o7XHUX329+x3FzNVjCx3SHEzMF0nkDv7r/HnBzX/xNTKxajBk6gyygaxrAFtLj39219oMfbtxv4KpaOiA==",
"dev": true
},
- "execa": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz",
- "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==",
- "dev": true,
- "requires": {
- "cross-spawn": "^6.0.0",
- "get-stream": "^4.0.0",
- "is-stream": "^1.1.0",
- "npm-run-path": "^2.0.0",
- "p-finally": "^1.0.0",
- "signal-exit": "^3.0.0",
- "strip-eof": "^1.0.0"
- }
- },
"exif-parser": {
"version": "0.1.12",
"resolved": "https://registry.npmjs.org/exif-parser/-/exif-parser-0.1.12.tgz",
@@ -2071,47 +3079,11 @@
"integrity": "sha512-Qe/5NJrgIOlwijpq3B7BEpzPFcgzggOTagZmkXQY4LA6bsXKTUstK7Wp12lEJ/mLKTpvIZxmIuRcLYWT6ov9lw==",
"dev": true
},
- "find-up": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
- "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
- "dev": true,
- "requires": {
- "locate-path": "^3.0.0"
- }
- },
- "flat": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz",
- "integrity": "sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw==",
- "dev": true,
- "requires": {
- "is-buffer": "~2.0.3"
- }
- },
"flru": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/flru/-/flru-1.0.2.tgz",
"integrity": "sha512-kWyh8ADvHBFz6ua5xYOPnUroZTT/bwWfrCeL0Wj1dzG4/YOmOcfJ99W8dOVyyynJN35rZ9aCOtHChqQovV7yog=="
},
- "for-each": {
- "version": "0.3.3",
- "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz",
- "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==",
- "dev": true,
- "requires": {
- "is-callable": "^1.1.3"
- }
- },
- "fs-minipass": {
- "version": "1.2.6",
- "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.6.tgz",
- "integrity": "sha512-crhvyXcMejjv3Z5d2Fa9sf5xLYVCF5O1c71QxbVnbLsmYMBEvDAftewesN/HhY03YRoA7zOMxjNGrF5svGaaeQ==",
- "dev": true,
- "requires": {
- "minipass": "^2.2.1"
- }
- },
"fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
@@ -2119,9 +3091,9 @@
"dev": true
},
"fsevents": {
- "version": "2.1.3",
- "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz",
- "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==",
+ "version": "2.3.2",
+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
+ "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
"dev": true,
"optional": true
},
@@ -2137,346 +3109,127 @@
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
"dev": true
},
- "get-stream": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
- "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
- "dev": true,
- "requires": {
- "pump": "^3.0.0"
- }
- },
"glob": {
- "version": "7.1.4",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz",
- "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==",
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
+ "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
"dev": true,
"requires": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
- "minimatch": "^3.0.4",
- "once": "^1.3.0",
- "path-is-absolute": "^1.0.0"
- }
- },
- "global": {
- "version": "4.3.2",
- "resolved": "https://registry.npmjs.org/global/-/global-4.3.2.tgz",
- "integrity": "sha1-52mJJopsdMOJCLEwWxD8DjlOnQ8=",
- "dev": true,
- "requires": {
- "min-document": "^2.19.0",
- "process": "~0.5.1"
- }
- },
- "globals": {
- "version": "11.12.0",
- "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz",
- "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==",
- "dev": true
- },
- "golden-fleece": {
- "version": "1.0.9",
- "resolved": "https://registry.npmjs.org/golden-fleece/-/golden-fleece-1.0.9.tgz",
- "integrity": "sha512-YSwLaGMOgSBx9roJlNLL12c+FRiw7VECphinc6mGucphc/ZxTHgdEz6gmJqH6NOzYEd/yr64hwjom5pZ+tJVpg==",
- "dev": true
- },
- "good-listener": {
- "version": "1.2.2",
- "resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz",
- "integrity": "sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=",
- "optional": true,
- "requires": {
- "delegate": "^3.1.2"
- }
- },
- "graceful-fs": {
- "version": "4.1.15",
- "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz",
- "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==",
- "dev": true
- },
- "growl": {
- "version": "1.10.5",
- "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz",
- "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==",
- "dev": true
- },
- "has": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
- "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
- "dev": true,
- "requires": {
- "function-bind": "^1.1.1"
- }
- },
- "has-flag": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
- "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
- "dev": true
- },
- "has-symbols": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz",
- "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=",
- "dev": true
- },
- "he": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
- "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==",
- "dev": true
- },
- "home-or-tmp": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-3.0.0.tgz",
- "integrity": "sha1-V6j+JM8zzdUkhgoVgh3cJchmcfs=",
- "dev": true
- },
- "hosted-git-info": {
- "version": "2.7.1",
- "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz",
- "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==",
- "dev": true
- },
- "html-minifier": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/html-minifier/-/html-minifier-4.0.0.tgz",
- "integrity": "sha512-aoGxanpFPLg7MkIl/DDFYtb0iWz7jMFGqFhvEDZga6/4QTjneiD8I/NXL1x5aaoCp7FSIT6h/OhykDdPsbtMig==",
- "dev": true,
- "requires": {
- "camel-case": "^3.0.0",
- "clean-css": "^4.2.1",
- "commander": "^2.19.0",
- "he": "^1.2.0",
- "param-case": "^2.1.1",
- "relateurl": "^0.2.7",
- "uglify-js": "^3.5.1"
- }
- },
- "http-link-header": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/http-link-header/-/http-link-header-1.0.2.tgz",
- "integrity": "sha512-z6YOZ8ZEnejkcCWlGZzYXNa6i+ZaTfiTg3WhlV/YvnNya3W/RbX1bMVUMTuCrg/DrtTCQxaFCkXCz4FtLpcebg==",
- "dev": true
- },
- "httpie": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/httpie/-/httpie-1.1.2.tgz",
- "integrity": "sha512-VQ82oXG95oY1fQw/XecHuvcFBA+lZQ9Vwj1RfLcO8a7HpDd4cc2ukwpJt+TUlFaLUAzZErylxWu6wclJ1rUhUQ=="
- },
- "ieee754": {
- "version": "1.1.13",
- "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz",
- "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==",
- "dev": true
- },
- "inflight": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
- "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
- "dev": true,
- "requires": {
- "once": "^1.3.0",
- "wrappy": "1"
- }
- },
- "inherits": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
- "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
- "dev": true
- },
- "interpret": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.2.0.tgz",
- "integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==",
- "dev": true
- },
- "invariant": {
- "version": "2.2.4",
- "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz",
- "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==",
- "dev": true,
- "requires": {
- "loose-envify": "^1.0.0"
- }
- },
- "invert-kv": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz",
- "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==",
- "dev": true
- },
- "is-arrayish": {
- "version": "0.2.1",
- "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
- "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=",
- "dev": true
- },
- "is-buffer": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz",
- "integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==",
- "dev": true
- },
- "is-callable": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz",
- "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==",
- "dev": true
- },
- "is-date-object": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz",
- "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=",
- "dev": true
- },
- "is-fullwidth-code-point": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
- "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
- "dev": true
- },
- "is-function": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.1.tgz",
- "integrity": "sha1-Es+5i2W1fdPRk6MSH19uL0N2ArU=",
- "dev": true
- },
- "is-module": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz",
- "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=",
- "dev": true
+ "minimatch": "^3.0.4",
+ "once": "^1.3.0",
+ "path-is-absolute": "^1.0.0"
+ }
},
- "is-regex": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz",
- "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=",
+ "global": {
+ "version": "4.4.0",
+ "resolved": "https://registry.npmjs.org/global/-/global-4.4.0.tgz",
+ "integrity": "sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w==",
"dev": true,
"requires": {
- "has": "^1.0.1"
+ "min-document": "^2.19.0",
+ "process": "^0.11.10"
}
},
- "is-stream": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
- "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=",
+ "globalyzer": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz",
+ "integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==",
"dev": true
},
- "is-symbol": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz",
- "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==",
- "dev": true,
- "requires": {
- "has-symbols": "^1.0.0"
- }
+ "globrex": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz",
+ "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==",
+ "dev": true
},
- "isexe": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
- "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
+ "golden-fleece": {
+ "version": "1.0.9",
+ "resolved": "https://registry.npmjs.org/golden-fleece/-/golden-fleece-1.0.9.tgz",
+ "integrity": "sha512-YSwLaGMOgSBx9roJlNLL12c+FRiw7VECphinc6mGucphc/ZxTHgdEz6gmJqH6NOzYEd/yr64hwjom5pZ+tJVpg==",
"dev": true
},
- "jest-worker": {
- "version": "26.3.0",
- "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.3.0.tgz",
- "integrity": "sha512-Vmpn2F6IASefL+DVBhPzI2J9/GJUsqzomdeN+P+dK8/jKxbh8R3BtFnx3FIta7wYlPU62cpJMJQo4kuOowcMnw==",
+ "has": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
+ "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
"dev": true,
"requires": {
- "@types/node": "*",
- "merge-stream": "^2.0.0",
- "supports-color": "^7.0.0"
- },
- "dependencies": {
- "has-flag": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
- "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
- "dev": true
- },
- "supports-color": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
- "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
- "dev": true,
- "requires": {
- "has-flag": "^4.0.0"
- }
- }
+ "function-bind": "^1.1.1"
}
},
- "jimp": {
- "version": "0.8.0",
- "resolved": "https://registry.npmjs.org/jimp/-/jimp-0.8.0.tgz",
- "integrity": "sha512-LrZMRVEgOIlw2Gv9ZsD6uuD3+uB6Idc3xF35UUeEqsO13kOs0GYUKDHXKyI/1n16kNFAze+vEzBzpjyewdp86g==",
+ "httpie": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/httpie/-/httpie-1.1.2.tgz",
+ "integrity": "sha512-VQ82oXG95oY1fQw/XecHuvcFBA+lZQ9Vwj1RfLcO8a7HpDd4cc2ukwpJt+TUlFaLUAzZErylxWu6wclJ1rUhUQ=="
+ },
+ "ieee754": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
+ "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
+ "dev": true
+ },
+ "inflight": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
+ "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"dev": true,
"requires": {
- "@jimp/custom": "^0.8.0",
- "@jimp/plugins": "^0.8.0",
- "@jimp/types": "^0.8.0",
- "core-js": "^2.5.7",
- "regenerator-runtime": "^0.13.3"
+ "once": "^1.3.0",
+ "wrappy": "1"
}
},
- "jpeg-js": {
- "version": "0.3.6",
- "resolved": "https://registry.npmjs.org/jpeg-js/-/jpeg-js-0.3.6.tgz",
- "integrity": "sha512-MUj2XlMB8kpe+8DJUGH/3UJm4XpI8XEgZQ+CiHDeyrGoKPdW/8FJv6ku+3UiYm5Fz3CWaL+iXmD8Q4Ap6aC1Jw==",
- "dev": true
- },
- "js-levenshtein": {
- "version": "1.1.6",
- "resolved": "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.6.tgz",
- "integrity": "sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==",
- "dev": true
+ "inherits": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
},
- "js-tokens": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
- "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
+ "interpret": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz",
+ "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==",
"dev": true
},
- "js-yaml": {
- "version": "3.13.1",
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz",
- "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==",
+ "is-core-module": {
+ "version": "2.8.0",
+ "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.0.tgz",
+ "integrity": "sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw==",
"dev": true,
"requires": {
- "argparse": "^1.0.7",
- "esprima": "^4.0.0"
+ "has": "^1.0.3"
}
},
- "jsesc": {
- "version": "2.5.2",
- "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz",
- "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==",
+ "is-fullwidth-code-point": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"dev": true
},
- "json-parse-better-errors": {
+ "is-function": {
"version": "1.0.2",
- "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz",
- "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==",
+ "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.2.tgz",
+ "integrity": "sha512-lw7DUp0aWXYg+CBCN+JKkcE0Q2RayZnSvnZBlwgxHBQhqt5pZNVy4Ri7H9GmmXkdu7LUthszM+Tor1u/2iBcpQ==",
"dev": true
},
- "json5": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.0.tgz",
- "integrity": "sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ==",
+ "jimp": {
+ "version": "0.8.5",
+ "resolved": "https://registry.npmjs.org/jimp/-/jimp-0.8.5.tgz",
+ "integrity": "sha512-BW7t/+TCgKpqZw/wHFwqF/A/Tyk43RmzRHyMBdqfOepqunUrajt0RTqowdWyFo4CS2FmD8pFiYfefWjpXFWrCA==",
"dev": true,
"requires": {
- "minimist": "^1.2.0"
+ "@jimp/custom": "^0.8.5",
+ "@jimp/plugins": "^0.8.5",
+ "@jimp/types": "^0.8.5",
+ "core-js": "^2.5.7",
+ "regenerator-runtime": "^0.13.3"
}
},
- "jsonify": {
- "version": "0.0.0",
- "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz",
- "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=",
+ "jpeg-js": {
+ "version": "0.3.7",
+ "resolved": "https://registry.npmjs.org/jpeg-js/-/jpeg-js-0.3.7.tgz",
+ "integrity": "sha512-9IXdWudL61npZjvLuVe/ktHiA41iE8qFyLB+4VDTblEsWBzeg8WQTlktdUK4CdncUqtUgUg0bbOmTE2bKBKaBQ==",
"dev": true
},
"jsonwebtoken": {
@@ -2515,19 +3268,16 @@
"safe-buffer": "^5.0.1"
}
},
- "lcid": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz",
- "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==",
- "dev": true,
- "requires": {
- "invert-kv": "^2.0.0"
- }
+ "kleur": {
+ "version": "4.1.4",
+ "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.4.tgz",
+ "integrity": "sha512-8QADVssbrFjivHWQU7KkMgptGTl6WAcSdlbBPY4uNF+mWr6DGcKrvY2w4FQJoXch7+fKMjj0dRrL75vk3k23OA==",
+ "dev": true
},
"load-bmfont": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/load-bmfont/-/load-bmfont-1.4.0.tgz",
- "integrity": "sha512-kT63aTAlNhZARowaNYcY29Fn/QYkc52M3l6V1ifRcPewg2lvUZDAj7R6dXjOL9D0sict76op3T5+odumDSF81g==",
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/load-bmfont/-/load-bmfont-1.4.1.tgz",
+ "integrity": "sha512-8UyQoYmdRDy81Brz6aLAUhfZLwr5zV0L3taTQ4hju7m6biuwiWiJXjPhBJxbUQJA8PrkvJ/7Enqmwk2sM14soA==",
"dev": true,
"requires": {
"buffer-equal": "0.0.1",
@@ -2538,44 +3288,8 @@
"phin": "^2.9.1",
"xhr": "^2.0.1",
"xtend": "^4.0.0"
- },
- "dependencies": {
- "mime": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
- "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
- "dev": true
- }
- }
- },
- "load-json-file": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz",
- "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=",
- "dev": true,
- "requires": {
- "graceful-fs": "^4.1.2",
- "parse-json": "^4.0.0",
- "pify": "^3.0.0",
- "strip-bom": "^3.0.0"
- }
- },
- "locate-path": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
- "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
- "dev": true,
- "requires": {
- "p-locate": "^3.0.0",
- "path-exists": "^3.0.0"
}
},
- "lodash": {
- "version": "4.17.19",
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
- "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==",
- "dev": true
- },
"lodash.deburr": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/lodash.deburr/-/lodash.deburr-4.1.0.tgz",
@@ -2617,76 +3331,24 @@
"resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz",
"integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w="
},
- "log-symbols": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz",
- "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==",
- "dev": true,
- "requires": {
- "chalk": "^2.0.1"
- }
- },
- "loose-envify": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
- "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
- "dev": true,
- "requires": {
- "js-tokens": "^3.0.0 || ^4.0.0"
- }
- },
- "lower-case": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-1.1.4.tgz",
- "integrity": "sha1-miyr0bno4K6ZOkv31YdcOcQujqw=",
- "dev": true
- },
- "map-age-cleaner": {
- "version": "0.1.3",
- "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz",
- "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==",
+ "magic-string": {
+ "version": "0.25.7",
+ "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz",
+ "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==",
"dev": true,
"requires": {
- "p-defer": "^1.0.0"
+ "sourcemap-codec": "^1.4.4"
}
},
"marked": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/marked/-/marked-1.1.1.tgz",
- "integrity": "sha512-mJzT8D2yPxoPh7h0UXkB+dBj4FykPJ2OIfxAWeIHrvoHDkFxukV/29QxoFQoPM6RLEwhIFdJpmKBlqVM3s2ZIw=="
- },
- "mem": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz",
- "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==",
- "dev": true,
- "requires": {
- "map-age-cleaner": "^0.1.1",
- "mimic-fn": "^2.0.0",
- "p-is-promise": "^2.0.0"
- }
- },
- "memorystream": {
- "version": "0.3.1",
- "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz",
- "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=",
- "dev": true
- },
- "merge-stream": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
- "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==",
- "dev": true
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.6.tgz",
+ "integrity": "sha512-+H0bTf8DM8zLuFBUm/2VklxaCrwlBFgoJzHJcMZCnZ9cPgsllHwKpL6TPLdDeA38yPluMuVKOL1hO5w6HmG5Mg=="
},
"mime": {
- "version": "2.4.6",
- "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.6.tgz",
- "integrity": "sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA=="
- },
- "mimic-fn": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
- "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
+ "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
"dev": true
},
"min-document": {
@@ -2708,30 +3370,11 @@
}
},
"minimist": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
- "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
+ "version": "0.0.8",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
+ "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
"dev": true
},
- "minipass": {
- "version": "2.5.0",
- "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.5.0.tgz",
- "integrity": "sha512-9FwMVYhn6ERvMR8XFdOavRz4QK/VJV8elU1x50vYexf9lslDcWe/f4HBRxCPd185ekRSjU6CfYyJCECa/CQy7Q==",
- "dev": true,
- "requires": {
- "safe-buffer": "^5.1.2",
- "yallist": "^3.0.0"
- }
- },
- "minizlib": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.2.1.tgz",
- "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==",
- "dev": true,
- "requires": {
- "minipass": "^2.2.1"
- }
- },
"mkdirp": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
@@ -2739,302 +3382,54 @@
"dev": true,
"requires": {
"minimist": "0.0.8"
- },
- "dependencies": {
- "minimist": {
- "version": "0.0.8",
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
- "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
- "dev": true
- }
- }
- },
- "mocha": {
- "version": "6.2.0",
- "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.2.0.tgz",
- "integrity": "sha512-qwfFgY+7EKAAUAdv7VYMZQknI7YJSGesxHyhn6qD52DV8UcSZs5XwCifcZGMVIE4a5fbmhvbotxC0DLQ0oKohQ==",
- "dev": true,
- "requires": {
- "ansi-colors": "3.2.3",
- "browser-stdout": "1.3.1",
- "debug": "3.2.6",
- "diff": "3.5.0",
- "escape-string-regexp": "1.0.5",
- "find-up": "3.0.0",
- "glob": "7.1.3",
- "growl": "1.10.5",
- "he": "1.2.0",
- "js-yaml": "3.13.1",
- "log-symbols": "2.2.0",
- "minimatch": "3.0.4",
- "mkdirp": "0.5.1",
- "ms": "2.1.1",
- "node-environment-flags": "1.0.5",
- "object.assign": "4.1.0",
- "strip-json-comments": "2.0.1",
- "supports-color": "6.0.0",
- "which": "1.3.1",
- "wide-align": "1.1.3",
- "yargs": "13.2.2",
- "yargs-parser": "13.0.0",
- "yargs-unparser": "1.5.0"
- },
- "dependencies": {
- "debug": {
- "version": "3.2.6",
- "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
- "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
- "dev": true,
- "requires": {
- "ms": "^2.1.1"
- }
- },
- "glob": {
- "version": "7.1.3",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz",
- "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==",
- "dev": true,
- "requires": {
- "fs.realpath": "^1.0.0",
- "inflight": "^1.0.4",
- "inherits": "2",
- "minimatch": "^3.0.4",
- "once": "^1.3.0",
- "path-is-absolute": "^1.0.0"
- }
- },
- "supports-color": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz",
- "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==",
- "dev": true,
- "requires": {
- "has-flag": "^3.0.0"
- }
- }
}
},
- "moment": {
- "version": "2.24.0",
- "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz",
- "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==",
- "dev": true
- },
"mri": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.4.tgz",
- "integrity": "sha512-6y7IjGPm8AzlvoUrwAaw1tLnUBudaS3752vcd8JtrpGGQn+rXIe63LFVHm/YMwtqAuh+LJPCFdlLYPWM1nYn6w==",
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz",
+ "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==",
"dev": true
},
"ms": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
- "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg=="
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
- "nice-try": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
- "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
+ "nanoid": {
+ "version": "3.1.30",
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.30.tgz",
+ "integrity": "sha512-zJpuPDwOv8D2zq2WRoMe1HsfZthVewpel9CAvTfc/2mBD1uUT/agc5f7GHGWXlYkFvi1mVxe4IjvP2HNrop7nQ==",
"dev": true
},
- "no-case": {
- "version": "2.3.2",
- "resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz",
- "integrity": "sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==",
- "dev": true,
- "requires": {
- "lower-case": "^1.1.1"
- }
- },
- "node-environment-flags": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.5.tgz",
- "integrity": "sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ==",
+ "node-fetch": {
+ "version": "2.6.6",
+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.6.tgz",
+ "integrity": "sha512-Z8/6vRlTUChSdIgMa51jxQ4lrw/Jy5SOW10ObaA47/RElsAN2c5Pn8bTgFGWn/ibwzXTE8qwr1Yzx28vsecXEA==",
"dev": true,
"requires": {
- "object.getownpropertydescriptors": "^2.0.3",
- "semver": "^5.7.0"
+ "whatwg-url": "^5.0.0"
}
},
- "node-fetch": {
- "version": "2.6.1",
- "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
- "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==",
- "dev": true
- },
"node-pg-migrate": {
- "version": "3.22.0",
- "resolved": "https://registry.npmjs.org/node-pg-migrate/-/node-pg-migrate-3.22.0.tgz",
- "integrity": "sha512-dg/noZOSh3WI6qFgbq69DCA/K1kAplBgnnkO6LkuI14xs74Y2URM9BgxBfKBDfBQwXoUBbcJglTmF8F7P8rRdQ==",
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/node-pg-migrate/-/node-pg-migrate-6.0.0.tgz",
+ "integrity": "sha512-mv0qhjENeD/HuGghZCuAcWCrOB77B5dNLMXRz13UeBDDTafsRGFpN+4/IpFM9EZ8g0mcE34/ceVYDLmk4W8/Pw==",
"dev": true,
"requires": {
- "@types/pg": "^7.4.0",
- "config": ">=1.0.0",
- "dotenv": ">=1.0.0",
- "lodash": "~4.17.0",
- "mkdirp": "~0.5.0",
- "yargs": "~13.3.0"
+ "@types/pg": "^8.0.0",
+ "decamelize": "^5.0.0",
+ "mkdirp": "~1.0.0",
+ "yargs": "~17.1.0"
},
"dependencies": {
- "ansi-regex": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
- "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
+ "mkdirp": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
+ "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
"dev": true
- },
- "cliui": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz",
- "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==",
- "dev": true,
- "requires": {
- "string-width": "^3.1.0",
- "strip-ansi": "^5.2.0",
- "wrap-ansi": "^5.1.0"
- }
- },
- "string-width": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
- "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==",
- "dev": true,
- "requires": {
- "emoji-regex": "^7.0.1",
- "is-fullwidth-code-point": "^2.0.0",
- "strip-ansi": "^5.1.0"
- }
- },
- "strip-ansi": {
- "version": "5.2.0",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
- "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
- "dev": true,
- "requires": {
- "ansi-regex": "^4.1.0"
- }
- },
- "wrap-ansi": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz",
- "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==",
- "dev": true,
- "requires": {
- "ansi-styles": "^3.2.0",
- "string-width": "^3.0.0",
- "strip-ansi": "^5.0.0"
- }
- },
- "yargs": {
- "version": "13.3.0",
- "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz",
- "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==",
- "dev": true,
- "requires": {
- "cliui": "^5.0.0",
- "find-up": "^3.0.0",
- "get-caller-file": "^2.0.1",
- "require-directory": "^2.1.1",
- "require-main-filename": "^2.0.0",
- "set-blocking": "^2.0.0",
- "string-width": "^3.0.0",
- "which-module": "^2.0.0",
- "y18n": "^4.0.0",
- "yargs-parser": "^13.1.1"
- }
- },
- "yargs-parser": {
- "version": "13.1.1",
- "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz",
- "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==",
- "dev": true,
- "requires": {
- "camelcase": "^5.0.0",
- "decamelize": "^1.2.0"
- }
}
}
},
- "node-releases": {
- "version": "1.1.29",
- "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.29.tgz",
- "integrity": "sha512-R5bDhzh6I+tpi/9i2hrrvGJ3yKPYzlVOORDkXhnZuwi5D3q1I5w4vYy24PJXTcLk9Q0kws9TO77T75bcK8/ysQ==",
- "dev": true,
- "requires": {
- "semver": "^5.3.0"
- }
- },
- "normalize-package-data": {
- "version": "2.5.0",
- "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz",
- "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==",
- "dev": true,
- "requires": {
- "hosted-git-info": "^2.1.4",
- "resolve": "^1.10.0",
- "semver": "2 || 3 || 4 || 5",
- "validate-npm-package-license": "^3.0.1"
- }
- },
- "npm-run-all": {
- "version": "4.1.5",
- "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz",
- "integrity": "sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "^3.2.1",
- "chalk": "^2.4.1",
- "cross-spawn": "^6.0.5",
- "memorystream": "^0.3.1",
- "minimatch": "^3.0.4",
- "pidtree": "^0.3.0",
- "read-pkg": "^3.0.0",
- "shell-quote": "^1.6.1",
- "string.prototype.padend": "^3.0.0"
- }
- },
- "npm-run-path": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz",
- "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=",
- "dev": true,
- "requires": {
- "path-key": "^2.0.0"
- }
- },
- "number-is-nan": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
- "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
- "dev": true
- },
- "object-keys": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz",
- "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==",
- "dev": true
- },
- "object.assign": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz",
- "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==",
- "dev": true,
- "requires": {
- "define-properties": "^1.1.2",
- "function-bind": "^1.1.1",
- "has-symbols": "^1.0.0",
- "object-keys": "^1.0.11"
- }
- },
- "object.getownpropertydescriptors": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz",
- "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=",
- "dev": true,
- "requires": {
- "define-properties": "^1.1.2",
- "es-abstract": "^1.5.1"
- }
- },
"omggif": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/omggif/-/omggif-1.0.10.tgz",
@@ -3050,79 +3445,17 @@
"wrappy": "1"
}
},
- "os-locale": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz",
- "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==",
- "dev": true,
- "requires": {
- "execa": "^1.0.0",
- "lcid": "^2.0.0",
- "mem": "^4.0.0"
- }
- },
- "p-defer": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz",
- "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=",
- "dev": true
- },
- "p-finally": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
- "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=",
- "dev": true
- },
- "p-is-promise": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz",
- "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==",
- "dev": true
- },
- "p-limit": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz",
- "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==",
- "dev": true,
- "requires": {
- "p-try": "^2.0.0"
- }
- },
- "p-locate": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
- "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
- "dev": true,
- "requires": {
- "p-limit": "^2.0.0"
- }
- },
- "p-try": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
- "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
- "dev": true
- },
"packet-reader": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz",
"integrity": "sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ=="
},
"pako": {
- "version": "1.0.10",
- "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.10.tgz",
- "integrity": "sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw==",
+ "version": "1.0.11",
+ "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
+ "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==",
"dev": true
},
- "param-case": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/param-case/-/param-case-2.1.1.tgz",
- "integrity": "sha1-35T9jPZTHs915r75oIWPvHK+Ikc=",
- "dev": true,
- "requires": {
- "no-case": "^2.2.0"
- }
- },
"parse-bmfont-ascii": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/parse-bmfont-ascii/-/parse-bmfont-ascii-1.0.6.tgz",
@@ -3146,29 +3479,9 @@
}
},
"parse-headers": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.2.tgz",
- "integrity": "sha512-/LypJhzFmyBIDYP9aDVgeyEb5sQfbfY5mnDq4hVhlQ69js87wXfmEI5V3xI6vvXasqebp0oCytYFLxsBVfCzSg==",
- "dev": true,
- "requires": {
- "for-each": "^0.3.3",
- "string.prototype.trim": "^1.1.2"
- }
- },
- "parse-json": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz",
- "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=",
- "dev": true,
- "requires": {
- "error-ex": "^1.3.1",
- "json-parse-better-errors": "^1.0.1"
- }
- },
- "path-exists": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
- "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=",
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.4.tgz",
+ "integrity": "sha512-psZ9iZoCNFLrgRjZ1d8mn0h9WRqJwFxM9q3x7iUjN/YT2OksthDJ5TiPCu2F38kS4zutqfW+YdVVkBZZx3/1aw==",
"dev": true
},
"path-is-absolute": {
@@ -3177,52 +3490,30 @@
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
"dev": true
},
- "path-key": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
- "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=",
- "dev": true
- },
"path-parse": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
- "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==",
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
+ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
"dev": true
},
- "path-type": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz",
- "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==",
- "dev": true,
- "requires": {
- "pify": "^3.0.0"
- }
- },
"pg": {
- "version": "7.12.1",
- "resolved": "https://registry.npmjs.org/pg/-/pg-7.12.1.tgz",
- "integrity": "sha512-l1UuyfEvoswYfcUe6k+JaxiN+5vkOgYcVSbSuw3FvdLqDbaoa2RJo1zfJKfPsSYPFVERd4GHvX3s2PjG1asSDA==",
+ "version": "8.7.1",
+ "resolved": "https://registry.npmjs.org/pg/-/pg-8.7.1.tgz",
+ "integrity": "sha512-7bdYcv7V6U3KAtWjpQJJBww0UEsWuh4yQ/EjNf2HeO/NnvKjpvhEIe/A/TleP6wtmSKnUnghs5A9jUoK6iDdkA==",
"requires": {
"buffer-writer": "2.0.0",
"packet-reader": "1.0.0",
- "pg-connection-string": "0.1.3",
- "pg-pool": "^2.0.4",
+ "pg-connection-string": "^2.5.0",
+ "pg-pool": "^3.4.1",
+ "pg-protocol": "^1.5.0",
"pg-types": "^2.1.0",
- "pgpass": "1.x",
- "semver": "4.3.2"
- },
- "dependencies": {
- "semver": {
- "version": "4.3.2",
- "resolved": "https://registry.npmjs.org/semver/-/semver-4.3.2.tgz",
- "integrity": "sha1-x6BxWKgL7dBSNVt3DYLWZA+AO+c="
- }
+ "pgpass": "1.x"
}
},
"pg-connection-string": {
- "version": "0.1.3",
- "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-0.1.3.tgz",
- "integrity": "sha1-2hhHsglA5C7hSSvq9l1J2RskXfc="
+ "version": "2.5.0",
+ "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.5.0.tgz",
+ "integrity": "sha512-r5o/V/ORTA6TmUnyWZR9nCj1klXCO2CEKNRlVuJptZe85QuhFayC7WeMic7ndayT5IRIR0S0xFxFi2ousartlQ=="
},
"pg-int8": {
"version": "1.0.1",
@@ -3230,9 +3521,15 @@
"integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw=="
},
"pg-pool": {
- "version": "2.0.7",
- "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-2.0.7.tgz",
- "integrity": "sha512-UiJyO5B9zZpu32GSlP0tXy8J2NsJ9EFGFfz5v6PSbdz/1hBLX1rNiiy5+mAm5iJJYwfCv4A0EBcQLGWwjbpzZw=="
+ "version": "3.4.1",
+ "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.4.1.tgz",
+ "integrity": "sha512-TVHxR/gf3MeJRvchgNHxsYsTCHQ+4wm3VIHSS19z8NC0+gioEhq1okDY1sm/TYbfoP6JLFx01s0ShvZ3puP/iQ==",
+ "requires": {}
+ },
+ "pg-protocol": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.5.0.tgz",
+ "integrity": "sha512-muRttij7H8TqRNu/DxrAJQITO4Ac7RmX3Klyr/9mJEOBeIpgnF8f9jAfRz5d3XwQZl5qBjF9gLsUtMPJE0vezQ=="
},
"pg-types": {
"version": "2.2.0",
@@ -3247,11 +3544,11 @@
}
},
"pgpass": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.2.tgz",
- "integrity": "sha1-Knu0G2BltnkH6R2hsHwYR8h3swY=",
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.4.tgz",
+ "integrity": "sha512-YmuA56alyBq7M59vxVBfPJrGSozru8QAdoNlWuW3cz8l+UX3cWge0vTvjKhsSHSJpo3Bom8/Mm6hf0TR5GY0+w==",
"requires": {
- "split": "^1.0.0"
+ "split2": "^3.1.1"
}
},
"phin": {
@@ -3260,22 +3557,16 @@
"integrity": "sha512-CzFr90qM24ju5f88quFC/6qohjC144rehe5n6DH900lgXmUe86+xCKc10ev56gRKC4/BkHUoG4uSiQgBiIXwDA==",
"dev": true
},
- "picomatch": {
- "version": "2.2.2",
- "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz",
- "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==",
- "dev": true
- },
- "pidtree": {
- "version": "0.3.0",
- "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.0.tgz",
- "integrity": "sha512-9CT4NFlDcosssyg8KVFltgokyKZIFjoBxw8CTGy+5F38Y1eQWrt8tRayiUOXE+zVKQnYu5BR8JjCtvK3BcnBhg==",
+ "picocolors": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
+ "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==",
"dev": true
},
- "pify": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
- "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
+ "picomatch": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz",
+ "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==",
"dev": true
},
"pixelmatch": {
@@ -3293,13 +3584,15 @@
"integrity": "sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w==",
"dev": true
},
- "polka": {
- "version": "1.0.0-next.9",
- "resolved": "https://registry.npmjs.org/polka/-/polka-1.0.0-next.9.tgz",
- "integrity": "sha512-oAWH5O3CIPTzPKNx9KF9NDfy3KRyy9NtUhDEJGmMRCDT6s3CZaGDm7xafcKtm0uK6g0CBiNtoeGWpPFSLUXeaw==",
+ "postcss": {
+ "version": "8.4.4",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.4.tgz",
+ "integrity": "sha512-joU6fBsN6EIer28Lj6GDFoC/5yOZzLCfn0zHAn/MYXI7aPt4m4hK5KC5ovEZXy+lnCjmYIbQWngvju2ddyEr8Q==",
+ "dev": true,
"requires": {
- "@polka/url": "^1.0.0-next.9",
- "trouter": "^3.1.0"
+ "nanoid": "^3.1.30",
+ "picocolors": "^1.0.0",
+ "source-map-js": "^1.0.1"
}
},
"postgres-array": {
@@ -3313,9 +3606,9 @@
"integrity": "sha1-AntTPAqokOJtFy1Hz5zOzFIazTU="
},
"postgres-date": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.4.tgz",
- "integrity": "sha512-bESRvKVuTrjoBluEcpv2346+6kgB7UlnqWZsnbnCccTNq/pqfj1j6oBaN5+b/NrDXepYUT/HKadqv3iS9lJuVA=="
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz",
+ "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q=="
},
"postgres-interval": {
"version": "1.2.0",
@@ -3326,58 +3619,29 @@
}
},
"prism-svelte": {
- "version": "0.4.3",
- "resolved": "https://registry.npmjs.org/prism-svelte/-/prism-svelte-0.4.3.tgz",
- "integrity": "sha512-plS7uY0WWiTBwWZs9KM3M88ZxHWKbrbMUDf52CPum6BqAxiLmKROmaTnmhXtv0krQ0l0HRLcFS8JDwOFyPt/OQ=="
+ "version": "0.4.7",
+ "resolved": "https://registry.npmjs.org/prism-svelte/-/prism-svelte-0.4.7.tgz",
+ "integrity": "sha512-yABh19CYbM24V7aS7TuPYRNMqthxwbvx6FF/Rw920YbyBWO3tnyPIqRMgHuSVsLmuHkkBS1Akyof463FVdkeDQ=="
},
"prismjs": {
- "version": "1.21.0",
- "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.21.0.tgz",
- "integrity": "sha512-uGdSIu1nk3kej2iZsLyDoJ7e9bnPzIgY0naW/HdknGj61zScaprVEVGHrPoXqI+M9sP0NDnTK2jpkvmldpuqDw==",
- "requires": {
- "clipboard": "^2.0.0"
- }
- },
- "private": {
- "version": "0.1.8",
- "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz",
- "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==",
- "dev": true
+ "version": "1.25.0",
+ "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.25.0.tgz",
+ "integrity": "sha512-WCjJHl1KEWbnkQom1+SzftbtXMKQoezOCYs5rECqMN+jP+apI7ftoflyqigqzopSO3hMhTEb0mFClA8lkolgEg=="
},
"process": {
- "version": "0.5.2",
- "resolved": "https://registry.npmjs.org/process/-/process-0.5.2.tgz",
- "integrity": "sha1-FjjYqONML0QKkduVq5rrZ3/Bhc8=",
+ "version": "0.11.10",
+ "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
+ "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=",
"dev": true
},
- "pump": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
- "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
- "dev": true,
- "requires": {
- "end-of-stream": "^1.1.0",
- "once": "^1.3.1"
- }
- },
- "randombytes": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
- "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==",
- "dev": true,
- "requires": {
- "safe-buffer": "^5.1.0"
- }
- },
- "read-pkg": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz",
- "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=",
- "dev": true,
+ "readable-stream": {
+ "version": "3.6.0",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
+ "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
"requires": {
- "load-json-file": "^4.0.0",
- "normalize-package-data": "^2.3.2",
- "path-type": "^3.0.0"
+ "inherits": "^2.0.3",
+ "string_decoder": "^1.1.1",
+ "util-deprecate": "^1.0.1"
}
},
"rechoir": {
@@ -3389,88 +3653,10 @@
"resolve": "^1.1.6"
}
},
- "regenerate": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz",
- "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==",
- "dev": true
- },
- "regenerate-unicode-properties": {
- "version": "8.1.0",
- "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.1.0.tgz",
- "integrity": "sha512-LGZzkgtLY79GeXLm8Dp0BVLdQlWICzBnJz/ipWUgo59qBaZ+BHtq51P2q1uVZlppMuUAT37SDk39qUbjTWB7bA==",
- "dev": true,
- "requires": {
- "regenerate": "^1.4.0"
- }
- },
"regenerator-runtime": {
- "version": "0.13.3",
- "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz",
- "integrity": "sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw==",
- "dev": true
- },
- "regenerator-transform": {
- "version": "0.14.1",
- "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.1.tgz",
- "integrity": "sha512-flVuee02C3FKRISbxhXl9mGzdbWUVHubl1SMaknjxkFB1/iqpJhArQUvRxOOPEc/9tAiX0BaQ28FJH10E4isSQ==",
- "dev": true,
- "requires": {
- "private": "^0.1.6"
- }
- },
- "regexp-tree": {
- "version": "0.1.13",
- "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.13.tgz",
- "integrity": "sha512-hwdV/GQY5F8ReLZWO+W1SRoN5YfpOKY6852+tBFcma72DKBIcHjPRIlIvQN35bCOljuAfP2G2iB0FC/w236mUw==",
- "dev": true
- },
- "regexparam": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/regexparam/-/regexparam-1.3.0.tgz",
- "integrity": "sha512-6IQpFBv6e5vz1QAqI+V4k8P2e/3gRrqfCJ9FI+O1FLQTO+Uz6RXZEZOPmTJ6hlGj7gkERzY5BRCv09whKP96/g=="
- },
- "regexpu-core": {
- "version": "4.5.5",
- "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.5.5.tgz",
- "integrity": "sha512-FpI67+ky9J+cDizQUJlIlNZFKual/lUkFr1AG6zOCpwZ9cLrg8UUVakyUQJD7fCDIe9Z2nwTQJNPyonatNmDFQ==",
- "dev": true,
- "requires": {
- "regenerate": "^1.4.0",
- "regenerate-unicode-properties": "^8.1.0",
- "regjsgen": "^0.5.0",
- "regjsparser": "^0.6.0",
- "unicode-match-property-ecmascript": "^1.0.4",
- "unicode-match-property-value-ecmascript": "^1.1.0"
- }
- },
- "regjsgen": {
- "version": "0.5.0",
- "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.0.tgz",
- "integrity": "sha512-RnIrLhrXCX5ow/E5/Mh2O4e/oa1/jW0eaBKTSy3LaCj+M3Bqvm97GWDp2yUtzIs4LEn65zR2yiYGFqb2ApnzDA==",
- "dev": true
- },
- "regjsparser": {
- "version": "0.6.0",
- "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.0.tgz",
- "integrity": "sha512-RQ7YyokLiQBomUJuUG8iGVvkgOLxwyZM8k6d3q5SAXpg4r5TZJZigKFvC6PpD+qQ98bCDC5YelPeA3EucDoNeQ==",
- "dev": true,
- "requires": {
- "jsesc": "~0.5.0"
- },
- "dependencies": {
- "jsesc": {
- "version": "0.5.0",
- "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz",
- "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=",
- "dev": true
- }
- }
- },
- "relateurl": {
- "version": "0.2.7",
- "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz",
- "integrity": "sha1-VNvzd+UUQKypCkzSdGANP/LYiKk=",
+ "version": "0.13.9",
+ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz",
+ "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==",
"dev": true
},
"require-directory": {
@@ -3479,12 +3665,6 @@
"integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=",
"dev": true
},
- "require-main-filename": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
- "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
- "dev": true
- },
"require-relative": {
"version": "0.8.7",
"resolved": "https://registry.npmjs.org/require-relative/-/require-relative-0.8.7.tgz",
@@ -3492,122 +3672,37 @@
"dev": true
},
"resolve": {
- "version": "1.11.0",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.0.tgz",
- "integrity": "sha512-WL2pBDjqT6pGUNSUzMw00o4T7If+z4H2x3Gz893WoUQ5KW8Vr9txp00ykiP16VBaZF5+j/OcXJHZ9+PCvdiDKw==",
+ "version": "1.20.0",
+ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz",
+ "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==",
"dev": true,
"requires": {
+ "is-core-module": "^2.2.0",
"path-parse": "^1.0.6"
}
},
- "rimraf": {
- "version": "2.7.1",
- "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
- "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
- "dev": true,
- "requires": {
- "glob": "^7.1.3"
- }
- },
"rollup": {
- "version": "2.26.10",
- "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.26.10.tgz",
- "integrity": "sha512-dUnjCWOA0h9qNX6qtcHidyatz8FAFZxVxt1dbcGtKdlJkpSxGK3G9+DLCYvtZr9v94D129ij9zUhG+xbRoqepw==",
- "dev": true,
- "requires": {
- "fsevents": "~2.1.2"
- }
- },
- "rollup-plugin-svelte": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/rollup-plugin-svelte/-/rollup-plugin-svelte-6.0.0.tgz",
- "integrity": "sha512-y9qtWa+iNYwXdOZqaEqz3i6k3gzofC9JXzv+WVKDOt0DLiJxJaSrlKKf4YkKG91RzTK5Lo+0fW8in9QH/DxEhA==",
- "dev": true,
- "requires": {
- "require-relative": "^0.8.7",
- "rollup-pluginutils": "^2.8.2",
- "sourcemap-codec": "^1.4.8"
- }
- },
- "rollup-plugin-terser": {
- "version": "7.0.1",
- "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.1.tgz",
- "integrity": "sha512-HL0dgzSxBYG/Ly9i/E5Sc+PuKKZ0zBzk11VmLCfdUtpqH4yYqkLclPkTqRy85FU9246yetImOClaQ/ufnj08vg==",
+ "version": "2.60.2",
+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.60.2.tgz",
+ "integrity": "sha512-1Bgjpq61sPjgoZzuiDSGvbI1tD91giZABgjCQBKM5aYLnzjq52GoDuWVwT/cm/MCxCMPU8gqQvkj8doQ5C8Oqw==",
"dev": true,
"requires": {
- "@babel/code-frame": "^7.10.4",
- "jest-worker": "^26.2.1",
- "serialize-javascript": "^4.0.0",
- "terser": "^5.0.0"
- },
- "dependencies": {
- "@babel/code-frame": {
- "version": "7.10.4",
- "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz",
- "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==",
- "dev": true,
- "requires": {
- "@babel/highlight": "^7.10.4"
- }
- },
- "@babel/highlight": {
- "version": "7.10.4",
- "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz",
- "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==",
- "dev": true,
- "requires": {
- "@babel/helper-validator-identifier": "^7.10.4",
- "chalk": "^2.0.0",
- "js-tokens": "^4.0.0"
- }
- }
+ "fsevents": "~2.3.2"
}
},
- "rollup-pluginutils": {
- "version": "2.8.2",
- "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz",
- "integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==",
+ "sade": {
+ "version": "1.7.4",
+ "resolved": "https://registry.npmjs.org/sade/-/sade-1.7.4.tgz",
+ "integrity": "sha512-y5yauMD93rX840MwUJr7C1ysLFBgMspsdTo4UVrDg3fXDvtwOyIqykhVAAm6fk/3au77773itJStObgK+LKaiA==",
"dev": true,
"requires": {
- "estree-walker": "^0.6.1"
- },
- "dependencies": {
- "estree-walker": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz",
- "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==",
- "dev": true
- }
+ "mri": "^1.1.0"
}
},
"safe-buffer": {
- "version": "5.1.2",
- "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
- "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
- },
- "sander": {
- "version": "0.6.0",
- "resolved": "https://registry.npmjs.org/sander/-/sander-0.6.0.tgz",
- "integrity": "sha1-rxYkzX+2362Y6+9WUxn5IAeNqSU=",
- "dev": true,
- "requires": {
- "graceful-fs": "^4.1.3",
- "mkdirp": "^0.5.1",
- "rimraf": "^2.5.2"
- }
- },
- "sapper": {
- "version": "0.27.16",
- "resolved": "https://registry.npmjs.org/sapper/-/sapper-0.27.16.tgz",
- "integrity": "sha512-q8dohkbhga6xO+0a8h84odFyoilQ0D0vJtF8NHra/DQmSeN2R2MXUfwhw3EyvLms3T1x8H3v+qw642Qf5JXA9g==",
- "dev": true,
- "requires": {
- "html-minifier": "^4.0.0",
- "http-link-header": "^1.0.2",
- "shimport": "^1.0.1",
- "sourcemap-codec": "^1.4.6",
- "string-hash": "^1.1.3"
- }
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
+ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
},
"sax": {
"version": "1.2.4",
@@ -3615,63 +3710,15 @@
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==",
"dev": true
},
- "select": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz",
- "integrity": "sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0=",
- "optional": true
- },
"semver": {
- "version": "5.7.0",
- "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz",
- "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA=="
- },
- "serialize-javascript": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz",
- "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==",
- "dev": true,
- "requires": {
- "randombytes": "^2.1.0"
- }
- },
- "set-blocking": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
- "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
- "dev": true
- },
- "shebang-command": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
- "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=",
- "dev": true,
- "requires": {
- "shebang-regex": "^1.0.0"
- }
- },
- "shebang-regex": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
- "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=",
- "dev": true
- },
- "shell-quote": {
- "version": "1.6.1",
- "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz",
- "integrity": "sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=",
- "dev": true,
- "requires": {
- "array-filter": "~0.0.0",
- "array-map": "~0.0.0",
- "array-reduce": "~0.0.0",
- "jsonify": "~0.0.0"
- }
+ "version": "5.7.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
+ "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ=="
},
"shelljs": {
- "version": "0.8.3",
- "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.3.tgz",
- "integrity": "sha512-fc0BKlAWiLpwZljmOvAOTE/gXawtCoNrP5oaY7KIaQbbyHeQVg01pSEuEGvGh3HEdBU4baCD7wQBwADmM/7f7A==",
+ "version": "0.8.4",
+ "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz",
+ "integrity": "sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==",
"dev": true,
"requires": {
"glob": "^7.0.0",
@@ -3679,183 +3726,66 @@
"rechoir": "^0.6.2"
}
},
- "shimport": {
+ "source-map-js": {
"version": "1.0.1",
- "resolved": "https://registry.npmjs.org/shimport/-/shimport-1.0.1.tgz",
- "integrity": "sha512-Imf4gH+8WQmT1GvxS/x79qpmfnE6m50hyN1ucatX+7oMCgmaF8obZWCPIzSUe6+P+YmXM46lkP2pxiV2/lt9Og==",
- "dev": true
- },
- "signal-exit": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
- "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=",
- "dev": true
- },
- "sirv": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/sirv/-/sirv-1.0.6.tgz",
- "integrity": "sha512-LRGu7Op4Xl9hhigOy2kcB53zAYTjNDdpooey49dIU0cMdpOv9ithVf7nstk3jvs8EhMiT/VORoyazZYGgw4vnA==",
- "requires": {
- "@polka/url": "^1.0.0-next.9",
- "mime": "^2.3.1",
- "totalist": "^1.0.0"
- }
- },
- "source-map": {
- "version": "0.5.7",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
- "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
+ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.1.tgz",
+ "integrity": "sha512-4+TN2b3tqOCd/kaGRJ/sTYA0tR0mdXx26ipdolxcwtJVqEnqNYvlCAt1q3ypy4QMlYus+Zh34RNtYLoq2oQ4IA==",
"dev": true
},
- "source-map-support": {
- "version": "0.5.19",
- "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz",
- "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==",
- "dev": true,
- "requires": {
- "buffer-from": "^1.0.0",
- "source-map": "^0.6.0"
- },
- "dependencies": {
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- }
- }
- },
"sourcemap-codec": {
"version": "1.4.8",
"resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz",
"integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==",
"dev": true
},
- "spdx-correct": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz",
- "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==",
- "dev": true,
- "requires": {
- "spdx-expression-parse": "^3.0.0",
- "spdx-license-ids": "^3.0.0"
- }
- },
- "spdx-exceptions": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz",
- "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==",
- "dev": true
- },
- "spdx-expression-parse": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz",
- "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==",
- "dev": true,
+ "split2": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz",
+ "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==",
"requires": {
- "spdx-exceptions": "^2.1.0",
- "spdx-license-ids": "^3.0.0"
+ "readable-stream": "^3.0.0"
}
},
- "spdx-license-ids": {
- "version": "3.0.4",
- "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz",
- "integrity": "sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA==",
- "dev": true
- },
- "split": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz",
- "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==",
+ "string_decoder": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
+ "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
"requires": {
- "through": "2"
+ "safe-buffer": "~5.2.0"
}
},
- "sprintf-js": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
- "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
- "dev": true
- },
- "string-hash": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/string-hash/-/string-hash-1.1.3.tgz",
- "integrity": "sha1-6Kr8CsGFW0Zmkp7X3RJ1311sgRs=",
- "dev": true
- },
"string-width": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
- "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==",
- "dev": true,
- "requires": {
- "is-fullwidth-code-point": "^2.0.0",
- "strip-ansi": "^4.0.0"
- }
- },
- "string.prototype.padend": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.0.0.tgz",
- "integrity": "sha1-86rvfBcZ8XDF6rHDK/eA2W4h8vA=",
- "dev": true,
- "requires": {
- "define-properties": "^1.1.2",
- "es-abstract": "^1.4.3",
- "function-bind": "^1.0.2"
- }
- },
- "string.prototype.trim": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.0.tgz",
- "integrity": "sha512-9EIjYD/WdlvLpn987+ctkLf0FfvBefOCuiEr2henD8X+7jfwPnyvTdmW8OJhj5p+M0/96mBdynLWkxUr+rHlpg==",
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"dev": true,
"requires": {
- "define-properties": "^1.1.3",
- "es-abstract": "^1.13.0",
- "function-bind": "^1.1.1"
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.1"
}
},
"strip-ansi": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
- "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dev": true,
"requires": {
- "ansi-regex": "^3.0.0"
+ "ansi-regex": "^5.0.1"
}
},
- "strip-bom": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
- "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=",
- "dev": true
- },
- "strip-eof": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
- "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=",
- "dev": true
- },
- "strip-json-comments": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
- "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=",
+ "svelte": {
+ "version": "3.44.2",
+ "resolved": "https://registry.npmjs.org/svelte/-/svelte-3.44.2.tgz",
+ "integrity": "sha512-jrZhZtmH3ZMweXg1Q15onb8QlWD+a5T5Oca4C1jYvSURp2oD35h4A5TV6t6MEa93K4LlX6BkafZPdQoFjw/ylA==",
"dev": true
},
- "supports-color": {
- "version": "5.5.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
- "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
+ "svelte-hmr": {
+ "version": "0.14.7",
+ "resolved": "https://registry.npmjs.org/svelte-hmr/-/svelte-hmr-0.14.7.tgz",
+ "integrity": "sha512-pDrzgcWSoMaK6AJkBWkmgIsecW0GChxYZSZieIYfCP0v2oPyx2CYU/zm7TBIcjLVUPP714WxmViE9Thht4etog==",
"dev": true,
- "requires": {
- "has-flag": "^3.0.0"
- }
- },
- "svelte": {
- "version": "3.12.0",
- "resolved": "https://registry.npmjs.org/svelte/-/svelte-3.12.0.tgz",
- "integrity": "sha512-9/broj3bjShrsk3FuVDH0Bho2BchPKT8ubAqRcTqwkqrO9npOS3Vi98Yb5mBaa4bYV+ELTuvPvaQZbCJYMFRdg==",
- "dev": true
+ "requires": {}
},
"svelte-json-tree": {
"version": "0.0.5",
@@ -3863,126 +3793,38 @@
"integrity": "sha512-kTcOVlsldI2neszYNQAfFCt+u62OWWAZgpeoW9RN3hjtJCWI5bkVj0gtljZWUlyEWTfgpmag5L5AHDKg8w8ZmQ==",
"dev": true
},
- "tar": {
- "version": "4.4.10",
- "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.10.tgz",
- "integrity": "sha512-g2SVs5QIxvo6OLp0GudTqEf05maawKUxXru104iaayWA09551tFCTI8f1Asb4lPfkBr91k07iL4c11XO3/b0tA==",
- "dev": true,
- "requires": {
- "chownr": "^1.1.1",
- "fs-minipass": "^1.2.5",
- "minipass": "^2.3.5",
- "minizlib": "^1.2.1",
- "mkdirp": "^0.5.0",
- "safe-buffer": "^5.1.2",
- "yallist": "^3.0.3"
- }
- },
- "terser": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/terser/-/terser-5.3.0.tgz",
- "integrity": "sha512-XTT3D3AwxC54KywJijmY2mxZ8nJiEjBHVYzq8l9OaYuRFWeQNBwvipuzzYEP4e+/AVcd1hqG/CqgsdIRyT45Fg==",
- "dev": true,
- "requires": {
- "commander": "^2.20.0",
- "source-map": "~0.6.1",
- "source-map-support": "~0.5.12"
- },
- "dependencies": {
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- }
- }
- },
- "through": {
- "version": "2.3.8",
- "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
- "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU="
- },
"timm": {
- "version": "1.6.2",
- "resolved": "https://registry.npmjs.org/timm/-/timm-1.6.2.tgz",
- "integrity": "sha512-IH3DYDL1wMUwmIlVmMrmesw5lZD6N+ZOAFWEyLrtpoL9Bcrs9u7M/vyOnHzDD2SMs4irLkVjqxZbHrXStS/Nmw==",
- "dev": true
- },
- "tiny-emitter": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz",
- "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==",
- "optional": true
- },
- "tinycolor2": {
- "version": "1.4.1",
- "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.4.1.tgz",
- "integrity": "sha1-9PrTM0R7wLB9TcjpIJ2POaisd+g=",
- "dev": true
- },
- "to-fast-properties": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
- "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=",
+ "version": "1.7.1",
+ "resolved": "https://registry.npmjs.org/timm/-/timm-1.7.1.tgz",
+ "integrity": "sha512-IjZc9KIotudix8bMaBW6QvMuq64BrJWFs1+4V0lXwWGQZwH+LnX87doAYhem4caOEusRP9/g6jVDQmZ8XOk1nw==",
"dev": true
},
- "totalist": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/totalist/-/totalist-1.1.0.tgz",
- "integrity": "sha512-gduQwd1rOdDMGxFG1gEvhV88Oirdo2p+KjoYFU7k2g+i7n6AFFbDQ5kMPUsW0pNbfQsB/cwXvT1i4Bue0s9g5g=="
- },
- "trim-right": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz",
- "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=",
- "dev": true
- },
- "trouter": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/trouter/-/trouter-3.1.0.tgz",
- "integrity": "sha512-3Swwu638QQWOefHLss9cdyLi5/9BKYmXZEXpH0KOFfB9YZwUAwHbDAcoYxaHfqAeFvbi/LqAK7rGkhCr1v1BJA==",
- "requires": {
- "regexparam": "^1.3.0"
- }
- },
- "uglify-js": {
- "version": "3.10.4",
- "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.10.4.tgz",
- "integrity": "sha512-kBFT3U4Dcj4/pJ52vfjCSfyLyvG9VYYuGYPmrPvAxRw/i7xHiT4VvCev+uiEMcEEiu6UNB6KgWmGtSUYIWScbw==",
- "dev": true
- },
- "unicode-canonical-property-names-ecmascript": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz",
- "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==",
- "dev": true
- },
- "unicode-match-property-ecmascript": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz",
- "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==",
+ "tiny-glob": {
+ "version": "0.2.9",
+ "resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.9.tgz",
+ "integrity": "sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==",
"dev": true,
"requires": {
- "unicode-canonical-property-names-ecmascript": "^1.0.4",
- "unicode-property-aliases-ecmascript": "^1.0.4"
+ "globalyzer": "0.1.0",
+ "globrex": "^0.1.2"
}
},
- "unicode-match-property-value-ecmascript": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.1.0.tgz",
- "integrity": "sha512-hDTHvaBk3RmFzvSl0UVrUmC3PuW9wKVnpoUDYH0JDkSIovzw+J5viQmeYHxVSBptubnr7PbH2e0fnpDRQnQl5g==",
+ "tinycolor2": {
+ "version": "1.4.2",
+ "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.4.2.tgz",
+ "integrity": "sha512-vJhccZPs965sV/L2sU4oRQVAos0pQXwsvTLkWYdqJ+a8Q5kPFzJTuOFwy7UniPli44NKQGAglksjvOcpo95aZA==",
"dev": true
},
- "unicode-property-aliases-ecmascript": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.5.tgz",
- "integrity": "sha512-L5RAqCfXqAwR3RriF8pM0lU0w4Ryf/GgzONwi6KnL1taJQa7x1TCxdJnILX59WIGOwR57IVxn7Nej0fz1Ny6fw==",
+ "totalist": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/totalist/-/totalist-2.0.0.tgz",
+ "integrity": "sha512-+Y17F0YzxfACxTyjfhnJQEe7afPA0GSpYlFkl2VFMxYP7jshQf9gXV7cH47EfToBumFThfKBvfAcoUn6fdNeRQ==",
"dev": true
},
- "upper-case": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-1.1.3.tgz",
- "integrity": "sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg=",
+ "tr46": {
+ "version": "0.0.3",
+ "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
+ "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=",
"dev": true
},
"utif": {
@@ -3994,95 +3836,62 @@
"pako": "^1.0.5"
}
},
- "util.promisify": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz",
- "integrity": "sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA==",
- "dev": true,
- "requires": {
- "define-properties": "^1.1.2",
- "object.getownpropertydescriptors": "^2.0.3"
- }
+ "util-deprecate": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
+ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
},
- "validate-npm-package-license": {
- "version": "3.0.4",
- "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
- "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==",
+ "uvu": {
+ "version": "0.5.2",
+ "resolved": "https://registry.npmjs.org/uvu/-/uvu-0.5.2.tgz",
+ "integrity": "sha512-m2hLe7I2eROhh+tm3WE5cTo/Cv3WQA7Oc9f7JB6uWv+/zVKvfAm53bMyOoGOSZeQ7Ov2Fu9pLhFr7p07bnT20w==",
"dev": true,
"requires": {
- "spdx-correct": "^3.0.0",
- "spdx-expression-parse": "^3.0.0"
+ "dequal": "^2.0.0",
+ "diff": "^5.0.0",
+ "kleur": "^4.0.3",
+ "sade": "^1.7.3",
+ "totalist": "^2.0.0"
}
},
- "which": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
- "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
+ "vite": {
+ "version": "2.6.14",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-2.6.14.tgz",
+ "integrity": "sha512-2HA9xGyi+EhY2MXo0+A2dRsqsAG3eFNEVIo12olkWhOmc8LfiM+eMdrXf+Ruje9gdXgvSqjLI9freec1RUM5EA==",
"dev": true,
"requires": {
- "isexe": "^2.0.0"
+ "esbuild": "^0.13.2",
+ "fsevents": "~2.3.2",
+ "postcss": "^8.3.8",
+ "resolve": "^1.20.0",
+ "rollup": "^2.57.0"
}
},
- "which-module": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz",
- "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=",
+ "webidl-conversions": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
+ "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=",
"dev": true
},
- "wide-align": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz",
- "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==",
+ "whatwg-url": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
+ "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=",
"dev": true,
"requires": {
- "string-width": "^1.0.2 || 2"
+ "tr46": "~0.0.3",
+ "webidl-conversions": "^3.0.0"
}
},
"wrap-ansi": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
- "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=",
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
+ "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
"dev": true,
"requires": {
- "string-width": "^1.0.1",
- "strip-ansi": "^3.0.1"
- },
- "dependencies": {
- "ansi-regex": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
- "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
- "dev": true
- },
- "is-fullwidth-code-point": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
- "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
- "dev": true,
- "requires": {
- "number-is-nan": "^1.0.0"
- }
- },
- "string-width": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
- "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
- "dev": true,
- "requires": {
- "code-point-at": "^1.0.0",
- "is-fullwidth-code-point": "^1.0.0",
- "strip-ansi": "^3.0.0"
- }
- },
- "strip-ansi": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
- "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
- "dev": true,
- "requires": {
- "ansi-regex": "^2.0.0"
- }
- }
+ "ansi-styles": "^4.0.0",
+ "string-width": "^4.1.0",
+ "strip-ansi": "^6.0.0"
}
},
"wrappy": {
@@ -4092,12 +3901,12 @@
"dev": true
},
"xhr": {
- "version": "2.5.0",
- "resolved": "https://registry.npmjs.org/xhr/-/xhr-2.5.0.tgz",
- "integrity": "sha512-4nlO/14t3BNUZRXIXfXe+3N6w3s1KoxcJUUURctd64BLRe67E4gRwp4PjywtDY72fXpZ1y6Ch0VZQRY/gMPzzQ==",
+ "version": "2.6.0",
+ "resolved": "https://registry.npmjs.org/xhr/-/xhr-2.6.0.tgz",
+ "integrity": "sha512-/eCGLb5rxjx5e3mF1A7s+pLlR6CGyqWN91fv1JgER5mVWg1MZmlhBvy9kjcsOdRk8RrIujotWyJamfyrp+WIcA==",
"dev": true,
"requires": {
- "global": "~4.3.0",
+ "global": "~4.4.0",
"is-function": "^1.0.1",
"parse-headers": "^2.0.0",
"xtend": "^4.0.0"
@@ -4110,13 +3919,12 @@
"dev": true
},
"xml2js": {
- "version": "0.4.22",
- "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.22.tgz",
- "integrity": "sha512-MWTbxAQqclRSTnehWWe5nMKzI3VmJ8ltiJEco8akcC6j3miOhjjfzKum5sId+CWhfxdOs/1xauYr8/ZDBtQiRw==",
+ "version": "0.4.23",
+ "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz",
+ "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==",
"dev": true,
"requires": {
"sax": ">=0.6.0",
- "util.promisify": "~1.0.0",
"xmlbuilder": "~11.0.0"
}
},
@@ -4132,133 +3940,37 @@
"integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="
},
"y18n": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz",
- "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==",
- "dev": true
- },
- "yallist": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz",
- "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==",
+ "version": "5.0.8",
+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
+ "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",
"dev": true
},
"yargs": {
- "version": "13.2.2",
- "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.2.tgz",
- "integrity": "sha512-WyEoxgyTD3w5XRpAQNYUB9ycVH/PQrToaTXdYXRdOXvEy1l19br+VJsc0vcO8PTGg5ro/l/GY7F/JMEBmI0BxA==",
+ "version": "17.1.1",
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.1.1.tgz",
+ "integrity": "sha512-c2k48R0PwKIqKhPMWjeiF6y2xY/gPMUlro0sgxqXpbOIohWiLNXWslsootttv7E1e73QPAMQSg5FeySbVcpsPQ==",
"dev": true,
"requires": {
- "cliui": "^4.0.0",
- "find-up": "^3.0.0",
- "get-caller-file": "^2.0.1",
- "os-locale": "^3.1.0",
+ "cliui": "^7.0.2",
+ "escalade": "^3.1.1",
+ "get-caller-file": "^2.0.5",
"require-directory": "^2.1.1",
- "require-main-filename": "^2.0.0",
- "set-blocking": "^2.0.0",
- "string-width": "^3.0.0",
- "which-module": "^2.0.0",
- "y18n": "^4.0.0",
- "yargs-parser": "^13.0.0"
- },
- "dependencies": {
- "ansi-regex": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
- "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
- "dev": true
- },
- "string-width": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
- "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==",
- "dev": true,
- "requires": {
- "emoji-regex": "^7.0.1",
- "is-fullwidth-code-point": "^2.0.0",
- "strip-ansi": "^5.1.0"
- }
- },
- "strip-ansi": {
- "version": "5.2.0",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
- "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
- "dev": true,
- "requires": {
- "ansi-regex": "^4.1.0"
- }
- }
+ "string-width": "^4.2.0",
+ "y18n": "^5.0.5",
+ "yargs-parser": "^20.2.2"
}
},
"yargs-parser": {
- "version": "13.0.0",
- "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.0.0.tgz",
- "integrity": "sha512-w2LXjoL8oRdRQN+hOyppuXs+V/fVAYtpcrRxZuF7Kt/Oc+Jr2uAcVntaUTNT6w5ihoWfFDpNY8CPx1QskxZ/pw==",
- "dev": true,
- "requires": {
- "camelcase": "^5.0.0",
- "decamelize": "^1.2.0"
- }
- },
- "yargs-unparser": {
- "version": "1.5.0",
- "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.5.0.tgz",
- "integrity": "sha512-HK25qidFTCVuj/D1VfNiEndpLIeJN78aqgR23nL3y4N0U/91cOAzqfHlF8n2BvoNDcZmJKin3ddNSvOxSr8flw==",
- "dev": true,
- "requires": {
- "flat": "^4.1.0",
- "lodash": "^4.17.11",
- "yargs": "^12.0.5"
- },
- "dependencies": {
- "get-caller-file": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz",
- "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==",
- "dev": true
- },
- "require-main-filename": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz",
- "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=",
- "dev": true
- },
- "yargs": {
- "version": "12.0.5",
- "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz",
- "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==",
- "dev": true,
- "requires": {
- "cliui": "^4.0.0",
- "decamelize": "^1.2.0",
- "find-up": "^3.0.0",
- "get-caller-file": "^1.0.1",
- "os-locale": "^3.0.0",
- "require-directory": "^2.1.1",
- "require-main-filename": "^1.0.1",
- "set-blocking": "^2.0.0",
- "string-width": "^2.0.0",
- "which-module": "^2.0.0",
- "y18n": "^3.2.1 || ^4.0.0",
- "yargs-parser": "^11.1.1"
- }
- },
- "yargs-parser": {
- "version": "11.1.1",
- "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz",
- "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==",
- "dev": true,
- "requires": {
- "camelcase": "^5.0.0",
- "decamelize": "^1.2.0"
- }
- }
- }
+ "version": "20.2.9",
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz",
+ "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==",
+ "dev": true
},
"yootils": {
"version": "0.0.16",
"resolved": "https://registry.npmjs.org/yootils/-/yootils-0.0.16.tgz",
- "integrity": "sha512-aIVecm5ucOzwhtKbl0zkfg0ZSOUR9c2da0k8cIc9umjjzkvVCWUUX/UHZ1CLPsv4wmJLqt0aWeLB7p9n9JDwYQ=="
+ "integrity": "sha512-aIVecm5ucOzwhtKbl0zkfg0ZSOUR9c2da0k8cIc9umjjzkvVCWUUX/UHZ1CLPsv4wmJLqt0aWeLB7p9n9JDwYQ==",
+ "dev": true
}
}
}
diff --git a/site/package.json b/site/package.json
index 6e00636476..66439f3ddb 100644
--- a/site/package.json
+++ b/site/package.json
@@ -2,63 +2,43 @@
"name": "svelte.dev",
"version": "1.0.0",
"description": "Docs and examples for Svelte",
+ "type": "module",
"scripts": {
- "dev": "npm run copy-workers && sapper dev",
+ "dev": "node scripts/update.js && npm run copy-workers && svelte-kit dev",
"copy-workers": "node scripts/copy-workers.js",
"migrate": "node-pg-migrate -r dotenv/config",
- "build": "npm run copy-workers && sapper build --legacy",
- "update": "node scripts/update_template.js && node scripts/get-contributors.js && node scripts/update_whos_using.js",
- "start": "node __sapper__/build",
- "test": "mocha -r esm test/**",
+ "build": "node scripts/update.js && npm run copy-workers && svelte-kit build",
+ "update": "node scripts/update.js --force=true",
+ "preview": "svelte-kit preview",
+ "start": "node build",
+ "test": "uvu test",
"deploy": "make deploy"
},
"dependencies": {
- "@polka/redirect": "^1.0.0-next.7",
- "@polka/send": "^1.0.0-next.7",
"cookie": "^0.4.0",
"devalue": "^2.0.0",
"do-not-zip": "^1.0.0",
"flru": "^1.0.2",
"httpie": "^1.1.2",
"jsonwebtoken": "^8.5.1",
- "marked": "^1.0.0",
- "pg": "^7.12.1",
- "polka": "^1.0.0-next.9",
+ "marked": "^4.0.6",
+ "pg": "^8.7.1",
"prism-svelte": "^0.4.3",
- "prismjs": "^1.21.0",
- "sirv": "^1.0.0",
- "yootils": "0.0.16"
+ "prismjs": "^1.25.0"
},
"devDependencies": {
- "@babel/core": "^7.6.0",
- "@babel/plugin-syntax-dynamic-import": "^7.2.0",
- "@babel/plugin-transform-runtime": "^7.6.0",
- "@babel/preset-env": "^7.6.0",
- "@babel/runtime": "^7.6.0",
- "@rollup/plugin-babel": "^5.0.0",
- "@rollup/plugin-commonjs": "^15.0.0",
- "@rollup/plugin-json": "^4.1.0",
- "@rollup/plugin-node-resolve": "^9.0.0",
- "@rollup/plugin-replace": "^2.2.0",
"@sindresorhus/slugify": "^0.9.1",
- "@sveltejs/site-kit": "^1.2.5",
- "@sveltejs/svelte-repl": "^0.2.1",
+ "@sveltejs/adapter-node": "next",
+ "@sveltejs/kit": "next",
+ "@sveltejs/site-kit": "^1.4.1",
+ "@sveltejs/svelte-repl": "^0.4.1",
"degit": "^2.1.4",
- "dotenv": "^8.1.0",
- "esm": "^3.2.25",
+ "dotenv": "^10.0.0",
"jimp": "^0.8.0",
- "mocha": "^6.2.0",
"node-fetch": "^2.6.1",
- "node-pg-migrate": "^3.22.0",
- "npm-run-all": "^4.1.5",
- "rollup": "^2.26.10",
- "rollup-plugin-svelte": "^6.0.0",
- "rollup-plugin-terser": "^7.0.0",
- "sapper": "^0.27.16",
+ "node-pg-migrate": "^6.0.0",
"shelljs": "^0.8.3",
- "svelte": "^3.12.0"
- },
- "engines": {
- "node": ">=10.0.0"
+ "svelte": "^3.39.0",
+ "uvu": "^0.5.2"
}
}
diff --git a/site/rollup.config.js b/site/rollup.config.js
deleted file mode 100644
index 0078711c7a..0000000000
--- a/site/rollup.config.js
+++ /dev/null
@@ -1,117 +0,0 @@
-import 'dotenv/config';
-import babel from '@rollup/plugin-babel';
-import commonjs from '@rollup/plugin-commonjs';
-import json from '@rollup/plugin-json';
-import replace from '@rollup/plugin-replace';
-import resolve from '@rollup/plugin-node-resolve';
-import svelte from 'rollup-plugin-svelte';
-import { terser } from 'rollup-plugin-terser';
-import config from 'sapper/config/rollup.js';
-import pkg from './package.json';
-
-const mode = process.env.NODE_ENV;
-const dev = mode === 'development';
-const legacy = !!process.env.SAPPER_LEGACY_BUILD;
-
-if (!dev && !process.env.MAPBOX_ACCESS_TOKEN) {
- throw new Error('MAPBOX_ACCESS_TOKEN is missing. Please add the token in the .env file before generating the production build.');
-}
-
-const onwarn = (warning, onwarn) => (warning.code === 'CIRCULAR_DEPENDENCY' && /[/\\]@sapper[/\\]/.test(warning.message)) || onwarn(warning);
-const dedupe = importee => importee === 'svelte' || importee.startsWith('svelte/');
-
-export default {
- client: {
- input: config.client.input(),
- output: config.client.output(),
- plugins: [
- replace({
- 'process.browser': true,
- 'process.env.NODE_ENV': JSON.stringify(mode),
- 'process.env.MAPBOX_ACCESS_TOKEN': JSON.stringify(process.env.MAPBOX_ACCESS_TOKEN)
- }),
- svelte({
- dev,
- hydratable: true,
- emitCss: true
- }),
- resolve({
- browser: true,
- dedupe
- }),
- commonjs(),
- json(),
-
- legacy && babel({
- extensions: ['.js', '.mjs', '.html', '.svelte'],
- babelHelpers: 'runtime',
- exclude: ['node_modules/@babel/**'],
- presets: [
- ['@babel/preset-env', {
- targets: '> 0.25%, not dead'
- }]
- ],
- plugins: [
- '@babel/plugin-syntax-dynamic-import',
- ['@babel/plugin-transform-runtime', {
- useESModules: true
- }]
- ]
- }),
-
- !dev && terser({
- module: true
- })
- ],
-
- preserveEntrySignatures: false,
- onwarn
- },
-
- server: {
- input: config.server.input(),
- output: config.server.output(),
- plugins: [
- replace({
- 'process.browser': false,
- 'process.env.NODE_ENV': JSON.stringify(mode)
- }),
- svelte({
- generate: 'ssr',
- dev
- }),
- resolve({
- dedupe
- }),
- commonjs(),
- json()
- ],
- external: [
- 'yootils',
- 'codemirror',
- ...Object.keys(pkg.dependencies || {}).concat(
- require('module').builtinModules || Object.keys(process.binding('natives'))
- )
- ],
-
- preserveEntrySignatures: 'strict',
- onwarn
- },
-
- serviceworker: {
- input: config.serviceworker.input(),
- output: config.serviceworker.output(),
- plugins: [
- resolve(),
- replace({
- 'process.browser': true,
- 'process.env.NODE_ENV': JSON.stringify(mode)
- }),
- commonjs(),
- !dev && terser()
- ],
-
- preserveEntrySignatures: false,
- onwarn
- }
-};
diff --git a/site/scripts/copy-workers.js b/site/scripts/copy-workers.js
index 4856764ad0..733714b217 100644
--- a/site/scripts/copy-workers.js
+++ b/site/scripts/copy-workers.js
@@ -1,4 +1,4 @@
-const sh = require('shelljs');
+import sh from 'shelljs';
sh.rm('-rf', 'static/workers');
sh.cp('-r', 'node_modules/@sveltejs/svelte-repl/workers', 'static');
diff --git a/site/scripts/get-example-thumbnails/index.js b/site/scripts/get-example-thumbnails/index.js
index 770fca852f..4c920a3b52 100644
--- a/site/scripts/get-example-thumbnails/index.js
+++ b/site/scripts/get-example-thumbnails/index.js
@@ -1,7 +1,7 @@
-const fs = require('fs');
-const puppeteer = require('puppeteer');
-const Jimp = require('jimp');
-const c = require('kleur');
+import fs from 'fs';
+import puppeteer from 'puppeteer';
+import Jimp from 'jimp';
+import c from 'kleur';
const slugs = [];
diff --git a/site/scripts/get-examples-from-tutorials/index.js b/site/scripts/get-examples-from-tutorials/index.js
index f828a089be..50a39ca2fd 100644
--- a/site/scripts/get-examples-from-tutorials/index.js
+++ b/site/scripts/get-examples-from-tutorials/index.js
@@ -1,5 +1,8 @@
-const sander = require('sander');
+import sander from 'sander';
+import { dirname } from 'path';
+import { fileURLToPath } from 'url';
+const __dirname = dirname(fileURLToPath(import.meta.url));
process.chdir(`${__dirname}/../..`);
function extract_frontmatter(markdown) {
diff --git a/site/scripts/get-contributors.js b/site/scripts/get_contributors.js
similarity index 65%
rename from site/scripts/get-contributors.js
rename to site/scripts/get_contributors.js
index cb1facb874..a98696793b 100644
--- a/site/scripts/get-contributors.js
+++ b/site/scripts/get_contributors.js
@@ -1,14 +1,27 @@
-require('dotenv/config');
-const fs = require('fs');
-const fetch = require('node-fetch');
-const Jimp = require('jimp');
+import 'dotenv/config';
+import fs from 'fs';
+import fetch from 'node-fetch';
+import Jimp from 'jimp';
+import { dirname } from 'path';
+import { fileURLToPath } from 'url';
+
+const force = process.env.FORCE_UPDATE === 'true';
+
+const __dirname = dirname(fileURLToPath(import.meta.url));
process.chdir(__dirname);
+const outputFile = `../src/routes/_contributors.js`;
+if (!force && fs.existsSync(outputFile)) {
+ console.info(`[update/contributors] ${outputFile} exists. Skipping`);
+ process.exit(0);
+}
+
const base = `https://api.github.com/repos/sveltejs/svelte/contributors`;
const { GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET } = process.env;
-const SIZE = 64;
+const MAX = 20;
+const SIZE = 128;
async function main() {
const contributors = [];
@@ -24,7 +37,9 @@ async function main() {
}
const authors = contributors
- .sort((a, b) => b.contributions - a.contributions);
+ .filter(({ login }) => !login.includes('[bot]'))
+ .sort((a, b) => b.contributions - a.contributions)
+ .slice(0, MAX);
const sprite = new Jimp(SIZE * authors.length, SIZE);
@@ -47,7 +62,7 @@ async function main() {
const str = `[\n\t${authors.map(a => `'${a.login}'`).join(',\n\t')}\n]`;
- fs.writeFileSync(`../src/routes/_contributors.js`, `export default ${str};`);
+ fs.writeFileSync(outputFile, `export default ${str};`);
}
-main();
\ No newline at end of file
+main();
diff --git a/site/scripts/get_donors.js b/site/scripts/get_donors.js
new file mode 100644
index 0000000000..a636c60934
--- /dev/null
+++ b/site/scripts/get_donors.js
@@ -0,0 +1,65 @@
+import 'dotenv/config';
+import fs from 'fs';
+import fetch from 'node-fetch';
+import Jimp from 'jimp';
+import { dirname } from 'path';
+import { fileURLToPath } from 'url';
+
+
+const force = process.env.FORCE_UPDATE === 'true';
+
+const __dirname = dirname(fileURLToPath(import.meta.url));
+process.chdir(__dirname);
+
+const outputFile = `../src/routes/_donors.js`;
+if (!force && fs.existsSync(outputFile)) {
+ console.info(`[update/donors] ${outputFile} exists. Skipping`);
+ process.exit(0);
+}
+
+const MAX = 20;
+const SIZE = 128;
+
+async function main() {
+ const res = await fetch('https://opencollective.com/svelte/members/all.json');
+ const donors = await res.json();
+
+ const unique = new Map();
+ donors.forEach(d => unique.set(d.profile, d));
+
+ let backers = [...unique.values()]
+ .filter(({ role }) => role === 'BACKER')
+ .sort((a, b) => b.totalAmountDonated - a.totalAmountDonated)
+ .slice(0, 3 * MAX);
+
+ const included = [];
+ for (let i = 0; included.length < MAX; i += 1) {
+ const backer = backers[i];
+ console.log(`${included.length + 1} / ${MAX}: ${backer.name}`);
+
+ try {
+ const image_data = await fetch(backer.image);
+ const buffer = await image_data.arrayBuffer();
+ const image = await Jimp.read(buffer);
+ image.resize(SIZE, SIZE);
+ included.push({ backer, image });
+ } catch( err) {
+ console.log(`Skipping ${backer.name}: no image data`);
+ }
+ }
+
+ const sprite = new Jimp(SIZE * included.length, SIZE);
+ for (let i = 0; i < included.length; i += 1) {
+ sprite.composite(included[i].image, i * SIZE, 0);
+ }
+
+ await sprite.quality(80).write(`../static/donors.jpg`);
+ // TODO: Optimizing the static/donors.jpg image should probably get automated as well
+ console.log('remember to additionally optimize the resulting /static/donors.jpg image file via e.g. https://squoosh.app ');
+
+ const str = `[\n\t${included.map(a => `${JSON.stringify(a.backer.name)}`).join(',\n\t')}\n]`;
+
+ fs.writeFileSync(outputFile, `export default ${str};`);
+}
+
+main();
diff --git a/site/scripts/update.js b/site/scripts/update.js
new file mode 100644
index 0000000000..724c0d1be8
--- /dev/null
+++ b/site/scripts/update.js
@@ -0,0 +1,9 @@
+import sh from 'shelljs';
+
+sh.env['FORCE_UPDATE'] = process.argv.includes('--force=true');
+
+Promise.all([
+ sh.exec('node ./scripts/get_contributors.js'),
+ sh.exec('node ./scripts/get_donors.js'),
+ sh.exec('node ./scripts/update_template.js')
+]);
diff --git a/site/scripts/update_template.js b/site/scripts/update_template.js
index 9d897c064f..77395efa5f 100644
--- a/site/scripts/update_template.js
+++ b/site/scripts/update_template.js
@@ -1,7 +1,18 @@
-const sh = require('shelljs');
-const fs = require('fs');
+import sh from 'shelljs';
+import fs from 'fs';
+import path, { dirname } from 'path';
+import { fileURLToPath } from 'url';
-sh.cd(__dirname + '/../');
+const force = process.env.FORCE_UPDATE === 'true';
+
+const __dirname = dirname(fileURLToPath(import.meta.url));
+sh.cd(path.join(__dirname, '..'));
+
+const outputFile = 'static/svelte-app.json';
+if (!force && fs.existsSync(outputFile)) {
+ console.info(`[update/template] ${outputFile} exists. Skipping`);
+ process.exit(0);
+}
// fetch svelte app
sh.rm('-rf','scripts/svelte-app');
@@ -22,4 +33,4 @@ for (const path of sh.find(appPath).filter(p => fs.lstatSync(p).isFile()) ) {
files.push({ path: path.slice(appPath.length + 1), data });
}
-fs.writeFileSync('static/svelte-app.json', JSON.stringify(files));
\ No newline at end of file
+fs.writeFileSync(outputFile, JSON.stringify(files));
diff --git a/site/scripts/update_whos_using.js b/site/scripts/update_whos_using.js
deleted file mode 100644
index 131a162359..0000000000
--- a/site/scripts/update_whos_using.js
+++ /dev/null
@@ -1,12 +0,0 @@
-const sh = require('shelljs');
-
-sh.cd(__dirname + '/../');
-
-// fetch community repo
-sh.rm('-rf','scripts/community');
-sh.exec('npx degit sveltejs/community scripts/community');
-
-// copy over relevant files
-sh.cp('scripts/community/whos-using-svelte/WhosUsingSvelte.svelte', 'src/routes/_components/WhosUsingSvelte.svelte');
-sh.rm('-rf', 'static/organisations');
-sh.cp('-r', 'scripts/community/whos-using-svelte/organisations', 'static');
diff --git a/site/src/app.html b/site/src/app.html
new file mode 100644
index 0000000000..d051adb2f3
--- /dev/null
+++ b/site/src/app.html
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ %svelte.head%
+
+
+ %svelte.body%
+
+
diff --git a/site/src/client.js b/site/src/client.js
deleted file mode 100644
index bda299367b..0000000000
--- a/site/src/client.js
+++ /dev/null
@@ -1,6 +0,0 @@
-import '@sveltejs/site-kit/base.css';
-import * as sapper from '@sapper/app';
-
-sapper.start({
- target: document.querySelector('#sapper')
-});
\ No newline at end of file
diff --git a/site/src/components/Repl/ReplWidget.svelte b/site/src/components/Repl/ReplWidget.svelte
index e83d53fb4d..ced2aafee2 100644
--- a/site/src/components/Repl/ReplWidget.svelte
+++ b/site/src/components/Repl/ReplWidget.svelte
@@ -1,6 +1,7 @@
+
-{#each contributors as contributor, i}
-
- {contributor}
-
-{/each}
+
+
+And so many more →
diff --git a/site/src/routes/_components/Donors.svelte b/site/src/routes/_components/Donors.svelte
new file mode 100644
index 0000000000..be6091b6e0
--- /dev/null
+++ b/site/src/routes/_components/Donors.svelte
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+And so many more →
diff --git a/site/src/routes/_components/WhosUsingSvelte.js b/site/src/routes/_components/WhosUsingSvelte.js
new file mode 100644
index 0000000000..430bc95867
--- /dev/null
+++ b/site/src/routes/_components/WhosUsingSvelte.js
@@ -0,0 +1,80 @@
+export const companies = [
+ {
+ href: "https://1password.com",
+ filename: "1password.svg",
+ alt: "1Password logo",
+ },
+ {
+ href: "https://www.alaskaair.com/",
+ style: "background-color: #01426a;",
+ filename: "alaskaairlines.svg",
+ alt: "Alaska Airlines logo",
+ },
+ {
+ href: "https://avast.com",
+ filename: "avast.svg",
+ alt: "Avast logo",
+ },
+ {
+ href: "https://chess.com",
+ style: "background-color: #312e2b;",
+ filename: "chess.svg",
+ alt: "Chess.com logo",
+ },
+ {
+ href: "https://fusioncharts.com",
+ filename: "fusioncharts.svg",
+ alt: "FusionCharts logo",
+ },
+ {
+ href: "https://godaddy.com",
+ filename: "godaddy.svg",
+ alt: "GoDaddy logo",
+ },
+ {
+ href: "https://www.ibm.com/",
+ filename: "ibm.svg",
+ alt: "IBM logo",
+ },
+ {
+ href: "https://media.lesechos.fr/infographie",
+ filename: "les-echos.svg",
+ alt: "Les Echos",
+ },
+ {
+ href: "https://www.philips.co.uk",
+ filename: "philips.svg",
+ alt: "Philips logo",
+ },
+ {
+ href: "https://global.rakuten.com/corp/",
+ filename: "rakuten.svg",
+ alt: "Rakuten logo",
+ },
+ {
+ href: "https://razorpay.com",
+ filename: "razorpay.svg",
+ alt: "Razorpay logo",
+ },
+ {
+ href: "https://www.se.com",
+ style: " background-color: #3dcd58; ",
+ filename: "Schneider_Electric.svg",
+ alt: "Schneider Electric",
+ },
+ {
+ href: "https://squareup.com",
+ filename: "square.svg",
+ alt: "Square",
+ },
+ {
+ href: "https://nytimes.com",
+ filename: "nyt.svg",
+ alt: "The New York Times logo",
+ },
+ {
+ href: "https://transloadit.com",
+ filename: "transloadit.svg",
+ alt: "Transloadit",
+ },
+];
diff --git a/site/src/routes/_components/WhosUsingSvelte.svelte b/site/src/routes/_components/WhosUsingSvelte.svelte
new file mode 100644
index 0000000000..06094eac2c
--- /dev/null
+++ b/site/src/routes/_components/WhosUsingSvelte.svelte
@@ -0,0 +1,66 @@
+
+
+
+
+
diff --git a/site/src/routes/apps/index.json.js b/site/src/routes/apps/index.json.js
index e6a09d52c5..e6b7d42e5b 100644
--- a/site/src/routes/apps/index.json.js
+++ b/site/src/routes/apps/index.json.js
@@ -1,26 +1,25 @@
-import send from '@polka/send';
-import { query } from '../../utils/db';
+import { query as db_query } from '../../utils/db';
-export async function get(req, res) {
- if (req.user) {
+export async function get({ query, locals }) {
+ if (locals.user) {
const page_size = 100;
- const offset = req.query.offset ? parseInt(req.query.offset) : 0;
- const rows = await query(`
+ const offset = query.get('offset') ? parseInt(query.get('offset')) : 0;
+ const rows = await db_query(`
select g.uid, g.name, coalesce(g.updated_at, g.created_at) as updated_at
from gists g
where g.user_id = $1
order by id desc
limit ${page_size + 1}
offset $2
- `, [req.user.id, offset]);
+ `, [locals.user.id, offset]);
rows.forEach(row => {
row.uid = row.uid.replace(/-/g, '');
});
const more = rows.length > page_size;
- send(res, 200, { apps: rows.slice(0, page_size), offset: more ? offset + page_size : null });
+ return { body: { apps: rows.slice(0, page_size), offset: more ? offset + page_size : null }};
} else {
- send(res, 401);
+ return { status: 401 };
}
}
diff --git a/site/src/routes/apps/index.svelte b/site/src/routes/apps/index.svelte
index 36cd1a904c..3c025f3b42 100644
--- a/site/src/routes/apps/index.svelte
+++ b/site/src/routes/apps/index.svelte
@@ -1,22 +1,22 @@
diff --git a/site/src/routes/auth/_config.js b/site/src/routes/auth/_config.js
index 7d1669cd72..58a9856bcc 100644
--- a/site/src/routes/auth/_config.js
+++ b/site/src/routes/auth/_config.js
@@ -1,6 +1,6 @@
export const oauth = 'https://github.com/login/oauth';
-export const baseurl = process.env.BASEURL;
+export const baseurl = process.env['BASEURL'];
export const secure = baseurl && baseurl.startsWith('https:');
-export const client_id = process.env.GITHUB_CLIENT_ID;
-export const client_secret = process.env.GITHUB_CLIENT_SECRET;
\ No newline at end of file
+export const client_id = process.env['GITHUB_CLIENT_ID'];
+export const client_secret = process.env['GITHUB_CLIENT_SECRET'];
diff --git a/site/src/routes/auth/callback.js b/site/src/routes/auth/callback.js
index 7979b1c21f..971ac96071 100644
--- a/site/src/routes/auth/callback.js
+++ b/site/src/routes/auth/callback.js
@@ -1,4 +1,3 @@
-import send from '@polka/send';
import devalue from 'devalue';
import * as cookie from 'cookie';
import * as httpie from 'httpie';
@@ -6,11 +5,11 @@ import { parse, stringify } from 'querystring';
import { sanitize_user, create_user, create_session } from '../../utils/auth';
import { oauth, secure, client_id, client_secret } from './_config.js';
-export async function get(req, res) {
+export async function get({ query }) {
try {
// Trade "code" for "access_token"
const r1 = await httpie.post(`${oauth}/access_token?` + stringify({
- code: req.query.code,
+ code: query.get('code'),
client_id,
client_secret,
}));
@@ -27,28 +26,29 @@ export async function get(req, res) {
const user = await create_user(r2.data, access_token);
const session = await create_session(user);
- res.writeHead(200, {
- 'Set-Cookie': cookie.serialize('sid', session.uid, {
- maxAge: 31536000,
- path: '/',
- httpOnly: true,
- secure
- }),
- 'Content-Type': 'text/html; charset=utf-8'
- });
-
- res.end(`
+ return {
+ headers: {
+ 'Set-Cookie': cookie.serialize('sid', session.uid, {
+ maxAge: 31536000,
+ path: '/',
+ httpOnly: true,
+ secure
+ }),
+ 'Content-Type': 'text/html; charset=utf-8'
+ },
+ body: `
- `);
+ `
+ };
} catch (err) {
console.error('GET /auth/callback', err);
- send(res, 500, err.data, {
- 'Content-Type': err.headers['content-type'],
- 'Content-Length': err.headers['content-length']
- });
+ return {
+ status: 500,
+ body: err.data
+ };
}
-}
\ No newline at end of file
+}
diff --git a/site/src/routes/auth/login.js b/site/src/routes/auth/login.js
index 7240498418..b1f075d682 100644
--- a/site/src/routes/auth/login.js
+++ b/site/src/routes/auth/login.js
@@ -1,19 +1,28 @@
-import send from '@polka/send';
import { stringify } from 'querystring';
import { oauth, baseurl, client_id } from './_config.js';
export const get = client_id
- ? (req, res) => {
+ ? () => {
const Location = `${oauth}/authorize?` + stringify({
scope: 'read:user',
client_id,
redirect_uri: `${baseurl}/auth/callback`,
});
- send(res, 302, Location, { Location });
+ return {
+ status: 302,
+ headers: {
+ Location
+ }
+ };
}
- : (req, res) => {
- send(res, 500, `
+ : () => {
+ return {
+ status: 500,
+ headers: {
+ 'Content-Type': 'text/html; charset=utf-8'
+ },
+ body: `
Missing .env file
In order to use GitHub authentication, you will need to register an OAuth application and create a local .env file:
@@ -21,7 +30,6 @@ export const get = client_id
The BASEURL variable should match the callback URL specified for your app.
See also here
- `, {
- 'Content-Type': 'text/html; charset=utf-8'
- });
- };
\ No newline at end of file
+ `
+ };
+ };
diff --git a/site/src/routes/auth/logout.js b/site/src/routes/auth/logout.js
index 7e132f0a41..cafc25ee04 100644
--- a/site/src/routes/auth/logout.js
+++ b/site/src/routes/auth/logout.js
@@ -1,17 +1,18 @@
-import send from '@polka/send';
import * as cookie from 'cookie';
import { secure } from './_config.js';
import { delete_session } from '../../utils/auth.js';
-export async function get(req, res) {
- await delete_session(req.cookies.sid);
+export async function get(request) {
+ await delete_session(request.locals.cookies.sid);
- send(res, 200, '', {
- 'Set-Cookie': cookie.serialize('sid', '', {
- maxAge: -1,
- path: '/',
- httpOnly: true,
- secure
- })
- });
-}
\ No newline at end of file
+ return {
+ headers: {
+ 'Set-Cookie': cookie.serialize('sid', '', {
+ maxAge: -1,
+ path: '/',
+ httpOnly: true,
+ secure
+ })
+ }
+ };
+}
diff --git a/site/src/routes/blog/[slug].json.js b/site/src/routes/blog/[slug].json.js
index ee41d5826d..60c48dd2f7 100644
--- a/site/src/routes/blog/[slug].json.js
+++ b/site/src/routes/blog/[slug].json.js
@@ -1,9 +1,8 @@
-import send from '@polka/send';
import get_posts from './_posts.js';
let lookup;
-export function get(req, res) {
+export function get({ params }) {
if (!lookup || process.env.NODE_ENV !== 'production') {
lookup = new Map();
get_posts().forEach(post => {
@@ -11,12 +10,14 @@ export function get(req, res) {
});
}
- const post = lookup.get(req.params.slug);
+ const post = lookup.get(params.slug);
if (post) {
- res.setHeader('Cache-Control', `max-age=${5 * 60 * 1e3}`); // 5 minutes
- send(res, 200, post);
- } else {
- send(res, 404, { message: 'not found' });
+ return {
+ body: post,
+ headers: {
+ 'Cache-Control': `max-age=${5 * 60 * 1e3}` // 5 minutes
+ }
+ };
}
}
diff --git a/site/src/routes/blog/[slug].svelte b/site/src/routes/blog/[slug].svelte
index b97b5ef136..480a1aa4a0 100644
--- a/site/src/routes/blog/[slug].svelte
+++ b/site/src/routes/blog/[slug].svelte
@@ -1,7 +1,9 @@
@@ -172,17 +174,4 @@
margin: 2em auto;
}
}
-
- /* @media (min-width: 1460px) {
- .post :global(iframe) {
- width: 1360px;
- margin: 2em -280px;
- }
- }
-
- @media (min-height: 800px) {
- .post :global(iframe) {
- height: 640px;
- }
- } */
diff --git a/site/src/routes/blog/_posts.js b/site/src/routes/blog/_posts.js
index 2c86e13656..0f66833c0e 100644
--- a/site/src/routes/blog/_posts.js
+++ b/site/src/routes/blog/_posts.js
@@ -1,7 +1,7 @@
import fs from 'fs';
import path from 'path';
import { extract_frontmatter, link_renderer } from '@sveltejs/site-kit/utils/markdown.js';
-import marked from 'marked';
+import { marked } from 'marked';
import { makeSlugProcessor } from '../../utils/slug';
import { highlight } from '../../utils/highlight';
import { SLUG_PRESERVE_UNICODE } from '../../../config';
diff --git a/site/src/routes/blog/index.json.js b/site/src/routes/blog/index.json.js
index 75180e6e87..b65451a5a1 100644
--- a/site/src/routes/blog/index.json.js
+++ b/site/src/routes/blog/index.json.js
@@ -1,9 +1,8 @@
-import send from '@polka/send';
import get_posts from './_posts.js';
let json;
-export function get(req, res) {
+export function get() {
if (!json || process.env.NODE_ENV !== 'production') {
const posts = get_posts()
.filter(post => !post.metadata.draft)
@@ -17,8 +16,11 @@ export function get(req, res) {
json = JSON.stringify(posts);
}
- send(res, 200, json, {
- 'Content-Type': 'application/json',
- 'Cache-Control': `max-age=${5 * 60 * 1e3}` // 5 minutes
- });
+ return {
+ body: json,
+ headers: {
+ 'Content-Type': 'application/json',
+ 'Cache-Control': `max-age=${5 * 60 * 1e3}` // 5 minutes
+ }
+ }
}
diff --git a/site/src/routes/blog/index.svelte b/site/src/routes/blog/index.svelte
index 92fc5ce96d..40131d7a19 100644
--- a/site/src/routes/blog/index.svelte
+++ b/site/src/routes/blog/index.svelte
@@ -1,7 +1,11 @@
@@ -18,10 +22,11 @@
+Blog
{#each posts as post}
-
+
{post.metadata.title}
{post.metadata.description}
diff --git a/site/src/routes/blog/rss.xml.js b/site/src/routes/blog/rss.xml.js
index 544474b274..a82426a973 100644
--- a/site/src/routes/blog/rss.xml.js
+++ b/site/src/routes/blog/rss.xml.js
@@ -1,4 +1,3 @@
-import send from '@polka/send';
import get_posts from '../blog/_posts.js';
const months = ',Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec'.split(',');
@@ -46,9 +45,12 @@ const rss = `
`.replace(/>[^\S]+/gm, '>').replace(/[^\S]+
- export async function preload() {
- const sections = await this.fetch(`docs.json`).then(r => r.json());
- return { sections };
+ const title_replacements = {
+ '1_export_creates_a_component_prop': 'props',
+ '2_Assignments_are_reactive': 'reactive assignments',
+ '3_$_marks_a_statement_as_reactive': 'reactive statements ($:)',
+ '4_Prefix_stores_with_$_to_access_their_values': 'accessing stores ($)'
+ };
+
+ export async function load({ fetch }) {
+ const sections = await fetch(`docs.json`).then(r => r.json());
+ for (const section of sections) {
+ for (const subsection of section.subsections) {
+ const { slug } = subsection;
+ // show abbreviated title in the table of contents
+ if (slug in title_replacements) {
+ subsection.title = title_replacements[slug];
+ }
+ }
+ }
+
+ return {
+ props: {
+ sections
+ }
+ };
}
@@ -19,4 +40,5 @@
+API Docs
diff --git a/site/src/routes/examples/[slug].json.js b/site/src/routes/examples/[slug].json.js
index 705a4e7e89..44e65aa840 100644
--- a/site/src/routes/examples/[slug].json.js
+++ b/site/src/routes/examples/[slug].json.js
@@ -1,10 +1,9 @@
-import send from '@polka/send';
import { get_example } from './_examples.js';
const cache = new Map();
-export function get(req, res) {
- const { slug } = req.params;
+export function get({ params }) {
+ const { slug } = params;
let example = cache.get(slug);
@@ -14,10 +13,8 @@ export function get(req, res) {
}
if (example) {
- send(res, 200, example);
- } else {
- send(res, 404, {
- error: 'not found'
- });
+ return {
+ body: example
+ };
}
}
diff --git a/site/src/routes/examples/index.json.js b/site/src/routes/examples/index.json.js
index 09876e1993..d425d50203 100644
--- a/site/src/routes/examples/index.json.js
+++ b/site/src/routes/examples/index.json.js
@@ -1,18 +1,22 @@
-import send from '@polka/send';
import { get_examples } from './_examples.js';
let cached;
-export function get(req, res) {
- try {
- if (!cached || process.env.NODE_ENV !== 'production') {
- cached = get_examples().filter(section => section.title);
- }
+export function get() {
+ if (!cached || process.env.NODE_ENV !== 'production') {
+ cached = get_examples().filter(section => section.title);
+ }
- send(res, 200, cached);
- } catch (e) {
- send(res, e.status || 500, {
- message: e.message
- });
+ try {
+ return {
+ body: cached
+ };
+ } catch(err) {
+ return {
+ status: e.status || 500,
+ body: {
+ message: e.message
+ }
+ };
}
}
diff --git a/site/src/routes/examples/index.svelte b/site/src/routes/examples/index.svelte
index 9fd783f950..099e39956c 100644
--- a/site/src/routes/examples/index.svelte
+++ b/site/src/routes/examples/index.svelte
@@ -1,7 +1,7 @@
@@ -26,7 +30,7 @@
-
+
{faq.metadata.question}
{@html faq.answer}
diff --git a/site/src/routes/index.svelte b/site/src/routes/index.svelte
index 73fbffbc6a..f64753417a 100644
--- a/site/src/routes/index.svelte
+++ b/site/src/routes/index.svelte
@@ -1,6 +1,7 @@
@@ -10,22 +12,24 @@
@@ -41,7 +44,7 @@
- {#if process.browser}
+ {#if browser}
{/if}
diff --git a/site/src/routes/repl/index.svelte b/site/src/routes/repl/index.svelte
index 0c7acfc9dc..483ab7e4cd 100644
--- a/site/src/routes/repl/index.svelte
+++ b/site/src/routes/repl/index.svelte
@@ -1,16 +1,23 @@
\ No newline at end of file
+
diff --git a/site/src/routes/repl/local/[...file].js b/site/src/routes/repl/local/[...file].js
deleted file mode 100644
index 7bd1c6a82c..0000000000
--- a/site/src/routes/repl/local/[...file].js
+++ /dev/null
@@ -1,17 +0,0 @@
-import { createReadStream } from 'fs';
-
-export function get(req, res) {
- const path = req.params.file.join('/');
- if (process.env.NODE_ENV !== 'development' || ('/' + path).includes('/.')) {
- res.writeHead(403);
- res.end();
- return;
- }
- createReadStream('../' + path)
- .on('error', () => {
- res.writeHead(403);
- res.end();
- })
- .pipe(res);
- res.writeHead(200, { 'Content-Type': 'text/javascript' });
-}
diff --git a/site/src/routes/repl/local/[...path].js b/site/src/routes/repl/local/[...path].js
new file mode 100644
index 0000000000..72bf70722f
--- /dev/null
+++ b/site/src/routes/repl/local/[...path].js
@@ -0,0 +1,11 @@
+import { readFileSync } from 'fs';
+
+export function get({ params: { path } }) {
+ if (process.env.NODE_ENV !== 'development' || ('/' + path).includes('/.')) {
+ return { status: 403 };
+ }
+ return {
+ headers: { 'Content-Type': 'text/javascript' },
+ body: readFileSync('../' + path)
+ };
+}
diff --git a/site/src/routes/tutorial/[slug]/_TableOfContents.svelte b/site/src/routes/tutorial/[slug]/_TableOfContents.svelte
index 97a298bcca..4a28c2335e 100644
--- a/site/src/routes/tutorial/[slug]/_TableOfContents.svelte
+++ b/site/src/routes/tutorial/[slug]/_TableOfContents.svelte
@@ -1,5 +1,5 @@
@@ -16,6 +21,7 @@
+
+
+
+
diff --git a/site/src/routes/tutorial/_layout.svelte b/site/src/routes/tutorial/_layout.svelte
deleted file mode 100644
index c424fac2e6..0000000000
--- a/site/src/routes/tutorial/_layout.svelte
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/site/src/routes/tutorial/index.json.js b/site/src/routes/tutorial/index.json.js
index 5c7ec8efa1..9df41f9e26 100644
--- a/site/src/routes/tutorial/index.json.js
+++ b/site/src/routes/tutorial/index.json.js
@@ -1,5 +1,4 @@
import * as fs from 'fs';
-import send from '@polka/send';
import { extract_frontmatter } from '@sveltejs/site-kit/utils/markdown';
let json;
@@ -48,16 +47,21 @@ function get_sections() {
return sections;
}
-export function get(req, res) {
+export function get() {
try {
if (!json || process.env.NODE_ENV !== 'production') {
json = get_sections();
}
- send(res, 200, json);
+ return {
+ body: json
+ };
} catch (err) {
- send(res, 500, {
- message: err.message
- });
+ return {
+ status: 500,
+ body: {
+ message: err.message
+ }
+ };
}
}
diff --git a/site/src/routes/tutorial/index.svelte b/site/src/routes/tutorial/index.svelte
index 738a1b33e8..69abd448aa 100644
--- a/site/src/routes/tutorial/index.svelte
+++ b/site/src/routes/tutorial/index.svelte
@@ -1,5 +1,8 @@
\ No newline at end of file
+
diff --git a/site/src/routes/tutorial/random-number.js b/site/src/routes/tutorial/random-number.js
index 818a38fe6a..5a4d94e1f4 100644
--- a/site/src/routes/tutorial/random-number.js
+++ b/site/src/routes/tutorial/random-number.js
@@ -1,20 +1,23 @@
-export function get(req, res) {
+export async function get(req) {
let { min = '0', max = '100' } = req.query;
min = +min;
max = +max;
- res.setHeader('Access-Control-Allow-Origin', '*');
-
// simulate a long delay
- setTimeout(() => {
- // fail sometimes
- if (Math.random() < 0.333) {
- res.statusCode = 400;
- res.end(`Failed to generate random number. Please try again`);
- return;
- }
+ await new Promise((res) => setTimeout(res, 1000));
+
+ // fail sometimes
+ if (Math.random() < 0.333) {
+ return {
+ status: 400,
+ headers: { 'Access-Control-Allow-Origin': '*' },
+ body: `Failed to generate random number. Please try again`
+ };
+ }
- const num = min + Math.round(Math.random() * (max - min));
- res.end(String(num));
- }, 1000);
-}
\ No newline at end of file
+ const num = min + Math.round(Math.random() * (max - min));
+ return {
+ headers: { 'Access-Control-Allow-Origin': '*' },
+ body: String(num)
+ };
+}
diff --git a/site/src/server.js b/site/src/server.js
deleted file mode 100644
index c7cf93c3b5..0000000000
--- a/site/src/server.js
+++ /dev/null
@@ -1,37 +0,0 @@
-import polka from 'polka';
-import send from '@polka/send';
-import sirv from 'sirv';
-import * as sapper from '@sapper/server';
-import { sanitize_user, authenticate } from './utils/auth';
-
-const { PORT = 3000 } = process.env;
-
-const app = polka({
- onError: (err, req, res) => {
- const error = err.message || err;
- const code = err.code || err.status || 500;
- res.headersSent || send(res, code, { error });
- }
-});
-
-if (process.env.PGHOST) {
- app.use(authenticate());
-}
-
-app.use(
- sirv('static', {
- dev: process.env.NODE_ENV === 'development',
- setHeaders(res) {
- res.setHeader('Access-Control-Allow-Origin', '*');
- res.hasHeader('Cache-Control') || res.setHeader('Cache-Control', 'max-age=600'); // 10min default
- }
- }),
-
- sapper.middleware({
- session: req => ({
- user: sanitize_user(req.user)
- })
- })
-);
-
-app.listen(PORT);
diff --git a/site/src/service-worker.js b/site/src/service-worker.js
deleted file mode 100644
index f7a76df99a..0000000000
--- a/site/src/service-worker.js
+++ /dev/null
@@ -1,87 +0,0 @@
-import { timestamp, files, shell } from '@sapper/service-worker';
-
-const ASSETS = `cache${timestamp}`;
-
-// `shell` is an array of all the files generated by Rollup,
-// `files` is an array of everything in the `static` directory
-const to_cache = shell.concat(files.filter(file => {
- const basename = file.split('/').pop();
- if (basename[0] === '.') return false; // .DS_Store and friends
- if (basename.endsWith('.mp3')) return false; // TODO others?
- return true;
-}));
-const cached = new Set(to_cache);
-
-self.addEventListener('install', event => {
- event.waitUntil(
- caches
- .open(ASSETS)
- .then(cache => cache.addAll(to_cache))
- .then(() => {
- self.skipWaiting();
- })
- );
-});
-
-self.addEventListener('activate', event => {
- event.waitUntil(
- caches.keys().then(async keys => {
- // delete old caches
- for (const key of keys) {
- if (key !== ASSETS) await caches.delete(key);
- }
-
- self.clients.claim();
- })
- );
-});
-
-self.addEventListener('fetch', event => {
- if (event.request.method !== 'GET' || event.request.headers.has('range')) return;
-
- const url = new URL(event.request.url);
-
- // don't try to handle e.g. data: URIs
- if (!url.protocol.startsWith('http')) return;
-
- // ignore dev server requests
- if (url.hostname === self.location.hostname && url.port !== self.location.port) return;
-
- // always serve static files and Rollup-generated assets from cache
- if (url.host === self.location.host && cached.has(url.pathname)) {
- event.respondWith(caches.match(event.request));
- return;
- }
-
- // for pages, you might want to serve a shell `index.html` file,
- // which Sapper has generated for you. It's not right for every
- // app, but if it's right for yours then uncomment this section
- /*
- if (url.origin === self.origin && routes.find(route => route.pattern.test(url.pathname))) {
- event.respondWith(caches.match('/index.html'));
- return;
- }
- */
-
- if (event.request.cache === 'only-if-cached') return;
-
- // for everything else, try the network first, falling back to
- // cache if the user is offline. (If the pages never change, you
- // might prefer a cache-first approach to a network-first one.)
- event.respondWith(
- caches
- .open(`offline${timestamp}`)
- .then(async cache => {
- try {
- const response = await fetch(event.request);
- cache.put(event.request, response.clone());
- return response;
- } catch (err) {
- const response = await cache.match(event.request);
- if (response) return response;
-
- throw err;
- }
- })
- );
-});
diff --git a/site/src/template.html b/site/src/template.html
deleted file mode 100644
index 28ea1910a5..0000000000
--- a/site/src/template.html
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
- %sapper.base%
-
-
-
-
-
-
-
-
-
-
-
-
-
- %sapper.styles%
-
-
- %sapper.head%
-
-
-
- %sapper.html%
-
-
- %sapper.scripts%
-
-
diff --git a/site/src/utils/auth.js b/site/src/utils/auth.js
index 1f7ccaf867..e810a4fe32 100644
--- a/site/src/utils/auth.js
+++ b/site/src/utils/auth.js
@@ -1,4 +1,3 @@
-import * as cookie from 'cookie';
import flru from 'flru';
import { find, query } from './db';
@@ -37,7 +36,7 @@ export const delete_session = async sid => {
session_cache.set(sid, null);
};
-const get_user = async sid => {
+export const get_user = async sid => {
if (!sid) return null;
if (!session_cache.has(sid)) {
@@ -51,15 +50,3 @@ const get_user = async sid => {
return session_cache.get(sid);
};
-
-export const authenticate = () => {
- // this is a convenient time to clear out expired sessions
- query(`delete from sessions where expiry < now()`);
-
- return async (req, res, next) => {
- req.cookies = cookie.parse(req.headers.cookie || '');
- req.user = await get_user(req.cookies.sid);
-
- next();
- };
-};
\ No newline at end of file
diff --git a/site/src/utils/db.js b/site/src/utils/db.js
index 069450b0f3..4d512aabe9 100644
--- a/site/src/utils/db.js
+++ b/site/src/utils/db.js
@@ -1,7 +1,7 @@
-import { Pool } from 'pg';
+import pg from 'pg';
// Uses `PG*` ENV vars
-export const DB = process.env.PGHOST ? new Pool() : null;
+export const DB = process.env['PGHOST'] ? new pg.Pool() : null;
export function query(text, values=[]) {
return DB.query(text, values).then(r => r.rows);
diff --git a/site/src/utils/highlight.js b/site/src/utils/highlight.js
index 124af2e6be..cbe227cec2 100644
--- a/site/src/utils/highlight.js
+++ b/site/src/utils/highlight.js
@@ -1,7 +1,7 @@
import { langs } from '@sveltejs/site-kit/utils/markdown.js';
import PrismJS from 'prismjs';
-import 'prismjs/components/prism-bash';
-import 'prismjs/components/prism-diff';
+import 'prismjs/components/prism-bash.js';
+import 'prismjs/components/prism-diff.js';
import 'prism-svelte';
export function highlight(source, lang) {
diff --git a/site/src/utils/slug.js b/site/src/utils/slug.js
index 05ec5512ca..25afcdf017 100644
--- a/site/src/utils/slug.js
+++ b/site/src/utils/slug.js
@@ -1,5 +1,5 @@
import slugify from '@sindresorhus/slugify';
-import {SLUG_SEPARATOR} from '../../config';
+import {SLUG_SEPARATOR} from '../../config.js';
/* url-safe processor */
diff --git a/site/static/examples/thumbnails/actions-pannable.jpg b/site/static/examples/thumbnails/actions-pannable.jpg
new file mode 100644
index 0000000000..3c152ab570
Binary files /dev/null and b/site/static/examples/thumbnails/actions-pannable.jpg differ
diff --git a/site/static/examples/thumbnails/conditional-slots.jpg b/site/static/examples/thumbnails/conditional-slots.jpg
new file mode 100644
index 0000000000..39bdbf3a3e
Binary files /dev/null and b/site/static/examples/thumbnails/conditional-slots.jpg differ
diff --git a/site/static/global.css b/site/static/global.css
index 7aa0715a98..329a811545 100644
--- a/site/static/global.css
+++ b/site/static/global.css
@@ -29,3 +29,16 @@ h5:hover .anchor,
h6:hover .anchor {
opacity: 1;
}
+
+/* visually hidden, but accessible to assistive tech */
+.visually-hidden {
+ border: 0;
+ clip: rect(0 0 0 0);
+ height: auto;
+ margin: 0;
+ overflow: hidden;
+ padding: 0;
+ position: absolute;
+ width: 1px;
+ white-space: nowrap;
+}
diff --git a/site/static/prism.css b/site/static/prism.css
index c803829288..0bedd0f02b 100644
--- a/site/static/prism.css
+++ b/site/static/prism.css
@@ -7,12 +7,12 @@
/* colors --------------------------------- */
pre[class*='language-'] {
--background: var(--back-light);
- --base: hsl(45, 7%, 45%);
- --comment: hsl(210, 25%, 60%);
- --keyword: hsl(204, 58%, 45%);
- --function: hsl(19, 67%, 45%);
- --string: hsl(41, 37%, 45%);
- --number: hsl(102, 27%, 50%);
+ --base: #545454;
+ --comment: #696969;
+ --keyword: #007f8a;
+ --function: #bb5525;
+ --string: #856e3d;
+ --number: #008000;
--tags: var(--function);
--important: var(--string);
}
diff --git a/site/static/whos-using-svelte/1password.svg b/site/static/whos-using-svelte/1password.svg
new file mode 100644
index 0000000000..ba8a63c014
--- /dev/null
+++ b/site/static/whos-using-svelte/1password.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/site/static/whos-using-svelte/Schneider_Electric.svg b/site/static/whos-using-svelte/Schneider_Electric.svg
new file mode 100644
index 0000000000..c70ca1fceb
--- /dev/null
+++ b/site/static/whos-using-svelte/Schneider_Electric.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/site/static/whos-using-svelte/alaskaairlines.svg b/site/static/whos-using-svelte/alaskaairlines.svg
new file mode 100644
index 0000000000..15d172c08b
--- /dev/null
+++ b/site/static/whos-using-svelte/alaskaairlines.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/site/static/whos-using-svelte/avast.svg b/site/static/whos-using-svelte/avast.svg
new file mode 100644
index 0000000000..736eeff3d9
--- /dev/null
+++ b/site/static/whos-using-svelte/avast.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/site/static/whos-using-svelte/chess.svg b/site/static/whos-using-svelte/chess.svg
new file mode 100644
index 0000000000..bd85352a52
--- /dev/null
+++ b/site/static/whos-using-svelte/chess.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/site/static/whos-using-svelte/fusioncharts.svg b/site/static/whos-using-svelte/fusioncharts.svg
new file mode 100644
index 0000000000..147dd9e026
--- /dev/null
+++ b/site/static/whos-using-svelte/fusioncharts.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/site/static/whos-using-svelte/godaddy.svg b/site/static/whos-using-svelte/godaddy.svg
new file mode 100644
index 0000000000..df39638281
--- /dev/null
+++ b/site/static/whos-using-svelte/godaddy.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/site/static/whos-using-svelte/ibm.svg b/site/static/whos-using-svelte/ibm.svg
new file mode 100644
index 0000000000..d8982a47ab
--- /dev/null
+++ b/site/static/whos-using-svelte/ibm.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/site/static/whos-using-svelte/les-echos.svg b/site/static/whos-using-svelte/les-echos.svg
new file mode 100644
index 0000000000..6ab7eddeef
--- /dev/null
+++ b/site/static/whos-using-svelte/les-echos.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/site/static/whos-using-svelte/nyt.svg b/site/static/whos-using-svelte/nyt.svg
new file mode 100644
index 0000000000..cef76f1afb
--- /dev/null
+++ b/site/static/whos-using-svelte/nyt.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/site/static/whos-using-svelte/philips.svg b/site/static/whos-using-svelte/philips.svg
new file mode 100644
index 0000000000..5f6c7fa343
--- /dev/null
+++ b/site/static/whos-using-svelte/philips.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/site/static/whos-using-svelte/rakuten.svg b/site/static/whos-using-svelte/rakuten.svg
new file mode 100644
index 0000000000..67b59c8354
--- /dev/null
+++ b/site/static/whos-using-svelte/rakuten.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/site/static/whos-using-svelte/razorpay.svg b/site/static/whos-using-svelte/razorpay.svg
new file mode 100644
index 0000000000..b430dc5a5b
--- /dev/null
+++ b/site/static/whos-using-svelte/razorpay.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/site/static/whos-using-svelte/square.svg b/site/static/whos-using-svelte/square.svg
new file mode 100644
index 0000000000..d1b0689c61
--- /dev/null
+++ b/site/static/whos-using-svelte/square.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/site/static/whos-using-svelte/transloadit.svg b/site/static/whos-using-svelte/transloadit.svg
new file mode 100644
index 0000000000..f3383655bb
--- /dev/null
+++ b/site/static/whos-using-svelte/transloadit.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/site/svelte.config.js b/site/svelte.config.js
new file mode 100644
index 0000000000..48c0747edc
--- /dev/null
+++ b/site/svelte.config.js
@@ -0,0 +1,44 @@
+import adapter from '@sveltejs/adapter-node';
+
+/** @type {import('@sveltejs/kit').Config} */
+export default {
+ kit: {
+ adapter: adapter(),
+ target: '#svelte',
+ prerender: {
+ enabled: false
+ },
+ vite: () => ({
+ // https://github.com/sveltejs/kit/issues/1632#issuecomment-854056053
+ build: {
+ rollupOptions: {
+ output: {
+ manualChunks: undefined
+ }
+ }
+ },
+ optimizeDeps: {
+ include: [
+ 'codemirror',
+ 'codemirror/mode/javascript/javascript.js',
+ 'codemirror/mode/handlebars/handlebars.js',
+ 'codemirror/mode/htmlmixed/htmlmixed.js',
+ 'codemirror/mode/xml/xml.js',
+ 'codemirror/mode/css/css.js',
+ 'codemirror/mode/markdown/markdown.js',
+ 'codemirror/addon/edit/closebrackets.js',
+ 'codemirror/addon/edit/closetag.js',
+ 'codemirror/addon/edit/continuelist.js',
+ 'codemirror/addon/comment/comment.js',
+ 'codemirror/addon/fold/foldcode.js',
+ 'codemirror/addon/fold/foldgutter.js',
+ 'codemirror/addon/fold/brace-fold.js',
+ 'codemirror/addon/fold/xml-fold.js',
+ 'codemirror/addon/fold/indent-fold.js',
+ 'codemirror/addon/fold/markdown-fold.js',
+ 'codemirror/addon/fold/comment-fold.js'
+ ]
+ }
+ })
+ }
+};
diff --git a/site/test/utils/slug.js b/site/test/utils/slug.js
index 17262c5e83..a25672171e 100644
--- a/site/test/utils/slug.js
+++ b/site/test/utils/slug.js
@@ -1,423 +1,430 @@
-import {strict as assert} from 'assert';
-import {urlsafeSlugProcessor, unicodeSafeProcessor} from '../../src/utils/slug';
-import {SLUG_SEPARATOR as _} from '../../config';
+import * as uvu from 'uvu';
+import * as assert from 'uvu/assert';
+import {urlsafeSlugProcessor, unicodeSafeProcessor} from '../../src/utils/slug.js';
+import {SLUG_SEPARATOR as _} from '../../config.js';
-describe('slug', () => {
- describe('urlsafeSlugProcessor', () => {
- describe('ascii', () => {
- it('space separated words', () => {
- assert.equal(
- urlsafeSlugProcessor('Text expressions'),
- `Text${_}expressions`
- );
- });
- it('numbered text', () => {
- assert.equal(
- urlsafeSlugProcessor('1. export creates'),
- `1${_}export${_}creates`
- );
- });
- it('punctuated text', () => {
- assert.equal(
- urlsafeSlugProcessor('svelte.VERSION'),
- `svelte${_}VERSION`
- );
- });
- it('text starting with the dollar sign', () => {
- assert.equal(
- urlsafeSlugProcessor('$destroy method'),
- `$destroy${_}method`
- );
- });
- it('numbered text containing the dollar sign', () => {
- assert.equal(
- urlsafeSlugProcessor('1. export $destroy'),
- `1${_}export${_}$destroy`
- );
- });
- it('text containing the equal char', () => {
- assert.equal(
- urlsafeSlugProcessor('script context=module'),
- `script${_}context${_}module`
- );
- });
- it('text containing the colon char', () => {
- assert.equal(
- urlsafeSlugProcessor('svelte:body'),
- `svelte${_}body`
- );
- });
- it('text containing the slash char', () => {
- assert.equal(
- urlsafeSlugProcessor('svelte/motion'),
- `svelte${_}motion`
- );
- });
- it('text containing the comma char', () => {
- assert.equal(
- urlsafeSlugProcessor('svelte, motion'),
- `svelte${_}motion`
- );
- });
- });
- describe('unicode', () => {
- it('should translate symbols to English', () => {
- assert.equal(
- urlsafeSlugProcessor('Ich ♥ Deutsch'),
- `Ich${_}love${_}Deutsch`
- );
- });
- it('should remove emoji', () => {
- assert.equal(
- urlsafeSlugProcessor('Ich 😍 Deutsch'),
- `Ich${_}Deutsch`
- );
- });
- });
- describe('cyricllic', () => {
- it('space separated words', () => {
- assert.equal(
- urlsafeSlugProcessor('Всплытие и перехват событий'),
- `Vsplytie${_}i${_}perehvat${_}sobytij`
- );
- });
- it('numbered text', () => {
- assert.equal(
- urlsafeSlugProcessor('1 Всплытие и перехват событий'),
- `1${_}Vsplytie${_}i${_}perehvat${_}sobytij`
- );
- });
- it('punctuated text', () => {
- assert.equal(
- urlsafeSlugProcessor('.Всплытие.и.перехват событий'),
- `Vsplytie${_}i${_}perehvat${_}sobytij`
- );
- });
- it('text starting with the dollar sign', () => {
- assert.equal(
- urlsafeSlugProcessor('$Всплытие $ перехват событий'),
- `$Vsplytie${_}$${_}perehvat${_}sobytij`
- );
- });
- it('text containing the dollar sign', () => {
- assert.equal(
- urlsafeSlugProcessor('Всплытие$перехват'),
- `Vsplytie$perehvat`
- );
- });
- it('text containing the equal char', () => {
- assert.equal(
- urlsafeSlugProcessor('Всплытие = перехват=событий'),
- `Vsplytie${_}perehvat${_}sobytij`
- );
- });
- it('text containing the colon char', () => {
- assert.equal(
- urlsafeSlugProcessor('Всплытие : перехват:событий'),
- `Vsplytie${_}perehvat${_}sobytij`
- );
- });
- it('text containing the slash char', () => {
- assert.equal(
- urlsafeSlugProcessor('Всплытие / перехват/событий'),
- `Vsplytie${_}perehvat${_}sobytij`
- );
- });
- it('text containing the comma char', () => {
- assert.equal(
- urlsafeSlugProcessor('Всплытие, перехват'),
- `Vsplytie${_}perehvat`
- );
- });
- });
- describe('ascii + cyricllic', () => {
- it('space separated words', () => {
- assert.equal(
- urlsafeSlugProcessor('Всплытие и export перехват событий'),
- `Vsplytie${_}i${_}export${_}perehvat${_}sobytij`
- );
- });
- it('ascii word concatenated to a cyricllic word', () => {
- assert.equal(
- urlsafeSlugProcessor('exportВсплытие'),
- 'exportVsplytie'
- );
- });
- it('cyricllic word concatenated to an ascii word', () => {
- assert.equal(
- urlsafeSlugProcessor('Всплытиеexport'),
- `Vsplytieexport`
- );
- });
- it('numbered text', () => {
- assert.equal(
- urlsafeSlugProcessor('1 export Всплытие и перехват событий'),
- `1${_}export${_}Vsplytie${_}i${_}perehvat${_}sobytij`
- );
- });
- it('punctuated text', () => {
- assert.equal(
- urlsafeSlugProcessor('.Всплытие.export.и.перехват событий'),
- `Vsplytie${_}export${_}i${_}perehvat${_}sobytij`
- );
- });
- it('text starting with the dollar sign, followed by ascii char', () => {
- assert.equal(
- urlsafeSlugProcessor('$exportВсплытие перехват событий'),
- `$exportVsplytie${_}perehvat${_}sobytij`
- );
- });
- it('text starting with the dollar sign, followed by unicode char', () => {
- assert.equal(
- urlsafeSlugProcessor('$Всплытие export перехват событий'),
- `$Vsplytie${_}export${_}perehvat${_}sobytij`
- );
- });
- it('text containing the dollar sign, followed by ascii char', () => {
- assert.equal(
- urlsafeSlugProcessor('export $destroy a component prop Всплытие и перехват событий'),
- `export${_}$destroy${_}a${_}component${_}prop${_}Vsplytie${_}i${_}perehvat${_}sobytij`
- );
- });
- it('text containing the dollar sign, followed by unicode char', () => {
- assert.equal(
- urlsafeSlugProcessor('Всплытие export $Всплытие a component prop Всплытие и перехват событий'),
- `Vsplytie${_}export${_}$Vsplytie${_}a${_}component${_}prop${_}Vsplytie${_}i${_}perehvat${_}sobytij`
- );
- });
- it('text containing the equal char', () => {
- assert.equal(
- urlsafeSlugProcessor('script context=module Всплытие=и перехват событий'),
- `script${_}context${_}module${_}Vsplytie${_}i${_}perehvat${_}sobytij`
- );
- });
- it('text containing the colon char', () => {
- assert.equal(
- urlsafeSlugProcessor('svelte:body Всплытие и:перехват событий'),
- `svelte${_}body${_}Vsplytie${_}i${_}perehvat${_}sobytij`
- );
- });
- it('text containing the slash char', () => {
- assert.equal(
- urlsafeSlugProcessor('svelte/motion Всплытие и / перехват/событий'),
- `svelte${_}motion${_}Vsplytie${_}i${_}perehvat${_}sobytij`
- );
- });
- it('text containing the comma char', () => {
- assert.equal(
- urlsafeSlugProcessor('Всплытие, export'),
- `Vsplytie${_}export`
- );
- });
- });
+function run(name, func) {
+ const suite = uvu.suite(name);
+ func(suite);
+ suite.run();
+}
+
+run('urlsafeSlugProcessor -> ascii', it => {
+ it('space separated words', () => {
+ assert.equal(
+ urlsafeSlugProcessor('Text expressions'),
+ `Text${_}expressions`
+ );
+ });
+ it('numbered text', () => {
+ assert.equal(
+ urlsafeSlugProcessor('1. export creates'),
+ `1${_}export${_}creates`
+ );
+ });
+ it('punctuated text', () => {
+ assert.equal(
+ urlsafeSlugProcessor('svelte.VERSION'),
+ `svelte${_}VERSION`
+ );
+ });
+ it('text starting with the dollar sign', () => {
+ assert.equal(
+ urlsafeSlugProcessor('$destroy method'),
+ `$destroy${_}method`
+ );
+ });
+ it('numbered text containing the dollar sign', () => {
+ assert.equal(
+ urlsafeSlugProcessor('1. export $destroy'),
+ `1${_}export${_}$destroy`
+ );
+ });
+ it('text containing the equal char', () => {
+ assert.equal(
+ urlsafeSlugProcessor('script context=module'),
+ `script${_}context${_}module`
+ );
+ });
+ it('text containing the colon char', () => {
+ assert.equal(
+ urlsafeSlugProcessor('svelte:body'),
+ `svelte${_}body`
+ );
+ });
+ it('text containing the slash char', () => {
+ assert.equal(
+ urlsafeSlugProcessor('svelte/motion'),
+ `svelte${_}motion`
+ );
+ });
+ it('text containing the comma char', () => {
+ assert.equal(
+ urlsafeSlugProcessor('svelte, motion'),
+ `svelte${_}motion`
+ );
+ });
+});
+
+run('urlsafeSlugProcessor - unicode', it => {
+ it('should translate symbols to English', () => {
+ assert.equal(
+ urlsafeSlugProcessor('Ich ♥ Deutsch'),
+ `Ich${_}love${_}Deutsch`
+ );
+ });
+ it('should remove emoji', () => {
+ assert.equal(
+ urlsafeSlugProcessor('Ich 😍 Deutsch'),
+ `Ich${_}Deutsch`
+ );
+ });
+});
+
+run('urlsafeSlugProcessor -> cyrillic', it => {
+ it('space separated words', () => {
+ assert.equal(
+ urlsafeSlugProcessor('Всплытие и перехват событий'),
+ `Vsplytie${_}i${_}perehvat${_}sobytij`
+ );
+ });
+ it('numbered text', () => {
+ assert.equal(
+ urlsafeSlugProcessor('1 Всплытие и перехват событий'),
+ `1${_}Vsplytie${_}i${_}perehvat${_}sobytij`
+ );
+ });
+ it('punctuated text', () => {
+ assert.equal(
+ urlsafeSlugProcessor('.Всплытие.и.перехват событий'),
+ `Vsplytie${_}i${_}perehvat${_}sobytij`
+ );
+ });
+ it('text starting with the dollar sign', () => {
+ assert.equal(
+ urlsafeSlugProcessor('$Всплытие $ перехват событий'),
+ `$Vsplytie${_}$${_}perehvat${_}sobytij`
+ );
+ });
+ it('text containing the dollar sign', () => {
+ assert.equal(
+ urlsafeSlugProcessor('Всплытие$перехват'),
+ `Vsplytie$perehvat`
+ );
+ });
+ it('text containing the equal char', () => {
+ assert.equal(
+ urlsafeSlugProcessor('Всплытие = перехват=событий'),
+ `Vsplytie${_}perehvat${_}sobytij`
+ );
+ });
+ it('text containing the colon char', () => {
+ assert.equal(
+ urlsafeSlugProcessor('Всплытие : перехват:событий'),
+ `Vsplytie${_}perehvat${_}sobytij`
+ );
+ });
+ it('text containing the slash char', () => {
+ assert.equal(
+ urlsafeSlugProcessor('Всплытие / перехват/событий'),
+ `Vsplytie${_}perehvat${_}sobytij`
+ );
+ });
+ it('text containing the comma char', () => {
+ assert.equal(
+ urlsafeSlugProcessor('Всплытие, перехват'),
+ `Vsplytie${_}perehvat`
+ );
+ });
+});
+
+run('urlsafeSlugProcessor -> ascii + cyrillic', it => {
+ it('space separated words', () => {
+ assert.equal(
+ urlsafeSlugProcessor('Всплытие и export перехват событий'),
+ `Vsplytie${_}i${_}export${_}perehvat${_}sobytij`
+ );
+ });
+ it('ascii word concatenated to a cyrillic word', () => {
+ assert.equal(
+ urlsafeSlugProcessor('exportВсплытие'),
+ 'exportVsplytie'
+ );
+ });
+ it('cyrillic word concatenated to an ascii word', () => {
+ assert.equal(
+ urlsafeSlugProcessor('Всплытиеexport'),
+ `Vsplytieexport`
+ );
+ });
+ it('numbered text', () => {
+ assert.equal(
+ urlsafeSlugProcessor('1 export Всплытие и перехват событий'),
+ `1${_}export${_}Vsplytie${_}i${_}perehvat${_}sobytij`
+ );
+ });
+ it('punctuated text', () => {
+ assert.equal(
+ urlsafeSlugProcessor('.Всплытие.export.и.перехват событий'),
+ `Vsplytie${_}export${_}i${_}perehvat${_}sobytij`
+ );
+ });
+ it('text starting with the dollar sign, followed by ascii char', () => {
+ assert.equal(
+ urlsafeSlugProcessor('$exportВсплытие перехват событий'),
+ `$exportVsplytie${_}perehvat${_}sobytij`
+ );
+ });
+ it('text starting with the dollar sign, followed by unicode char', () => {
+ assert.equal(
+ urlsafeSlugProcessor('$Всплытие export перехват событий'),
+ `$Vsplytie${_}export${_}perehvat${_}sobytij`
+ );
+ });
+ it('text containing the dollar sign, followed by ascii char', () => {
+ assert.equal(
+ urlsafeSlugProcessor('export $destroy a component prop Всплытие и перехват событий'),
+ `export${_}$destroy${_}a${_}component${_}prop${_}Vsplytie${_}i${_}perehvat${_}sobytij`
+ );
+ });
+ it('text containing the dollar sign, followed by unicode char', () => {
+ assert.equal(
+ urlsafeSlugProcessor('Всплытие export $Всплытие a component prop Всплытие и перехват событий'),
+ `Vsplytie${_}export${_}$Vsplytie${_}a${_}component${_}prop${_}Vsplytie${_}i${_}perehvat${_}sobytij`
+ );
+ });
+ it('text containing the equal char', () => {
+ assert.equal(
+ urlsafeSlugProcessor('script context=module Всплытие=и перехват событий'),
+ `script${_}context${_}module${_}Vsplytie${_}i${_}perehvat${_}sobytij`
+ );
+ });
+ it('text containing the colon char', () => {
+ assert.equal(
+ urlsafeSlugProcessor('svelte:body Всплытие и:перехват событий'),
+ `svelte${_}body${_}Vsplytie${_}i${_}perehvat${_}sobytij`
+ );
+ });
+ it('text containing the slash char', () => {
+ assert.equal(
+ urlsafeSlugProcessor('svelte/motion Всплытие и / перехват/событий'),
+ `svelte${_}motion${_}Vsplytie${_}i${_}perehvat${_}sobytij`
+ );
+ });
+ it('text containing the comma char', () => {
+ assert.equal(
+ urlsafeSlugProcessor('Всплытие, export'),
+ `Vsplytie${_}export`
+ );
});
+});
+
+run('unicodeSafeProcessor (preserve unicode) -> ascii', it => {
+ it('space separated words', () => {
+ assert.equal(
+ unicodeSafeProcessor('Text expressions'),
+ `Text${_}expressions`
+ );
+ });
+ it('numbered text', () => {
+ assert.equal(
+ unicodeSafeProcessor('1. export creates'),
+ `1${_}export${_}creates`
+ );
+ });
+ it('punctuated text', () => {
+ assert.equal(
+ unicodeSafeProcessor('svelte.VERSION'),
+ `svelte${_}VERSION`
+ );
+ });
+ it('text starting with the dollar sign', () => {
+ assert.equal(
+ unicodeSafeProcessor('$destroy method'),
+ `$destroy${_}method`
+ );
+ });
+ it('numbered text containing the dollar sign', () => {
+ assert.equal(
+ unicodeSafeProcessor('1. export $destroy'),
+ `1${_}export${_}$destroy`
+ );
+ });
+ it('text containing the equal char', () => {
+ assert.equal(
+ unicodeSafeProcessor('script context=module'),
+ `script${_}context${_}module`
+ );
+ });
+ it('text containing the colon char', () => {
+ assert.equal(
+ unicodeSafeProcessor('svelte:body'),
+ `svelte${_}body`
+ );
+ });
+ it('text containing the slash char', () => {
+ assert.equal(
+ unicodeSafeProcessor('svelte/motion'),
+ `svelte${_}motion`
+ );
+ });
+ it('text containing the comma char', () => {
+ assert.equal(
+ unicodeSafeProcessor('svelte, motion'),
+ `svelte${_}motion`
+ );
+ });
+});
+
+run('unicodeSafeProcessor (preserve unicode) -> unicode', it => {
+ it('should preserve symbols', () => {
+ assert.equal(
+ unicodeSafeProcessor('Ich ♥ Deutsch'),
+ `Ich${_}love${_}Deutsch`
+ );
+ });
+ it('should remove emoji', () => {
+ assert.equal(
+ unicodeSafeProcessor('Ich 😍 Deutsch'),
+ `Ich${_}Deutsch`
+ );
+ });
+});
- describe('unicodeSafeProcessor (preserve unicode)', () => {
- describe('ascii', () => {
- it('space separated words', () => {
- assert.equal(
- unicodeSafeProcessor('Text expressions'),
- `Text${_}expressions`
- );
- });
- it('numbered text', () => {
- assert.equal(
- unicodeSafeProcessor('1. export creates'),
- `1${_}export${_}creates`
- );
- });
- it('punctuated text', () => {
- assert.equal(
- unicodeSafeProcessor('svelte.VERSION'),
- `svelte${_}VERSION`
- );
- });
- it('text starting with the dollar sign', () => {
- assert.equal(
- unicodeSafeProcessor('$destroy method'),
- `$destroy${_}method`
- );
- });
- it('numbered text containing the dollar sign', () => {
- assert.equal(
- unicodeSafeProcessor('1. export $destroy'),
- `1${_}export${_}$destroy`
- );
- });
- it('text containing the equal char', () => {
- assert.equal(
- unicodeSafeProcessor('script context=module'),
- `script${_}context${_}module`
- );
- });
- it('text containing the colon char', () => {
- assert.equal(
- unicodeSafeProcessor('svelte:body'),
- `svelte${_}body`
- );
- });
- it('text containing the slash char', () => {
- assert.equal(
- unicodeSafeProcessor('svelte/motion'),
- `svelte${_}motion`
- );
- });
- it('text containing the comma char', () => {
- assert.equal(
- unicodeSafeProcessor('svelte, motion'),
- `svelte${_}motion`
- );
- });
- });
- describe('unicode', () => {
- it('should preserve symbols', () => {
- assert.equal(
- unicodeSafeProcessor('Ich ♥ Deutsch'),
- `Ich${_}love${_}Deutsch`
- );
- });
- it('should remove emoji', () => {
- assert.equal(
- unicodeSafeProcessor('Ich 😍 Deutsch'),
- `Ich${_}Deutsch`
- );
- });
- });
- describe('cyricllic', () => {
- it('space separated words', () => {
- assert.equal(
- unicodeSafeProcessor('Всплытие и перехват событий'),
- `Всплытие${_}и${_}перехват${_}событий`
- );
- });
- it('numbered text', () => {
- assert.equal(
- unicodeSafeProcessor('1 Всплытие и перехват событий'),
- `1${_}Всплытие${_}и${_}перехват${_}событий`
- );
- });
- it('punctuated text', () => {
- assert.equal(
- unicodeSafeProcessor('.Всплытие.и.перехват событий'),
- `Всплытие${_}и${_}перехват${_}событий`
- );
- });
- it('text starting with the dollar sign', () => {
- assert.equal(
- unicodeSafeProcessor('$Всплытие $ перехват событий'),
- `$${_}Всплытие${_}$${_}перехват${_}событий`
- );
- });
- it('text containing the dollar sign', () => {
- assert.equal(
- unicodeSafeProcessor('Всплытие$перехват'),
- `Всплытие${_}$${_}перехват`
- );
- });
- it('text containing the equal char', () => {
- assert.equal(
- unicodeSafeProcessor('Всплытие = перехват=событий'),
- `Всплытие${_}перехват${_}событий`
- );
- });
- it('text containing the colon char', () => {
- assert.equal(
- unicodeSafeProcessor('Всплытие : перехват:событий'),
- `Всплытие${_}перехват${_}событий`
- );
- });
- it('text containing the slash char', () => {
- assert.equal(
- unicodeSafeProcessor('Всплытие / перехват/событий'),
- `Всплытие${_}перехват${_}событий`
- );
- });
- it('text containing the comma char', () => {
- assert.equal(
- unicodeSafeProcessor('Всплытие, перехват'),
- `Всплытие${_}перехват`
- );
- });
- });
- describe('ascii + cyricllic', () => {
- it('space separated words', () => {
- assert.equal(
- unicodeSafeProcessor('Всплытие и export перехват событий'),
- `Всплытие${_}и${_}export${_}перехват${_}событий`
- );
- });
- it('ascii word concatenated to a cyricllic word', () => {
- assert.equal(
- unicodeSafeProcessor('exportВсплытие'),
- `export${_}Всплытие`
- );
- });
- it('cyricllic word concatenated to an ascii word', () => {
- assert.equal(
- unicodeSafeProcessor('Всплытиеexport'),
- `Всплытие${_}export`
- );
- });
- it('numbered text', () => {
- assert.equal(
- unicodeSafeProcessor('1 export Всплытие и перехват событий'),
- `1${_}export${_}Всплытие${_}и${_}перехват${_}событий`
- );
- });
- it('punctuated text', () => {
- assert.equal(
- unicodeSafeProcessor('.Всплытие.export.и.перехват событий'),
- `Всплытие${_}export${_}и${_}перехват${_}событий`
- );
- });
- it('text starting with the dollar sign, followed by ascii char', () => {
- assert.equal(
- unicodeSafeProcessor('$exportВсплытие перехват событий'),
- `$export${_}Всплытие${_}перехват${_}событий`
- );
- });
- it('text starting with the dollar sign, followed by unicode char', () => {
- assert.equal(
- unicodeSafeProcessor('$Всплытие export перехват событий'),
- `$${_}Всплытие${_}export${_}перехват${_}событий`
- );
- });
- it('text containing the dollar sign, followed by ascii char', () => {
- assert.equal(
- unicodeSafeProcessor('export $destroy a component prop Всплытие и перехват событий'),
- `export${_}$destroy${_}a${_}component${_}prop${_}Всплытие${_}и${_}перехват${_}событий`
- );
- });
- it('text containing the dollar sign, followed by unicode char', () => {
- assert.equal(
- unicodeSafeProcessor('Всплытие export $Всплытие a component prop Всплытие и перехват событий'),
- `Всплытие${_}export${_}$${_}Всплытие${_}a${_}component${_}prop${_}Всплытие${_}и${_}перехват${_}событий`
- );
- });
- it('text containing the equal char', () => {
- assert.equal(
- unicodeSafeProcessor('script context=module Всплытие=и перехват событий'),
- `script${_}context${_}module${_}Всплытие${_}и${_}перехват${_}событий`
- );
- });
- it('text containing the colon char', () => {
- assert.equal(
- unicodeSafeProcessor('svelte:body Всплытие и:перехват событий'),
- `svelte${_}body${_}Всплытие${_}и${_}перехват${_}событий`
- );
- });
- it('text containing the slash char', () => {
- assert.equal(
- unicodeSafeProcessor('svelte/motion Всплытие и / перехват/событий'),
- `svelte${_}motion${_}Всплытие${_}и${_}перехват${_}событий`
- );
- });
- it('text containing the comma char', () => {
- assert.equal(
- unicodeSafeProcessor('Всплытие, export'),
- `Всплытие${_}export`
- );
- });
- });
+run('unicodeSafeProcessor (preserve unicode) -> cyrillic', it => {
+ it('space separated words', () => {
+ assert.equal(
+ unicodeSafeProcessor('Всплытие и перехват событий'),
+ `Всплытие${_}и${_}перехват${_}событий`
+ );
+ });
+ it('numbered text', () => {
+ assert.equal(
+ unicodeSafeProcessor('1 Всплытие и перехват событий'),
+ `1${_}Всплытие${_}и${_}перехват${_}событий`
+ );
+ });
+ it('punctuated text', () => {
+ assert.equal(
+ unicodeSafeProcessor('.Всплытие.и.перехват событий'),
+ `Всплытие${_}и${_}перехват${_}событий`
+ );
+ });
+ it('text starting with the dollar sign', () => {
+ assert.equal(
+ unicodeSafeProcessor('$Всплытие $ перехват событий'),
+ `$${_}Всплытие${_}$${_}перехват${_}событий`
+ );
+ });
+ it('text containing the dollar sign', () => {
+ assert.equal(
+ unicodeSafeProcessor('Всплытие$перехват'),
+ `Всплытие${_}$${_}перехват`
+ );
+ });
+ it('text containing the equal char', () => {
+ assert.equal(
+ unicodeSafeProcessor('Всплытие = перехват=событий'),
+ `Всплытие${_}перехват${_}событий`
+ );
+ });
+ it('text containing the colon char', () => {
+ assert.equal(
+ unicodeSafeProcessor('Всплытие : перехват:событий'),
+ `Всплытие${_}перехват${_}событий`
+ );
+ });
+ it('text containing the slash char', () => {
+ assert.equal(
+ unicodeSafeProcessor('Всплытие / перехват/событий'),
+ `Всплытие${_}перехват${_}событий`
+ );
+ });
+ it('text containing the comma char', () => {
+ assert.equal(
+ unicodeSafeProcessor('Всплытие, перехват'),
+ `Всплытие${_}перехват`
+ );
+ });
+});
+
+run('unicodeSafeProcessor (preserve unicode) -> ascii + cyrillic', it => {
+ it('space separated words', () => {
+ assert.equal(
+ unicodeSafeProcessor('Всплытие и export перехват событий'),
+ `Всплытие${_}и${_}export${_}перехват${_}событий`
+ );
+ });
+ it('ascii word concatenated to a cyrillic word', () => {
+ assert.equal(
+ unicodeSafeProcessor('exportВсплытие'),
+ `export${_}Всплытие`
+ );
+ });
+ it('cyrillic word concatenated to an ascii word', () => {
+ assert.equal(
+ unicodeSafeProcessor('Всплытиеexport'),
+ `Всплытие${_}export`
+ );
+ });
+ it('numbered text', () => {
+ assert.equal(
+ unicodeSafeProcessor('1 export Всплытие и перехват событий'),
+ `1${_}export${_}Всплытие${_}и${_}перехват${_}событий`
+ );
+ });
+ it('punctuated text', () => {
+ assert.equal(
+ unicodeSafeProcessor('.Всплытие.export.и.перехват событий'),
+ `Всплытие${_}export${_}и${_}перехват${_}событий`
+ );
+ });
+ it('text starting with the dollar sign, followed by ascii char', () => {
+ assert.equal(
+ unicodeSafeProcessor('$exportВсплытие перехват событий'),
+ `$export${_}Всплытие${_}перехват${_}событий`
+ );
+ });
+ it('text starting with the dollar sign, followed by unicode char', () => {
+ assert.equal(
+ unicodeSafeProcessor('$Всплытие export перехват событий'),
+ `$${_}Всплытие${_}export${_}перехват${_}событий`
+ );
+ });
+ it('text containing the dollar sign, followed by ascii char', () => {
+ assert.equal(
+ unicodeSafeProcessor('export $destroy a component prop Всплытие и перехват событий'),
+ `export${_}$destroy${_}a${_}component${_}prop${_}Всплытие${_}и${_}перехват${_}событий`
+ );
+ });
+ it('text containing the dollar sign, followed by unicode char', () => {
+ assert.equal(
+ unicodeSafeProcessor('Всплытие export $Всплытие a component prop Всплытие и перехват событий'),
+ `Всплытие${_}export${_}$${_}Всплытие${_}a${_}component${_}prop${_}Всплытие${_}и${_}перехват${_}событий`
+ );
+ });
+ it('text containing the equal char', () => {
+ assert.equal(
+ unicodeSafeProcessor('script context=module Всплытие=и перехват событий'),
+ `script${_}context${_}module${_}Всплытие${_}и${_}перехват${_}событий`
+ );
+ });
+ it('text containing the colon char', () => {
+ assert.equal(
+ unicodeSafeProcessor('svelte:body Всплытие и:перехват событий'),
+ `svelte${_}body${_}Всплытие${_}и${_}перехват${_}событий`
+ );
+ });
+ it('text containing the slash char', () => {
+ assert.equal(
+ unicodeSafeProcessor('svelte/motion Всплытие и / перехват/событий'),
+ `svelte${_}motion${_}Всплытие${_}и${_}перехват${_}событий`
+ );
+ });
+ it('text containing the comma char', () => {
+ assert.equal(
+ unicodeSafeProcessor('Всплытие, export'),
+ `Всплытие${_}export`
+ );
});
});
diff --git a/src/compiler/compile/Component.ts b/src/compiler/compile/Component.ts
index c16862165c..4d4cf909fd 100644
--- a/src/compiler/compile/Component.ts
+++ b/src/compiler/compile/Component.ts
@@ -19,17 +19,24 @@ import error from '../utils/error';
import get_code_frame from '../utils/get_code_frame';
import flatten_reference from './utils/flatten_reference';
import is_used_as_reference from './utils/is_used_as_reference';
-import is_reference from 'is-reference';
+import is_reference, { NodeWithPropertyDefinition } from 'is-reference';
import TemplateScope from './nodes/shared/TemplateScope';
import fuzzymatch from '../utils/fuzzymatch';
import get_object from './utils/get_object';
import Slot from './nodes/Slot';
-import { Node, ImportDeclaration, Identifier, Program, ExpressionStatement, AssignmentExpression, Literal } from 'estree';
+import { Node, ImportDeclaration, ExportNamedDeclaration, Identifier, ExpressionStatement, AssignmentExpression, Literal, Property, RestElement, ExportDefaultDeclaration, ExportAllDeclaration } from 'estree';
import add_to_set from './utils/add_to_set';
import check_graph_for_cycles from './utils/check_graph_for_cycles';
-import { print, x, b } from 'code-red';
+import { print, b } from 'code-red';
import { is_reserved_keyword } from './utils/reserved_keywords';
+import { apply_preprocessor_sourcemap } from '../utils/mapped_code';
import Element from './nodes/Element';
+import { DecodedSourceMap, RawSourceMap } from '@ampproject/remapping/dist/types/types';
+import { clone } from '../utils/clone';
+import compiler_warnings from './compiler_warnings';
+import compiler_errors from './compiler_errors';
+import { extract_ignores_above_position, extract_svelte_ignore_from_comments } from '../utils/extract_svelte_ignore';
+import check_enable_sourcemap from './utils/check_enable_sourcemap';
interface ComponentOptions {
namespace?: string;
@@ -64,6 +71,8 @@ export default class Component {
var_lookup: Map = new Map();
imports: ImportDeclaration[] = [];
+ exports_from: ExportNamedDeclaration[] = [];
+ instance_exports_from: ExportNamedDeclaration[] = [];
hoistable_nodes: Set = new Set();
node_for_declaration: Map = new Map();
@@ -114,12 +123,12 @@ export default class Component {
// the instance JS gets mutated, so we park
// a copy here for later. TODO this feels gross
- this.original_ast = {
+ this.original_ast = clone({
html: ast.html,
css: ast.css,
- instance: ast.instance && JSON.parse(JSON.stringify(ast.instance)),
+ instance: ast.instance,
module: ast.module
- };
+ });
this.file =
compile_options.filename &&
@@ -131,12 +140,14 @@ export default class Component {
this.locate = getLocator(this.source, { offsetLine: 1 });
// styles
- this.stylesheet = new Stylesheet(
+ this.stylesheet = new Stylesheet({
source,
ast,
- compile_options.filename,
- compile_options.dev
- );
+ filename: compile_options.filename,
+ component_name: name,
+ dev: compile_options.dev,
+ get_css_hash: compile_options.cssHash
+ });
this.stylesheet.validate(this);
this.component_options = process_component_options(
@@ -155,10 +166,7 @@ export default class Component {
const svelteOptions = ast.html.children.find(
child => child.name === 'svelte:options'
) || { start: 0, end: 0 };
- this.warn(svelteOptions, {
- code: 'custom-element-no-tag',
- message: 'No custom element \'tag\' option was specified. To automatically register a custom element, specify a name with a hyphen in it, e.g. . To hide this warning, use '
- });
+ this.warn(svelteOptions, compiler_warnings.custom_element_no_tag);
}
this.tag = this.component_options.tag || compile_options.tag;
} else {
@@ -166,21 +174,29 @@ export default class Component {
}
this.walk_module_js();
+
+ this.push_ignores(this.ast.instance ? extract_ignores_above_position(this.ast.instance.start, this.ast.html.children) : []);
this.walk_instance_js_pre_template();
+ this.pop_ignores();
this.fragment = new Fragment(this, ast.html);
this.name = this.get_unique_name(name);
+ this.push_ignores(this.ast.instance ? extract_ignores_above_position(this.ast.instance.start, this.ast.html.children) : []);
this.walk_instance_js_post_template();
+ this.pop_ignores();
this.elements.forEach(element => this.stylesheet.apply(element));
if (!compile_options.customElement) this.stylesheet.reify();
this.stylesheet.warn_on_unused_selectors(this);
}
- add_var(variable: Var) {
+ add_var(variable: Var, add_to_lookup = true) {
this.vars.push(variable);
- this.var_lookup.set(variable.name, variable);
+
+ if (add_to_lookup) {
+ this.var_lookup.set(variable.name, variable);
+ }
}
add_reference(name: string) {
@@ -211,6 +227,10 @@ export default class Component {
variable.subscribable = true;
}
} else {
+ if (this.compile_options.varsReport === 'full') {
+ this.add_var({ name, referenced: true }, false);
+ }
+
this.used_names.add(name);
}
}
@@ -255,6 +275,14 @@ export default class Component {
} else {
let name = node.name.slice(1);
+ if (compile_options.hydratable) {
+ if (internal_exports.has(`${name}_hydration`)) {
+ name += '_hydration';
+ } else if (internal_exports.has(`${name}Hydration`)) {
+ name += 'Hydration';
+ }
+ }
+
if (compile_options.dev) {
if (internal_exports.has(`${name}_dev`)) {
name += '_dev';
@@ -267,17 +295,13 @@ export default class Component {
this.helpers.set(name, alias);
node.name = alias.name;
}
- }
-
- else if (node.name[0] !== '#' && !is_valid(node.name)) {
+ } else if (node.name[0] !== '#' && !is_valid(node.name)) {
// this hack allows x`foo.${bar}` where bar could be invalid
const literal: Literal = { type: 'Literal', value: node.name };
if (parent.type === 'Property' && key === 'key') {
parent.key = literal;
- }
-
- else if (parent.type === 'MemberExpression' && key === 'property') {
+ } else if (parent.type === 'MemberExpression' && key === 'property') {
parent.property = literal;
parent.computed = true;
}
@@ -312,24 +336,36 @@ export default class Component {
.map(variable => ({
name: variable.name,
as: variable.export_name
- }))
+ })),
+ this.exports_from
);
css = compile_options.customElement
? { code: null, map: null }
: result.css;
- js = print(program, {
- sourceMapSource: compile_options.filename
- });
+ const js_sourcemap_enabled = check_enable_sourcemap(compile_options.enableSourcemap, 'js');
- js.map.sources = [
- compile_options.filename ? get_relative_path(compile_options.outputFilename || '', compile_options.filename) : null
- ];
+ if (!js_sourcemap_enabled) {
+ js = print(program);
+ js.map = null;
+ } else {
+ const sourcemap_source_filename = get_sourcemap_source_filename(compile_options);
- js.map.sourcesContent = [
- this.source
- ];
+ js = print(program, {
+ sourceMapSource: sourcemap_source_filename
+ });
+
+ js.map.sources = [
+ sourcemap_source_filename
+ ];
+
+ js.map.sourcesContent = [
+ this.source
+ ];
+
+ js.map = apply_preprocessor_sourcemap(sourcemap_source_filename, js.map, compile_options.sourcemap as (string | RawSourceMap | DecodedSourceMap));
+ }
}
return {
@@ -337,19 +373,7 @@ export default class Component {
css,
ast: this.original_ast,
warnings: this.warnings,
- vars: this.vars
- .filter(v => !v.global && !v.internal)
- .map(v => ({
- name: v.name,
- export_name: v.export_name || null,
- injected: v.injected || false,
- module: v.module || false,
- mutated: v.mutated || false,
- reassigned: v.reassigned || false,
- referenced: v.referenced || false,
- writable: v.writable || false,
- referenced_from_script: v.referenced_from_script || false
- })),
+ vars: this.get_vars_report(),
stats: this.stats.render()
};
}
@@ -399,6 +423,28 @@ export default class Component {
};
}
+ get_vars_report(): Var[] {
+ const { compile_options, vars } = this;
+
+ const vars_report = compile_options.varsReport === false
+ ? []
+ : compile_options.varsReport === 'full'
+ ? vars
+ : vars.filter(v => !v.global && !v.internal);
+
+ return vars_report.map(v => ({
+ name: v.name,
+ export_name: v.export_name || null,
+ injected: v.injected || false,
+ module: v.module || false,
+ mutated: v.mutated || false,
+ reassigned: v.reassigned || false,
+ referenced: v.referenced || false,
+ writable: v.writable || false,
+ referenced_from_script: v.referenced_from_script || false
+ }));
+ }
+
error(
pos: {
start: number;
@@ -409,14 +455,18 @@ export default class Component {
message: string;
}
) {
- error(e.message, {
- name: 'ValidationError',
- code: e.code,
- source: this.source,
- start: pos.start,
- end: pos.end,
- filename: this.compile_options.filename
- });
+ if (this.compile_options.errorMode === 'warn') {
+ this.warn(pos, e);
+ } else {
+ error(e.message, {
+ name: 'ValidationError',
+ code: e.code,
+ source: this.source,
+ start: pos.start,
+ end: pos.end,
+ filename: this.compile_options.filename
+ });
+ }
}
warn(
@@ -455,20 +505,27 @@ export default class Component {
this.imports.push(node);
}
- extract_exports(node) {
+ extract_exports(node, module_script = false) {
+ const ignores = extract_svelte_ignore_from_comments(node);
+ if (ignores.length) this.push_ignores(ignores);
+ const result = this._extract_exports(node, module_script);
+ if (ignores.length) this.pop_ignores();
+ return result;
+ }
+
+ private _extract_exports(node: ExportDefaultDeclaration | ExportNamedDeclaration | ExportAllDeclaration, module_script) {
if (node.type === 'ExportDefaultDeclaration') {
- this.error(node, {
- code: 'default-export',
- message: 'A component cannot have a default export'
- });
+ return this.error(node as any, compiler_errors.default_export);
}
if (node.type === 'ExportNamedDeclaration') {
if (node.source) {
- this.error(node, {
- code: 'not-implemented',
- message: 'A component currently cannot have an export ... from'
- });
+ if (module_script) {
+ this.exports_from.push(node);
+ } else {
+ this.instance_exports_from.push(node);
+ }
+ return null;
}
if (node.declaration) {
if (node.declaration.type === 'VariableDeclaration') {
@@ -477,10 +534,7 @@ export default class Component {
const variable = this.var_lookup.get(name);
variable.export_name = name;
if (variable.writable && !(variable.referenced || variable.referenced_from_script || variable.subscribable)) {
- this.warn(declarator, {
- code: 'unused-export-let',
- message: `${this.name.name} has unused export property '${name}'. If it is for external reference only, please consider using \`export const ${name}\``
- });
+ this.warn(declarator as any, compiler_warnings.unused_export_let(this.name.name, name));
}
});
});
@@ -500,10 +554,7 @@ export default class Component {
variable.export_name = specifier.exported.name;
if (variable.writable && !(variable.referenced || variable.referenced_from_script || variable.subscribable)) {
- this.warn(specifier, {
- code: 'unused-export-let',
- message: `${this.name.name} has unused export property '${specifier.exported.name}'. If it is for external reference only, please consider using \`export const ${specifier.exported.name}\``
- });
+ this.warn(specifier as any, compiler_warnings.unused_export_let(this.name.name, specifier.exported.name));
}
}
});
@@ -521,8 +572,7 @@ export default class Component {
if (this.hoistable_nodes.has(node)) return false;
if (this.reactive_declaration_nodes.has(node)) return false;
if (node.type === 'ImportDeclaration') return false;
- if (node.type === 'ExportDeclaration' && node.specifiers.length > 0)
- return false;
+ if (node.type === 'ExportDeclaration' && node.specifiers.length > 0) return false;
return true;
});
}
@@ -535,10 +585,7 @@ export default class Component {
walk(script.content, {
enter(node: Node) {
if (node.type === 'LabeledStatement' && node.label.name === '$') {
- component.warn(node as any, {
- code: 'module-script-reactive-declaration',
- message: '$: has no effect in a module script'
- });
+ component.warn(node as any, compiler_warnings.module_script_reactive_declaration);
}
}
});
@@ -548,10 +595,7 @@ export default class Component {
scope.declarations.forEach((node, name) => {
if (name[0] === '$') {
- this.error(node as any, {
- code: 'illegal-declaration',
- message: 'The $ prefix is reserved, and cannot be used for variable and import names'
- });
+ return this.error(node as any, compiler_errors.illegal_declaration);
}
const writable = node.type === 'VariableDeclaration' && (node.kind === 'var' || node.kind === 'let');
@@ -566,10 +610,7 @@ export default class Component {
globals.forEach((node, name) => {
if (name[0] === '$') {
- this.error(node as any, {
- code: 'illegal-subscription',
- message: 'Cannot reference store value inside ';
+import parser_errors from '../errors';
function get_context(parser: Parser, attributes: any[], start: number): string {
const context = attributes.find(attribute => attribute.name === 'context');
if (!context) return 'default';
if (context.value.length !== 1 || context.value[0].type !== 'Text') {
- parser.error({
- code: 'invalid-script',
- message: 'context attribute must be static'
- }, start);
+ parser.error(parser_errors.invalid_script_context_attribute, start);
}
const value = context.value[0].data;
if (value !== 'module') {
- parser.error({
- code: 'invalid-script',
- message: 'If the context attribute is supplied, its value must be "module"'
- }, context.start);
+ parser.error(parser_errors.invalid_script_context_value, context.start);
}
return value;
@@ -30,16 +23,13 @@ function get_context(parser: Parser, attributes: any[], start: number): string {
export default function read_script(parser: Parser, start: number, attributes: Node[]): Script {
const script_start = parser.index;
- const script_end = parser.template.indexOf(script_closing_tag, script_start);
-
- if (script_end === -1) parser.error({
- code: 'unclosed-script',
- message: '` : match;
- }
- );
- }
+ // TODO keep track: what preprocessor generated what sourcemap?
+ // to make debugging easier = detect low-resolution sourcemaps in fn combine_mappings
- for (const fn of style) {
- source = await replace_async(
- source,
- /|` : match;
- }
- );
+ for (const process of markup) {
+ result.update_source(await process_markup(process, result));
}
- return {
- // TODO return separated output, in future version where svelte.compile supports it:
- // style: { code: styleCode, map: styleMap },
- // script { code: scriptCode, map: scriptMap },
- // markup { code: markupCode, map: markupMap },
+ for (const process of script) {
+ result.update_source(await process_tag('script', process, result));
+ }
- code: source,
- dependencies: [...new Set(dependencies)],
+ for (const preprocess of style) {
+ result.update_source(await process_tag('style', preprocess, result));
+ }
- toString() {
- return source;
- }
- };
+ return result.to_processed();
}
diff --git a/src/compiler/preprocess/replace_in_code.ts b/src/compiler/preprocess/replace_in_code.ts
new file mode 100644
index 0000000000..cf0207afc3
--- /dev/null
+++ b/src/compiler/preprocess/replace_in_code.ts
@@ -0,0 +1,75 @@
+import { MappedCode } from '../utils/mapped_code';
+import { Source } from './types';
+
+interface Replacement {
+ offset: number;
+ length: number;
+ replacement: MappedCode;
+}
+
+export function slice_source(
+ code_slice: string,
+ offset: number,
+ { file_basename, filename, get_location }: Source
+): Source {
+ return {
+ source: code_slice,
+ get_location: (index: number) => get_location(index + offset),
+ file_basename,
+ filename
+ };
+}
+
+function calculate_replacements(
+ re: RegExp,
+ get_replacement: (...match: any[]) => Promise,
+ source: string
+) {
+ const replacements: Array> = [];
+
+ source.replace(re, (...match) => {
+ replacements.push(
+ get_replacement(...match).then(
+ replacement => {
+ const matched_string = match[0];
+ const offset = match[match.length - 2];
+
+ return ({ offset, length: matched_string.length, replacement });
+ }
+ )
+ );
+ return '';
+ });
+
+ return Promise.all(replacements);
+}
+
+function perform_replacements(
+ replacements: Replacement[],
+ source: Source
+): MappedCode {
+ const out = new MappedCode();
+ let last_end = 0;
+
+ for (const { offset, length, replacement } of replacements) {
+ const unchanged_prefix = MappedCode.from_source(
+ slice_source(source.source.slice(last_end, offset), last_end, source)
+ );
+ out.concat(unchanged_prefix).concat(replacement);
+ last_end = offset + length;
+ }
+
+ const unchanged_suffix = MappedCode.from_source(slice_source(source.source.slice(last_end), last_end, source));
+
+ return out.concat(unchanged_suffix);
+}
+
+export async function replace_in_code(
+ regex: RegExp,
+ get_replacement: (...match: any[]) => Promise,
+ location: Source
+): Promise {
+ const replacements = await calculate_replacements(regex, get_replacement, location.source);
+
+ return perform_replacements(replacements, location);
+}
diff --git a/src/compiler/preprocess/types.ts b/src/compiler/preprocess/types.ts
new file mode 100644
index 0000000000..b1e605238d
--- /dev/null
+++ b/src/compiler/preprocess/types.ts
@@ -0,0 +1,42 @@
+import { Location } from 'locate-character';
+
+/**
+ * @internal
+ */
+export interface Source {
+ source: string;
+ get_location: (search: number) => Location;
+ file_basename: string;
+ filename?: string;
+}
+
+export interface Processed {
+ code: string;
+ map?: string | object; // we are opaque with the type here to avoid dependency on the remapping module for our public types.
+ dependencies?: string[];
+ toString?: () => string;
+}
+
+export type MarkupPreprocessor = (options: {
+ content: string;
+ filename?: string;
+}) => Processed | void | Promise;
+
+export type Preprocessor = (options: {
+ /**
+ * The script/style tag content
+ */
+ content: string;
+ attributes: Record;
+ /**
+ * The whole Svelte file content
+ */
+ markup: string;
+ filename?: string;
+}) => Processed | void | Promise;
+
+export interface PreprocessorGroup {
+ markup?: MarkupPreprocessor;
+ style?: Preprocessor;
+ script?: Preprocessor;
+}
diff --git a/src/compiler/utils/clone.ts b/src/compiler/utils/clone.ts
new file mode 100644
index 0000000000..f11ed94967
--- /dev/null
+++ b/src/compiler/utils/clone.ts
@@ -0,0 +1,33 @@
+// adapted from klona v2.0.4 - https://github.com/lukeed/klona
+// (c) Luke Edwards, under MIT License
+
+// The sole modification is to skip function values in objects when cloning, so we don't break tests.
+
+export function clone(val) {
+ let k, out, tmp;
+
+ if (Array.isArray(val)) {
+ out = Array(k = val.length);
+ while (k--) out[k] = (tmp = val[k]) && typeof tmp === 'object' ? clone(tmp) : tmp;
+ return out;
+ }
+
+ if (Object.prototype.toString.call(val) === '[object Object]') {
+ out = {}; // null
+ for (k in val) {
+ if (k === '__proto__') {
+ Object.defineProperty(out, k, {
+ value: clone(val[k]),
+ configurable: true,
+ enumerable: true,
+ writable: true
+ });
+ } else if (typeof val[k] !== 'function') { // MODIFICATION: skip functions
+ out[k] = (tmp = val[k]) && typeof tmp === 'object' ? clone(tmp) : tmp;
+ }
+ }
+ return out;
+ }
+
+ return val;
+}
diff --git a/src/compiler/utils/error.ts b/src/compiler/utils/error.ts
index e05ea66df1..882ff54ebe 100644
--- a/src/compiler/utils/error.ts
+++ b/src/compiler/utils/error.ts
@@ -37,4 +37,4 @@ export default function error(message: string, props: {
error.frame = get_code_frame(props.source, start.line - 1, start.column);
throw error;
-}
\ No newline at end of file
+}
diff --git a/src/compiler/utils/extract_svelte_ignore.ts b/src/compiler/utils/extract_svelte_ignore.ts
new file mode 100644
index 0000000000..306ba872d6
--- /dev/null
+++ b/src/compiler/utils/extract_svelte_ignore.ts
@@ -0,0 +1,34 @@
+import { TemplateNode } from '../interfaces';
+import { flatten } from './flatten';
+
+const pattern = /^\s*svelte-ignore\s+([\s\S]+)\s*$/m;
+
+export function extract_svelte_ignore(text: string): string[] {
+ const match = pattern.exec(text);
+ return match ? match[1].split(/[^\S]/).map(x => x.trim()).filter(Boolean) : [];
+}
+
+export function extract_svelte_ignore_from_comments }>(node: Node): string[] {
+ return flatten((node.leadingComments || []).map(comment => extract_svelte_ignore(comment.value)));
+}
+
+export function extract_ignores_above_position(position: number, template_nodes: TemplateNode[]): string[] {
+ const previous_node_idx = template_nodes.findIndex(child => child.end === position);
+ if (previous_node_idx === -1) {
+ return [];
+ }
+
+ for (let i = previous_node_idx; i >= 0; i--) {
+ const node = template_nodes[i];
+ if (node.type !== 'Comment' && node.type !== 'Text') {
+ return [];
+ }
+ if (node.type === 'Comment') {
+ if (node.ignores.length) {
+ return node.ignores;
+ }
+ }
+ }
+
+ return [];
+}
diff --git a/src/compiler/utils/flatten.ts b/src/compiler/utils/flatten.ts
new file mode 100644
index 0000000000..53557a2eee
--- /dev/null
+++ b/src/compiler/utils/flatten.ts
@@ -0,0 +1,14 @@
+export function flatten(nodes: T[][], target?: T[]): T[];
+export function flatten(nodes: T[], target?: T[]): T[];
+export function flatten(nodes: any[], target: any[] = []): any[] {
+ for (let i = 0; i < nodes.length; i += 1) {
+ const node = nodes[i];
+ if (Array.isArray(node)) {
+ flatten(node, target);
+ } else {
+ target.push(node);
+ }
+ }
+
+ return target;
+}
diff --git a/src/compiler/utils/full_char_code_at.ts b/src/compiler/utils/full_char_code_at.ts
index b5187693eb..0469b537fc 100644
--- a/src/compiler/utils/full_char_code_at.ts
+++ b/src/compiler/utils/full_char_code_at.ts
@@ -7,4 +7,4 @@ export default function full_char_code_at(str: string, i: number): number {
const next = str.charCodeAt(i + 1);
return (code << 10) + next - 0x35fdc00;
-}
\ No newline at end of file
+}
diff --git a/src/compiler/utils/fuzzymatch.ts b/src/compiler/utils/fuzzymatch.ts
index 0891b7209b..8b22a4175d 100644
--- a/src/compiler/utils/fuzzymatch.ts
+++ b/src/compiler/utils/fuzzymatch.ts
@@ -13,8 +13,9 @@ const GRAM_SIZE_UPPER = 3;
// return an edit distance from 0 to 1
function _distance(str1: string, str2: string) {
- if (str1 === null && str2 === null)
+ if (str1 === null && str2 === null) {
throw 'Trying to compare two null values';
+ }
if (str1 === null || str2 === null) return 0;
str1 = String(str1);
str2 = String(str2);
diff --git a/src/compiler/utils/mapped_code.ts b/src/compiler/utils/mapped_code.ts
new file mode 100644
index 0000000000..58f44d7b8c
--- /dev/null
+++ b/src/compiler/utils/mapped_code.ts
@@ -0,0 +1,333 @@
+import { DecodedSourceMap, RawSourceMap, SourceMapLoader } from '@ampproject/remapping/dist/types/types';
+import remapping from '@ampproject/remapping';
+import { SourceMap } from 'magic-string';
+import { Source, Processed } from '../preprocess/types';
+
+export type SourceLocation = {
+ line: number;
+ column: number;
+};
+
+function last_line_length(s: string) {
+ return s.length - s.lastIndexOf('\n') - 1;
+}
+
+// mutate map in-place
+export function sourcemap_add_offset(
+ map: DecodedSourceMap, offset: SourceLocation, source_index: number
+) {
+ if (map.mappings.length == 0) return;
+ for (let line = 0; line < map.mappings.length; line++) {
+ const segment_list = map.mappings[line];
+ for (let segment = 0; segment < segment_list.length; segment++) {
+ const seg = segment_list[segment];
+ // shift only segments that belong to component source file
+ if (seg[1] === source_index) { // also ensures that seg.length >= 4
+ // shift column if it points at the first line
+ if (seg[2] === 0) {
+ seg[3] += offset.column;
+ }
+ // shift line
+ seg[2] += offset.line;
+ }
+ }
+ }
+}
+
+function merge_tables(this_table: T[], other_table: T[]): [T[], number[], boolean, boolean] {
+ const new_table = this_table.slice();
+ const idx_map = [];
+ other_table = other_table || [];
+ let val_changed = false;
+ for (const [other_idx, other_val] of other_table.entries()) {
+ const this_idx = this_table.indexOf(other_val);
+ if (this_idx >= 0) {
+ idx_map[other_idx] = this_idx;
+ } else {
+ const new_idx = new_table.length;
+ new_table[new_idx] = other_val;
+ idx_map[other_idx] = new_idx;
+ val_changed = true;
+ }
+ }
+ let idx_changed = val_changed;
+ if (val_changed) {
+ if (idx_map.find((val, idx) => val != idx) === undefined) {
+ // idx_map is identity map [0, 1, 2, 3, 4, ....]
+ idx_changed = false;
+ }
+ }
+ return [new_table, idx_map, val_changed, idx_changed];
+}
+
+function pushArray(_this: T[], other: T[]) {
+ // We use push to mutate in place for memory and perf reasons
+ // We use the for loop instead of _this.push(...other) to avoid the JS engine's function argument limit (65,535 in JavascriptCore)
+ for (let i = 0; i < other.length; i++) {
+ _this.push(other[i]);
+ }
+}
+
+export class MappedCode {
+ string: string;
+ map: DecodedSourceMap;
+
+ constructor(string = '', map: DecodedSourceMap = null) {
+ this.string = string;
+ if (map) {
+ this.map = map as DecodedSourceMap;
+ } else {
+ this.map = {
+ version: 3,
+ mappings: [],
+ sources: [],
+ names: []
+ };
+ }
+ }
+
+ /**
+ * concat in-place (mutable), return this (chainable)
+ * will also mutate the `other` object
+ */
+ concat(other: MappedCode): MappedCode {
+ // noop: if one is empty, return the other
+ if (other.string == '') return this;
+ if (this.string == '') {
+ this.string = other.string;
+ this.map = other.map;
+ return this;
+ }
+
+ // compute last line length before mutating
+ const column_offset = last_line_length(this.string);
+
+ this.string += other.string;
+
+ const m1 = this.map;
+ const m2 = other.map;
+
+ if (m2.mappings.length == 0) return this;
+
+ // combine sources and names
+ const [sources, new_source_idx, sources_changed, sources_idx_changed] = merge_tables(m1.sources, m2.sources);
+ const [names, new_name_idx, names_changed, names_idx_changed] = merge_tables(m1.names, m2.names);
+
+ if (sources_changed) m1.sources = sources;
+ if (names_changed) m1.names = names;
+
+ // unswitched loops are faster
+ if (sources_idx_changed && names_idx_changed) {
+ for (let line = 0; line < m2.mappings.length; line++) {
+ const segment_list = m2.mappings[line];
+ for (let segment = 0; segment < segment_list.length; segment++) {
+ const seg = segment_list[segment];
+ if (seg[1] >= 0) seg[1] = new_source_idx[seg[1]];
+ if (seg[4] >= 0) seg[4] = new_name_idx[seg[4]];
+ }
+ }
+ } else if (sources_idx_changed) {
+ for (let line = 0; line < m2.mappings.length; line++) {
+ const segment_list = m2.mappings[line];
+ for (let segment = 0; segment < segment_list.length; segment++) {
+ const seg = segment_list[segment];
+ if (seg[1] >= 0) seg[1] = new_source_idx[seg[1]];
+ }
+ }
+ } else if (names_idx_changed) {
+ for (let line = 0; line < m2.mappings.length; line++) {
+ const segment_list = m2.mappings[line];
+ for (let segment = 0; segment < segment_list.length; segment++) {
+ const seg = segment_list[segment];
+ if (seg[4] >= 0) seg[4] = new_name_idx[seg[4]];
+ }
+ }
+ }
+
+ // combine the mappings
+
+ // combine
+ // 1. last line of first map
+ // 2. first line of second map
+ // columns of 2 must be shifted
+
+ if (m2.mappings.length > 0 && column_offset > 0) {
+ const first_line = m2.mappings[0];
+ for (let i = 0; i < first_line.length; i++) {
+ first_line[i][0] += column_offset;
+ }
+ }
+
+ // combine last line + first line
+ pushArray(m1.mappings[m1.mappings.length - 1], m2.mappings.shift());
+
+ // append other lines
+ pushArray(m1.mappings, m2.mappings);
+
+ return this;
+ }
+
+ static from_processed(string: string, map?: DecodedSourceMap): MappedCode {
+ const line_count = string.split('\n').length;
+
+ if (map) {
+ // ensure that count of source map mappings lines
+ // is equal to count of generated code lines
+ // (some tools may produce less)
+ const missing_lines = line_count - map.mappings.length;
+ for (let i = 0; i < missing_lines; i++) {
+ map.mappings.push([]);
+ }
+ return new MappedCode(string, map);
+ }
+
+ if (string == '') return new MappedCode();
+ map = { version: 3, names: [], sources: [], mappings: [] };
+
+ // add empty SourceMapSegment[] for every line
+ for (let i = 0; i < line_count; i++) map.mappings.push([]);
+ return new MappedCode(string, map);
+ }
+
+ static from_source({ source, file_basename, get_location }: Source): MappedCode {
+ let offset: SourceLocation = get_location(0);
+
+ if (!offset) offset = { line: 0, column: 0 };
+ const map: DecodedSourceMap = { version: 3, names: [], sources: [file_basename], mappings: [] };
+ if (source == '') return new MappedCode(source, map);
+
+ // we create a high resolution identity map here,
+ // we know that it will eventually be merged with svelte's map,
+ // at which stage the resolution will decrease.
+ const line_list = source.split('\n');
+ for (let line = 0; line < line_list.length; line++) {
+ map.mappings.push([]);
+ const token_list = line_list[line].split(/([^\d\w\s]|\s+)/g);
+ for (let token = 0, column = 0; token < token_list.length; token++) {
+ if (token_list[token] == '') continue;
+ map.mappings[line].push([column, 0, offset.line + line, column]);
+ column += token_list[token].length;
+ }
+ }
+ // shift columns in first line
+ const segment_list = map.mappings[0];
+ for (let segment = 0; segment < segment_list.length; segment++) {
+ segment_list[segment][3] += offset.column;
+ }
+ return new MappedCode(source, map);
+ }
+}
+
+export function combine_sourcemaps(
+ filename: string,
+ sourcemap_list: Array
+): RawSourceMap {
+ if (sourcemap_list.length == 0) return null;
+
+ let map_idx = 1;
+ const map: RawSourceMap =
+ sourcemap_list.slice(0, -1)
+ .find(m => m.sources.length !== 1) === undefined
+
+ ? remapping( // use array interface
+ // only the oldest sourcemap can have multiple sources
+ sourcemap_list,
+ () => null,
+ true // skip optional field `sourcesContent`
+ )
+
+ : remapping( // use loader interface
+ sourcemap_list[0], // last map
+ function loader(sourcefile) {
+ if (sourcefile === filename && sourcemap_list[map_idx]) {
+ return sourcemap_list[map_idx++]; // idx 1, 2, ...
+ // bundle file = branch node
+ } else {
+ return null; // source file = leaf node
+ }
+ } as SourceMapLoader,
+ true
+ );
+
+ if (!map.file) delete map.file; // skip optional field `file`
+
+ // When source maps are combined and the leading map is empty, sources is not set.
+ // Add the filename to the empty array in this case.
+ // Further improvements to remapping may help address this as well https://github.com/ampproject/remapping/issues/116
+ if (!map.sources.length) map.sources = [filename];
+
+ return map;
+}
+
+// browser vs node.js
+const b64enc = typeof btoa == 'function' ? btoa : b => Buffer.from(b).toString('base64');
+const b64dec = typeof atob == 'function' ? atob : a => Buffer.from(a, 'base64').toString();
+
+export function apply_preprocessor_sourcemap(filename: string, svelte_map: SourceMap, preprocessor_map_input: string | DecodedSourceMap | RawSourceMap): SourceMap {
+ if (!svelte_map || !preprocessor_map_input) return svelte_map;
+
+ const preprocessor_map = typeof preprocessor_map_input === 'string' ? JSON.parse(preprocessor_map_input) : preprocessor_map_input;
+
+ const result_map = combine_sourcemaps(
+ filename,
+ [
+ svelte_map as RawSourceMap,
+ preprocessor_map
+ ]
+ ) as RawSourceMap;
+
+ // Svelte expects a SourceMap which includes toUrl and toString. Instead of wrapping our output in a class,
+ // we just tack on the extra properties.
+ Object.defineProperties(result_map, {
+ toString: {
+ enumerable: false,
+ value: function toString() {
+ return JSON.stringify(this);
+ }
+ },
+ toUrl: {
+ enumerable: false,
+ value: function toUrl() {
+ return 'data:application/json;charset=utf-8;base64,' + b64enc(this.toString());
+ }
+ }
+ });
+
+ return result_map as SourceMap;
+}
+
+// parse attached sourcemap in processed.code
+export function parse_attached_sourcemap(processed: Processed, tag_name: 'script' | 'style'): void {
+ const r_in = '[#@]\\s*sourceMappingURL\\s*=\\s*(\\S*)';
+ const regex = (tag_name == 'script')
+ ? new RegExp('(?://' + r_in + ')|(?:/\\*' + r_in + '\\s*\\*/)$')
+ : new RegExp('/\\*' + r_in + '\\s*\\*/$');
+ function log_warning(message) {
+ // code_start: help to find preprocessor
+ const code_start = processed.code.length < 100 ? processed.code : (processed.code.slice(0, 100) + ' [...]');
+ console.warn(`warning: ${message}. processed.code = ${JSON.stringify(code_start)}`);
+ }
+ processed.code = processed.code.replace(regex, (_, match1, match2) => {
+ const map_url = (tag_name == 'script') ? (match1 || match2) : match1;
+ const map_data = (map_url.match(/data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(\S*)/) || [])[1];
+ if (map_data) {
+ // sourceMappingURL is data URL
+ if (processed.map) {
+ log_warning('Not implemented. ' +
+ 'Found sourcemap in both processed.code and processed.map. ' +
+ 'Please update your preprocessor to return only one sourcemap.');
+ // ignore attached sourcemap
+ return '';
+ }
+ processed.map = b64dec(map_data); // use attached sourcemap
+ return ''; // remove from processed.code
+ }
+ // sourceMappingURL is path or URL
+ if (!processed.map) {
+ log_warning(`Found sourcemap path ${JSON.stringify(map_url)} in processed.code, but no sourcemap data. ` +
+ 'Please update your preprocessor to return sourcemap data directly.');
+ }
+ // ignore sourcemap path
+ return ''; // remove from processed.code
+ });
+}
diff --git a/src/compiler/utils/names.ts b/src/compiler/utils/names.ts
index 7b6a6f55e0..27acc8eb78 100644
--- a/src/compiler/utils/names.ts
+++ b/src/compiler/utils/names.ts
@@ -4,6 +4,7 @@ import full_char_code_at from './full_char_code_at';
export const globals = new Set([
'alert',
'Array',
+ 'BigInt',
'Boolean',
'clearInterval',
'clearTimeout',
@@ -13,6 +14,7 @@ export const globals = new Set([
'decodeURI',
'decodeURIComponent',
'document',
+ 'Element',
'encodeURI',
'encodeURIComponent',
'Error',
@@ -23,6 +25,7 @@ export const globals = new Set([
'global',
'globalThis',
'history',
+ 'HTMLElement',
'Infinity',
'InternalError',
'Intl',
@@ -35,6 +38,7 @@ export const globals = new Set([
'Math',
'NaN',
'navigator',
+ 'Node',
'Number',
'Object',
'parseFloat',
@@ -50,11 +54,13 @@ export const globals = new Set([
'setInterval',
'setTimeout',
'String',
+ 'SVGElement',
'SyntaxError',
'TypeError',
'undefined',
'URIError',
'URL',
+ 'URLSearchParams',
'window'
]);
diff --git a/src/compiler/utils/namespaces.ts b/src/compiler/utils/namespaces.ts
index 3db7bc3fae..01d9bd60b3 100644
--- a/src/compiler/utils/namespaces.ts
+++ b/src/compiler/utils/namespaces.ts
@@ -1,3 +1,6 @@
+// The `foreign` namespace covers all DOM implementations that aren't HTML5.
+// It opts out of HTML5-specific a11y checks and case-insensitive attribute names.
+export const foreign = 'https://svelte.dev/docs#svelte_options';
export const html = 'http://www.w3.org/1999/xhtml';
export const mathml = 'http://www.w3.org/1998/Math/MathML';
export const svg = 'http://www.w3.org/2000/svg';
@@ -6,12 +9,14 @@ export const xml = 'http://www.w3.org/XML/1998/namespace';
export const xmlns = 'http://www.w3.org/2000/xmlns';
export const valid_namespaces = [
+ 'foreign',
'html',
'mathml',
'svg',
'xlink',
'xml',
'xmlns',
+ foreign,
html,
mathml,
svg,
@@ -20,4 +25,4 @@ export const valid_namespaces = [
xmlns
];
-export const namespaces: Record = { html, mathml, svg, xlink, xml, xmlns };
+export const namespaces: Record = { foreign, html, mathml, svg, xlink, xml, xmlns };
diff --git a/src/compiler/utils/nodes_match.ts b/src/compiler/utils/nodes_match.ts
index 2b6f998c19..ff841d5f02 100644
--- a/src/compiler/utils/nodes_match.ts
+++ b/src/compiler/utils/nodes_match.ts
@@ -29,4 +29,4 @@ export function nodes_match(a, b) {
}
return a === b;
-}
\ No newline at end of file
+}
diff --git a/src/compiler/utils/patterns.ts b/src/compiler/utils/patterns.ts
index 317a7c1990..0728035a48 100644
--- a/src/compiler/utils/patterns.ts
+++ b/src/compiler/utils/patterns.ts
@@ -1,3 +1,5 @@
export const whitespace = /[ \t\r\n]/;
+export const start_whitespace = /^[ \t\r\n]*/;
+export const end_whitespace = /[ \t\r\n]*$/;
export const dimensions = /^(?:offset|client)(?:Width|Height)$/;
diff --git a/src/compiler/utils/trim.ts b/src/compiler/utils/trim.ts
index 43f413bb1d..05af79cc90 100644
--- a/src/compiler/utils/trim.ts
+++ b/src/compiler/utils/trim.ts
@@ -1,15 +1,9 @@
-import { whitespace } from './patterns';
+import { start_whitespace, end_whitespace } from './patterns';
export function trim_start(str: string) {
- let i = 0;
- while (whitespace.test(str[i])) i += 1;
-
- return str.slice(i);
+ return str.replace(start_whitespace, '');
}
export function trim_end(str: string) {
- let i = str.length;
- while (whitespace.test(str[i - 1])) i -= 1;
-
- return str.slice(0, i);
+ return str.replace(end_whitespace, '');
}
diff --git a/src/runtime/animate/index.ts b/src/runtime/animate/index.ts
index 82ec0d5a5f..a68e6b0dc3 100644
--- a/src/runtime/animate/index.ts
+++ b/src/runtime/animate/index.ts
@@ -16,27 +16,31 @@ interface FlipParams {
easing?: (t: number) => number;
}
-export function flip(node: Element, animation: { from: DOMRect; to: DOMRect }, params: FlipParams): AnimationConfig {
+export function flip(node: Element, { from, to }: { from: DOMRect; to: DOMRect }, params: FlipParams = {}): AnimationConfig {
const style = getComputedStyle(node);
const transform = style.transform === 'none' ? '' : style.transform;
- const scaleX = animation.from.width / node.clientWidth;
- const scaleY = animation.from.height / node.clientHeight;
- const dx = (animation.from.left - animation.to.left) / scaleX;
- const dy = (animation.from.top - animation.to.top) / scaleY;
-
- const d = Math.sqrt(dx * dx + dy * dy);
+ const [ox, oy] = style.transformOrigin.split(' ').map(parseFloat);
+ const dx = (from.left + from.width * ox / to.width) - (to.left + ox);
+ const dy = (from.top + from.height * oy / to.height) - (to.top + oy);
const {
delay = 0,
- duration = (d: number) => Math.sqrt(d) * 120,
+ duration = (d) => Math.sqrt(d) * 120,
easing = cubicOut
} = params;
return {
delay,
- duration: is_function(duration) ? duration(d) : duration,
+ duration: is_function(duration) ? duration(Math.sqrt(dx * dx + dy * dy)) : duration,
easing,
- css: (_t, u) => `transform: ${transform} translate(${u * dx}px, ${u * dy}px);`
+ css: (t, u) => {
+ const x = u * dx;
+ const y = u * dy;
+ const sx = t + u * from.width / to.width;
+ const sy = t + u * from.height / to.height;
+
+ return `transform: ${transform} translate(${x}px, ${y}px) scale(${sx}, ${sy});`;
+ }
};
}
diff --git a/src/runtime/index.ts b/src/runtime/index.ts
index e6c0c916f2..8e12f9f0ee 100644
--- a/src/runtime/index.ts
+++ b/src/runtime/index.ts
@@ -7,7 +7,10 @@ export {
afterUpdate,
setContext,
getContext,
+ getAllContexts,
+ hasContext,
tick,
createEventDispatcher,
- SvelteComponentDev as SvelteComponent
+ SvelteComponentDev as SvelteComponent,
+ SvelteComponentTyped
} from 'svelte/internal';
diff --git a/src/runtime/internal/Component.ts b/src/runtime/internal/Component.ts
index 459a78031a..3e48010547 100644
--- a/src/runtime/internal/Component.ts
+++ b/src/runtime/internal/Component.ts
@@ -1,11 +1,14 @@
import { add_render_callback, flush, schedule_update, dirty_components } from './scheduler';
import { current_component, set_current_component } from './lifecycle';
import { blank_object, is_empty, is_function, run, run_all, noop } from './utils';
-import { children, detach } from './dom';
+import { children, detach, start_hydrating, end_hydrating } from './dom';
import { transition_in } from './transitions';
-interface Fragment {
- key: string|null;
+/**
+ * INTERNAL, DO NOT USE. Code may change at any time.
+ */
+export interface Fragment {
+ key: string | null;
first: null;
/* create */ c: () => void;
/* claim */ l: (nodes: any) => void;
@@ -17,23 +20,25 @@ interface Fragment {
/* animate */ a: () => void;
/* intro */ i: (local: any) => void;
/* outro */ o: (local: any) => void;
- /* destroy */ d: (detaching: 0|1) => void;
+ /* destroy */ d: (detaching: 0 | 1) => void;
}
interface T$$ {
dirty: number[];
- ctx: null|any;
+ ctx: null | any;
bound: any;
update: () => void;
callbacks: any;
after_update: any[];
props: Record;
- fragment: null|false|Fragment;
+ fragment: null | false | Fragment;
not_equal: any;
before_update: any[];
context: Map;
on_mount: any[];
on_destroy: any[];
skip_bound: boolean;
+ on_disconnect: any[];
+ root:Element | ShadowRoot
}
export function bind(component, name, callback) {
@@ -52,23 +57,26 @@ export function claim_component(block, parent_nodes) {
block && block.l(parent_nodes);
}
-export function mount_component(component, target, anchor) {
+export function mount_component(component, target, anchor, customElement) {
const { fragment, on_mount, on_destroy, after_update } = component.$$;
fragment && fragment.m(target, anchor);
- // onMount happens before the initial afterUpdate
- add_render_callback(() => {
- const new_on_destroy = on_mount.map(run).filter(is_function);
- if (on_destroy) {
- on_destroy.push(...new_on_destroy);
- } else {
- // Edge case - component was destroyed immediately,
- // most likely as a result of a binding initialising
- run_all(new_on_destroy);
- }
- component.$$.on_mount = [];
- });
+ if (!customElement) {
+ // onMount happens before the initial afterUpdate
+ add_render_callback(() => {
+
+ const new_on_destroy = on_mount.map(run).filter(is_function);
+ if (on_destroy) {
+ on_destroy.push(...new_on_destroy);
+ } else {
+ // Edge case - component was destroyed immediately,
+ // most likely as a result of a binding initialising
+ run_all(new_on_destroy);
+ }
+ component.$$.on_mount = [];
+ });
+ }
after_update.forEach(add_render_callback);
}
@@ -96,12 +104,10 @@ function make_dirty(component, i) {
component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31));
}
-export function init(component, options, instance, create_fragment, not_equal, props, dirty = [-1]) {
+export function init(component, options, instance, create_fragment, not_equal, props, append_styles, dirty = [-1]) {
const parent_component = current_component;
set_current_component(component);
- const prop_values = options.props || {};
-
const $$: T$$ = component.$$ = {
fragment: null,
ctx: null,
@@ -115,20 +121,24 @@ export function init(component, options, instance, create_fragment, not_equal, p
// lifecycle
on_mount: [],
on_destroy: [],
+ on_disconnect: [],
before_update: [],
after_update: [],
- context: new Map(parent_component ? parent_component.$$.context : []),
+ context: new Map(options.context || (parent_component ? parent_component.$$.context : [])),
// everything else
callbacks: blank_object(),
dirty,
- skip_bound: false
+ skip_bound: false,
+ root: options.target || parent_component.$$.root
};
+ append_styles && append_styles($$.root);
+
let ready = false;
$$.ctx = instance
- ? instance(component, prop_values, (i, ret, ...rest) => {
+ ? instance(component, options.props || {}, (i, ret, ...rest) => {
const value = rest.length ? rest[0] : ret;
if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {
if (!$$.skip_bound && $$.bound[i]) $$.bound[i](value);
@@ -147,6 +157,7 @@ export function init(component, options, instance, create_fragment, not_equal, p
if (options.target) {
if (options.hydrate) {
+ start_hydrating();
const nodes = children(options.target);
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
$$.fragment && $$.fragment!.l(nodes);
@@ -157,7 +168,8 @@ export function init(component, options, instance, create_fragment, not_equal, p
}
if (options.intro) transition_in(component.$$.fragment);
- mount_component(component, options.target, options.anchor);
+ mount_component(component, options.target, options.anchor, options.customElement);
+ end_hydrating();
flush();
}
@@ -175,6 +187,9 @@ if (typeof HTMLElement === 'function') {
}
connectedCallback() {
+ const { on_mount } = this.$$;
+ this.$$.on_disconnect = on_mount.map(run).filter(is_function);
+
// @ts-ignore todo: improve typings
for (const key in this.$$.slotted) {
// @ts-ignore todo: improve typings
@@ -186,6 +201,10 @@ if (typeof HTMLElement === 'function') {
this[attr] = newValue;
}
+ disconnectedCallback() {
+ run_all(this.$$.on_disconnect);
+ }
+
$destroy() {
destroy_component(this, 1);
this.$destroy = noop;
@@ -212,6 +231,9 @@ if (typeof HTMLElement === 'function') {
};
}
+/**
+ * Base class for Svelte components. Used when dev=false.
+ */
export class SvelteComponent {
$$: T$$;
$$set?: ($$props: any) => void;
diff --git a/src/runtime/internal/animations.ts b/src/runtime/internal/animations.ts
index 6dc6a446f6..215fa7d814 100644
--- a/src/runtime/internal/animations.ts
+++ b/src/runtime/internal/animations.ts
@@ -6,7 +6,7 @@ import { AnimationConfig } from '../animate';
//todo: documentation says it is DOMRect, but in IE it would be ClientRect
-type PositionRect = DOMRect|ClientRect;
+type PositionRect = DOMRect | ClientRect;
type AnimationFn = (node: Element, { from, to }: { from: PositionRect; to: PositionRect }, params: any) => AnimationConfig;
diff --git a/src/runtime/internal/await_block.ts b/src/runtime/internal/await_block.ts
index 4b7ca6fd21..ea6e8a187f 100644
--- a/src/runtime/internal/await_block.ts
+++ b/src/runtime/internal/await_block.ts
@@ -28,7 +28,9 @@ export function handle_promise(promise, info) {
if (i !== index && block) {
group_outros();
transition_out(block, 1, 1, () => {
- info.blocks[i] = null;
+ if (info.blocks[i] === block) {
+ info.blocks[i] = null;
+ }
});
check_outros();
}
@@ -81,3 +83,17 @@ export function handle_promise(promise, info) {
info.resolved = promise;
}
}
+
+export function update_await_block_branch(info, ctx, dirty) {
+ const child_ctx = ctx.slice();
+ const { resolved } = info;
+
+ if (info.current === info.then) {
+ child_ctx[info.value] = resolved;
+ }
+ if (info.current === info.catch) {
+ child_ctx[info.error] = resolved;
+ }
+
+ info.block.p(child_ctx, dirty);
+}
diff --git a/src/runtime/internal/dev.ts b/src/runtime/internal/dev.ts
index 708b393601..76d68086c8 100644
--- a/src/runtime/internal/dev.ts
+++ b/src/runtime/internal/dev.ts
@@ -1,8 +1,8 @@
-import { custom_event, append, insert, detach, listen, attr } from './dom';
+import { custom_event, append, append_hydration, insert, insert_hydration, detach, listen, attr } from './dom';
import { SvelteComponent } from './Component';
export function dispatch_dev(type: string, detail?: T) {
- document.dispatchEvent(custom_event(type, { version: '__VERSION__', ...detail }));
+ document.dispatchEvent(custom_event(type, { version: '__VERSION__', ...detail }, true));
}
export function append_dev(target: Node, node: Node) {
@@ -10,11 +10,21 @@ export function append_dev(target: Node, node: Node) {
append(target, node);
}
+export function append_hydration_dev(target: Node, node: Node) {
+ dispatch_dev('SvelteDOMInsert', { target, node });
+ append_hydration(target, node);
+}
+
export function insert_dev(target: Node, node: Node, anchor?: Node) {
dispatch_dev('SvelteDOMInsert', { target, node, anchor });
insert(target, node, anchor);
}
+export function insert_hydration_dev(target: Node, node: Node, anchor?: Node) {
+ dispatch_dev('SvelteDOMInsert', { target, node, anchor });
+ insert_hydration(target, node, anchor);
+}
+
export function detach_dev(node: Node) {
dispatch_dev('SvelteDOMRemove', { node });
detach(node);
@@ -100,20 +110,47 @@ export function validate_slots(name, slot, keys) {
type Props = Record;
export interface SvelteComponentDev {
$set(props?: Props): void;
- $on(event: string, callback: (event: CustomEvent) => void): () => void;
+ $on(event: string, callback: (event: any) => void): () => void;
$destroy(): void;
[accessor: string]: any;
}
+interface IComponentOptions = Record> {
+ target: Element | ShadowRoot;
+ anchor?: Element;
+ props?: Props;
+ context?: Map;
+ hydrate?: boolean;
+ intro?: boolean;
+ $$inline?: boolean;
+}
+/**
+ * Base class for Svelte components with some minor dev-enhancements. Used when dev=true.
+ */
export class SvelteComponentDev extends SvelteComponent {
- constructor(options: {
- target: Element;
- anchor?: Element;
- props?: Props;
- hydrate?: boolean;
- intro?: boolean;
- $$inline?: boolean;
- }) {
+ /**
+ * @private
+ * For type checking capabilities only.
+ * Does not exist at runtime.
+ * ### DO NOT USE!
+ */
+ $$prop_def: Props;
+ /**
+ * @private
+ * For type checking capabilities only.
+ * Does not exist at runtime.
+ * ### DO NOT USE!
+ */
+ $$events_def: any;
+ /**
+ * @private
+ * For type checking capabilities only.
+ * Does not exist at runtime.
+ * ### DO NOT USE!
+ */
+ $$slot_def: any;
+
+ constructor(options: IComponentOptions) {
if (!options || (!options.target && !options.$$inline)) {
throw new Error("'target' is a required option");
}
@@ -133,6 +170,83 @@ export class SvelteComponentDev extends SvelteComponent {
$inject_state() {}
}
+// TODO https://github.com/microsoft/TypeScript/issues/41770 is the reason
+// why we have to split out SvelteComponentTyped to not break existing usage of SvelteComponent.
+// Try to find a better way for Svelte 4.0.
+
+export interface SvelteComponentTyped<
+ Props extends Record = any,
+ Events extends Record = any,
+ Slots extends Record = any // eslint-disable-line @typescript-eslint/no-unused-vars
+> {
+ $set(props?: Partial): void;
+ $on>(type: K, callback: (e: Events[K]) => void): () => void;
+ $destroy(): void;
+ [accessor: string]: any;
+}
+/**
+ * Base class to create strongly typed Svelte components.
+ * This only exists for typing purposes and should be used in `.d.ts` files.
+ *
+ * ### Example:
+ *
+ * You have component library on npm called `component-library`, from which
+ * you export a component called `MyComponent`. For Svelte+TypeScript users,
+ * you want to provide typings. Therefore you create a `index.d.ts`:
+ * ```ts
+ * import { SvelteComponentTyped } from "svelte";
+ * export class MyComponent extends SvelteComponentTyped<{foo: string}> {}
+ * ```
+ * Typing this makes it possible for IDEs like VS Code with the Svelte extension
+ * to provide intellisense and to use the component like this in a Svelte file
+ * with TypeScript:
+ * ```svelte
+ *
+ *
+ * ```
+ *
+ * #### Why not make this part of `SvelteComponent(Dev)`?
+ * Because
+ * ```ts
+ * class ASubclassOfSvelteComponent extends SvelteComponent<{foo: string}> {}
+ * const component: typeof SvelteComponent = ASubclassOfSvelteComponent;
+ * ```
+ * will throw a type error, so we need to separate the more strictly typed class.
+ */
+export class SvelteComponentTyped<
+ Props extends Record = any,
+ Events extends Record = any,
+ Slots extends Record = any
+> extends SvelteComponentDev {
+ /**
+ * @private
+ * For type checking capabilities only.
+ * Does not exist at runtime.
+ * ### DO NOT USE!
+ */
+ $$prop_def: Props;
+ /**
+ * @private
+ * For type checking capabilities only.
+ * Does not exist at runtime.
+ * ### DO NOT USE!
+ */
+ $$events_def: Events;
+ /**
+ * @private
+ * For type checking capabilities only.
+ * Does not exist at runtime.
+ * ### DO NOT USE!
+ */
+ $$slot_def: Slots;
+
+ constructor(options: IComponentOptions) {
+ super(options);
+ }
+}
+
export function loop_guard(timeout) {
const start = Date.now();
return () => {
diff --git a/src/runtime/internal/dom.ts b/src/runtime/internal/dom.ts
index 5380443fbc..eb3389e3f8 100644
--- a/src/runtime/internal/dom.ts
+++ b/src/runtime/internal/dom.ts
@@ -1,13 +1,207 @@
import { has_prop } from './utils';
+// Track which nodes are claimed during hydration. Unclaimed nodes can then be removed from the DOM
+// at the end of hydration without touching the remaining nodes.
+let is_hydrating = false;
+
+export function start_hydrating() {
+ is_hydrating = true;
+}
+export function end_hydrating() {
+ is_hydrating = false;
+}
+
+type NodeEx = Node & {
+ claim_order?: number,
+ hydrate_init? : true,
+ actual_end_child?: NodeEx,
+ childNodes: NodeListOf,
+};
+
+function upper_bound(low: number, high: number, key: (index: number) => number, value: number) {
+ // Return first index of value larger than input value in the range [low, high)
+ while (low < high) {
+ const mid = low + ((high - low) >> 1);
+ if (key(mid) <= value) {
+ low = mid + 1;
+ } else {
+ high = mid;
+ }
+ }
+ return low;
+}
+
+function init_hydrate(target: NodeEx) {
+ if (target.hydrate_init) return;
+ target.hydrate_init = true;
+
+ type NodeEx2 = NodeEx & {claim_order: number};
+
+ // We know that all children have claim_order values since the unclaimed have been detached if target is not
+ let children: ArrayLike = target.childNodes as NodeListOf;
+
+ // If target is , there may be children without claim_order
+ if (target.nodeName === 'HEAD') {
+ const myChildren = [];
+ for (let i = 0; i < children.length; i++) {
+ const node = children[i];
+ if (node.claim_order !== undefined) {
+ myChildren.push(node);
+ }
+ }
+ children = myChildren;
+ }
+
+ /*
+ * Reorder claimed children optimally.
+ * We can reorder claimed children optimally by finding the longest subsequence of
+ * nodes that are already claimed in order and only moving the rest. The longest
+ * subsequence subsequence of nodes that are claimed in order can be found by
+ * computing the longest increasing subsequence of .claim_order values.
+ *
+ * This algorithm is optimal in generating the least amount of reorder operations
+ * possible.
+ *
+ * Proof:
+ * We know that, given a set of reordering operations, the nodes that do not move
+ * always form an increasing subsequence, since they do not move among each other
+ * meaning that they must be already ordered among each other. Thus, the maximal
+ * set of nodes that do not move form a longest increasing subsequence.
+ */
+
+ // Compute longest increasing subsequence
+ // m: subsequence length j => index k of smallest value that ends an increasing subsequence of length j
+ const m = new Int32Array(children.length + 1);
+ // Predecessor indices + 1
+ const p = new Int32Array(children.length);
+
+ m[0] = -1;
+ let longest = 0;
+ for (let i = 0; i < children.length; i++) {
+ const current = children[i].claim_order;
+ // Find the largest subsequence length such that it ends in a value less than our current value
+
+ // upper_bound returns first greater value, so we subtract one
+ // with fast path for when we are on the current longest subsequence
+ const seqLen = ((longest > 0 && children[m[longest]].claim_order <= current) ? longest + 1 : upper_bound(1, longest, idx => children[m[idx]].claim_order, current)) - 1;
+
+ p[i] = m[seqLen] + 1;
+
+ const newLen = seqLen + 1;
+
+ // We can guarantee that current is the smallest value. Otherwise, we would have generated a longer sequence.
+ m[newLen] = i;
+
+ longest = Math.max(newLen, longest);
+ }
+
+ // The longest increasing subsequence of nodes (initially reversed)
+ const lis: NodeEx2[] = [];
+ // The rest of the nodes, nodes that will be moved
+ const toMove: NodeEx2[] = [];
+ let last = children.length - 1;
+ for (let cur = m[longest] + 1; cur != 0; cur = p[cur - 1]) {
+ lis.push(children[cur - 1]);
+ for (; last >= cur; last--) {
+ toMove.push(children[last]);
+ }
+ last--;
+ }
+ for (; last >= 0; last--) {
+ toMove.push(children[last]);
+ }
+ lis.reverse();
+
+ // We sort the nodes being moved to guarantee that their insertion order matches the claim order
+ toMove.sort((a, b) => a.claim_order - b.claim_order);
+
+ // Finally, we move the nodes
+ for (let i = 0, j = 0; i < toMove.length; i++) {
+ while (j < lis.length && toMove[i].claim_order >= lis[j].claim_order) {
+ j++;
+ }
+ const anchor = j < lis.length ? lis[j] : null;
+ target.insertBefore(toMove[i], anchor);
+ }
+}
+
export function append(target: Node, node: Node) {
target.appendChild(node);
}
+export function append_styles(
+ target: Node,
+ style_sheet_id: string,
+ styles: string
+) {
+ const append_styles_to = get_root_for_style(target);
+
+ if (!append_styles_to.getElementById(style_sheet_id)) {
+ const style = element('style');
+ style.id = style_sheet_id;
+ style.textContent = styles;
+ append_stylesheet(append_styles_to, style);
+ }
+}
+
+export function get_root_for_style(node: Node): ShadowRoot | Document {
+ if (!node) return document;
+
+ const root = node.getRootNode ? node.getRootNode() : node.ownerDocument;
+ if (root && (root as ShadowRoot).host) {
+ return root as ShadowRoot;
+ }
+ return node.ownerDocument;
+}
+
+export function append_empty_stylesheet(node: Node) {
+ const style_element = element('style') as HTMLStyleElement;
+ append_stylesheet(get_root_for_style(node), style_element);
+ return style_element;
+}
+
+function append_stylesheet(node: ShadowRoot | Document, style: HTMLStyleElement) {
+ append((node as Document).head || node, style);
+}
+
+export function append_hydration(target: NodeEx, node: NodeEx) {
+ if (is_hydrating) {
+ init_hydrate(target);
+
+ if ((target.actual_end_child === undefined) || ((target.actual_end_child !== null) && (target.actual_end_child.parentElement !== target))) {
+ target.actual_end_child = target.firstChild;
+ }
+
+ // Skip nodes of undefined ordering
+ while ((target.actual_end_child !== null) && (target.actual_end_child.claim_order === undefined)) {
+ target.actual_end_child = target.actual_end_child.nextSibling;
+ }
+
+ if (node !== target.actual_end_child) {
+ // We only insert if the ordering of this node should be modified or the parent node is not target
+ if (node.claim_order !== undefined || node.parentNode !== target) {
+ target.insertBefore(node, target.actual_end_child);
+ }
+ } else {
+ target.actual_end_child = node.nextSibling;
+ }
+ } else if (node.parentNode !== target || node.nextSibling !== null) {
+ target.appendChild(node);
+ }
+}
+
export function insert(target: Node, node: Node, anchor?: Node) {
target.insertBefore(node, anchor || null);
}
+export function insert_hydration(target: NodeEx, node: NodeEx, anchor?: NodeEx) {
+ if (is_hydrating && !anchor) {
+ append_hydration(target, node);
+ } else if (node.parentNode !== target || node.nextSibling != anchor) {
+ target.insertBefore(node, anchor || null);
+ }
+}
+
export function detach(node: Node) {
node.parentNode.removeChild(node);
}
@@ -85,6 +279,13 @@ export function self(fn) {
};
}
+export function trusted(fn) {
+ return function(event) {
+ // @ts-ignore
+ if (event.isTrusted) fn.call(this, event);
+ };
+}
+
export function attr(node: Element, attribute: string, value?: string) {
if (value == null) node.removeAttribute(attribute);
else if (node.getAttribute(attribute) !== value) node.setAttribute(attribute, value);
@@ -116,7 +317,7 @@ export function set_svg_attributes(node: Element & ElementCSSInlineStyle, attrib
export function set_custom_element_data(node, prop, value) {
if (prop in node) {
- node[prop] = value;
+ node[prop] = typeof node[prop] === 'boolean' && value === '' ? true : value;
} else {
attr(node, prop, value);
}
@@ -149,46 +350,166 @@ export function time_ranges_to_array(ranges) {
return array;
}
-export function children(element) {
+type ChildNodeEx = ChildNode & NodeEx;
+
+type ChildNodeArray = ChildNodeEx[] & {
+ claim_info?: {
+ /**
+ * The index of the last claimed element
+ */
+ last_index: number;
+ /**
+ * The total number of elements claimed
+ */
+ total_claimed: number;
+ }
+};
+
+export function children(element: Element) {
return Array.from(element.childNodes);
}
-export function claim_element(nodes, name, attributes, svg) {
- for (let i = 0; i < nodes.length; i += 1) {
- const node = nodes[i];
- if (node.nodeName === name) {
- let j = 0;
+function init_claim_info(nodes: ChildNodeArray) {
+ if (nodes.claim_info === undefined) {
+ nodes.claim_info = {last_index: 0, total_claimed: 0};
+ }
+}
+
+function claim_node(nodes: ChildNodeArray, predicate: (node: ChildNodeEx) => node is R, processNode: (node: ChildNodeEx) => ChildNodeEx | undefined, createNode: () => R, dontUpdateLastIndex: boolean = false) {
+ // Try to find nodes in an order such that we lengthen the longest increasing subsequence
+ init_claim_info(nodes);
+
+ const resultNode = (() => {
+ // We first try to find an element after the previous one
+ for (let i = nodes.claim_info.last_index; i < nodes.length; i++) {
+ const node = nodes[i];
+
+ if (predicate(node)) {
+ const replacement = processNode(node);
+
+ if (replacement === undefined) {
+ nodes.splice(i, 1);
+ } else {
+ nodes[i] = replacement;
+ }
+ if (!dontUpdateLastIndex) {
+ nodes.claim_info.last_index = i;
+ }
+ return node;
+ }
+ }
+
+
+ // Otherwise, we try to find one before
+ // We iterate in reverse so that we don't go too far back
+ for (let i = nodes.claim_info.last_index - 1; i >= 0; i--) {
+ const node = nodes[i];
+
+ if (predicate(node)) {
+ const replacement = processNode(node);
+
+ if (replacement === undefined) {
+ nodes.splice(i, 1);
+ } else {
+ nodes[i] = replacement;
+ }
+ if (!dontUpdateLastIndex) {
+ nodes.claim_info.last_index = i;
+ } else if (replacement === undefined) {
+ // Since we spliced before the last_index, we decrease it
+ nodes.claim_info.last_index--;
+ }
+ return node;
+ }
+ }
+
+ // If we can't find any matching node, we create a new one
+ return createNode();
+ })();
+
+ resultNode.claim_order = nodes.claim_info.total_claimed;
+ nodes.claim_info.total_claimed += 1;
+ return resultNode;
+}
+
+function claim_element_base(nodes: ChildNodeArray, name: string, attributes: { [key: string]: boolean }, create_element: (name: string) => Element | SVGElement) {
+ return claim_node(
+ nodes,
+ (node: ChildNode): node is Element | SVGElement => node.nodeName === name,
+ (node: Element) => {
const remove = [];
- while (j < node.attributes.length) {
- const attribute = node.attributes[j++];
+ for (let j = 0; j < node.attributes.length; j++) {
+ const attribute = node.attributes[j];
if (!attributes[attribute.name]) {
remove.push(attribute.name);
}
}
- for (let k = 0; k < remove.length; k++) {
- node.removeAttribute(remove[k]);
+ remove.forEach(v => node.removeAttribute(v));
+ return undefined;
+ },
+ () => create_element(name)
+ );
+}
+
+export function claim_element(nodes: ChildNodeArray, name: string, attributes: { [key: string]: boolean }) {
+ return claim_element_base(nodes, name, attributes, element);
+}
+
+export function claim_svg_element(nodes: ChildNodeArray, name: string, attributes: { [key: string]: boolean }) {
+ return claim_element_base(nodes, name, attributes, svg_element);
+}
+
+export function claim_text(nodes: ChildNodeArray, data) {
+ return claim_node(
+ nodes,
+ (node: ChildNode): node is Text => node.nodeType === 3,
+ (node: Text) => {
+ const dataStr = '' + data;
+ if (node.data.startsWith(dataStr)) {
+ if (node.data.length !== dataStr.length) {
+ return node.splitText(dataStr.length);
+ }
+ } else {
+ node.data = dataStr;
}
- return nodes.splice(i, 1)[0];
- }
- }
+ },
+ () => text(data),
+ true // Text nodes should not update last index since it is likely not worth it to eliminate an increasing subsequence of actual elements
+ );
+}
- return svg ? svg_element(name) : element(name);
+export function claim_space(nodes) {
+ return claim_text(nodes, ' ');
}
-export function claim_text(nodes, data) {
- for (let i = 0; i < nodes.length; i += 1) {
+function find_comment(nodes, text, start) {
+ for (let i = start; i < nodes.length; i += 1) {
const node = nodes[i];
- if (node.nodeType === 3) {
- node.data = '' + data;
- return nodes.splice(i, 1)[0];
+ if (node.nodeType === 8 /* comment node */ && node.textContent.trim() === text) {
+ return i;
}
}
-
- return text(data);
+ return nodes.length;
}
-export function claim_space(nodes) {
- return claim_text(nodes, ' ');
+export function claim_html_tag(nodes) {
+ // find html opening tag
+ const start_index = find_comment(nodes, 'HTML_TAG_START', 0);
+ const end_index = find_comment(nodes, 'HTML_TAG_END', start_index);
+ if (start_index === end_index) {
+ return new HtmlTagHydration();
+ }
+
+ init_claim_info(nodes);
+ const html_tag_nodes = nodes.splice(start_index, end_index + 1);
+ detach(html_tag_nodes[0]);
+ detach(html_tag_nodes[html_tag_nodes.length - 1]);
+ const claimed_nodes = html_tag_nodes.slice(1, html_tag_nodes.length - 1);
+ for (const n of claimed_nodes) {
+ n.claim_order = nodes.claim_info.total_claimed;
+ nodes.claim_info.total_claimed += 1;
+ }
+ return new HtmlTagHydration(claimed_nodes);
}
export function set_data(text, data) {
@@ -221,6 +542,8 @@ export function select_option(select, value) {
return;
}
}
+
+ select.selectedIndex = -1; // no option should be selected
}
export function select_options(select, value) {
@@ -261,7 +584,6 @@ export function is_crossorigin() {
export function add_resize_listener(node: HTMLElement, fn: () => void) {
const computed_style = getComputedStyle(node);
- const z_index = (parseInt(computed_style.zIndex) || 0) - 1;
if (computed_style.position === 'static') {
node.style.position = 'relative';
@@ -270,7 +592,7 @@ export function add_resize_listener(node: HTMLElement, fn: () => void) {
const iframe = element('iframe');
iframe.setAttribute('style',
'display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; ' +
- `overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: ${z_index};`
+ 'overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;'
);
iframe.setAttribute('aria-hidden', 'true');
iframe.tabIndex = -1;
@@ -308,38 +630,45 @@ export function toggle_class(element, name, toggle) {
element.classList[toggle ? 'add' : 'remove'](name);
}
-export function custom_event(type: string, detail?: T) {
+export function custom_event(type: string, detail?: T, bubbles: boolean = false) {
const e: CustomEvent = document.createEvent('CustomEvent');
- e.initCustomEvent(type, false, false, detail);
+ e.initCustomEvent(type, bubbles, false, detail);
return e;
}
export function query_selector_all(selector: string, parent: HTMLElement = document.body) {
- return Array.from(parent.querySelectorAll(selector));
+ return Array.from(parent.querySelectorAll(selector)) as ChildNodeArray;
}
export class HtmlTag {
+ // parent for creating node
e: HTMLElement;
+ // html tag nodes
n: ChildNode[];
+ // target
t: HTMLElement;
+ // anchor
a: HTMLElement;
- constructor(anchor: HTMLElement = null) {
- this.a = anchor;
+ constructor() {
this.e = this.n = null;
}
+ c(html: string) {
+ this.h(html);
+ }
+
m(html: string, target: HTMLElement, anchor: HTMLElement = null) {
if (!this.e) {
this.e = element(target.nodeName as keyof HTMLElementTagNameMap);
this.t = target;
- this.h(html);
+ this.c(html);
}
this.i(anchor);
}
- h(html) {
+ h(html: string) {
this.e.innerHTML = html;
this.n = Array.from(this.e.childNodes);
}
@@ -360,3 +689,42 @@ export class HtmlTag {
this.n.forEach(detach);
}
}
+
+export class HtmlTagHydration extends HtmlTag {
+ // hydration claimed nodes
+ l: ChildNode[] | void;
+
+ constructor(claimed_nodes?: ChildNode[]) {
+ super();
+ this.e = this.n = null;
+ this.l = claimed_nodes;
+ }
+ c(html: string) {
+ if (this.l) {
+ this.n = this.l;
+ } else {
+ super.c(html);
+ }
+ }
+ i(anchor) {
+ for (let i = 0; i < this.n.length; i += 1) {
+ insert_hydration(this.t, this.n[i], anchor);
+ }
+ }
+}
+
+export function attribute_to_object(attributes: NamedNodeMap) {
+ const result = {};
+ for (const attribute of attributes) {
+ result[attribute.name] = attribute.value;
+ }
+ return result;
+}
+
+export function get_custom_elements_slots(element: HTMLElement) {
+ const result = {};
+ element.childNodes.forEach((node: Element) => {
+ result[node.slot || 'default'] = true;
+ });
+ return result;
+}
diff --git a/src/runtime/internal/keyed_each.ts b/src/runtime/internal/keyed_each.ts
index 6e333da1a4..079d5f4499 100644
--- a/src/runtime/internal/keyed_each.ts
+++ b/src/runtime/internal/keyed_each.ts
@@ -73,19 +73,13 @@ export function update_keyed_each(old_blocks, dirty, get_key, dynamic, ctx, list
next = new_block.first;
o--;
n--;
- }
-
- else if (!new_lookup.has(old_key)) {
+ } else if (!new_lookup.has(old_key)) {
// remove old block
destroy(old_block, lookup);
o--;
- }
-
- else if (!lookup.has(new_key) || will_move.has(new_key)) {
+ } else if (!lookup.has(new_key) || will_move.has(new_key)) {
insert(new_block);
- }
-
- else if (did_move.has(old_key)) {
+ } else if (did_move.has(old_key)) {
o--;
} else if (deltas.get(new_key) > deltas.get(old_key)) {
diff --git a/src/runtime/internal/lifecycle.ts b/src/runtime/internal/lifecycle.ts
index 9e65e59cbd..bb3df3d295 100644
--- a/src/runtime/internal/lifecycle.ts
+++ b/src/runtime/internal/lifecycle.ts
@@ -11,19 +11,19 @@ export function get_current_component() {
return current_component;
}
-export function beforeUpdate(fn) {
+export function beforeUpdate(fn: () => any) {
get_current_component().$$.before_update.push(fn);
}
-export function onMount(fn) {
+export function onMount(fn: () => any) {
get_current_component().$$.on_mount.push(fn);
}
-export function afterUpdate(fn) {
+export function afterUpdate(fn: () => any) {
get_current_component().$$.after_update.push(fn);
}
-export function onDestroy(fn) {
+export function onDestroy(fn: () => any) {
get_current_component().$$.on_destroy.push(fn);
}
@@ -54,6 +54,14 @@ export function getContext(key): T {
return get_current_component().$$.context.get(key);
}
+export function getAllContexts = Map>(): T {
+ return get_current_component().$$.context;
+}
+
+export function hasContext(key): boolean {
+ return get_current_component().$$.context.has(key);
+}
+
// TODO figure out if we still want to support
// shorthand events, or if we want to implement
// a real bubbling mechanism
@@ -61,6 +69,7 @@ export function bubble(component, event) {
const callbacks = component.$$.callbacks[event.type];
if (callbacks) {
- callbacks.slice().forEach(fn => fn(event));
+ // @ts-ignore
+ callbacks.slice().forEach(fn => fn.call(this, event));
}
}
diff --git a/src/runtime/internal/spread.ts b/src/runtime/internal/spread.ts
index 203b0b11e9..2acb98fd3f 100644
--- a/src/runtime/internal/spread.ts
+++ b/src/runtime/internal/spread.ts
@@ -38,4 +38,4 @@ export function get_spread_update(levels, updates) {
export function get_spread_object(spread_props) {
return typeof spread_props === 'object' && spread_props !== null ? spread_props : {};
-}
\ No newline at end of file
+}
diff --git a/src/runtime/internal/ssr.ts b/src/runtime/internal/ssr.ts
index 6f1cdedd8a..fd72aa1548 100644
--- a/src/runtime/internal/ssr.ts
+++ b/src/runtime/internal/ssr.ts
@@ -25,7 +25,7 @@ export function spread(args, classes_to_add) {
else if (boolean_attributes.has(name.toLowerCase())) {
if (value) str += ' ' + name;
} else if (value != null) {
- str += ` ${name}="${String(value).replace(/"/g, '"').replace(/'/g, ''')}"`;
+ str += ` ${name}="${value}"`;
}
});
@@ -44,6 +44,18 @@ export function escape(html) {
return String(html).replace(/["'&<>]/g, match => escaped[match]);
}
+export function escape_attribute_value(value) {
+ return typeof value === 'string' ? escape(value) : value;
+}
+
+export function escape_object(obj) {
+ const result = {};
+ for (const key in obj) {
+ result[key] = escape_attribute_value(obj[key]);
+ }
+ return result;
+}
+
export function each(items, fn) {
let str = '';
for (let i = 0; i < items.length; i += 1) {
@@ -74,12 +86,12 @@ export function debug(file, line, column, values) {
let on_destroy;
export function create_ssr_component(fn) {
- function $$render(result, props, bindings, slots) {
+ function $$render(result, props, bindings, slots, context) {
const parent_component = current_component;
const $$ = {
on_destroy,
- context: new Map(parent_component ? parent_component.$$.context : []),
+ context: new Map(context || (parent_component ? parent_component.$$.context : [])),
// these will be immediately discarded
on_mount: [],
@@ -97,7 +109,7 @@ export function create_ssr_component(fn) {
}
return {
- render: (props = {}, options = {}) => {
+ render: (props = {}, { $$slots = {}, context = new Map() } = {}) => {
on_destroy = [];
const result: {
@@ -109,7 +121,7 @@ export function create_ssr_component(fn) {
}>;
} = { title: '', head: '', css: new Set() };
- const html = $$render(result, props, {}, options);
+ const html = $$render(result, props, {}, $$slots, context);
run_all(on_destroy);
@@ -134,4 +146,4 @@ export function add_attribute(name, value, boolean) {
export function add_classes(classes) {
return classes ? ` class="${classes}"` : '';
-}
\ No newline at end of file
+}
diff --git a/src/runtime/internal/style_manager.ts b/src/runtime/internal/style_manager.ts
index 8060e65a5d..0993b3bf18 100644
--- a/src/runtime/internal/style_manager.ts
+++ b/src/runtime/internal/style_manager.ts
@@ -1,4 +1,4 @@
-import { element } from './dom';
+import { append_empty_stylesheet, get_root_for_style } from './dom';
import { raf } from './environment';
interface ExtendedDoc extends Document {
@@ -29,9 +29,9 @@ export function create_rule(node: Element & ElementCSSInlineStyle, a: number, b:
const rule = keyframes + `100% {${fn(b, 1 - b)}}\n}`;
const name = `__svelte_${hash(rule)}_${uid}`;
- const doc = node.ownerDocument as ExtendedDoc;
+ const doc = get_root_for_style(node) as ExtendedDoc;
active_docs.add(doc);
- const stylesheet = doc.__svelte_stylesheet || (doc.__svelte_stylesheet = doc.head.appendChild(element('style') as HTMLStyleElement).sheet as CSSStyleSheet);
+ const stylesheet = doc.__svelte_stylesheet || (doc.__svelte_stylesheet = append_empty_stylesheet(node).sheet as CSSStyleSheet);
const current_rules = doc.__svelte_rules || (doc.__svelte_rules = {});
if (!current_rules[name]) {
diff --git a/src/runtime/internal/transitions.ts b/src/runtime/internal/transitions.ts
index 343a8c82e4..a0134668ef 100644
--- a/src/runtime/internal/transitions.ts
+++ b/src/runtime/internal/transitions.ts
@@ -5,8 +5,25 @@ import { create_rule, delete_rule } from './style_manager';
import { custom_event } from './dom';
import { add_render_callback } from './scheduler';
import { TransitionConfig } from '../transition';
-
-let promise: Promise|null;
+import { Fragment } from './Component';
+
+let promise: Promise | null;
+type INTRO = 1;
+type OUTRO = 0;
+interface Outro {
+ /**
+ * remaining outros
+ */
+ r: number;
+ /**
+ * callbacks
+ */
+ c: Function[];
+ /**
+ * parent outro
+ */
+ p: Outro;
+}
function wait() {
if (!promise) {
@@ -19,12 +36,12 @@ function wait() {
return promise;
}
-function dispatch(node: Element, direction: boolean, kind: 'start' | 'end') {
+function dispatch(node: Element, direction: INTRO | OUTRO | boolean, kind: 'start' | 'end') {
node.dispatchEvent(custom_event(`${direction ? 'intro' : 'outro'}${kind}`));
}
const outroing = new Set();
-let outros;
+let outros: Outro;
export function group_outros() {
outros = {
@@ -41,14 +58,14 @@ export function check_outros() {
outros = outros.p;
}
-export function transition_in(block, local?: 0 | 1) {
+export function transition_in(block: Fragment, local?: 0 | 1) {
if (block && block.i) {
outroing.delete(block);
block.i(local);
}
}
-export function transition_out(block, local: 0 | 1, detach: 0 | 1, callback) {
+export function transition_out(block: Fragment, local: 0 | 1, detach?: 0 | 1, callback?) {
if (block && block.o) {
if (outroing.has(block)) return;
outroing.add(block);
@@ -126,7 +143,8 @@ export function create_in_transition(node: Element & ElementCSSInlineStyle, fn:
return {
start() {
if (started) return;
-
+
+ started = true;
delete_rule(node);
if (is_function(config)) {
@@ -225,21 +243,39 @@ export function create_out_transition(node: Element & ElementCSSInlineStyle, fn:
};
}
+interface PendingProgram {
+ start: number;
+ b: INTRO | OUTRO;
+ group?: Outro;
+}
+interface Program {
+ a: number;
+ b: INTRO | OUTRO;
+ /**
+ * direction
+ */
+ d: 1 | -1;
+ duration: number;
+ start: number;
+ end: number;
+ group?: Outro;
+}
+
export function create_bidirectional_transition(node: Element & ElementCSSInlineStyle, fn: TransitionFn, params: any, intro: boolean) {
let config = fn(node, params);
let t = intro ? 0 : 1;
- let running_program = null;
- let pending_program = null;
+ let running_program: Program | null = null;
+ let pending_program: PendingProgram | null = null;
let animation_name = null;
function clear_animation() {
if (animation_name) delete_rule(node, animation_name);
}
- function init(program, duration) {
- const d = program.b - t;
+ function init(program: PendingProgram, duration: number): Program {
+ const d = (program.b - t) as Program['d'];
duration *= Math.abs(d);
return {
@@ -253,7 +289,7 @@ export function create_bidirectional_transition(node: Element & ElementCSSInline
};
}
- function go(b) {
+ function go(b: INTRO | OUTRO) {
const {
delay = 0,
duration = 300,
@@ -262,7 +298,7 @@ export function create_bidirectional_transition(node: Element & ElementCSSInline
css
} = config || null_transition;
- const program = {
+ const program: PendingProgram = {
start: now() + delay,
b
};
@@ -318,9 +354,7 @@ export function create_bidirectional_transition(node: Element & ElementCSSInline
}
running_program = null;
- }
-
- else if (now >= running_program.start) {
+ } else if (now >= running_program.start) {
const p = now - running_program.start;
t = running_program.a + running_program.d * easing(p / running_program.duration);
tick(t, 1 - t);
@@ -333,7 +367,7 @@ export function create_bidirectional_transition(node: Element & ElementCSSInline
}
return {
- run(b) {
+ run(b: INTRO | OUTRO) {
if (is_function(config)) {
wait().then(() => {
// @ts-ignore
diff --git a/src/runtime/internal/utils.ts b/src/runtime/internal/utils.ts
index 3b8815cb1d..8868e38ee2 100644
--- a/src/runtime/internal/utils.ts
+++ b/src/runtime/internal/utils.ts
@@ -28,7 +28,7 @@ export function blank_object() {
return Object.create(null);
}
-export function run_all(fns) {
+export function run_all(fns: Function[]) {
fns.forEach(run);
}
@@ -40,6 +40,16 @@ export function safe_not_equal(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
+let src_url_equal_anchor;
+
+export function src_url_equal(element_src, url) {
+ if (!src_url_equal_anchor) {
+ src_url_equal_anchor = document.createElement('a');
+ }
+ src_url_equal_anchor.href = url;
+ return element_src === src_url_equal_anchor.href;
+}
+
export function not_equal(a, b) {
return a != a ? b == b : a !== b;
}
@@ -79,7 +89,7 @@ export function create_slot(definition, ctx, $$scope, fn) {
}
}
-export function get_slot_context(definition, ctx, $$scope, fn) {
+function get_slot_context(definition, ctx, $$scope, fn) {
return definition[1] && fn
? assign($$scope.ctx.slice(), definition[1](fn(ctx)))
: $$scope.ctx;
@@ -109,14 +119,30 @@ export function get_slot_changes(definition, $$scope, dirty, fn) {
return $$scope.dirty;
}
-export function update_slot(slot, slot_definition, ctx, $$scope, dirty, get_slot_changes_fn, get_slot_context_fn) {
- const slot_changes = get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn);
+export function update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn) {
if (slot_changes) {
const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);
slot.p(slot_context, slot_changes);
}
}
+export function update_slot(slot, slot_definition, ctx, $$scope, dirty, get_slot_changes_fn, get_slot_context_fn) {
+ const slot_changes = get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn);
+ update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn);
+}
+
+export function get_all_dirty_from_scope($$scope) {
+ if ($$scope.ctx.length > 32) {
+ const dirty = [];
+ const length = $$scope.ctx.length / 32;
+ for (let i = 0; i < length; i++) {
+ dirty[i] = -1;
+ }
+ return dirty;
+ }
+ return -1;
+}
+
export function exclude_internal_props(props) {
const result = {};
for (const k in props) if (k[0] !== '$') result[k] = props[k];
@@ -151,7 +177,7 @@ export function null_to_empty(value) {
return value == null ? '' : value;
}
-export function set_store_value(store, ret, value = ret) {
+export function set_store_value(store, ret, value) {
store.set(value);
return ret;
}
diff --git a/src/runtime/motion/spring.ts b/src/runtime/motion/spring.ts
index 5845a13a57..64d17a058b 100644
--- a/src/runtime/motion/spring.ts
+++ b/src/runtime/motion/spring.ts
@@ -14,7 +14,7 @@ function tick_spring(ctx: TickContext, last_value: T, current_value: T, ta
// @ts-ignore
const delta = target_value - current_value;
// @ts-ignore
- const velocity = (current_value - last_value) / (ctx.dt||1/60); // guard div by 0
+ const velocity = (current_value - last_value) / (ctx.dt || 1 / 60); // guard div by 0
const spring = ctx.opts.stiffness * delta;
const damper = ctx.opts.damping * velocity;
const acceleration = (spring - damper) * ctx.inv_mass;
@@ -34,9 +34,10 @@ function tick_spring(ctx: TickContext, last_value: T, current_value: T, ta
tick_spring(ctx, last_value[i], current_value[i], target_value[i]));
} else if (typeof current_value === 'object') {
const next_value = {};
- for (const k in current_value)
+ for (const k in current_value) {
// @ts-ignore
next_value[k] = tick_spring(ctx, last_value[k], current_value[k], target_value[k]);
+ }
// @ts-ignore
return next_value;
} else {
@@ -57,7 +58,7 @@ interface SpringUpdateOpts {
type Updater = (target_value: T, value: T) => T;
-interface Spring extends Readable{
+export interface Spring extends Readable{
set: (new_value: T, opts?: SpringUpdateOpts) => Promise;
update: (fn: Updater, opts?: SpringUpdateOpts) => Promise;
precision: number;
@@ -79,7 +80,7 @@ export function spring(value?: T, opts: SpringOpts = {}): Spring {
let inv_mass_recovery_rate = 0;
let cancel_task = false;
- function set(new_value: T, opts: SpringUpdateOpts={}): Promise {
+ function set(new_value: T, opts: SpringUpdateOpts = {}): Promise {
target_value = new_value;
const token = current_token = {};
@@ -121,8 +122,9 @@ export function spring(value?: T, opts: SpringOpts = {}): Spring {
last_value = value;
store.set(value = next_value);
- if (ctx.settled)
+ if (ctx.settled) {
task = null;
+ }
return !ctx.settled;
});
}
diff --git a/src/runtime/motion/tweened.ts b/src/runtime/motion/tweened.ts
index 83434cdff6..f0ede9add7 100644
--- a/src/runtime/motion/tweened.ts
+++ b/src/runtime/motion/tweened.ts
@@ -63,7 +63,7 @@ interface Options {
type Updater = (target_value: T, value: T) => T;
-interface Tweened extends Readable {
+export interface Tweened extends Readable {
set(value: T, opts?: Options): Promise;
update(updater: Updater, opts?: Options): Promise;
diff --git a/src/runtime/ssr.ts b/src/runtime/ssr.ts
new file mode 100644
index 0000000000..cbac1f3ef8
--- /dev/null
+++ b/src/runtime/ssr.ts
@@ -0,0 +1,15 @@
+export {
+ onDestroy,
+ setContext,
+ getContext,
+ getAllContexts,
+ hasContext,
+ tick,
+ createEventDispatcher,
+ SvelteComponent,
+ SvelteComponentTyped
+} from './index';
+
+export function onMount() {}
+export function beforeUpdate() {}
+export function afterUpdate() {}
diff --git a/src/runtime/store/index.ts b/src/runtime/store/index.ts
index 0f97d1341a..e947fa0740 100644
--- a/src/runtime/store/index.ts
+++ b/src/runtime/store/index.ts
@@ -1,19 +1,19 @@
import { run_all, subscribe, noop, safe_not_equal, is_function, get_store_value } from 'svelte/internal';
/** Callback to inform of a value updates. */
-type Subscriber = (value: T) => void;
+export type Subscriber = (value: T) => void;
/** Unsubscribes from value updates. */
-type Unsubscriber = () => void;
+export type Unsubscriber = () => void;
/** Callback to update a value. */
-type Updater = (value: T) => T;
+export type Updater = (value: T) => T;
/** Cleanup logic callback. */
type Invalidator = (value?: T) => void;
/** Start and stop notification callbacks. */
-type StartStopNotifier = (set: Subscriber) => Unsubscriber | void;
+export type StartStopNotifier = (set: Subscriber) => Unsubscriber | void;
/** Readable interface for subscribing. */
export interface Readable {
@@ -22,7 +22,7 @@ export interface Readable {
* @param run subscription callback
* @param invalidate cleanup callback
*/
- subscribe(run: Subscriber, invalidate?: Invalidator): Unsubscriber;
+ subscribe(this: void, run: Subscriber, invalidate?: Invalidator): Unsubscriber;
}
/** Writable interface for both updating and subscribing. */
@@ -31,13 +31,13 @@ export interface Writable extends Readable {
* Set value and inform subscribers.
* @param value to set
*/
- set(value: T): void;
+ set(this: void, value: T): void;
/**
* Update value using callback and inform subscribers.
* @param updater callback
*/
- update(updater: Updater): void;
+ update(this: void, updater: Updater): void;
}
/** Pair of subscriber and invalidator. */
@@ -50,7 +50,7 @@ const subscriber_queue = [];
* @param value initial value
* @param {StartStopNotifier}start start and stop notifications for subscriptions
*/
-export function readable(value: T, start: StartStopNotifier): Readable {
+export function readable(value?: T, start?: StartStopNotifier): Readable {
return {
subscribe: writable(value, start).subscribe
};
@@ -61,19 +61,18 @@ export function readable(value: T, start: StartStopNotifier): Readable
* @param {*=}value initial value
* @param {StartStopNotifier=}start start and stop notifications for subscriptions
*/
-export function writable(value: T, start: StartStopNotifier = noop): Writable {
+export function writable(value?: T, start: StartStopNotifier = noop): Writable {
let stop: Unsubscriber;
- const subscribers: Array> = [];
+ const subscribers: Set> = new Set();
function set(new_value: T): void {
if (safe_not_equal(value, new_value)) {
value = new_value;
if (stop) { // store is ready
const run_queue = !subscriber_queue.length;
- for (let i = 0; i < subscribers.length; i += 1) {
- const s = subscribers[i];
- s[1]();
- subscriber_queue.push(s, value);
+ for (const subscriber of subscribers) {
+ subscriber[1]();
+ subscriber_queue.push(subscriber, value);
}
if (run_queue) {
for (let i = 0; i < subscriber_queue.length; i += 2) {
@@ -91,18 +90,15 @@ export function writable(value: T, start: StartStopNotifier = noop): Writa
function subscribe(run: Subscriber, invalidate: Invalidator = noop): Unsubscriber {
const subscriber: SubscribeInvalidateTuple = [run, invalidate];
- subscribers.push(subscriber);
- if (subscribers.length === 1) {
+ subscribers.add(subscriber);
+ if (subscribers.size === 1) {
stop = start(set) || noop;
}
run(value);
return () => {
- const index = subscribers.indexOf(subscriber);
- if (index !== -1) {
- subscribers.splice(index, 1);
- }
- if (subscribers.length === 0) {
+ subscribers.delete(subscriber);
+ if (subscribers.size === 0) {
stop();
stop = null;
}
@@ -113,7 +109,7 @@ export function writable(value: T, start: StartStopNotifier = noop): Writa
}
/** One or more `Readable`s. */
-type Stores = Readable | [Readable, ...Array>];
+type Stores = Readable | [Readable, ...Array>] | Array>;
/** One or more values from `Readable` stores. */
type StoresValues = T extends Readable ? U :
@@ -125,10 +121,12 @@ type StoresValues = T extends Readable ? U :
*
* @param stores - input stores
* @param fn - function callback that aggregates the values
+ * @param initial_value - when used asynchronously
*/
export function derived(
stores: S,
- fn: (values: StoresValues) => T
+ fn: (values: StoresValues, set: (value: T) => void) => Unsubscriber | void,
+ initial_value?: T
): Readable;
/**
@@ -137,14 +135,26 @@ export function derived(
*
* @param stores - input stores
* @param fn - function callback that aggregates the values
- * @param initial_value - when used asynchronously
+ * @param initial_value - initial value
*/
export function derived(
stores: S,
- fn: (values: StoresValues, set: (value: T) => void) => Unsubscriber | void,
+ fn: (values: StoresValues) => T,
initial_value?: T
): Readable;
+/**
+ * Derived value store by synchronizing one or more readable stores and
+ * applying an aggregation function over its input values.
+ *
+ * @param stores - input stores
+ * @param fn - function callback that aggregates the values
+ */
+export function derived(
+ stores: S,
+ fn: (values: StoresValues) => T
+): Readable;
+
export function derived(stores: Stores, fn: Function, initial_value?: T): Readable {
const single = !Array.isArray(stores);
const stores_array: Array> = single
@@ -201,4 +211,4 @@ export function derived(stores: Stores, fn: Function, initial_value?: T): Rea
* Get the current value from a store by subscribing and immediately unsubscribing.
* @param store readable
*/
-export { get_store_value as get };
\ No newline at end of file
+export { get_store_value as get };
diff --git a/src/runtime/transition/index.ts b/src/runtime/transition/index.ts
index 7e879cb941..9315cd77d5 100644
--- a/src/runtime/transition/index.ts
+++ b/src/runtime/transition/index.ts
@@ -1,7 +1,7 @@
import { cubicOut, cubicInOut, linear } from 'svelte/easing';
import { assign, is_function } from 'svelte/internal';
-type EasingFunction = (t: number) => number;
+export type EasingFunction = (t: number) => number;
export interface TransitionConfig {
delay?: number;
@@ -11,7 +11,7 @@ export interface TransitionConfig {
tick?: (t: number, u: number) => void;
}
-interface BlurParams {
+export interface BlurParams {
delay?: number;
duration?: number;
easing?: EasingFunction;
@@ -25,7 +25,7 @@ export function blur(node: Element, {
easing = cubicInOut,
amount = 5,
opacity = 0
-}: BlurParams): TransitionConfig {
+}: BlurParams = {}): TransitionConfig {
const style = getComputedStyle(node);
const target_opacity = +style.opacity;
const f = style.filter === 'none' ? '' : style.filter;
@@ -40,7 +40,7 @@ export function blur(node: Element, {
};
}
-interface FadeParams {
+export interface FadeParams {
delay?: number;
duration?: number;
easing?: EasingFunction;
@@ -50,7 +50,7 @@ export function fade(node: Element, {
delay = 0,
duration = 400,
easing = linear
-}: FadeParams): TransitionConfig {
+}: FadeParams = {}): TransitionConfig {
const o = +getComputedStyle(node).opacity;
return {
@@ -61,7 +61,7 @@ export function fade(node: Element, {
};
}
-interface FlyParams {
+export interface FlyParams {
delay?: number;
duration?: number;
easing?: EasingFunction;
@@ -77,7 +77,7 @@ export function fly(node: Element, {
x = 0,
y = 0,
opacity = 0
-}: FlyParams): TransitionConfig {
+}: FlyParams = {}): TransitionConfig {
const style = getComputedStyle(node);
const target_opacity = +style.opacity;
const transform = style.transform === 'none' ? '' : style.transform;
@@ -94,7 +94,7 @@ export function fly(node: Element, {
};
}
-interface SlideParams {
+export interface SlideParams {
delay?: number;
duration?: number;
easing?: EasingFunction;
@@ -104,7 +104,7 @@ export function slide(node: Element, {
delay = 0,
duration = 400,
easing = cubicOut
-}: SlideParams): TransitionConfig {
+}: SlideParams = {}): TransitionConfig {
const style = getComputedStyle(node);
const opacity = +style.opacity;
const height = parseFloat(style.height);
@@ -132,7 +132,7 @@ export function slide(node: Element, {
};
}
-interface ScaleParams {
+export interface ScaleParams {
delay?: number;
duration?: number;
easing?: EasingFunction;
@@ -146,7 +146,7 @@ export function scale(node: Element, {
easing = cubicOut,
start = 0,
opacity = 0
-}: ScaleParams): TransitionConfig {
+}: ScaleParams = {}): TransitionConfig {
const style = getComputedStyle(node);
const target_opacity = +style.opacity;
const transform = style.transform === 'none' ? '' : style.transform;
@@ -165,7 +165,7 @@ export function scale(node: Element, {
};
}
-interface DrawParams {
+export interface DrawParams {
delay?: number;
speed?: number;
duration?: number | ((len: number) => number);
@@ -177,8 +177,12 @@ export function draw(node: SVGElement & { getTotalLength(): number }, {
speed,
duration,
easing = cubicInOut
-}: DrawParams): TransitionConfig {
- const len = node.getTotalLength();
+}: DrawParams = {}): TransitionConfig {
+ let len = node.getTotalLength();
+ const style = getComputedStyle(node);
+ if (style.strokeLinecap !== 'butt') {
+ len += parseInt(style.strokeWidth);
+ }
if (duration === undefined) {
if (speed === undefined) {
@@ -198,7 +202,7 @@ export function draw(node: SVGElement & { getTotalLength(): number }, {
};
}
-interface CrossfadeParams {
+export interface CrossfadeParams {
delay?: number;
duration?: number | ((len: number) => number);
easing?: EasingFunction;
@@ -207,8 +211,21 @@ interface CrossfadeParams {
type ClientRectMap = Map;
export function crossfade({ fallback, ...defaults }: CrossfadeParams & {
- fallback: (node: Element, params: CrossfadeParams, intro: boolean) => TransitionConfig;
-}) {
+ fallback?: (node: Element, params: CrossfadeParams, intro: boolean) => TransitionConfig;
+}): [
+ (
+ node: Element,
+ params: CrossfadeParams & {
+ key: any;
+ }
+ ) => () => TransitionConfig,
+ (
+ node: Element,
+ params: CrossfadeParams & {
+ key: any;
+ }
+ ) => () => TransitionConfig
+] {
const to_receive: ClientRectMap = new Map();
const to_send: ClientRectMap = new Map();
@@ -237,7 +254,7 @@ export function crossfade({ fallback, ...defaults }: CrossfadeParams & {
css: (t, u) => `
opacity: ${t * opacity};
transform-origin: top left;
- transform: ${transform} translate(${u * dx}px,${u * dy}px) scale(${t + (1-t) * dw}, ${t + (1-t) * dh});
+ transform: ${transform} translate(${u * dx}px,${u * dy}px) scale(${t + (1 - t) * dw}, ${t + (1 - t) * dh});
`
};
}
diff --git a/test/css/index.ts b/test/css/index.ts
index c12418353d..65b43322b1 100644
--- a/test/css/index.ts
+++ b/test/css/index.ts
@@ -156,4 +156,4 @@ function read(file) {
} catch (err) {
return null;
}
-}
\ No newline at end of file
+}
diff --git a/test/css/samples/custom-css-hash/_config.js b/test/css/samples/custom-css-hash/_config.js
new file mode 100644
index 0000000000..6ee2e02939
--- /dev/null
+++ b/test/css/samples/custom-css-hash/_config.js
@@ -0,0 +1,12 @@
+export default {
+ compileOptions: {
+ filename: 'src/components/FooSwitcher.svelte',
+ cssHash({ hash, css, name, filename }) {
+ const minFilename = filename
+ .split('/')
+ .map(i => i.charAt(0).toLowerCase())
+ .join('');
+ return `sv-${name}-${minFilename}-${hash(css)}`;
+ }
+ }
+};
diff --git a/test/css/samples/custom-css-hash/expected.css b/test/css/samples/custom-css-hash/expected.css
new file mode 100644
index 0000000000..fe710597ea
--- /dev/null
+++ b/test/css/samples/custom-css-hash/expected.css
@@ -0,0 +1 @@
+div.sv-FooSwitcher-scf-bzh57p{color:red}
\ No newline at end of file
diff --git a/test/css/samples/custom-css-hash/input.svelte b/test/css/samples/custom-css-hash/input.svelte
new file mode 100644
index 0000000000..bfe5a23214
--- /dev/null
+++ b/test/css/samples/custom-css-hash/input.svelte
@@ -0,0 +1,7 @@
+red
+
+
diff --git a/test/css/samples/empty-class/_config.js b/test/css/samples/empty-class/_config.js
index 725d805d65..ef5c5c1cc5 100644
--- a/test/css/samples/empty-class/_config.js
+++ b/test/css/samples/empty-class/_config.js
@@ -22,4 +22,4 @@ export default {
5: color: red;
6: }`
}]
-};
\ No newline at end of file
+};
diff --git a/test/css/samples/empty-rule-dev/_config.js b/test/css/samples/empty-rule-dev/_config.js
index bdadb774d1..5b9d5ecf1a 100644
--- a/test/css/samples/empty-rule-dev/_config.js
+++ b/test/css/samples/empty-rule-dev/_config.js
@@ -2,4 +2,4 @@ export default {
compileOptions: {
dev: true
}
-};
\ No newline at end of file
+};
diff --git a/test/css/samples/global-compound-selector/_config.js b/test/css/samples/global-compound-selector/_config.js
new file mode 100644
index 0000000000..0a95b541c8
--- /dev/null
+++ b/test/css/samples/global-compound-selector/_config.js
@@ -0,0 +1,27 @@
+export default {
+ warnings: [
+ {
+ code: 'css-unused-selector',
+ frame: `
+ 16: }
+ 17:
+ 18: .bar:global(.foo) {
+ ^
+ 19: color: blue;
+ 20: }
+ `,
+ message: 'Unused CSS selector ".bar:global(.foo)"',
+ pos: 210,
+ start: {
+ character: 210,
+ column: 1,
+ line: 18
+ },
+ end: {
+ character: 227,
+ column: 18,
+ line: 18
+ }
+ }
+ ]
+};
diff --git a/test/css/samples/global-compound-selector/expected.css b/test/css/samples/global-compound-selector/expected.css
new file mode 100644
index 0000000000..ff9bed9c34
--- /dev/null
+++ b/test/css/samples/global-compound-selector/expected.css
@@ -0,0 +1 @@
+div.svelte-xyz.svelte-xyz.bar{color:red}.foo.svelte-xyz.svelte-xyz.bar{color:red}.foo.svelte-xyz.bar span.svelte-xyz{color:red}
\ No newline at end of file
diff --git a/test/css/samples/global-compound-selector/expected.html b/test/css/samples/global-compound-selector/expected.html
new file mode 100644
index 0000000000..ca16db5456
--- /dev/null
+++ b/test/css/samples/global-compound-selector/expected.html
@@ -0,0 +1,3 @@
+text
+texttext
+text
\ No newline at end of file
diff --git a/test/css/samples/global-compound-selector/input.svelte b/test/css/samples/global-compound-selector/input.svelte
new file mode 100644
index 0000000000..347ae3ac55
--- /dev/null
+++ b/test/css/samples/global-compound-selector/input.svelte
@@ -0,0 +1,21 @@
+text
+texttext
+text
+
+
\ No newline at end of file
diff --git a/test/css/samples/global-with-child-combinator-2/_config.js b/test/css/samples/global-with-child-combinator-2/_config.js
new file mode 100644
index 0000000000..2286f4fe3c
--- /dev/null
+++ b/test/css/samples/global-with-child-combinator-2/_config.js
@@ -0,0 +1,27 @@
+export default {
+ warnings: [
+ {
+ code: 'css-unused-selector',
+ end: {
+ character: 111,
+ column: 21,
+ line: 8
+ },
+ frame: `
+ 6: color: red;
+ 7: }
+ 8: a:global(.foo) > div {
+ ^
+ 9: color: red;
+ 10: }
+ `,
+ message: 'Unused CSS selector "a:global(.foo) > div"',
+ pos: 91,
+ start: {
+ character: 91,
+ column: 1,
+ line: 8
+ }
+ }
+ ]
+};
diff --git a/test/css/samples/global-with-child-combinator-2/expected.css b/test/css/samples/global-with-child-combinator-2/expected.css
new file mode 100644
index 0000000000..3f406244a3
--- /dev/null
+++ b/test/css/samples/global-with-child-combinator-2/expected.css
@@ -0,0 +1 @@
+div>div.svelte-xyz.svelte-xyz{color:red}div.svelte-xyz.foo>div.svelte-xyz{color:red}
\ No newline at end of file
diff --git a/test/css/samples/global-with-child-combinator-2/expected.html b/test/css/samples/global-with-child-combinator-2/expected.html
new file mode 100644
index 0000000000..32ff99e34f
--- /dev/null
+++ b/test/css/samples/global-with-child-combinator-2/expected.html
@@ -0,0 +1,3 @@
+
\ No newline at end of file
diff --git a/test/css/samples/global-with-child-combinator-2/input.svelte b/test/css/samples/global-with-child-combinator-2/input.svelte
new file mode 100644
index 0000000000..caf7c5869a
--- /dev/null
+++ b/test/css/samples/global-with-child-combinator-2/input.svelte
@@ -0,0 +1,15 @@
+
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/numeric-seperator/_config.js b/test/css/samples/global-with-child-combinator-3/_config.js
similarity index 51%
rename from test/runtime/samples/numeric-seperator/_config.js
rename to test/css/samples/global-with-child-combinator-3/_config.js
index 2b1b5168ee..c81f1a9f82 100644
--- a/test/runtime/samples/numeric-seperator/_config.js
+++ b/test/css/samples/global-with-child-combinator-3/_config.js
@@ -1,3 +1,3 @@
export default {
- html: '2048 2048'
+ warnings: []
};
diff --git a/test/css/samples/global-with-child-combinator-3/expected.css b/test/css/samples/global-with-child-combinator-3/expected.css
new file mode 100644
index 0000000000..11c60c7147
--- /dev/null
+++ b/test/css/samples/global-with-child-combinator-3/expected.css
@@ -0,0 +1 @@
+a>b>div.svelte-xyz{color:red}
\ No newline at end of file
diff --git a/test/css/samples/global-with-child-combinator-3/expected.html b/test/css/samples/global-with-child-combinator-3/expected.html
new file mode 100644
index 0000000000..32ff99e34f
--- /dev/null
+++ b/test/css/samples/global-with-child-combinator-3/expected.html
@@ -0,0 +1,3 @@
+
\ No newline at end of file
diff --git a/test/css/samples/global-with-child-combinator-3/input.svelte b/test/css/samples/global-with-child-combinator-3/input.svelte
new file mode 100644
index 0000000000..146f302633
--- /dev/null
+++ b/test/css/samples/global-with-child-combinator-3/input.svelte
@@ -0,0 +1,9 @@
+
+
+
\ No newline at end of file
diff --git a/test/css/samples/global-with-child-combinator/_config.js b/test/css/samples/global-with-child-combinator/_config.js
new file mode 100644
index 0000000000..c81f1a9f82
--- /dev/null
+++ b/test/css/samples/global-with-child-combinator/_config.js
@@ -0,0 +1,3 @@
+export default {
+ warnings: []
+};
diff --git a/test/css/samples/global-with-child-combinator/expected.css b/test/css/samples/global-with-child-combinator/expected.css
new file mode 100644
index 0000000000..9d8989b63b
--- /dev/null
+++ b/test/css/samples/global-with-child-combinator/expected.css
@@ -0,0 +1 @@
+div>div.svelte-xyz{color:red}
\ No newline at end of file
diff --git a/test/css/samples/global-with-child-combinator/expected.html b/test/css/samples/global-with-child-combinator/expected.html
new file mode 100644
index 0000000000..32ff99e34f
--- /dev/null
+++ b/test/css/samples/global-with-child-combinator/expected.html
@@ -0,0 +1,3 @@
+
\ No newline at end of file
diff --git a/test/css/samples/global-with-child-combinator/input.svelte b/test/css/samples/global-with-child-combinator/input.svelte
new file mode 100644
index 0000000000..3b5ff160c3
--- /dev/null
+++ b/test/css/samples/global-with-child-combinator/input.svelte
@@ -0,0 +1,9 @@
+
+
+
\ No newline at end of file
diff --git a/test/css/samples/global/expected.css b/test/css/samples/global/expected.css
index 698a44038b..64891e17fd 100644
--- a/test/css/samples/global/expected.css
+++ b/test/css/samples/global/expected.css
@@ -1 +1 @@
-div{color:red}div.foo{color:blue}.foo{font-weight:bold}
\ No newline at end of file
+div{color:red}div.foo.svelte-xyz{color:blue}div.foo{color:pink}.foo{font-weight:bold}
\ No newline at end of file
diff --git a/test/css/samples/global/input.svelte b/test/css/samples/global/input.svelte
index 0350c826f5..31ac143940 100644
--- a/test/css/samples/global/input.svelte
+++ b/test/css/samples/global/input.svelte
@@ -10,6 +10,10 @@
color: blue;
}
+ :global(div.foo) {
+ color: pink;
+ }
+
:global(.foo) {
font-weight: bold;
}
diff --git a/test/css/samples/host/_config.js b/test/css/samples/host/_config.js
new file mode 100644
index 0000000000..61539db5bc
--- /dev/null
+++ b/test/css/samples/host/_config.js
@@ -0,0 +1,27 @@
+export default {
+ warnings: [
+ {
+ code: 'css-unused-selector',
+ message: 'Unused CSS selector ":host > span"',
+ pos: 147,
+ start: {
+ character: 147,
+ column: 1,
+ line: 18
+ },
+ end: {
+ character: 159,
+ column: 13,
+ line: 18
+ },
+ frame: `
+ 16: }
+ 17:
+ 18: :host > span {
+ ^
+ 19: color: red;
+ 20: }
+ `
+ }
+ ]
+};
diff --git a/test/css/samples/host/expected.css b/test/css/samples/host/expected.css
new file mode 100644
index 0000000000..d848082f5e
--- /dev/null
+++ b/test/css/samples/host/expected.css
@@ -0,0 +1 @@
+:host h1.svelte-xyz{color:red}:host>h1.svelte-xyz{color:red}:host>.svelte-xyz{color:red}:host span.svelte-xyz{color:red}:host{color:red}
\ No newline at end of file
diff --git a/test/css/samples/host/input.svelte b/test/css/samples/host/input.svelte
new file mode 100644
index 0000000000..85db1617ef
--- /dev/null
+++ b/test/css/samples/host/input.svelte
@@ -0,0 +1,31 @@
+
+
+Hello!
+
+
+ World!
+
diff --git a/test/css/samples/nested/_config.js b/test/css/samples/nested/_config.js
index e90f873ac1..5678e73bed 100644
--- a/test/css/samples/nested/_config.js
+++ b/test/css/samples/nested/_config.js
@@ -2,4 +2,4 @@ export default {
props: {
dynamic: 'x'
}
-};
\ No newline at end of file
+};
diff --git a/test/css/samples/omit-scoping-attribute-attribute-selector-equals-dynamic/_config.js b/test/css/samples/omit-scoping-attribute-attribute-selector-equals-dynamic/_config.js
index 2e954ca8e9..f0dad3b273 100644
--- a/test/css/samples/omit-scoping-attribute-attribute-selector-equals-dynamic/_config.js
+++ b/test/css/samples/omit-scoping-attribute-attribute-selector-equals-dynamic/_config.js
@@ -2,4 +2,4 @@ export default {
props: {
dynamic: 'whatever'
}
-};
\ No newline at end of file
+};
diff --git a/test/css/samples/omit-scoping-attribute-descendant-global-inner-class/_config.js b/test/css/samples/omit-scoping-attribute-descendant-global-inner-class/_config.js
index 1ae834ca0d..50317168a6 100644
--- a/test/css/samples/omit-scoping-attribute-descendant-global-inner-class/_config.js
+++ b/test/css/samples/omit-scoping-attribute-descendant-global-inner-class/_config.js
@@ -2,4 +2,4 @@ export default {
props: {
raw: 'raw
'
}
-};
\ No newline at end of file
+};
diff --git a/test/css/samples/omit-scoping-attribute-descendant-global-inner-multiple/_config.js b/test/css/samples/omit-scoping-attribute-descendant-global-inner-multiple/_config.js
index 1ae834ca0d..50317168a6 100644
--- a/test/css/samples/omit-scoping-attribute-descendant-global-inner-multiple/_config.js
+++ b/test/css/samples/omit-scoping-attribute-descendant-global-inner-multiple/_config.js
@@ -2,4 +2,4 @@ export default {
props: {
raw: 'raw
'
}
-};
\ No newline at end of file
+};
diff --git a/test/css/samples/omit-scoping-attribute-descendant-global-inner/_config.js b/test/css/samples/omit-scoping-attribute-descendant-global-inner/_config.js
index 1ae834ca0d..50317168a6 100644
--- a/test/css/samples/omit-scoping-attribute-descendant-global-inner/_config.js
+++ b/test/css/samples/omit-scoping-attribute-descendant-global-inner/_config.js
@@ -2,4 +2,4 @@ export default {
props: {
raw: 'raw
'
}
-};
\ No newline at end of file
+};
diff --git a/test/css/samples/omit-scoping-attribute-descendant-global-outer-multiple/_config.js b/test/css/samples/omit-scoping-attribute-descendant-global-outer-multiple/_config.js
index 1ae834ca0d..50317168a6 100644
--- a/test/css/samples/omit-scoping-attribute-descendant-global-outer-multiple/_config.js
+++ b/test/css/samples/omit-scoping-attribute-descendant-global-outer-multiple/_config.js
@@ -2,4 +2,4 @@ export default {
props: {
raw: 'raw
'
}
-};
\ No newline at end of file
+};
diff --git a/test/css/samples/omit-scoping-attribute-descendant-global-outer/_config.js b/test/css/samples/omit-scoping-attribute-descendant-global-outer/_config.js
index 1ae834ca0d..50317168a6 100644
--- a/test/css/samples/omit-scoping-attribute-descendant-global-outer/_config.js
+++ b/test/css/samples/omit-scoping-attribute-descendant-global-outer/_config.js
@@ -2,4 +2,4 @@ export default {
props: {
raw: 'raw
'
}
-};
\ No newline at end of file
+};
diff --git a/test/css/samples/omit-scoping-attribute-descendant/_config.js b/test/css/samples/omit-scoping-attribute-descendant/_config.js
index b69a9041a5..4b70a48802 100644
--- a/test/css/samples/omit-scoping-attribute-descendant/_config.js
+++ b/test/css/samples/omit-scoping-attribute-descendant/_config.js
@@ -21,4 +21,4 @@ export default {
9: color: red;
10: }`
}]
-};
\ No newline at end of file
+};
diff --git a/test/css/samples/omit-scoping-attribute-global/_config.js b/test/css/samples/omit-scoping-attribute-global/_config.js
index 1ae834ca0d..50317168a6 100644
--- a/test/css/samples/omit-scoping-attribute-global/_config.js
+++ b/test/css/samples/omit-scoping-attribute-global/_config.js
@@ -2,4 +2,4 @@ export default {
props: {
raw: 'raw
'
}
-};
\ No newline at end of file
+};
diff --git a/test/css/samples/root/_config.js b/test/css/samples/root/_config.js
new file mode 100644
index 0000000000..ff8b4c5632
--- /dev/null
+++ b/test/css/samples/root/_config.js
@@ -0,0 +1 @@
+export default {};
diff --git a/test/css/samples/root/expected.css b/test/css/samples/root/expected.css
new file mode 100644
index 0000000000..ce35d8835f
--- /dev/null
+++ b/test/css/samples/root/expected.css
@@ -0,0 +1 @@
+:root{color:red}.foo:root{color:blue}:root.foo{color:green}
\ No newline at end of file
diff --git a/test/css/samples/root/expected.html b/test/css/samples/root/expected.html
new file mode 100644
index 0000000000..1d90ab5df7
--- /dev/null
+++ b/test/css/samples/root/expected.html
@@ -0,0 +1 @@
+Hello!
\ No newline at end of file
diff --git a/test/css/samples/root/input.svelte b/test/css/samples/root/input.svelte
new file mode 100644
index 0000000000..979c9d4f0a
--- /dev/null
+++ b/test/css/samples/root/input.svelte
@@ -0,0 +1,13 @@
+
+
+Hello!
diff --git a/test/css/samples/siblings-combinator-global/_config.js b/test/css/samples/siblings-combinator-global/_config.js
new file mode 100644
index 0000000000..342c09ce48
--- /dev/null
+++ b/test/css/samples/siblings-combinator-global/_config.js
@@ -0,0 +1,50 @@
+export default {
+ warnings: [
+ {
+ code: 'css-unused-selector',
+ message: 'Unused CSS selector ":global(input) + span"',
+ pos: 239,
+ start: {
+ character: 239,
+ column: 2,
+ line: 9
+ },
+ end: {
+ character: 260,
+ column: 23,
+ line: 9
+ },
+ frame: `
+ 7: :global(input) ~ p { color: red; }
+ 8:
+ 9: :global(input) + span { color: red; }
+ ^
+ 10: :global(input) ~ span { color: red; }
+ 11:
+ `
+ },
+ {
+ code: 'css-unused-selector',
+ message: 'Unused CSS selector ":global(input) ~ span"',
+ pos: 279,
+ start: {
+ character: 279,
+ column: 2,
+ line: 10
+ },
+ end: {
+ character: 300,
+ column: 23,
+ line: 10
+ },
+ frame: `
+ 8:
+ 9: :global(input) + span { color: red; }
+ 10: :global(input) ~ span { color: red; }
+ ^
+ 11:
+ 12:
+ `
+ }
+ ]
+};
diff --git a/test/css/samples/siblings-combinator-global/expected.css b/test/css/samples/siblings-combinator-global/expected.css
new file mode 100644
index 0000000000..83a4713156
--- /dev/null
+++ b/test/css/samples/siblings-combinator-global/expected.css
@@ -0,0 +1 @@
+input+div.svelte-xyz{color:red}input~div.svelte-xyz{color:red}input+h1.svelte-xyz{color:red}input~h1.svelte-xyz{color:red}input+p.svelte-xyz{color:red}input~p.svelte-xyz{color:red}
\ No newline at end of file
diff --git a/test/css/samples/siblings-combinator-global/input.svelte b/test/css/samples/siblings-combinator-global/input.svelte
new file mode 100644
index 0000000000..ec06f3c015
--- /dev/null
+++ b/test/css/samples/siblings-combinator-global/input.svelte
@@ -0,0 +1,21 @@
+
+
+Hello!
+
+
+ World!
+
+
+{#each [] as _}
+
+{/each}
\ No newline at end of file
diff --git a/test/css/samples/unused-selector-leading/_config.js b/test/css/samples/unused-selector-leading/_config.js
index 487e704c92..8d1c41af1c 100644
--- a/test/css/samples/unused-selector-leading/_config.js
+++ b/test/css/samples/unused-selector-leading/_config.js
@@ -48,4 +48,4 @@ export default {
6: }`
}
]
-};
\ No newline at end of file
+};
diff --git a/test/css/samples/unused-selector-ternary/_config.js b/test/css/samples/unused-selector-ternary/_config.js
index 95b09ab891..7009e60cc0 100644
--- a/test/css/samples/unused-selector-ternary/_config.js
+++ b/test/css/samples/unused-selector-ternary/_config.js
@@ -26,4 +26,4 @@ export default {
17: color: green;
18: }`
}]
-};
\ No newline at end of file
+};
diff --git a/test/css/samples/unused-selector/_config.js b/test/css/samples/unused-selector/_config.js
index b3acb2c78e..ed1a2032ca 100644
--- a/test/css/samples/unused-selector/_config.js
+++ b/test/css/samples/unused-selector/_config.js
@@ -22,4 +22,4 @@ export default {
9: color: blue;
10: }`
}]
-};
\ No newline at end of file
+};
diff --git a/test/custom-elements/assert.js b/test/custom-elements/assert.js
index 0edbd31124..4ee8d9dda0 100644
--- a/test/custom-elements/assert.js
+++ b/test/custom-elements/assert.js
@@ -30,4 +30,25 @@ export function equal(a, b, message) {
export function ok(condition, message) {
if (!condition) throw new Error(message || `Expected ${condition} to be truthy`);
-}
\ No newline at end of file
+}
+
+export function htmlEqual(actual, expected, message) {
+ return deepEqual(
+ normalizeHtml(window, actual),
+ normalizeHtml(window, expected),
+ message
+ );
+}
+
+function normalizeHtml(window, html) {
+ try {
+ const node = window.document.createElement('div');
+ node.innerHTML = html
+ .replace(//g, '')
+ .replace(/>[\s\r\n]+<')
+ .trim();
+ return node.innerHTML.replace(/<\/?noscript\/?>/g, '');
+ } catch (err) {
+ throw new Error(`Failed to normalize HTML:\n${html}`);
+ }
+}
diff --git a/test/custom-elements/index.ts b/test/custom-elements/index.ts
index d3644a3142..35df156879 100644
--- a/test/custom-elements/index.ts
+++ b/test/custom-elements/index.ts
@@ -110,8 +110,8 @@ describe('custom-elements', function() {
const page = await browser.newPage();
- page.on('console', (type, ...args) => {
- console[type](...args);
+ page.on('console', (type) => {
+ console[type._type](type._text);
});
page.on('error', error => {
diff --git a/test/custom-elements/samples/$$props/main.svelte b/test/custom-elements/samples/$$props/main.svelte
new file mode 100644
index 0000000000..68931e22db
--- /dev/null
+++ b/test/custom-elements/samples/$$props/main.svelte
@@ -0,0 +1,10 @@
+
+
+
+
+name: {name}
+$$props: {JSON.stringify($$props)}
+$$restProps: {JSON.stringify($$restProps)}
+
diff --git a/test/custom-elements/samples/$$props/test.js b/test/custom-elements/samples/$$props/test.js
new file mode 100644
index 0000000000..94cad86577
--- /dev/null
+++ b/test/custom-elements/samples/$$props/test.js
@@ -0,0 +1,13 @@
+import * as assert from 'assert';
+import './main.svelte';
+
+export default function (target) {
+ target.innerHTML = ' ';
+ const el = target.querySelector('custom-element');
+
+ assert.htmlEqual(el.shadowRoot.innerHTML, `
+ name: world
+ $$props: {"name":"world","answer":"42","test":"svelte"}
+ $$restProps: {"answer":"42","test":"svelte"}
+ `);
+}
diff --git a/test/custom-elements/samples/$$slot/main.svelte b/test/custom-elements/samples/$$slot/main.svelte
new file mode 100644
index 0000000000..05e1ac3284
--- /dev/null
+++ b/test/custom-elements/samples/$$slot/main.svelte
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+$$slots: {toString($$slots)}
+{#if $$slots.b}
+
+
+
+{:else}
+ Slot b is not available
+{/if}
\ No newline at end of file
diff --git a/test/custom-elements/samples/$$slot/test.js b/test/custom-elements/samples/$$slot/test.js
new file mode 100644
index 0000000000..567e93f509
--- /dev/null
+++ b/test/custom-elements/samples/$$slot/test.js
@@ -0,0 +1,28 @@
+import * as assert from 'assert';
+import './main.svelte';
+
+export default function (target) {
+ target.innerHTML = `
+ hello world bye world
+ hello world hello world bye world
+ `;
+
+ const [a, b] = target.querySelectorAll('custom-element');
+
+ assert.htmlEqual(a.shadowRoot.innerHTML, `
+
+
+ $$slots: {"a":true,"default":true}
+ Slot b is not available
+ `);
+
+ assert.htmlEqual(b.shadowRoot.innerHTML, `
+
+
+ $$slots: {"a":true,"b":true,"default":true}
+
+ `);
+
+ assert.equal(a.getData(), '');
+ assert.equal(b.getData(), 'foo');
+}
diff --git a/test/custom-elements/samples/custom-method/test.js b/test/custom-elements/samples/custom-method/test.js
index e274786079..08c58c3383 100644
--- a/test/custom-elements/samples/custom-method/test.js
+++ b/test/custom-elements/samples/custom-method/test.js
@@ -9,4 +9,4 @@ export default async function (target) {
const p = el.shadowRoot.querySelector('p');
assert.equal(p.textContent, '42');
-}
\ No newline at end of file
+}
diff --git a/test/custom-elements/samples/escaped-css/test.js b/test/custom-elements/samples/escaped-css/test.js
index 3696ee8c1b..6277ccba32 100644
--- a/test/custom-elements/samples/escaped-css/test.js
+++ b/test/custom-elements/samples/escaped-css/test.js
@@ -10,4 +10,4 @@ export default function (target) {
const before = getComputedStyle(icon, '::before');
assert.equal(before.content, JSON.stringify(String.fromCharCode(0xff)));
-}
\ No newline at end of file
+}
diff --git a/test/custom-elements/samples/extended-builtin/custom-button.js b/test/custom-elements/samples/extended-builtin/custom-button.js
index 9134b2af9f..19fe4aa0e7 100644
--- a/test/custom-elements/samples/extended-builtin/custom-button.js
+++ b/test/custom-elements/samples/extended-builtin/custom-button.js
@@ -1,2 +1,2 @@
class CustomButton extends HTMLButtonElement {}
-customElements.define('custom-button', CustomButton, { extends: 'button' });
\ No newline at end of file
+customElements.define('custom-button', CustomButton, { extends: 'button' });
diff --git a/test/custom-elements/samples/extended-builtin/test.js b/test/custom-elements/samples/extended-builtin/test.js
index 3886ae1149..a2f253e5d4 100644
--- a/test/custom-elements/samples/extended-builtin/test.js
+++ b/test/custom-elements/samples/extended-builtin/test.js
@@ -12,4 +12,4 @@ export default function (target) {
const button = el.shadowRoot.querySelector('button');
assert.ok(button instanceof customElements.get('custom-button'));
-}
\ No newline at end of file
+}
diff --git a/test/custom-elements/samples/html-slots/test.js b/test/custom-elements/samples/html-slots/test.js
index bb38a83eab..06d18d9944 100644
--- a/test/custom-elements/samples/html-slots/test.js
+++ b/test/custom-elements/samples/html-slots/test.js
@@ -14,4 +14,4 @@ export default function (target) {
assert.equal(slot0.assignedNodes()[1], target.querySelector('strong'));
assert.equal(slot1.assignedNodes().length, 0);
-}
\ No newline at end of file
+}
diff --git a/test/custom-elements/samples/html/test.js b/test/custom-elements/samples/html/test.js
index 1638ead784..4e38fd6c2d 100644
--- a/test/custom-elements/samples/html/test.js
+++ b/test/custom-elements/samples/html/test.js
@@ -9,4 +9,4 @@ export default function (target) {
const h1 = el.shadowRoot.querySelector('h1');
assert.equal(h1.textContent, 'Hello world!');
-}
\ No newline at end of file
+}
diff --git a/test/custom-elements/samples/nested.skip/test.js b/test/custom-elements/samples/nested.skip/test.js
index 0052e19ad0..09edc38f54 100644
--- a/test/custom-elements/samples/nested.skip/test.js
+++ b/test/custom-elements/samples/nested.skip/test.js
@@ -14,4 +14,4 @@ export default async function (target) {
assert.equal(counter.count, 1);
assert.equal(counter.shadowRoot.innerHTML, 'count: 1 ');
-}
\ No newline at end of file
+}
diff --git a/test/custom-elements/samples/new-styled/test.js b/test/custom-elements/samples/new-styled/test.js
index f027121009..72c2cecd10 100644
--- a/test/custom-elements/samples/new-styled/test.js
+++ b/test/custom-elements/samples/new-styled/test.js
@@ -16,4 +16,4 @@ export default function (target) {
assert.equal(getComputedStyle(unstyled).color, 'rgb(0, 0, 0)');
assert.equal(getComputedStyle(styled).color, 'rgb(255, 0, 0)');
-}
\ No newline at end of file
+}
diff --git a/test/custom-elements/samples/new/test.js b/test/custom-elements/samples/new/test.js
index 1137495e35..88ba69ab69 100644
--- a/test/custom-elements/samples/new/test.js
+++ b/test/custom-elements/samples/new/test.js
@@ -15,4 +15,4 @@ export default function (target) {
const h1 = el.shadowRoot.querySelector('h1');
assert.equal(h1.textContent, 'Hello world!');
-}
\ No newline at end of file
+}
diff --git a/test/custom-elements/samples/no-missing-prop-warnings/_config.js b/test/custom-elements/samples/no-missing-prop-warnings/_config.js
index e26996239d..083edcd210 100644
--- a/test/custom-elements/samples/no-missing-prop-warnings/_config.js
+++ b/test/custom-elements/samples/no-missing-prop-warnings/_config.js
@@ -1,3 +1,3 @@
export default {
dev: true
-};
\ No newline at end of file
+};
diff --git a/test/custom-elements/samples/no-missing-prop-warnings/test.js b/test/custom-elements/samples/no-missing-prop-warnings/test.js
index c3296afde0..6f15b63920 100644
--- a/test/custom-elements/samples/no-missing-prop-warnings/test.js
+++ b/test/custom-elements/samples/no-missing-prop-warnings/test.js
@@ -16,4 +16,4 @@ export default function (target) {
]);
console.warn = warn;
-}
\ No newline at end of file
+}
diff --git a/test/custom-elements/samples/oncreate/main.svelte b/test/custom-elements/samples/oncreate/main.svelte
index ed3980a28e..23819e660f 100644
--- a/test/custom-elements/samples/oncreate/main.svelte
+++ b/test/custom-elements/samples/oncreate/main.svelte
@@ -3,9 +3,12 @@
diff --git a/test/custom-elements/samples/oncreate/test.js b/test/custom-elements/samples/oncreate/test.js
index 11d76078f2..f451979976 100644
--- a/test/custom-elements/samples/oncreate/test.js
+++ b/test/custom-elements/samples/oncreate/test.js
@@ -2,7 +2,9 @@ import * as assert from 'assert';
import './main.svelte';
export default function (target) {
- target.innerHTML = ' ';
+ target.innerHTML = ' ';
const el = target.querySelector('my-app');
+
assert.ok(el.wasCreated);
-}
\ No newline at end of file
+ assert.ok(el.propsInitialized);
+}
diff --git a/test/custom-elements/samples/ondestroy/main.svelte b/test/custom-elements/samples/ondestroy/main.svelte
new file mode 100644
index 0000000000..aa945ca602
--- /dev/null
+++ b/test/custom-elements/samples/ondestroy/main.svelte
@@ -0,0 +1,22 @@
+
+
+
+
+
diff --git a/test/custom-elements/samples/ondestroy/test.js b/test/custom-elements/samples/ondestroy/test.js
new file mode 100644
index 0000000000..61375bfa96
--- /dev/null
+++ b/test/custom-elements/samples/ondestroy/test.js
@@ -0,0 +1,11 @@
+import * as assert from 'assert';
+import './main.svelte';
+
+export default function (target) {
+ target.innerHTML = ' ';
+ const el = target.querySelector('my-app');
+ target.removeChild(el);
+
+ assert.ok(target.dataset.onMountDestroyed);
+ assert.equal(target.dataset.destroyed, undefined);
+}
diff --git a/test/custom-elements/samples/props/main.svelte b/test/custom-elements/samples/props/main.svelte
index 80b483bf6e..cf47b436b5 100644
--- a/test/custom-elements/samples/props/main.svelte
+++ b/test/custom-elements/samples/props/main.svelte
@@ -4,6 +4,7 @@
import './my-widget.svelte';
export let items = ['a', 'b', 'c'];
+ export let flagged = false;
-
+
diff --git a/test/custom-elements/samples/props/my-widget.svelte b/test/custom-elements/samples/props/my-widget.svelte
index cf512e0ff8..970acf84b2 100644
--- a/test/custom-elements/samples/props/my-widget.svelte
+++ b/test/custom-elements/samples/props/my-widget.svelte
@@ -2,7 +2,11 @@
{items.length} items
{items.join(', ')}
+{flag1 ? 'flagged (dynamic attribute)' : 'not flagged'}
+{flag2 ? 'flagged (static attribute)' : 'not flagged'}
diff --git a/test/custom-elements/samples/props/test.js b/test/custom-elements/samples/props/test.js
index 9c7e44c3a3..41ca77d29d 100644
--- a/test/custom-elements/samples/props/test.js
+++ b/test/custom-elements/samples/props/test.js
@@ -11,13 +11,17 @@ export default function (target) {
const el = target.querySelector('custom-element');
const widget = el.shadowRoot.querySelector('my-widget');
- const [p1, p2] = widget.shadowRoot.querySelectorAll('p');
+ const [p1, p2, p3, p4] = widget.shadowRoot.querySelectorAll('p');
assert.equal(p1.textContent, '3 items');
assert.equal(p2.textContent, 'a, b, c');
+ assert.equal(p3.textContent, 'not flagged');
+ assert.equal(p4.textContent, 'flagged (static attribute)');
el.items = ['d', 'e', 'f', 'g', 'h'];
+ el.flagged = true;
assert.equal(p1.textContent, '5 items');
assert.equal(p2.textContent, 'd, e, f, g, h');
-}
\ No newline at end of file
+ assert.equal(p3.textContent, 'flagged (dynamic attribute)');
+}
diff --git a/test/helpers.ts b/test/helpers.ts
index 6452dbae1a..101490d4dc 100644
--- a/test/helpers.ts
+++ b/test/helpers.ts
@@ -4,7 +4,7 @@ import glob from 'tiny-glob/sync';
import * as path from 'path';
import * as fs from 'fs';
import * as colors from 'kleur';
-export const assert = (assert$1 as unknown) as typeof assert$1 & { htmlEqual: (actual, expected, message?) => void };
+export const assert = (assert$1 as unknown) as typeof assert$1 & { htmlEqual: (actual, expected, message?) => void, htmlEqualWithComments: (actual, expected, message?) => void };
// for coverage purposes, we need to test source files,
// but for sanity purposes, we need to test dist files
@@ -118,6 +118,9 @@ function cleanChildren(node) {
node.removeChild(child);
child = previous;
}
+ } else if (child.nodeType === 8) {
+ // comment
+ // do nothing
} else {
cleanChildren(child);
}
@@ -137,11 +140,11 @@ function cleanChildren(node) {
}
}
-export function normalizeHtml(window, html) {
+export function normalizeHtml(window, html, preserveComments = false) {
try {
const node = window.document.createElement('div');
node.innerHTML = html
- .replace(//g, '')
+ .replace(/()/g, preserveComments ? '$1' : '')
.replace(/>[\s\r\n]+<')
.trim();
cleanChildren(node);
@@ -162,6 +165,14 @@ export function setupHtmlEqual() {
message
);
};
+ // eslint-disable-next-line no-import-assign
+ assert.htmlEqualWithComments = (actual, expected, message) => {
+ assert.deepEqual(
+ normalizeHtml(window, actual, true),
+ normalizeHtml(window, expected, true),
+ message
+ );
+ };
}
export function loadConfig(file) {
@@ -259,4 +270,12 @@ export function mkdirp(dir) {
} catch (err) {
// do nothing
}
-}
\ No newline at end of file
+}
+
+export function prettyPrintPuppeteerAssertionError(message) {
+ const match = /Error: Expected "(.+)" to equal "(.+)"/.exec(message);
+
+ if (match) {
+ assert.equal(match[1], match[2]);
+ }
+}
diff --git a/test/hydration/index.ts b/test/hydration/index.ts
index e50351c56e..f3e2c9ea0a 100644
--- a/test/hydration/index.ts
+++ b/test/hydration/index.ts
@@ -52,6 +52,7 @@ describe('hydration', () => {
const cwd = path.resolve(`${__dirname}/samples/${dir}`);
compileOptions = config.compileOptions || {};
+ compileOptions.accessors = 'accessors' in config ? config.accessors : true;
const window = env();
@@ -118,9 +119,11 @@ describe('hydration', () => {
throw err;
}
- if (config.show) showOutput(cwd, {
- hydratable: true
- });
+ if (config.show) {
+ showOutput(cwd, {
+ hydratable: true
+ });
+ }
});
}
diff --git a/test/hydration/samples/basic/_config.js b/test/hydration/samples/basic/_config.js
index 79d91d0d8a..81d01322e4 100644
--- a/test/hydration/samples/basic/_config.js
+++ b/test/hydration/samples/basic/_config.js
@@ -14,4 +14,4 @@ export default {
assert.equal(h1, snapshot.h1);
assert.equal(h1.childNodes[0], snapshot.text);
}
-};
\ No newline at end of file
+};
diff --git a/test/hydration/samples/binding-input/_config.js b/test/hydration/samples/binding-input/_config.js
index 9004d06490..ac3a6be43a 100644
--- a/test/hydration/samples/binding-input/_config.js
+++ b/test/hydration/samples/binding-input/_config.js
@@ -26,4 +26,4 @@ export default {
Hello everybody!
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/hydration/samples/claim-text/Component.svelte b/test/hydration/samples/claim-text/Component.svelte
new file mode 100644
index 0000000000..c4a56edceb
--- /dev/null
+++ b/test/hydration/samples/claim-text/Component.svelte
@@ -0,0 +1,5 @@
+
+ Title
+
+
+There should be one
diff --git a/test/hydration/samples/claim-text/Layout.svelte b/test/hydration/samples/claim-text/Layout.svelte
new file mode 100644
index 0000000000..b37cf18832
--- /dev/null
+++ b/test/hydration/samples/claim-text/Layout.svelte
@@ -0,0 +1,2 @@
+This p and the slot below are direct children of the root.
+
diff --git a/test/hydration/samples/claim-text/_after.html b/test/hydration/samples/claim-text/_after.html
new file mode 100644
index 0000000000..6f79ed7159
--- /dev/null
+++ b/test/hydration/samples/claim-text/_after.html
@@ -0,0 +1,3 @@
+This p and the slot below are direct children of the root.
+
+There should be one
\ No newline at end of file
diff --git a/test/hydration/samples/claim-text/_before.html b/test/hydration/samples/claim-text/_before.html
new file mode 100644
index 0000000000..e5653f47fe
--- /dev/null
+++ b/test/hydration/samples/claim-text/_before.html
@@ -0,0 +1,5 @@
+This p and the slot below are direct children of the root.
+
+There should be one
+
+
\ No newline at end of file
diff --git a/test/hydration/samples/claim-text/main.svelte b/test/hydration/samples/claim-text/main.svelte
new file mode 100644
index 0000000000..46c001589d
--- /dev/null
+++ b/test/hydration/samples/claim-text/main.svelte
@@ -0,0 +1,8 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/test/hydration/samples/component-in-element/_config.js b/test/hydration/samples/component-in-element/_config.js
index 790b026400..557fe068c4 100644
--- a/test/hydration/samples/component-in-element/_config.js
+++ b/test/hydration/samples/component-in-element/_config.js
@@ -18,4 +18,4 @@ export default {
assert.equal(p, snapshot.p);
assert.equal(p.childNodes[0], snapshot.text);
}
-};
\ No newline at end of file
+};
diff --git a/test/hydration/samples/component/_config.js b/test/hydration/samples/component/_config.js
index c26b3c7ad0..4435b2f86e 100644
--- a/test/hydration/samples/component/_config.js
+++ b/test/hydration/samples/component/_config.js
@@ -14,4 +14,4 @@ export default {
assert.equal(p, snapshot.p);
assert.equal(p.childNodes[0], snapshot.text);
}
-};
\ No newline at end of file
+};
diff --git a/test/hydration/samples/dynamic-text-changed/_config.js b/test/hydration/samples/dynamic-text-changed/_config.js
index 467aef49ac..c42e251464 100644
--- a/test/hydration/samples/dynamic-text-changed/_config.js
+++ b/test/hydration/samples/dynamic-text-changed/_config.js
@@ -18,4 +18,4 @@ export default {
assert.equal(h1, snapshot.h1);
assert.equal(h1.childNodes[0], snapshot.text);
}
-};
\ No newline at end of file
+};
diff --git a/test/hydration/samples/dynamic-text/_config.js b/test/hydration/samples/dynamic-text/_config.js
index a7f0fc3d8b..47e095d4ca 100644
--- a/test/hydration/samples/dynamic-text/_config.js
+++ b/test/hydration/samples/dynamic-text/_config.js
@@ -18,4 +18,4 @@ export default {
assert.equal(h1, snapshot.h1);
assert.equal(h1.childNodes[0], snapshot.text);
}
-};
\ No newline at end of file
+};
diff --git a/test/hydration/samples/each-block/_config.js b/test/hydration/samples/each-block/_config.js
index 5c58a4c232..81f0a75831 100644
--- a/test/hydration/samples/each-block/_config.js
+++ b/test/hydration/samples/each-block/_config.js
@@ -26,4 +26,4 @@ export default {
assert.equal(lis[1], snapshot.lis[1]);
assert.equal(lis[2], snapshot.lis[2]);
}
-};
\ No newline at end of file
+};
diff --git a/test/hydration/samples/element-attribute-added/_config.js b/test/hydration/samples/element-attribute-added/_config.js
index fb4a90bd3d..a662743c2c 100644
--- a/test/hydration/samples/element-attribute-added/_config.js
+++ b/test/hydration/samples/element-attribute-added/_config.js
@@ -16,4 +16,4 @@ export default {
assert.equal(div, snapshot.div);
}
-};
\ No newline at end of file
+};
diff --git a/test/hydration/samples/element-attribute-changed/_config.js b/test/hydration/samples/element-attribute-changed/_config.js
index 05881f748f..d402e35d7b 100644
--- a/test/hydration/samples/element-attribute-changed/_config.js
+++ b/test/hydration/samples/element-attribute-changed/_config.js
@@ -16,4 +16,4 @@ export default {
assert.equal(div, snapshot.div);
}
-};
\ No newline at end of file
+};
diff --git a/test/hydration/samples/element-attribute-removed/_config.js b/test/hydration/samples/element-attribute-removed/_config.js
index 05881f748f..d402e35d7b 100644
--- a/test/hydration/samples/element-attribute-removed/_config.js
+++ b/test/hydration/samples/element-attribute-removed/_config.js
@@ -16,4 +16,4 @@ export default {
assert.equal(div, snapshot.div);
}
-};
\ No newline at end of file
+};
diff --git a/test/hydration/samples/element-attribute-unchanged/_config.js b/test/hydration/samples/element-attribute-unchanged/_config.js
index d41f5db0fb..d9d220b6e5 100644
--- a/test/hydration/samples/element-attribute-unchanged/_config.js
+++ b/test/hydration/samples/element-attribute-unchanged/_config.js
@@ -12,4 +12,4 @@ export default {
assert.equal(div, snapshot.div);
}
-};
\ No newline at end of file
+};
diff --git a/test/hydration/samples/element-nested-sibling/_after.html b/test/hydration/samples/element-nested-sibling/_after.html
new file mode 100644
index 0000000000..d011cf6e38
--- /dev/null
+++ b/test/hydration/samples/element-nested-sibling/_after.html
@@ -0,0 +1,4 @@
+
+ 1
+ 2
+
diff --git a/test/hydration/samples/element-nested-sibling/_before.html b/test/hydration/samples/element-nested-sibling/_before.html
new file mode 100644
index 0000000000..d011cf6e38
--- /dev/null
+++ b/test/hydration/samples/element-nested-sibling/_before.html
@@ -0,0 +1,4 @@
+
+ 1
+ 2
+
diff --git a/test/hydration/samples/element-nested-sibling/_config.js b/test/hydration/samples/element-nested-sibling/_config.js
new file mode 100644
index 0000000000..8410fc189d
--- /dev/null
+++ b/test/hydration/samples/element-nested-sibling/_config.js
@@ -0,0 +1,19 @@
+export default {
+ snapshot(target) {
+ const p = target.querySelector('p');
+
+ return {
+ p,
+ span: p.querySelector('span'),
+ code: p.querySelector('code')
+ };
+ },
+
+ test(assert, target, snapshot) {
+ const p = target.querySelector('p');
+
+ assert.equal(p, snapshot.p);
+ assert.equal(p.querySelector('span'), snapshot.span);
+ assert.equal(p.querySelector('code'), snapshot.code);
+ }
+};
diff --git a/test/hydration/samples/element-nested-sibling/main.svelte b/test/hydration/samples/element-nested-sibling/main.svelte
new file mode 100644
index 0000000000..d6e02107e2
--- /dev/null
+++ b/test/hydration/samples/element-nested-sibling/main.svelte
@@ -0,0 +1,6 @@
+
+ 1
+ {#if true}
+ 2
+ {/if}
+
diff --git a/test/hydration/samples/element-nested/_config.js b/test/hydration/samples/element-nested/_config.js
index 0965bc39c6..cd34008c04 100644
--- a/test/hydration/samples/element-nested/_config.js
+++ b/test/hydration/samples/element-nested/_config.js
@@ -14,4 +14,4 @@ export default {
assert.equal(div, snapshot.div);
assert.equal(div.querySelector('p'), snapshot.p);
}
-};
\ No newline at end of file
+};
diff --git a/test/hydration/samples/element-ref/_config.js b/test/hydration/samples/element-ref/_config.js
index 3182207293..80d681f7c5 100644
--- a/test/hydration/samples/element-ref/_config.js
+++ b/test/hydration/samples/element-ref/_config.js
@@ -13,4 +13,4 @@ export default {
assert.equal(h1, snapshot.h1);
assert.equal(component.h1, h1);
}
-};
\ No newline at end of file
+};
diff --git a/test/hydration/samples/event-handler/_config.js b/test/hydration/samples/event-handler/_config.js
index cdf7431836..027b2bd15b 100644
--- a/test/hydration/samples/event-handler/_config.js
+++ b/test/hydration/samples/event-handler/_config.js
@@ -23,4 +23,4 @@ export default {
clicked!
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/hydration/samples/event-handler/main.svelte b/test/hydration/samples/event-handler/main.svelte
index 3d1a05ed3e..ca2b21e4b1 100644
--- a/test/hydration/samples/event-handler/main.svelte
+++ b/test/hydration/samples/event-handler/main.svelte
@@ -1,9 +1,9 @@
click me
{#if clicked}
clicked!
-{/if}
\ No newline at end of file
+{/if}
diff --git a/test/hydration/samples/expression-sibling/_after.html b/test/hydration/samples/expression-sibling/_after.html
new file mode 100644
index 0000000000..9c0a0b5778
--- /dev/null
+++ b/test/hydration/samples/expression-sibling/_after.html
@@ -0,0 +1 @@
+1 2 3
diff --git a/test/hydration/samples/expression-sibling/_before.html b/test/hydration/samples/expression-sibling/_before.html
new file mode 100644
index 0000000000..9c0a0b5778
--- /dev/null
+++ b/test/hydration/samples/expression-sibling/_before.html
@@ -0,0 +1 @@
+1 2 3
diff --git a/test/hydration/samples/expression-sibling/_config.js b/test/hydration/samples/expression-sibling/_config.js
new file mode 100644
index 0000000000..c6d3ef3f2f
--- /dev/null
+++ b/test/hydration/samples/expression-sibling/_config.js
@@ -0,0 +1,19 @@
+export default {
+ snapshot(target) {
+ const p = target.querySelector('p');
+
+ return {
+ p,
+ text: p.childNodes[0],
+ span: p.querySelector('span')
+ };
+ },
+
+ test(assert, target, snapshot) {
+ const p = target.querySelector('p');
+
+ assert.equal(p, snapshot.p);
+ assert.equal(p.childNodes[0], snapshot.text);
+ assert.equal(p.querySelector('span'), snapshot.span);
+ }
+};
diff --git a/test/hydration/samples/expression-sibling/main.svelte b/test/hydration/samples/expression-sibling/main.svelte
new file mode 100644
index 0000000000..65aa541e9c
--- /dev/null
+++ b/test/hydration/samples/expression-sibling/main.svelte
@@ -0,0 +1 @@
+{1} 2 3
diff --git a/test/hydration/samples/head-meta-hydrate-duplicate/_after_head.html b/test/hydration/samples/head-meta-hydrate-duplicate/_after_head.html
index 10cf2c8b9a..be7a01ba4f 100644
--- a/test/hydration/samples/head-meta-hydrate-duplicate/_after_head.html
+++ b/test/hydration/samples/head-meta-hydrate-duplicate/_after_head.html
@@ -1,4 +1,4 @@
Some Title
-
\ No newline at end of file
+
diff --git a/test/hydration/samples/if-block-anchor/_config.js b/test/hydration/samples/if-block-anchor/_config.js
index ee5ed39ad9..ab519c913b 100644
--- a/test/hydration/samples/if-block-anchor/_config.js
+++ b/test/hydration/samples/if-block-anchor/_config.js
@@ -23,4 +23,4 @@ export default {
assert.equal(ps[0], snapshot.p0);
assert.equal(ps[1], snapshot.p1);
}
-};
\ No newline at end of file
+};
diff --git a/test/hydration/samples/if-block-false/_config.js b/test/hydration/samples/if-block-false/_config.js
index 6be30614f8..a11d800e45 100644
--- a/test/hydration/samples/if-block-false/_config.js
+++ b/test/hydration/samples/if-block-false/_config.js
@@ -16,4 +16,4 @@ export default {
assert.equal(p, snapshot.p);
}
-};
\ No newline at end of file
+};
diff --git a/test/hydration/samples/if-block-update/_config.js b/test/hydration/samples/if-block-update/_config.js
index 260ae62d53..fb4a723145 100644
--- a/test/hydration/samples/if-block-update/_config.js
+++ b/test/hydration/samples/if-block-update/_config.js
@@ -21,4 +21,4 @@ export default {
component.bar = true;
assert.htmlEqual(target.innerHTML, 'bar!
');
}
-};
\ No newline at end of file
+};
diff --git a/test/hydration/samples/if-block/_config.js b/test/hydration/samples/if-block/_config.js
index 7aca2ce55d..bd89748dc0 100644
--- a/test/hydration/samples/if-block/_config.js
+++ b/test/hydration/samples/if-block/_config.js
@@ -16,4 +16,4 @@ export default {
assert.equal(p, snapshot.p);
}
-};
\ No newline at end of file
+};
diff --git a/test/hydration/samples/raw/_config.js b/test/hydration/samples/raw/_config.js
index a43f634906..f4fb2889cd 100644
--- a/test/hydration/samples/raw/_config.js
+++ b/test/hydration/samples/raw/_config.js
@@ -24,4 +24,4 @@ export default {
assert.equal(ps[1], snapshot.p1);
assert.equal(ps[1].firstChild, snapshot.text1);
}
-};
\ No newline at end of file
+};
diff --git a/test/hydration/samples/top-level-text/_config.js b/test/hydration/samples/top-level-text/_config.js
index e8a81e7ca1..2ccf126555 100644
--- a/test/hydration/samples/top-level-text/_config.js
+++ b/test/hydration/samples/top-level-text/_config.js
@@ -10,4 +10,4 @@ export default {
assert.equal(text, snapshot.text);
}
-};
\ No newline at end of file
+};
diff --git a/test/js/samples/action-custom-event-handler/expected.js b/test/js/samples/action-custom-event-handler/expected.js
index 51656290d6..6433d5b04a 100644
--- a/test/js/samples/action-custom-event-handler/expected.js
+++ b/test/js/samples/action-custom-event-handler/expected.js
@@ -56,7 +56,7 @@ function instance($$self, $$props, $$invalidate) {
const foo_function = () => handleFoo(bar);
$$self.$$set = $$props => {
- if ("bar" in $$props) $$invalidate(0, bar = $$props.bar);
+ if ('bar' in $$props) $$invalidate(0, bar = $$props.bar);
};
return [bar, foo_function];
diff --git a/test/js/samples/action/expected.js b/test/js/samples/action/expected.js
index d52960bddd..689669c5bc 100644
--- a/test/js/samples/action/expected.js
+++ b/test/js/samples/action/expected.js
@@ -48,11 +48,11 @@ function link(node) {
history.pushState(null, null, event.target.href);
}
- node.addEventListener("click", onClick);
+ node.addEventListener('click', onClick);
return {
destroy() {
- node.removeEventListener("click", onClick);
+ node.removeEventListener('click', onClick);
}
};
}
diff --git a/test/js/samples/bind-open/expected.js b/test/js/samples/bind-open/expected.js
index 56ff302845..669cb41405 100644
--- a/test/js/samples/bind-open/expected.js
+++ b/test/js/samples/bind-open/expected.js
@@ -53,7 +53,7 @@ function instance($$self, $$props, $$invalidate) {
}
$$self.$$set = $$props => {
- if ("open" in $$props) $$invalidate(0, open = $$props.open);
+ if ('open' in $$props) $$invalidate(0, open = $$props.open);
};
return [open, details_toggle_handler];
diff --git a/test/js/samples/bind-width-height/expected.js b/test/js/samples/bind-width-height/expected.js
index f23c20b683..8966e57c9c 100644
--- a/test/js/samples/bind-width-height/expected.js
+++ b/test/js/samples/bind-width-height/expected.js
@@ -47,8 +47,8 @@ function instance($$self, $$props, $$invalidate) {
}
$$self.$$set = $$props => {
- if ("w" in $$props) $$invalidate(0, w = $$props.w);
- if ("h" in $$props) $$invalidate(1, h = $$props.h);
+ if ('w' in $$props) $$invalidate(0, w = $$props.w);
+ if ('h' in $$props) $$invalidate(1, h = $$props.h);
};
return [w, h, div_elementresize_handler];
diff --git a/test/js/samples/bindings-readonly-order/expected.js b/test/js/samples/bindings-readonly-order/expected.js
index 78a71dcd84..ea83573ee3 100644
--- a/test/js/samples/bindings-readonly-order/expected.js
+++ b/test/js/samples/bindings-readonly-order/expected.js
@@ -69,7 +69,7 @@ function instance($$self, $$props, $$invalidate) {
}
$$self.$$set = $$props => {
- if ("files" in $$props) $$invalidate(0, files = $$props.files);
+ if ('files' in $$props) $$invalidate(0, files = $$props.files);
};
return [files, input0_change_handler, input1_change_handler];
diff --git a/test/js/samples/capture-inject-dev-only/_config.js b/test/js/samples/capture-inject-dev-only/_config.js
index 1e0819f22e..1f2b217a9a 100644
--- a/test/js/samples/capture-inject-dev-only/_config.js
+++ b/test/js/samples/capture-inject-dev-only/_config.js
@@ -2,4 +2,4 @@ export default {
options: {
dev: false
}
-};
\ No newline at end of file
+};
diff --git a/test/js/samples/capture-inject-state/expected.js b/test/js/samples/capture-inject-state/expected.js
index 6a0351ae44..58e1879553 100644
--- a/test/js/samples/capture-inject-state/expected.js
+++ b/test/js/samples/capture-inject-state/expected.js
@@ -95,31 +95,33 @@ const moduleContantProps = 4;
let moduleLet;
const moduleConst = 2;
let shadowedByModule;
-const priv = "priv";
+const priv = 'priv';
function instance($$self, $$props, $$invalidate) {
+ let computed;
+
let $prop,
$$unsubscribe_prop = noop,
$$subscribe_prop = () => ($$unsubscribe_prop(), $$unsubscribe_prop = subscribe(prop, $$value => $$invalidate(2, $prop = $$value)), prop);
$$self.$$.on_destroy.push(() => $$unsubscribe_prop());
let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots("Component", slots, []);
+ validate_slots('Component', slots, []);
let { prop } = $$props;
- validate_store(prop, "prop");
+ validate_store(prop, 'prop');
$$subscribe_prop();
let { alias: realName } = $$props;
let local;
let shadowedByModule;
- const writable_props = ["prop", "alias"];
+ const writable_props = ['prop', 'alias'];
Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(` was created with unknown prop '${key}'`);
+ if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(` was created with unknown prop '${key}'`);
});
$$self.$$set = $$props => {
- if ("prop" in $$props) $$subscribe_prop($$invalidate(0, prop = $$props.prop));
- if ("alias" in $$props) $$invalidate(1, realName = $$props.alias);
+ if ('prop' in $$props) $$subscribe_prop($$invalidate(0, prop = $$props.prop));
+ if ('alias' in $$props) $$invalidate(1, realName = $$props.alias);
};
$$self.$capture_state = () => ({
@@ -138,15 +140,13 @@ function instance($$self, $$props, $$invalidate) {
});
$$self.$inject_state = $$props => {
- if ("prop" in $$props) $$subscribe_prop($$invalidate(0, prop = $$props.prop));
- if ("realName" in $$props) $$invalidate(1, realName = $$props.realName);
- if ("local" in $$props) $$invalidate(3, local = $$props.local);
- if ("shadowedByModule" in $$props) $$invalidate(4, shadowedByModule = $$props.shadowedByModule);
- if ("computed" in $$props) computed = $$props.computed;
+ if ('prop' in $$props) $$subscribe_prop($$invalidate(0, prop = $$props.prop));
+ if ('realName' in $$props) $$invalidate(1, realName = $$props.realName);
+ if ('local' in $$props) $$invalidate(3, local = $$props.local);
+ if ('shadowedByModule' in $$props) $$invalidate(4, shadowedByModule = $$props.shadowedByModule);
+ if ('computed' in $$props) computed = $$props.computed;
};
- let computed;
-
if ($$props && "$$inject" in $$props) {
$$self.$inject_state($$props.$$inject);
}
@@ -170,11 +170,11 @@ class Component extends SvelteComponentDev {
const { ctx } = this.$$;
const props = options.props || {};
- if (/*prop*/ ctx[0] === undefined && !("prop" in props)) {
+ if (/*prop*/ ctx[0] === undefined && !('prop' in props)) {
console.warn(" was created without expected prop 'prop'");
}
- if (/*realName*/ ctx[1] === undefined && !("alias" in props)) {
+ if (/*realName*/ ctx[1] === undefined && !('alias' in props)) {
console.warn(" was created without expected prop 'alias'");
}
}
diff --git a/test/js/samples/collapse-element-class-name/expected.js b/test/js/samples/collapse-element-class-name/expected.js
new file mode 100644
index 0000000000..a55affe76e
--- /dev/null
+++ b/test/js/samples/collapse-element-class-name/expected.js
@@ -0,0 +1,114 @@
+/* generated by Svelte vX.Y.Z */
+import {
+ SvelteComponent,
+ assign,
+ attr,
+ compute_rest_props,
+ create_component,
+ destroy_component,
+ detach,
+ element,
+ exclude_internal_props,
+ init,
+ insert,
+ mount_component,
+ safe_not_equal,
+ space,
+ transition_in,
+ transition_out
+} from "svelte/internal";
+
+import Component from "./Component.svelte";
+
+function create_fragment(ctx) {
+ let div;
+ let div_class_value;
+ let div_style_value;
+ let div_other_value;
+ let t;
+ let component;
+ let current;
+
+ component = new Component({
+ props: {
+ class: "\n\t\tbutton\n\t\tbutton--size--" + /*size*/ ctx[0] + "\n\t\tbutton--theme--" + /*theme*/ ctx[1] + "\n \t" + (/*$$restProps*/ ctx[2].class || ''),
+ style: "\n\t\tcolor: green;\n\t\tbackground: white;\n\t\tfont-size: " + /*size*/ ctx[0] + ";\n \ttransform: " + /*$$restProps*/ ctx[2].scale + " " + /*$$restProps*/ ctx[2].rotate + ";\n\t\t" + /*$$restProps*/ ctx[2].styles,
+ other: "\n\t\tbutton\n\t\tbutton--size--" + /*size*/ ctx[0] + "\n\t\tbutton--theme--" + /*theme*/ ctx[1] + "\n \t" + (/*$$restProps*/ ctx[2].class || '')
+ }
+ });
+
+ return {
+ c() {
+ div = element("div");
+ t = space();
+ create_component(component.$$.fragment);
+ attr(div, "class", div_class_value = "button button--size--" + /*size*/ ctx[0] + " button--theme--" + /*theme*/ ctx[1] + " " + (/*$$restProps*/ ctx[2].class || ''));
+ attr(div, "style", div_style_value = "color: green; background: white; font-size: " + /*size*/ ctx[0] + "; transform: " + /*$$restProps*/ ctx[2].scale + " " + /*$$restProps*/ ctx[2].rotate + "; " + /*$$restProps*/ ctx[2].styles);
+ attr(div, "other", div_other_value = "\n\t\tbutton\n\t\tbutton--size--" + /*size*/ ctx[0] + "\n\t\tbutton--theme--" + /*theme*/ ctx[1] + "\n \t" + (/*$$restProps*/ ctx[2].class || ''));
+ },
+ m(target, anchor) {
+ insert(target, div, anchor);
+ insert(target, t, anchor);
+ mount_component(component, target, anchor);
+ current = true;
+ },
+ p(ctx, [dirty]) {
+ if (!current || dirty & /*size, theme, $$restProps*/ 7 && div_class_value !== (div_class_value = "button button--size--" + /*size*/ ctx[0] + " button--theme--" + /*theme*/ ctx[1] + " " + (/*$$restProps*/ ctx[2].class || ''))) {
+ attr(div, "class", div_class_value);
+ }
+
+ if (!current || dirty & /*size, $$restProps*/ 5 && div_style_value !== (div_style_value = "color: green; background: white; font-size: " + /*size*/ ctx[0] + "; transform: " + /*$$restProps*/ ctx[2].scale + " " + /*$$restProps*/ ctx[2].rotate + "; " + /*$$restProps*/ ctx[2].styles)) {
+ attr(div, "style", div_style_value);
+ }
+
+ if (!current || dirty & /*size, theme, $$restProps*/ 7 && div_other_value !== (div_other_value = "\n\t\tbutton\n\t\tbutton--size--" + /*size*/ ctx[0] + "\n\t\tbutton--theme--" + /*theme*/ ctx[1] + "\n \t" + (/*$$restProps*/ ctx[2].class || ''))) {
+ attr(div, "other", div_other_value);
+ }
+
+ const component_changes = {};
+ if (dirty & /*size, theme, $$restProps*/ 7) component_changes.class = "\n\t\tbutton\n\t\tbutton--size--" + /*size*/ ctx[0] + "\n\t\tbutton--theme--" + /*theme*/ ctx[1] + "\n \t" + (/*$$restProps*/ ctx[2].class || '');
+ if (dirty & /*size, $$restProps*/ 5) component_changes.style = "\n\t\tcolor: green;\n\t\tbackground: white;\n\t\tfont-size: " + /*size*/ ctx[0] + ";\n \ttransform: " + /*$$restProps*/ ctx[2].scale + " " + /*$$restProps*/ ctx[2].rotate + ";\n\t\t" + /*$$restProps*/ ctx[2].styles;
+ if (dirty & /*size, theme, $$restProps*/ 7) component_changes.other = "\n\t\tbutton\n\t\tbutton--size--" + /*size*/ ctx[0] + "\n\t\tbutton--theme--" + /*theme*/ ctx[1] + "\n \t" + (/*$$restProps*/ ctx[2].class || '');
+ component.$set(component_changes);
+ },
+ i(local) {
+ if (current) return;
+ transition_in(component.$$.fragment, local);
+ current = true;
+ },
+ o(local) {
+ transition_out(component.$$.fragment, local);
+ current = false;
+ },
+ d(detaching) {
+ if (detaching) detach(div);
+ if (detaching) detach(t);
+ destroy_component(component, detaching);
+ }
+ };
+}
+
+function instance($$self, $$props, $$invalidate) {
+ const omit_props_names = ["size","theme"];
+ let $$restProps = compute_rest_props($$props, omit_props_names);
+ let { size } = $$props;
+ let { theme } = $$props;
+
+ $$self.$$set = $$new_props => {
+ $$props = assign(assign({}, $$props), exclude_internal_props($$new_props));
+ $$invalidate(2, $$restProps = compute_rest_props($$props, omit_props_names));
+ if ('size' in $$new_props) $$invalidate(0, size = $$new_props.size);
+ if ('theme' in $$new_props) $$invalidate(1, theme = $$new_props.theme);
+ };
+
+ return [size, theme, $$restProps];
+}
+
+class Component_1 extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(this, options, instance, create_fragment, safe_not_equal, { size: 0, theme: 1 });
+ }
+}
+
+export default Component_1;
\ No newline at end of file
diff --git a/test/js/samples/collapse-element-class-name/input.svelte b/test/js/samples/collapse-element-class-name/input.svelte
new file mode 100644
index 0000000000..a4cb283778
--- /dev/null
+++ b/test/js/samples/collapse-element-class-name/input.svelte
@@ -0,0 +1,41 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/test/js/samples/collapses-text-around-comments/expected.js b/test/js/samples/collapses-text-around-comments/expected.js
index 67335ce246..63a32bbf38 100644
--- a/test/js/samples/collapses-text-around-comments/expected.js
+++ b/test/js/samples/collapses-text-around-comments/expected.js
@@ -2,6 +2,7 @@
import {
SvelteComponent,
append,
+ append_styles,
attr,
detach,
element,
@@ -13,11 +14,8 @@ import {
text
} from "svelte/internal";
-function add_css() {
- var style = element("style");
- style.id = "svelte-1a7i8ec-style";
- style.textContent = "p.svelte-1a7i8ec{color:red}";
- append(document.head, style);
+function add_css(target) {
+ append_styles(target, "svelte-1a7i8ec", "p.svelte-1a7i8ec{color:red}");
}
function create_fragment(ctx) {
@@ -49,7 +47,7 @@ function instance($$self, $$props, $$invalidate) {
let { foo = 42 } = $$props;
$$self.$$set = $$props => {
- if ("foo" in $$props) $$invalidate(0, foo = $$props.foo);
+ if ('foo' in $$props) $$invalidate(0, foo = $$props.foo);
};
return [foo];
@@ -58,9 +56,8 @@ function instance($$self, $$props, $$invalidate) {
class Component extends SvelteComponent {
constructor(options) {
super();
- if (!document.getElementById("svelte-1a7i8ec-style")) add_css();
- init(this, options, instance, create_fragment, safe_not_equal, { foo: 0 });
+ init(this, options, instance, create_fragment, safe_not_equal, { foo: 0 }, add_css);
}
}
-export default Component;
\ No newline at end of file
+export default Component;
diff --git a/test/js/samples/component-static-immutable/_config.js b/test/js/samples/component-static-immutable/_config.js
index 06713941e0..e9026d8223 100644
--- a/test/js/samples/component-static-immutable/_config.js
+++ b/test/js/samples/component-static-immutable/_config.js
@@ -2,4 +2,4 @@ export default {
options: {
immutable: true
}
-};
\ No newline at end of file
+};
diff --git a/test/js/samples/component-static-immutable2/_config.js b/test/js/samples/component-static-immutable2/_config.js
index 06713941e0..e9026d8223 100644
--- a/test/js/samples/component-static-immutable2/_config.js
+++ b/test/js/samples/component-static-immutable2/_config.js
@@ -2,4 +2,4 @@ export default {
options: {
immutable: true
}
-};
\ No newline at end of file
+};
diff --git a/test/js/samples/component-static-var/expected.js b/test/js/samples/component-static-var/expected.js
index 2cd5ed386f..9e481a25c3 100644
--- a/test/js/samples/component-static-var/expected.js
+++ b/test/js/samples/component-static-var/expected.js
@@ -16,8 +16,8 @@ import {
transition_out
} from "svelte/internal";
-import Foo from "./Foo.svelte";
-import Bar from "./Bar.svelte";
+import Foo from './Foo.svelte';
+import Bar from './Bar.svelte';
function create_fragment(ctx) {
let foo;
diff --git a/test/js/samples/component-store-access-invalidate/expected.js b/test/js/samples/component-store-access-invalidate/expected.js
index 4c7bfd7009..2742481aef 100644
--- a/test/js/samples/component-store-access-invalidate/expected.js
+++ b/test/js/samples/component-store-access-invalidate/expected.js
@@ -13,7 +13,7 @@ import {
text
} from "svelte/internal";
-import { writable } from "svelte/store";
+import { writable } from 'svelte/store';
function create_fragment(ctx) {
let h1;
diff --git a/test/js/samples/component-store-file-invalidate/expected.js b/test/js/samples/component-store-file-invalidate/expected.js
index d2fb3d0be4..86a467f368 100644
--- a/test/js/samples/component-store-file-invalidate/expected.js
+++ b/test/js/samples/component-store-file-invalidate/expected.js
@@ -7,7 +7,7 @@ import {
set_store_value
} from "svelte/internal";
-import { count } from "./store.js";
+import { count } from './store.js';
function instance($$self, $$props, $$invalidate) {
let $count;
diff --git a/test/js/samples/component-store-file-invalidate/store.js b/test/js/samples/component-store-file-invalidate/store.js
index 99e27e5584..b799c0ffc4 100644
--- a/test/js/samples/component-store-file-invalidate/store.js
+++ b/test/js/samples/component-store-file-invalidate/store.js
@@ -1,3 +1,3 @@
import { writable } from '../../../../store';
-export const count = writable(0);
\ No newline at end of file
+export const count = writable(0);
diff --git a/test/js/samples/component-store-reassign-invalidate/expected.js b/test/js/samples/component-store-reassign-invalidate/expected.js
index 0cf555bf0d..9047316cef 100644
--- a/test/js/samples/component-store-reassign-invalidate/expected.js
+++ b/test/js/samples/component-store-reassign-invalidate/expected.js
@@ -15,7 +15,7 @@ import {
text
} from "svelte/internal";
-import { writable } from "svelte/store";
+import { writable } from 'svelte/store';
function create_fragment(ctx) {
let h1;
diff --git a/test/js/samples/computed-collapsed-if/expected.js b/test/js/samples/computed-collapsed-if/expected.js
index 3e70d6a7ae..8bcb5ed8b7 100644
--- a/test/js/samples/computed-collapsed-if/expected.js
+++ b/test/js/samples/computed-collapsed-if/expected.js
@@ -13,7 +13,7 @@ function instance($$self, $$props, $$invalidate) {
}
$$self.$$set = $$props => {
- if ("x" in $$props) $$invalidate(0, x = $$props.x);
+ if ('x' in $$props) $$invalidate(0, x = $$props.x);
};
return [x, a, b];
diff --git a/test/js/samples/css-media-query/expected.js b/test/js/samples/css-media-query/expected.js
index f477670059..d743432206 100644
--- a/test/js/samples/css-media-query/expected.js
+++ b/test/js/samples/css-media-query/expected.js
@@ -1,7 +1,7 @@
/* generated by Svelte vX.Y.Z */
import {
SvelteComponent,
- append,
+ append_styles,
attr,
detach,
element,
@@ -11,11 +11,8 @@ import {
safe_not_equal
} from "svelte/internal";
-function add_css() {
- var style = element("style");
- style.id = "svelte-1slhpfn-style";
- style.textContent = "@media(min-width: 1px){div.svelte-1slhpfn{color:red}}";
- append(document.head, style);
+function add_css(target) {
+ append_styles(target, "svelte-1slhpfn", "@media(min-width: 1px){div.svelte-1slhpfn{color:red}}");
}
function create_fragment(ctx) {
@@ -41,9 +38,8 @@ function create_fragment(ctx) {
class Component extends SvelteComponent {
constructor(options) {
super();
- if (!document.getElementById("svelte-1slhpfn-style")) add_css();
- init(this, options, null, create_fragment, safe_not_equal, {});
+ init(this, options, null, create_fragment, safe_not_equal, {}, add_css);
}
}
-export default Component;
\ No newline at end of file
+export default Component;
diff --git a/test/js/samples/css-shadow-dom-keyframes/_config.js b/test/js/samples/css-shadow-dom-keyframes/_config.js
index 735dd07e62..e8a05d399c 100644
--- a/test/js/samples/css-shadow-dom-keyframes/_config.js
+++ b/test/js/samples/css-shadow-dom-keyframes/_config.js
@@ -2,4 +2,4 @@ export default {
options: {
customElement: true
}
-};
\ No newline at end of file
+};
diff --git a/test/js/samples/css-shadow-dom-keyframes/expected.js b/test/js/samples/css-shadow-dom-keyframes/expected.js
index a0a0ebe021..5d65949488 100644
--- a/test/js/samples/css-shadow-dom-keyframes/expected.js
+++ b/test/js/samples/css-shadow-dom-keyframes/expected.js
@@ -1,6 +1,7 @@
/* generated by Svelte vX.Y.Z */
import {
SvelteElement,
+ attribute_to_object,
detach,
element,
init,
@@ -34,7 +35,20 @@ class Component extends SvelteElement {
constructor(options) {
super();
this.shadowRoot.innerHTML = ``;
- init(this, { target: this.shadowRoot }, null, create_fragment, safe_not_equal, {});
+
+ init(
+ this,
+ {
+ target: this.shadowRoot,
+ props: attribute_to_object(this.attributes),
+ customElement: true
+ },
+ null,
+ create_fragment,
+ safe_not_equal,
+ {},
+ null
+ );
if (options) {
if (options.target) {
@@ -45,4 +59,4 @@ class Component extends SvelteElement {
}
customElements.define("custom-element", Component);
-export default Component;
\ No newline at end of file
+export default Component;
diff --git a/test/js/samples/custom-svelte-path/_config.js b/test/js/samples/custom-svelte-path/_config.js
new file mode 100644
index 0000000000..19a7366845
--- /dev/null
+++ b/test/js/samples/custom-svelte-path/_config.js
@@ -0,0 +1,5 @@
+export default {
+ options: {
+ sveltePath: 'a/b/svelte'
+ }
+};
diff --git a/test/js/samples/custom-svelte-path/expected.js b/test/js/samples/custom-svelte-path/expected.js
new file mode 100644
index 0000000000..3210f216d3
--- /dev/null
+++ b/test/js/samples/custom-svelte-path/expected.js
@@ -0,0 +1,64 @@
+/* generated by Svelte vX.Y.Z */
+import {
+ SvelteComponent,
+ append,
+ detach,
+ element,
+ init,
+ insert,
+ noop,
+ safe_not_equal,
+ set_data,
+ text
+} from "a/b/svelte/internal";
+
+import { onMount } from "a/b/svelte";
+
+function create_fragment(ctx) {
+ let h1;
+ let t0;
+ let t1;
+ let t2;
+
+ return {
+ c() {
+ h1 = element("h1");
+ t0 = text("Hello ");
+ t1 = text(/*name*/ ctx[0]);
+ t2 = text("!");
+ },
+ m(target, anchor) {
+ insert(target, h1, anchor);
+ append(h1, t0);
+ append(h1, t1);
+ append(h1, t2);
+ },
+ p(ctx, [dirty]) {
+ if (dirty & /*name*/ 1) set_data(t1, /*name*/ ctx[0]);
+ },
+ i: noop,
+ o: noop,
+ d(detaching) {
+ if (detaching) detach(h1);
+ }
+ };
+}
+
+function instance($$self, $$props, $$invalidate) {
+ let name = '';
+
+ onMount(() => {
+ $$invalidate(0, name = 'world');
+ });
+
+ return [name];
+}
+
+class Component extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(this, options, instance, create_fragment, safe_not_equal, {});
+ }
+}
+
+export default Component;
\ No newline at end of file
diff --git a/test/js/samples/custom-svelte-path/input.svelte b/test/js/samples/custom-svelte-path/input.svelte
new file mode 100644
index 0000000000..03d31e7c7b
--- /dev/null
+++ b/test/js/samples/custom-svelte-path/input.svelte
@@ -0,0 +1,9 @@
+
+
+Hello {name}!
\ No newline at end of file
diff --git a/test/js/samples/data-attribute/expected.js b/test/js/samples/data-attribute/expected.js
index 8c30e6f6db..2b2f8870e4 100644
--- a/test/js/samples/data-attribute/expected.js
+++ b/test/js/samples/data-attribute/expected.js
@@ -48,7 +48,7 @@ function instance($$self, $$props, $$invalidate) {
let { bar } = $$props;
$$self.$$set = $$props => {
- if ("bar" in $$props) $$invalidate(0, bar = $$props.bar);
+ if ('bar' in $$props) $$invalidate(0, bar = $$props.bar);
};
return [bar];
diff --git a/test/js/samples/debug-empty/_config.js b/test/js/samples/debug-empty/_config.js
index b1f2518e8a..414b026a97 100644
--- a/test/js/samples/debug-empty/_config.js
+++ b/test/js/samples/debug-empty/_config.js
@@ -2,4 +2,4 @@ export default {
options: {
dev: true
}
-};
\ No newline at end of file
+};
diff --git a/test/js/samples/debug-empty/expected.js b/test/js/samples/debug-empty/expected.js
index f427f1bf45..55303b41b7 100644
--- a/test/js/samples/debug-empty/expected.js
+++ b/test/js/samples/debug-empty/expected.js
@@ -70,22 +70,22 @@ function create_fragment(ctx) {
function instance($$self, $$props, $$invalidate) {
let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots("Component", slots, []);
+ validate_slots('Component', slots, []);
let { name } = $$props;
- const writable_props = ["name"];
+ const writable_props = ['name'];
Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(` was created with unknown prop '${key}'`);
+ if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(` was created with unknown prop '${key}'`);
});
$$self.$$set = $$props => {
- if ("name" in $$props) $$invalidate(0, name = $$props.name);
+ if ('name' in $$props) $$invalidate(0, name = $$props.name);
};
$$self.$capture_state = () => ({ name });
$$self.$inject_state = $$props => {
- if ("name" in $$props) $$invalidate(0, name = $$props.name);
+ if ('name' in $$props) $$invalidate(0, name = $$props.name);
};
if ($$props && "$$inject" in $$props) {
@@ -110,7 +110,7 @@ class Component extends SvelteComponentDev {
const { ctx } = this.$$;
const props = options.props || {};
- if (/*name*/ ctx[0] === undefined && !("name" in props)) {
+ if (/*name*/ ctx[0] === undefined && !('name' in props)) {
console.warn(" was created without expected prop 'name'");
}
}
diff --git a/test/js/samples/debug-foo-bar-baz-things/_config.js b/test/js/samples/debug-foo-bar-baz-things/_config.js
index b1f2518e8a..414b026a97 100644
--- a/test/js/samples/debug-foo-bar-baz-things/_config.js
+++ b/test/js/samples/debug-foo-bar-baz-things/_config.js
@@ -2,4 +2,4 @@ export default {
options: {
dev: true
}
-};
\ No newline at end of file
+};
diff --git a/test/js/samples/debug-foo-bar-baz-things/expected.js b/test/js/samples/debug-foo-bar-baz-things/expected.js
index 7439b3310b..3377d35018 100644
--- a/test/js/samples/debug-foo-bar-baz-things/expected.js
+++ b/test/js/samples/debug-foo-bar-baz-things/expected.js
@@ -171,31 +171,31 @@ function create_fragment(ctx) {
function instance($$self, $$props, $$invalidate) {
let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots("Component", slots, []);
+ validate_slots('Component', slots, []);
let { things } = $$props;
let { foo } = $$props;
let { bar } = $$props;
let { baz } = $$props;
- const writable_props = ["things", "foo", "bar", "baz"];
+ const writable_props = ['things', 'foo', 'bar', 'baz'];
Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(` was created with unknown prop '${key}'`);
+ if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(` was created with unknown prop '${key}'`);
});
$$self.$$set = $$props => {
- if ("things" in $$props) $$invalidate(0, things = $$props.things);
- if ("foo" in $$props) $$invalidate(1, foo = $$props.foo);
- if ("bar" in $$props) $$invalidate(2, bar = $$props.bar);
- if ("baz" in $$props) $$invalidate(3, baz = $$props.baz);
+ if ('things' in $$props) $$invalidate(0, things = $$props.things);
+ if ('foo' in $$props) $$invalidate(1, foo = $$props.foo);
+ if ('bar' in $$props) $$invalidate(2, bar = $$props.bar);
+ if ('baz' in $$props) $$invalidate(3, baz = $$props.baz);
};
$$self.$capture_state = () => ({ things, foo, bar, baz });
$$self.$inject_state = $$props => {
- if ("things" in $$props) $$invalidate(0, things = $$props.things);
- if ("foo" in $$props) $$invalidate(1, foo = $$props.foo);
- if ("bar" in $$props) $$invalidate(2, bar = $$props.bar);
- if ("baz" in $$props) $$invalidate(3, baz = $$props.baz);
+ if ('things' in $$props) $$invalidate(0, things = $$props.things);
+ if ('foo' in $$props) $$invalidate(1, foo = $$props.foo);
+ if ('bar' in $$props) $$invalidate(2, bar = $$props.bar);
+ if ('baz' in $$props) $$invalidate(3, baz = $$props.baz);
};
if ($$props && "$$inject" in $$props) {
@@ -220,19 +220,19 @@ class Component extends SvelteComponentDev {
const { ctx } = this.$$;
const props = options.props || {};
- if (/*things*/ ctx[0] === undefined && !("things" in props)) {
+ if (/*things*/ ctx[0] === undefined && !('things' in props)) {
console.warn(" was created without expected prop 'things'");
}
- if (/*foo*/ ctx[1] === undefined && !("foo" in props)) {
+ if (/*foo*/ ctx[1] === undefined && !('foo' in props)) {
console.warn(" was created without expected prop 'foo'");
}
- if (/*bar*/ ctx[2] === undefined && !("bar" in props)) {
+ if (/*bar*/ ctx[2] === undefined && !('bar' in props)) {
console.warn(" was created without expected prop 'bar'");
}
- if (/*baz*/ ctx[3] === undefined && !("baz" in props)) {
+ if (/*baz*/ ctx[3] === undefined && !('baz' in props)) {
console.warn(" was created without expected prop 'baz'");
}
}
diff --git a/test/js/samples/debug-foo/_config.js b/test/js/samples/debug-foo/_config.js
index b1f2518e8a..414b026a97 100644
--- a/test/js/samples/debug-foo/_config.js
+++ b/test/js/samples/debug-foo/_config.js
@@ -2,4 +2,4 @@ export default {
options: {
dev: true
}
-};
\ No newline at end of file
+};
diff --git a/test/js/samples/debug-foo/expected.js b/test/js/samples/debug-foo/expected.js
index d869a5cf9e..518897c237 100644
--- a/test/js/samples/debug-foo/expected.js
+++ b/test/js/samples/debug-foo/expected.js
@@ -165,25 +165,25 @@ function create_fragment(ctx) {
function instance($$self, $$props, $$invalidate) {
let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots("Component", slots, []);
+ validate_slots('Component', slots, []);
let { things } = $$props;
let { foo } = $$props;
- const writable_props = ["things", "foo"];
+ const writable_props = ['things', 'foo'];
Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(` was created with unknown prop '${key}'`);
+ if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(` was created with unknown prop '${key}'`);
});
$$self.$$set = $$props => {
- if ("things" in $$props) $$invalidate(0, things = $$props.things);
- if ("foo" in $$props) $$invalidate(1, foo = $$props.foo);
+ if ('things' in $$props) $$invalidate(0, things = $$props.things);
+ if ('foo' in $$props) $$invalidate(1, foo = $$props.foo);
};
$$self.$capture_state = () => ({ things, foo });
$$self.$inject_state = $$props => {
- if ("things" in $$props) $$invalidate(0, things = $$props.things);
- if ("foo" in $$props) $$invalidate(1, foo = $$props.foo);
+ if ('things' in $$props) $$invalidate(0, things = $$props.things);
+ if ('foo' in $$props) $$invalidate(1, foo = $$props.foo);
};
if ($$props && "$$inject" in $$props) {
@@ -208,11 +208,11 @@ class Component extends SvelteComponentDev {
const { ctx } = this.$$;
const props = options.props || {};
- if (/*things*/ ctx[0] === undefined && !("things" in props)) {
+ if (/*things*/ ctx[0] === undefined && !('things' in props)) {
console.warn(" was created without expected prop 'things'");
}
- if (/*foo*/ ctx[1] === undefined && !("foo" in props)) {
+ if (/*foo*/ ctx[1] === undefined && !('foo' in props)) {
console.warn(" was created without expected prop 'foo'");
}
}
diff --git a/test/js/samples/debug-hoisted/expected.js b/test/js/samples/debug-hoisted/expected.js
index c6257ac90d..9fc4f7cf4f 100644
--- a/test/js/samples/debug-hoisted/expected.js
+++ b/test/js/samples/debug-hoisted/expected.js
@@ -50,20 +50,20 @@ function create_fragment(ctx) {
function instance($$self, $$props, $$invalidate) {
let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots("Component", slots, []);
+ validate_slots('Component', slots, []);
let obj = { x: 5 };
let kobzol = 5;
const writable_props = [];
Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(` was created with unknown prop '${key}'`);
+ if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(` was created with unknown prop '${key}'`);
});
$$self.$capture_state = () => ({ obj, kobzol });
$$self.$inject_state = $$props => {
- if ("obj" in $$props) $$invalidate(0, obj = $$props.obj);
- if ("kobzol" in $$props) $$invalidate(1, kobzol = $$props.kobzol);
+ if ('obj' in $$props) $$invalidate(0, obj = $$props.obj);
+ if ('kobzol' in $$props) $$invalidate(1, kobzol = $$props.kobzol);
};
if ($$props && "$$inject" in $$props) {
diff --git a/test/js/samples/debug-no-dependencies/_config.js b/test/js/samples/debug-no-dependencies/_config.js
index b1f2518e8a..414b026a97 100644
--- a/test/js/samples/debug-no-dependencies/_config.js
+++ b/test/js/samples/debug-no-dependencies/_config.js
@@ -2,4 +2,4 @@ export default {
options: {
dev: true
}
-};
\ No newline at end of file
+};
diff --git a/test/js/samples/debug-no-dependencies/expected.js b/test/js/samples/debug-no-dependencies/expected.js
index 4d8d05d3aa..8107b890a6 100644
--- a/test/js/samples/debug-no-dependencies/expected.js
+++ b/test/js/samples/debug-no-dependencies/expected.js
@@ -137,11 +137,11 @@ function create_fragment(ctx) {
function instance($$self, $$props) {
let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots("Component", slots, []);
+ validate_slots('Component', slots, []);
const writable_props = [];
Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(` was created with unknown prop '${key}'`);
+ if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(` was created with unknown prop '${key}'`);
});
return [];
diff --git a/test/js/samples/debug-ssr-foo/_config.js b/test/js/samples/debug-ssr-foo/_config.js
index 39bfbe7e62..c4070b9a3b 100644
--- a/test/js/samples/debug-ssr-foo/_config.js
+++ b/test/js/samples/debug-ssr-foo/_config.js
@@ -3,4 +3,4 @@ export default {
generate: 'ssr',
dev: true
}
-};
\ No newline at end of file
+};
diff --git a/test/js/samples/deconflict-builtins/expected.js b/test/js/samples/deconflict-builtins/expected.js
index 6bc60194aa..8c9bb83b5b 100644
--- a/test/js/samples/deconflict-builtins/expected.js
+++ b/test/js/samples/deconflict-builtins/expected.js
@@ -105,7 +105,7 @@ function instance($$self, $$props, $$invalidate) {
let { createElement } = $$props;
$$self.$$set = $$props => {
- if ("createElement" in $$props) $$invalidate(0, createElement = $$props.createElement);
+ if ('createElement' in $$props) $$invalidate(0, createElement = $$props.createElement);
};
return [createElement];
diff --git a/test/js/samples/deconflict-globals/expected.js b/test/js/samples/deconflict-globals/expected.js
index 7168eba6a5..c048cc2ddd 100644
--- a/test/js/samples/deconflict-globals/expected.js
+++ b/test/js/samples/deconflict-globals/expected.js
@@ -1,17 +1,17 @@
/* generated by Svelte vX.Y.Z */
import { SvelteComponent, init, safe_not_equal } from "svelte/internal";
-import { onMount } from "svelte";
+import { onMount } from 'svelte';
function instance($$self, $$props, $$invalidate) {
- let { foo = "bar" } = $$props;
+ let { foo = 'bar' } = $$props;
onMount(() => {
alert(JSON.stringify(data()));
});
$$self.$$set = $$props => {
- if ("foo" in $$props) $$invalidate(0, foo = $$props.foo);
+ if ('foo' in $$props) $$invalidate(0, foo = $$props.foo);
};
return [foo];
diff --git a/test/js/samples/dev-warning-missing-data-computed/_config.js b/test/js/samples/dev-warning-missing-data-computed/_config.js
index b1f2518e8a..414b026a97 100644
--- a/test/js/samples/dev-warning-missing-data-computed/_config.js
+++ b/test/js/samples/dev-warning-missing-data-computed/_config.js
@@ -2,4 +2,4 @@ export default {
options: {
dev: true
}
-};
\ No newline at end of file
+};
diff --git a/test/js/samples/dev-warning-missing-data-computed/expected.js b/test/js/samples/dev-warning-missing-data-computed/expected.js
index 8c7f8bb1cf..5e10ec55f8 100644
--- a/test/js/samples/dev-warning-missing-data-computed/expected.js
+++ b/test/js/samples/dev-warning-missing-data-computed/expected.js
@@ -66,24 +66,24 @@ function create_fragment(ctx) {
function instance($$self, $$props, $$invalidate) {
let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots("Component", slots, []);
+ validate_slots('Component', slots, []);
let { foo } = $$props;
let bar;
- const writable_props = ["foo"];
+ const writable_props = ['foo'];
Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(` was created with unknown prop '${key}'`);
+ if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(` was created with unknown prop '${key}'`);
});
$$self.$$set = $$props => {
- if ("foo" in $$props) $$invalidate(0, foo = $$props.foo);
+ if ('foo' in $$props) $$invalidate(0, foo = $$props.foo);
};
$$self.$capture_state = () => ({ foo, bar });
$$self.$inject_state = $$props => {
- if ("foo" in $$props) $$invalidate(0, foo = $$props.foo);
- if ("bar" in $$props) $$invalidate(1, bar = $$props.bar);
+ if ('foo' in $$props) $$invalidate(0, foo = $$props.foo);
+ if ('bar' in $$props) $$invalidate(1, bar = $$props.bar);
};
if ($$props && "$$inject" in $$props) {
@@ -114,7 +114,7 @@ class Component extends SvelteComponentDev {
const { ctx } = this.$$;
const props = options.props || {};
- if (/*foo*/ ctx[0] === undefined && !("foo" in props)) {
+ if (/*foo*/ ctx[0] === undefined && !('foo' in props)) {
console.warn(" was created without expected prop 'foo'");
}
}
diff --git a/test/js/samples/dynamic-import/expected.js b/test/js/samples/dynamic-import/expected.js
index d1085f431b..d25a825d3b 100644
--- a/test/js/samples/dynamic-import/expected.js
+++ b/test/js/samples/dynamic-import/expected.js
@@ -11,7 +11,7 @@ import {
transition_out
} from "svelte/internal";
-import LazyLoad from "./LazyLoad.svelte";
+import LazyLoad from './LazyLoad.svelte';
function create_fragment(ctx) {
let lazyload;
@@ -42,7 +42,7 @@ function create_fragment(ctx) {
};
}
-const func = () => import("./Foo.svelte");
+const func = () => import('./Foo.svelte');
class Component extends SvelteComponent {
constructor(options) {
diff --git a/test/js/samples/each-block-array-literal/expected.js b/test/js/samples/each-block-array-literal/expected.js
index fe51ac5bc3..bb5a04e952 100644
--- a/test/js/samples/each-block-array-literal/expected.js
+++ b/test/js/samples/each-block-array-literal/expected.js
@@ -107,11 +107,11 @@ function instance($$self, $$props, $$invalidate) {
let { e } = $$props;
$$self.$$set = $$props => {
- if ("a" in $$props) $$invalidate(0, a = $$props.a);
- if ("b" in $$props) $$invalidate(1, b = $$props.b);
- if ("c" in $$props) $$invalidate(2, c = $$props.c);
- if ("d" in $$props) $$invalidate(3, d = $$props.d);
- if ("e" in $$props) $$invalidate(4, e = $$props.e);
+ if ('a' in $$props) $$invalidate(0, a = $$props.a);
+ if ('b' in $$props) $$invalidate(1, b = $$props.b);
+ if ('c' in $$props) $$invalidate(2, c = $$props.c);
+ if ('d' in $$props) $$invalidate(3, d = $$props.d);
+ if ('e' in $$props) $$invalidate(4, e = $$props.e);
};
return [a, b, c, d, e];
diff --git a/test/js/samples/each-block-changed-check/expected.js b/test/js/samples/each-block-changed-check/expected.js
index 63bc1d8607..19947edbbb 100644
--- a/test/js/samples/each-block-changed-check/expected.js
+++ b/test/js/samples/each-block-changed-check/expected.js
@@ -52,8 +52,9 @@ function create_each_block(ctx) {
t4 = text(t4_value);
t5 = text(" ago:");
t6 = space();
+ html_tag = new HtmlTag();
attr(span, "class", "meta");
- html_tag = new HtmlTag(null);
+ html_tag.a = null;
attr(div, "class", "comment");
},
m(target, anchor) {
@@ -153,10 +154,10 @@ function instance($$self, $$props, $$invalidate) {
let { foo } = $$props;
$$self.$$set = $$props => {
- if ("comments" in $$props) $$invalidate(0, comments = $$props.comments);
- if ("elapsed" in $$props) $$invalidate(1, elapsed = $$props.elapsed);
- if ("time" in $$props) $$invalidate(2, time = $$props.time);
- if ("foo" in $$props) $$invalidate(3, foo = $$props.foo);
+ if ('comments' in $$props) $$invalidate(0, comments = $$props.comments);
+ if ('elapsed' in $$props) $$invalidate(1, elapsed = $$props.elapsed);
+ if ('time' in $$props) $$invalidate(2, time = $$props.time);
+ if ('foo' in $$props) $$invalidate(3, foo = $$props.foo);
};
return [comments, elapsed, time, foo];
diff --git a/test/js/samples/each-block-keyed-animated/expected.js b/test/js/samples/each-block-keyed-animated/expected.js
index 46ef63ee7f..6f7c22a086 100644
--- a/test/js/samples/each-block-keyed-animated/expected.js
+++ b/test/js/samples/each-block-keyed-animated/expected.js
@@ -43,7 +43,8 @@ function create_each_block(key_1, ctx) {
insert(target, div, anchor);
append(div, t);
},
- p(ctx, dirty) {
+ p(new_ctx, dirty) {
+ ctx = new_ctx;
if (dirty & /*things*/ 1 && t_value !== (t_value = /*thing*/ ctx[1].name + "")) set_data(t, t_value);
},
r() {
@@ -93,7 +94,7 @@ function create_fragment(ctx) {
},
p(ctx, [dirty]) {
if (dirty & /*things*/ 1) {
- const each_value = /*things*/ ctx[0];
+ each_value = /*things*/ ctx[0];
for (let i = 0; i < each_blocks.length; i += 1) each_blocks[i].r();
each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, each_1_anchor.parentNode, fix_and_destroy_block, create_each_block, each_1_anchor, get_each_context);
for (let i = 0; i < each_blocks.length; i += 1) each_blocks[i].a();
@@ -129,7 +130,7 @@ function instance($$self, $$props, $$invalidate) {
let { things } = $$props;
$$self.$$set = $$props => {
- if ("things" in $$props) $$invalidate(0, things = $$props.things);
+ if ('things' in $$props) $$invalidate(0, things = $$props.things);
};
return [things];
diff --git a/test/js/samples/each-block-keyed/expected.js b/test/js/samples/each-block-keyed/expected.js
index 71853cf295..a275697d8e 100644
--- a/test/js/samples/each-block-keyed/expected.js
+++ b/test/js/samples/each-block-keyed/expected.js
@@ -39,7 +39,8 @@ function create_each_block(key_1, ctx) {
insert(target, div, anchor);
append(div, t);
},
- p(ctx, dirty) {
+ p(new_ctx, dirty) {
+ ctx = new_ctx;
if (dirty & /*things*/ 1 && t_value !== (t_value = /*thing*/ ctx[1].name + "")) set_data(t, t_value);
},
d(detaching) {
@@ -78,7 +79,7 @@ function create_fragment(ctx) {
},
p(ctx, [dirty]) {
if (dirty & /*things*/ 1) {
- const each_value = /*things*/ ctx[0];
+ each_value = /*things*/ ctx[0];
each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, each_1_anchor.parentNode, destroy_block, create_each_block, each_1_anchor, get_each_context);
}
},
@@ -98,7 +99,7 @@ function instance($$self, $$props, $$invalidate) {
let { things } = $$props;
$$self.$$set = $$props => {
- if ("things" in $$props) $$invalidate(0, things = $$props.things);
+ if ('things' in $$props) $$invalidate(0, things = $$props.things);
};
return [things];
diff --git a/test/js/samples/export-from-accessors/_config.js b/test/js/samples/export-from-accessors/_config.js
new file mode 100644
index 0000000000..7f9293a560
--- /dev/null
+++ b/test/js/samples/export-from-accessors/_config.js
@@ -0,0 +1,5 @@
+export default {
+ options: {
+ accessors: true
+ }
+};
diff --git a/test/js/samples/export-from-accessors/expected.js b/test/js/samples/export-from-accessors/expected.js
new file mode 100644
index 0000000000..20b0524ca7
--- /dev/null
+++ b/test/js/samples/export-from-accessors/expected.js
@@ -0,0 +1,34 @@
+/* generated by Svelte vX.Y.Z */
+import { SvelteComponent, init, safe_not_equal } from "svelte/internal";
+
+import { f as f_1, g as g_1 } from './d';
+import { h as h_1 } from './e';
+import { i as j } from './f';
+export { d as e } from './c';
+export { c } from './b';
+export { a, b } from './a';
+
+class Component extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(this, options, null, null, safe_not_equal, {});
+ }
+
+ get f() {
+ return f_1;
+ }
+
+ get g() {
+ return g_1;
+ }
+
+ get h() {
+ return h_1;
+ }
+
+ get j() {
+ return j;
+ }
+}
+
+export default Component;
\ No newline at end of file
diff --git a/test/js/samples/export-from-accessors/input.svelte b/test/js/samples/export-from-accessors/input.svelte
new file mode 100644
index 0000000000..66957806a2
--- /dev/null
+++ b/test/js/samples/export-from-accessors/input.svelte
@@ -0,0 +1,11 @@
+
+
+
diff --git a/test/js/samples/export-from-cjs/_config.js b/test/js/samples/export-from-cjs/_config.js
new file mode 100644
index 0000000000..2506f1d5fc
--- /dev/null
+++ b/test/js/samples/export-from-cjs/_config.js
@@ -0,0 +1,6 @@
+export default {
+ options: {
+ accessors: true,
+ format: 'cjs'
+ }
+};
diff --git a/test/js/samples/export-from-cjs/expected.js b/test/js/samples/export-from-cjs/expected.js
new file mode 100644
index 0000000000..d40f986635
--- /dev/null
+++ b/test/js/samples/export-from-cjs/expected.js
@@ -0,0 +1,36 @@
+/* generated by Svelte vX.Y.Z */
+"use strict";
+
+const { SvelteComponent, init, safe_not_equal } = require("svelte/internal");
+const { f: f_1, g: g_1 } = require("./d");
+const { h: h_1 } = require("./e");
+const { i: j } = require("./f");
+exports.e = require("./c").d;
+exports.c = require("./b").c;
+exports.a = require("./a").a;
+exports.b = require("./a").b;
+
+class Component extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(this, options, null, null, safe_not_equal, {});
+ }
+
+ get f() {
+ return f_1;
+ }
+
+ get g() {
+ return g_1;
+ }
+
+ get h() {
+ return h_1;
+ }
+
+ get j() {
+ return j;
+ }
+}
+
+exports.default = Component;
\ No newline at end of file
diff --git a/test/js/samples/export-from-cjs/input.svelte b/test/js/samples/export-from-cjs/input.svelte
new file mode 100644
index 0000000000..66957806a2
--- /dev/null
+++ b/test/js/samples/export-from-cjs/input.svelte
@@ -0,0 +1,11 @@
+
+
+
diff --git a/test/js/samples/export-from/expected.js b/test/js/samples/export-from/expected.js
new file mode 100644
index 0000000000..04fb47605f
--- /dev/null
+++ b/test/js/samples/export-from/expected.js
@@ -0,0 +1,18 @@
+/* generated by Svelte vX.Y.Z */
+import { SvelteComponent, init, safe_not_equal } from "svelte/internal";
+
+import './d';
+import './e';
+import './f';
+export { d as e } from './c';
+export { c } from './b';
+export { a, b } from './a';
+
+class Component extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(this, options, null, null, safe_not_equal, {});
+ }
+}
+
+export default Component;
\ No newline at end of file
diff --git a/test/js/samples/export-from/input.svelte b/test/js/samples/export-from/input.svelte
new file mode 100644
index 0000000000..66957806a2
--- /dev/null
+++ b/test/js/samples/export-from/input.svelte
@@ -0,0 +1,11 @@
+
+
+
diff --git a/test/js/samples/hydrated-void-element/_config.js b/test/js/samples/hydrated-void-element/_config.js
index 84c0d733ef..af1bf11a52 100644
--- a/test/js/samples/hydrated-void-element/_config.js
+++ b/test/js/samples/hydrated-void-element/_config.js
@@ -2,4 +2,4 @@ export default {
options: {
hydratable: true
}
-};
\ No newline at end of file
+};
diff --git a/test/js/samples/hydrated-void-element/expected.js b/test/js/samples/hydrated-void-element/expected.js
index e53d16d925..e84b9ad58e 100644
--- a/test/js/samples/hydrated-void-element/expected.js
+++ b/test/js/samples/hydrated-void-element/expected.js
@@ -8,10 +8,11 @@ import {
detach,
element,
init,
- insert,
+ insert_hydration,
noop,
safe_not_equal,
- space
+ space,
+ src_url_equal
} from "svelte/internal";
function create_fragment(ctx) {
@@ -35,13 +36,13 @@ function create_fragment(ctx) {
this.h();
},
h() {
- if (img.src !== (img_src_value = "donuts.jpg")) attr(img, "src", img_src_value);
+ if (!src_url_equal(img.src, img_src_value = "donuts.jpg")) attr(img, "src", img_src_value);
attr(img, "alt", "donuts");
},
m(target, anchor) {
- insert(target, img, anchor);
- insert(target, t, anchor);
- insert(target, div, anchor);
+ insert_hydration(target, img, anchor);
+ insert_hydration(target, t, anchor);
+ insert_hydration(target, div, anchor);
},
p: noop,
i: noop,
@@ -61,4 +62,4 @@ class Component extends SvelteComponent {
}
}
-export default Component;
\ No newline at end of file
+export default Component;
diff --git a/test/js/samples/hydrated-void-svg-element/_config.js b/test/js/samples/hydrated-void-svg-element/_config.js
new file mode 100644
index 0000000000..af1bf11a52
--- /dev/null
+++ b/test/js/samples/hydrated-void-svg-element/_config.js
@@ -0,0 +1,5 @@
+export default {
+ options: {
+ hydratable: true
+ }
+};
diff --git a/test/js/samples/hydrated-void-svg-element/expected.js b/test/js/samples/hydrated-void-svg-element/expected.js
new file mode 100644
index 0000000000..e3b525bcdd
--- /dev/null
+++ b/test/js/samples/hydrated-void-svg-element/expected.js
@@ -0,0 +1,58 @@
+/* generated by Svelte vX.Y.Z */
+import {
+ SvelteComponent,
+ append_hydration,
+ children,
+ claim_svg_element,
+ claim_text,
+ detach,
+ init,
+ insert_hydration,
+ noop,
+ safe_not_equal,
+ svg_element,
+ text
+} from "svelte/internal";
+
+function create_fragment(ctx) {
+ let svg;
+ let title;
+ let t;
+
+ return {
+ c() {
+ svg = svg_element("svg");
+ title = svg_element("title");
+ t = text("a title");
+ },
+ l(nodes) {
+ svg = claim_svg_element(nodes, "svg", {});
+ var svg_nodes = children(svg);
+ title = claim_svg_element(svg_nodes, "title", {});
+ var title_nodes = children(title);
+ t = claim_text(title_nodes, "a title");
+ title_nodes.forEach(detach);
+ svg_nodes.forEach(detach);
+ },
+ m(target, anchor) {
+ insert_hydration(target, svg, anchor);
+ append_hydration(svg, title);
+ append_hydration(title, t);
+ },
+ p: noop,
+ i: noop,
+ o: noop,
+ d(detaching) {
+ if (detaching) detach(svg);
+ }
+ };
+}
+
+class Component extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(this, options, null, create_fragment, safe_not_equal, {});
+ }
+}
+
+export default Component;
diff --git a/test/js/samples/hydrated-void-svg-element/input.svelte b/test/js/samples/hydrated-void-svg-element/input.svelte
new file mode 100644
index 0000000000..7ec3f98b64
--- /dev/null
+++ b/test/js/samples/hydrated-void-svg-element/input.svelte
@@ -0,0 +1,3 @@
+
+ a title
+
\ No newline at end of file
diff --git a/test/js/samples/if-block-no-update/expected.js b/test/js/samples/if-block-no-update/expected.js
index c67b33fa85..25f197eb1a 100644
--- a/test/js/samples/if-block-no-update/expected.js
+++ b/test/js/samples/if-block-no-update/expected.js
@@ -89,7 +89,7 @@ function instance($$self, $$props, $$invalidate) {
let { foo } = $$props;
$$self.$$set = $$props => {
- if ("foo" in $$props) $$invalidate(0, foo = $$props.foo);
+ if ('foo' in $$props) $$invalidate(0, foo = $$props.foo);
};
return [foo];
diff --git a/test/js/samples/if-block-simple/expected.js b/test/js/samples/if-block-simple/expected.js
index 4cdd73cddb..6debe92c24 100644
--- a/test/js/samples/if-block-simple/expected.js
+++ b/test/js/samples/if-block-simple/expected.js
@@ -67,7 +67,7 @@ function instance($$self, $$props, $$invalidate) {
let { foo } = $$props;
$$self.$$set = $$props => {
- if ("foo" in $$props) $$invalidate(0, foo = $$props.foo);
+ if ('foo' in $$props) $$invalidate(0, foo = $$props.foo);
};
return [foo];
diff --git a/test/js/samples/inline-style-optimized-multiple/expected.js b/test/js/samples/inline-style-optimized-multiple/expected.js
index 0a9d0a1e8e..4e4dba16d5 100644
--- a/test/js/samples/inline-style-optimized-multiple/expected.js
+++ b/test/js/samples/inline-style-optimized-multiple/expected.js
@@ -45,9 +45,9 @@ function instance($$self, $$props, $$invalidate) {
let { y } = $$props;
$$self.$$set = $$props => {
- if ("color" in $$props) $$invalidate(0, color = $$props.color);
- if ("x" in $$props) $$invalidate(1, x = $$props.x);
- if ("y" in $$props) $$invalidate(2, y = $$props.y);
+ if ('color' in $$props) $$invalidate(0, color = $$props.color);
+ if ('x' in $$props) $$invalidate(1, x = $$props.x);
+ if ('y' in $$props) $$invalidate(2, y = $$props.y);
};
return [color, x, y];
diff --git a/test/js/samples/inline-style-optimized-url/expected.js b/test/js/samples/inline-style-optimized-url/expected.js
index 0debb03585..a861e9dc7e 100644
--- a/test/js/samples/inline-style-optimized-url/expected.js
+++ b/test/js/samples/inline-style-optimized-url/expected.js
@@ -38,7 +38,7 @@ function instance($$self, $$props, $$invalidate) {
let { data } = $$props;
$$self.$$set = $$props => {
- if ("data" in $$props) $$invalidate(0, data = $$props.data);
+ if ('data' in $$props) $$invalidate(0, data = $$props.data);
};
return [data];
diff --git a/test/js/samples/inline-style-optimized/expected.js b/test/js/samples/inline-style-optimized/expected.js
index b7db0f1cf3..ea4f39ab47 100644
--- a/test/js/samples/inline-style-optimized/expected.js
+++ b/test/js/samples/inline-style-optimized/expected.js
@@ -38,7 +38,7 @@ function instance($$self, $$props, $$invalidate) {
let { color } = $$props;
$$self.$$set = $$props => {
- if ("color" in $$props) $$invalidate(0, color = $$props.color);
+ if ('color' in $$props) $$invalidate(0, color = $$props.color);
};
return [color];
diff --git a/test/js/samples/inline-style-unoptimized/expected.js b/test/js/samples/inline-style-unoptimized/expected.js
index 0688f14b9b..2900fb6ce7 100644
--- a/test/js/samples/inline-style-unoptimized/expected.js
+++ b/test/js/samples/inline-style-unoptimized/expected.js
@@ -55,9 +55,9 @@ function instance($$self, $$props, $$invalidate) {
let { value } = $$props;
$$self.$$set = $$props => {
- if ("style" in $$props) $$invalidate(0, style = $$props.style);
- if ("key" in $$props) $$invalidate(1, key = $$props.key);
- if ("value" in $$props) $$invalidate(2, value = $$props.value);
+ if ('style' in $$props) $$invalidate(0, style = $$props.style);
+ if ('key' in $$props) $$invalidate(1, key = $$props.key);
+ if ('value' in $$props) $$invalidate(2, value = $$props.value);
};
return [style, key, value];
diff --git a/test/js/samples/inline-style-without-updates/expected.js b/test/js/samples/inline-style-without-updates/expected.js
index 375896f259..ebfffe902c 100644
--- a/test/js/samples/inline-style-without-updates/expected.js
+++ b/test/js/samples/inline-style-without-updates/expected.js
@@ -30,7 +30,7 @@ function create_fragment(ctx) {
};
}
-let color = "red";
+let color = 'red';
class Component extends SvelteComponent {
constructor(options) {
diff --git a/test/js/samples/input-files/expected.js b/test/js/samples/input-files/expected.js
index 8adc7443f5..42ddddbcb3 100644
--- a/test/js/samples/input-files/expected.js
+++ b/test/js/samples/input-files/expected.js
@@ -50,7 +50,7 @@ function instance($$self, $$props, $$invalidate) {
}
$$self.$$set = $$props => {
- if ("files" in $$props) $$invalidate(0, files = $$props.files);
+ if ('files' in $$props) $$invalidate(0, files = $$props.files);
};
return [files, input_change_handler];
diff --git a/test/js/samples/input-no-initial-value/expected.js b/test/js/samples/input-no-initial-value/expected.js
index 3354aa3111..a91a95bde2 100644
--- a/test/js/samples/input-no-initial-value/expected.js
+++ b/test/js/samples/input-no-initial-value/expected.js
@@ -69,7 +69,7 @@ function instance($$self, $$props, $$invalidate) {
function handleSubmit(event) {
event.preventDefault();
- console.log("value", test);
+ console.log('value', test);
}
function input_input_handler() {
diff --git a/test/js/samples/input-range/expected.js b/test/js/samples/input-range/expected.js
index a855ca3653..7ced4b176b 100644
--- a/test/js/samples/input-range/expected.js
+++ b/test/js/samples/input-range/expected.js
@@ -61,7 +61,7 @@ function instance($$self, $$props, $$invalidate) {
}
$$self.$$set = $$props => {
- if ("value" in $$props) $$invalidate(0, value = $$props.value);
+ if ('value' in $$props) $$invalidate(0, value = $$props.value);
};
return [value, input_change_input_handler];
diff --git a/test/js/samples/input-value/expected.js b/test/js/samples/input-value/expected.js
index 781a2ae603..2491a24256 100644
--- a/test/js/samples/input-value/expected.js
+++ b/test/js/samples/input-value/expected.js
@@ -64,7 +64,7 @@ function create_fragment(ctx) {
}
function instance($$self, $$props, $$invalidate) {
- let name = "change me";
+ let name = 'change me';
function onInput(event) {
$$invalidate(0, name = event.target.value);
diff --git a/test/js/samples/input-without-blowback-guard/expected.js b/test/js/samples/input-without-blowback-guard/expected.js
index 6c5b215623..007177bda5 100644
--- a/test/js/samples/input-without-blowback-guard/expected.js
+++ b/test/js/samples/input-without-blowback-guard/expected.js
@@ -54,7 +54,7 @@ function instance($$self, $$props, $$invalidate) {
}
$$self.$$set = $$props => {
- if ("foo" in $$props) $$invalidate(0, foo = $$props.foo);
+ if ('foo' in $$props) $$invalidate(0, foo = $$props.foo);
};
return [foo, input_change_handler];
diff --git a/test/js/samples/instrumentation-script-main-block/expected.js b/test/js/samples/instrumentation-script-main-block/expected.js
index bc80924602..a471a50b37 100644
--- a/test/js/samples/instrumentation-script-main-block/expected.js
+++ b/test/js/samples/instrumentation-script-main-block/expected.js
@@ -62,7 +62,7 @@ function instance($$self, $$props, $$invalidate) {
}
};
- return [x];
+ return [x, y];
}
class Component extends SvelteComponent {
diff --git a/test/js/samples/legacy-input-type/_config.js b/test/js/samples/legacy-input-type/_config.js
index b5141be9ab..67924a4ffe 100644
--- a/test/js/samples/legacy-input-type/_config.js
+++ b/test/js/samples/legacy-input-type/_config.js
@@ -2,4 +2,4 @@ export default {
options: {
legacy: true
}
-};
\ No newline at end of file
+};
diff --git a/test/js/samples/loop-protect/expected.js b/test/js/samples/loop-protect/expected.js
index 1042b20823..04033d0d95 100644
--- a/test/js/samples/loop-protect/expected.js
+++ b/test/js/samples/loop-protect/expected.js
@@ -54,7 +54,7 @@ function create_fragment(ctx) {
}
function foo() {
- const guard = "foo";
+ const guard = 'foo';
{
const guard_1 = loop_guard(100);
@@ -68,7 +68,7 @@ function foo() {
function instance($$self, $$props, $$invalidate) {
let { $$slots: slots = {}, $$scope } = $$props;
- validate_slots("Component", slots, []);
+ validate_slots('Component', slots, []);
let node;
{
@@ -110,11 +110,11 @@ function instance($$self, $$props, $$invalidate) {
const writable_props = [];
Object.keys($$props).forEach(key => {
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console_1.warn(` was created with unknown prop '${key}'`);
+ if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1.warn(` was created with unknown prop '${key}'`);
});
function div_binding($$value) {
- binding_callbacks[$$value ? "unshift" : "push"](() => {
+ binding_callbacks[$$value ? 'unshift' : 'push'](() => {
node = $$value;
$$invalidate(0, node);
});
@@ -123,7 +123,7 @@ function instance($$self, $$props, $$invalidate) {
$$self.$capture_state = () => ({ node, foo });
$$self.$inject_state = $$props => {
- if ("node" in $$props) $$invalidate(0, node = $$props.node);
+ if ('node' in $$props) $$invalidate(0, node = $$props.node);
};
if ($$props && "$$inject" in $$props) {
diff --git a/test/js/samples/media-bindings/expected.js b/test/js/samples/media-bindings/expected.js
index 867d4a7dad..5005eb47d1 100644
--- a/test/js/samples/media-bindings/expected.js
+++ b/test/js/samples/media-bindings/expected.js
@@ -174,17 +174,17 @@ function instance($$self, $$props, $$invalidate) {
}
$$self.$$set = $$props => {
- if ("buffered" in $$props) $$invalidate(0, buffered = $$props.buffered);
- if ("seekable" in $$props) $$invalidate(1, seekable = $$props.seekable);
- if ("played" in $$props) $$invalidate(2, played = $$props.played);
- if ("currentTime" in $$props) $$invalidate(3, currentTime = $$props.currentTime);
- if ("duration" in $$props) $$invalidate(4, duration = $$props.duration);
- if ("paused" in $$props) $$invalidate(5, paused = $$props.paused);
- if ("volume" in $$props) $$invalidate(6, volume = $$props.volume);
- if ("muted" in $$props) $$invalidate(7, muted = $$props.muted);
- if ("playbackRate" in $$props) $$invalidate(8, playbackRate = $$props.playbackRate);
- if ("seeking" in $$props) $$invalidate(9, seeking = $$props.seeking);
- if ("ended" in $$props) $$invalidate(10, ended = $$props.ended);
+ if ('buffered' in $$props) $$invalidate(0, buffered = $$props.buffered);
+ if ('seekable' in $$props) $$invalidate(1, seekable = $$props.seekable);
+ if ('played' in $$props) $$invalidate(2, played = $$props.played);
+ if ('currentTime' in $$props) $$invalidate(3, currentTime = $$props.currentTime);
+ if ('duration' in $$props) $$invalidate(4, duration = $$props.duration);
+ if ('paused' in $$props) $$invalidate(5, paused = $$props.paused);
+ if ('volume' in $$props) $$invalidate(6, volume = $$props.volume);
+ if ('muted' in $$props) $$invalidate(7, muted = $$props.muted);
+ if ('playbackRate' in $$props) $$invalidate(8, playbackRate = $$props.playbackRate);
+ if ('seeking' in $$props) $$invalidate(9, seeking = $$props.seeking);
+ if ('ended' in $$props) $$invalidate(10, ended = $$props.ended);
};
return [
diff --git a/test/js/samples/non-imported-component/expected.js b/test/js/samples/non-imported-component/expected.js
index 5a6b8e8bb7..e3f2760ce0 100644
--- a/test/js/samples/non-imported-component/expected.js
+++ b/test/js/samples/non-imported-component/expected.js
@@ -14,7 +14,7 @@ import {
transition_out
} from "svelte/internal";
-import Imported from "Imported.svelte";
+import Imported from 'Imported.svelte';
function create_fragment(ctx) {
let imported;
diff --git a/test/js/samples/non-mutable-reference/expected.js b/test/js/samples/non-mutable-reference/expected.js
index 93f2145a2e..adc67b9bc4 100644
--- a/test/js/samples/non-mutable-reference/expected.js
+++ b/test/js/samples/non-mutable-reference/expected.js
@@ -29,7 +29,7 @@ function create_fragment(ctx) {
};
}
-let name = "world";
+let name = 'world';
class Component extends SvelteComponent {
constructor(options) {
diff --git a/test/js/samples/optional-chaining/expected.js b/test/js/samples/optional-chaining/expected.js
index 8aa94796c1..57369ddb72 100644
--- a/test/js/samples/optional-chaining/expected.js
+++ b/test/js/samples/optional-chaining/expected.js
@@ -23,9 +23,9 @@ function create_fragment(ctx) {
let t1_value = /*b*/ ctx[1]?.optional + "";
let t1;
let t2;
- let t3_value = /*c*/ ctx[2]["computed"] + "";
+ let t3_value = /*c*/ ctx[2]['computed'] + "";
let t3;
- let t4_value = /*d*/ ctx[3]?.["computed_optional"] + "";
+ let t4_value = /*d*/ ctx[3]?.['computed_optional'] + "";
let t4;
let t5;
let t6_value = /*e*/ ctx[4]() + "";
@@ -48,8 +48,8 @@ function create_fragment(ctx) {
props: {
a: /*a*/ ctx[0].normal,
b: /*b*/ ctx[1]?.optional,
- c: /*c*/ ctx[2]["computed"],
- d: /*d*/ ctx[3]?.["computed_optional"],
+ c: /*c*/ ctx[2]['computed'],
+ d: /*d*/ ctx[3]?.['computed_optional'],
e: /*e*/ ctx[4](),
f: /*f*/ ctx[5]?.()
}
@@ -71,8 +71,8 @@ function create_fragment(ctx) {
create_component(component.$$.fragment);
attr(div, "a", div_a_value = /*a*/ ctx[0].normal);
attr(div, "b", div_b_value = /*b*/ ctx[1]?.optional);
- attr(div, "c", div_c_value = /*c*/ ctx[2]["computed"]);
- attr(div, "d", div_d_value = /*d*/ ctx[3]?.["computed_optional"]);
+ attr(div, "c", div_c_value = /*c*/ ctx[2]['computed']);
+ attr(div, "d", div_d_value = /*d*/ ctx[3]?.['computed_optional']);
attr(div, "e", div_e_value = /*e*/ ctx[4]());
attr(div, "f", div_f_value = /*f*/ ctx[5]?.());
},
@@ -94,8 +94,8 @@ function create_fragment(ctx) {
p(ctx, [dirty]) {
if ((!current || dirty & /*a*/ 1) && t0_value !== (t0_value = /*a*/ ctx[0].normal + "")) set_data(t0, t0_value);
if ((!current || dirty & /*b*/ 2) && t1_value !== (t1_value = /*b*/ ctx[1]?.optional + "")) set_data(t1, t1_value);
- if ((!current || dirty & /*c*/ 4) && t3_value !== (t3_value = /*c*/ ctx[2]["computed"] + "")) set_data(t3, t3_value);
- if ((!current || dirty & /*d*/ 8) && t4_value !== (t4_value = /*d*/ ctx[3]?.["computed_optional"] + "")) set_data(t4, t4_value);
+ if ((!current || dirty & /*c*/ 4) && t3_value !== (t3_value = /*c*/ ctx[2]['computed'] + "")) set_data(t3, t3_value);
+ if ((!current || dirty & /*d*/ 8) && t4_value !== (t4_value = /*d*/ ctx[3]?.['computed_optional'] + "")) set_data(t4, t4_value);
if ((!current || dirty & /*e*/ 16) && t6_value !== (t6_value = /*e*/ ctx[4]() + "")) set_data(t6, t6_value);
if ((!current || dirty & /*f*/ 32) && t7_value !== (t7_value = /*f*/ ctx[5]?.() + "")) set_data(t7, t7_value);
@@ -107,11 +107,11 @@ function create_fragment(ctx) {
attr(div, "b", div_b_value);
}
- if (!current || dirty & /*c*/ 4 && div_c_value !== (div_c_value = /*c*/ ctx[2]["computed"])) {
+ if (!current || dirty & /*c*/ 4 && div_c_value !== (div_c_value = /*c*/ ctx[2]['computed'])) {
attr(div, "c", div_c_value);
}
- if (!current || dirty & /*d*/ 8 && div_d_value !== (div_d_value = /*d*/ ctx[3]?.["computed_optional"])) {
+ if (!current || dirty & /*d*/ 8 && div_d_value !== (div_d_value = /*d*/ ctx[3]?.['computed_optional'])) {
attr(div, "d", div_d_value);
}
@@ -126,8 +126,8 @@ function create_fragment(ctx) {
const component_changes = {};
if (dirty & /*a*/ 1) component_changes.a = /*a*/ ctx[0].normal;
if (dirty & /*b*/ 2) component_changes.b = /*b*/ ctx[1]?.optional;
- if (dirty & /*c*/ 4) component_changes.c = /*c*/ ctx[2]["computed"];
- if (dirty & /*d*/ 8) component_changes.d = /*d*/ ctx[3]?.["computed_optional"];
+ if (dirty & /*c*/ 4) component_changes.c = /*c*/ ctx[2]['computed'];
+ if (dirty & /*d*/ 8) component_changes.d = /*d*/ ctx[3]?.['computed_optional'];
if (dirty & /*e*/ 16) component_changes.e = /*e*/ ctx[4]();
if (dirty & /*f*/ 32) component_changes.f = /*f*/ ctx[5]?.();
component.$set(component_changes);
@@ -168,12 +168,12 @@ function instance($$self, $$props, $$invalidate) {
let Component;
$$self.$$set = $$props => {
- if ("a" in $$props) $$invalidate(0, a = $$props.a);
- if ("b" in $$props) $$invalidate(1, b = $$props.b);
- if ("c" in $$props) $$invalidate(2, c = $$props.c);
- if ("d" in $$props) $$invalidate(3, d = $$props.d);
- if ("e" in $$props) $$invalidate(4, e = $$props.e);
- if ("f" in $$props) $$invalidate(5, f = $$props.f);
+ if ('a' in $$props) $$invalidate(0, a = $$props.a);
+ if ('b' in $$props) $$invalidate(1, b = $$props.b);
+ if ('c' in $$props) $$invalidate(2, c = $$props.c);
+ if ('d' in $$props) $$invalidate(3, d = $$props.d);
+ if ('e' in $$props) $$invalidate(4, e = $$props.e);
+ if ('f' in $$props) $$invalidate(5, f = $$props.f);
};
return [a, b, c, d, e, f, Component];
diff --git a/test/js/samples/reactive-class-optimized/expected.js b/test/js/samples/reactive-class-optimized/expected.js
new file mode 100644
index 0000000000..1d0606ad60
--- /dev/null
+++ b/test/js/samples/reactive-class-optimized/expected.js
@@ -0,0 +1,162 @@
+/* generated by Svelte vX.Y.Z */
+import {
+ SvelteComponent,
+ component_subscribe,
+ detach,
+ element,
+ init,
+ insert,
+ noop,
+ safe_not_equal,
+ space,
+ subscribe,
+ toggle_class
+} from "svelte/internal";
+
+import { reactiveStoreVal, unreactiveExport } from './store';
+
+function create_fragment(ctx) {
+ let div0;
+ let t0;
+ let div1;
+ let t1;
+ let div2;
+ let t2;
+ let div3;
+ let t3;
+ let div4;
+ let t4;
+ let div5;
+ let t5;
+ let div6;
+ let t6;
+ let div7;
+ let t7;
+ let div8;
+
+ return {
+ c() {
+ div0 = element("div");
+ t0 = space();
+ div1 = element("div");
+ t1 = space();
+ div2 = element("div");
+ t2 = space();
+ div3 = element("div");
+ t3 = space();
+ div4 = element("div");
+ t4 = space();
+ div5 = element("div");
+ t5 = space();
+ div6 = element("div");
+ t6 = space();
+ div7 = element("div");
+ t7 = space();
+ div8 = element("div");
+ toggle_class(div0, "update1", reactiveModuleVar);
+ toggle_class(div1, "update2", /*reactiveConst*/ ctx[0].x);
+ toggle_class(div2, "update3", nonReactiveGlobal && /*reactiveConst*/ ctx[0].x);
+ toggle_class(div3, "update4", /*$reactiveStoreVal*/ ctx[2]);
+ toggle_class(div4, "update5", /*$reactiveDeclaration*/ ctx[3]);
+ toggle_class(div5, "static1", nonReactiveModuleVar);
+ toggle_class(div6, "static2", nonReactiveGlobal);
+ toggle_class(div7, "static3", nonReactiveModuleVar && nonReactiveGlobal);
+ toggle_class(div8, "static4", unreactiveExport);
+ },
+ m(target, anchor) {
+ insert(target, div0, anchor);
+ insert(target, t0, anchor);
+ insert(target, div1, anchor);
+ insert(target, t1, anchor);
+ insert(target, div2, anchor);
+ insert(target, t2, anchor);
+ insert(target, div3, anchor);
+ insert(target, t3, anchor);
+ insert(target, div4, anchor);
+ insert(target, t4, anchor);
+ insert(target, div5, anchor);
+ insert(target, t5, anchor);
+ insert(target, div6, anchor);
+ insert(target, t6, anchor);
+ insert(target, div7, anchor);
+ insert(target, t7, anchor);
+ insert(target, div8, anchor);
+ },
+ p(ctx, [dirty]) {
+ if (dirty & /*reactiveModuleVar*/ 0) {
+ toggle_class(div0, "update1", reactiveModuleVar);
+ }
+
+ if (dirty & /*reactiveConst*/ 1) {
+ toggle_class(div1, "update2", /*reactiveConst*/ ctx[0].x);
+ }
+
+ if (dirty & /*nonReactiveGlobal, reactiveConst*/ 1) {
+ toggle_class(div2, "update3", nonReactiveGlobal && /*reactiveConst*/ ctx[0].x);
+ }
+
+ if (dirty & /*$reactiveStoreVal*/ 4) {
+ toggle_class(div3, "update4", /*$reactiveStoreVal*/ ctx[2]);
+ }
+
+ if (dirty & /*$reactiveDeclaration*/ 8) {
+ toggle_class(div4, "update5", /*$reactiveDeclaration*/ ctx[3]);
+ }
+ },
+ i: noop,
+ o: noop,
+ d(detaching) {
+ if (detaching) detach(div0);
+ if (detaching) detach(t0);
+ if (detaching) detach(div1);
+ if (detaching) detach(t1);
+ if (detaching) detach(div2);
+ if (detaching) detach(t2);
+ if (detaching) detach(div3);
+ if (detaching) detach(t3);
+ if (detaching) detach(div4);
+ if (detaching) detach(t4);
+ if (detaching) detach(div5);
+ if (detaching) detach(t5);
+ if (detaching) detach(div6);
+ if (detaching) detach(t6);
+ if (detaching) detach(div7);
+ if (detaching) detach(t7);
+ if (detaching) detach(div8);
+ }
+ };
+}
+
+let nonReactiveModuleVar = Math.random();
+let reactiveModuleVar = Math.random();
+
+function instance($$self, $$props, $$invalidate) {
+ let reactiveDeclaration;
+ let $reactiveStoreVal;
+
+ let $reactiveDeclaration,
+ $$unsubscribe_reactiveDeclaration = noop,
+ $$subscribe_reactiveDeclaration = () => ($$unsubscribe_reactiveDeclaration(), $$unsubscribe_reactiveDeclaration = subscribe(reactiveDeclaration, $$value => $$invalidate(3, $reactiveDeclaration = $$value)), reactiveDeclaration);
+
+ component_subscribe($$self, reactiveStoreVal, $$value => $$invalidate(2, $reactiveStoreVal = $$value));
+ $$self.$$.on_destroy.push(() => $$unsubscribe_reactiveDeclaration());
+ nonReactiveGlobal = Math.random();
+ const reactiveConst = { x: Math.random() };
+ reactiveModuleVar += 1;
+
+ if (Math.random()) {
+ reactiveConst.x += 1;
+ }
+
+ $: $$subscribe_reactiveDeclaration($$invalidate(1, reactiveDeclaration = reactiveModuleVar * 2));
+ return [reactiveConst, reactiveDeclaration, $reactiveStoreVal, $reactiveDeclaration];
+}
+
+class Component extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(this, options, instance, create_fragment, safe_not_equal, {});
+ }
+}
+
+export default Component;
\ No newline at end of file
diff --git a/test/js/samples/reactive-class-optimized/input.svelte b/test/js/samples/reactive-class-optimized/input.svelte
new file mode 100644
index 0000000000..f10fd11290
--- /dev/null
+++ b/test/js/samples/reactive-class-optimized/input.svelte
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/js/samples/reactive-class-optimized/store.js b/test/js/samples/reactive-class-optimized/store.js
new file mode 100644
index 0000000000..bd91f0ece3
--- /dev/null
+++ b/test/js/samples/reactive-class-optimized/store.js
@@ -0,0 +1,4 @@
+import { writable } from '../../../../store';
+
+export const reactiveStoreVal = writable(0);
+export const unreactiveExport = true;
diff --git a/test/js/samples/reactive-values-non-topologically-ordered/expected.js b/test/js/samples/reactive-values-non-topologically-ordered/expected.js
index 15290496d5..82af20ee90 100644
--- a/test/js/samples/reactive-values-non-topologically-ordered/expected.js
+++ b/test/js/samples/reactive-values-non-topologically-ordered/expected.js
@@ -7,20 +7,20 @@ function instance($$self, $$props, $$invalidate) {
let b;
$$self.$$set = $$props => {
- if ("x" in $$props) $$invalidate(0, x = $$props.x);
+ if ('x' in $$props) $$invalidate(0, x = $$props.x);
};
$$self.$$.update = () => {
if ($$self.$$.dirty & /*x*/ 1) {
- $: $$invalidate(2, b = x);
+ $: $$invalidate(1, b = x);
}
- if ($$self.$$.dirty & /*b*/ 4) {
+ if ($$self.$$.dirty & /*b*/ 2) {
$: a = b;
}
};
- return [x];
+ return [x, b];
}
class Component extends SvelteComponent {
diff --git a/test/js/samples/reactive-values-non-writable-dependencies/expected.js b/test/js/samples/reactive-values-non-writable-dependencies/expected.js
index 5196a770d9..ca01bda65b 100644
--- a/test/js/samples/reactive-values-non-writable-dependencies/expected.js
+++ b/test/js/samples/reactive-values-non-writable-dependencies/expected.js
@@ -6,13 +6,13 @@ function instance($$self, $$props, $$invalidate) {
let { b = 2 } = $$props;
$$self.$$set = $$props => {
- if ("a" in $$props) $$invalidate(0, a = $$props.a);
- if ("b" in $$props) $$invalidate(1, b = $$props.b);
+ if ('a' in $$props) $$invalidate(0, a = $$props.a);
+ if ('b' in $$props) $$invalidate(1, b = $$props.b);
};
$$self.$$.update = () => {
if ($$self.$$.dirty & /*a, b*/ 3) {
- $: console.log("max", Math.max(a, b));
+ $: console.log('max', Math.max(a, b));
}
};
diff --git a/test/js/samples/select-dynamic-value/expected.js b/test/js/samples/select-dynamic-value/expected.js
index 8777cd2600..cd1ab1d812 100644
--- a/test/js/samples/select-dynamic-value/expected.js
+++ b/test/js/samples/select-dynamic-value/expected.js
@@ -51,7 +51,7 @@ function instance($$self, $$props, $$invalidate) {
let { current } = $$props;
$$self.$$set = $$props => {
- if ("current" in $$props) $$invalidate(0, current = $$props.current);
+ if ('current' in $$props) $$invalidate(0, current = $$props.current);
};
return [current];
diff --git a/test/js/samples/src-attribute-check-in-foreign/_config.js b/test/js/samples/src-attribute-check-in-foreign/_config.js
new file mode 100644
index 0000000000..af1bf11a52
--- /dev/null
+++ b/test/js/samples/src-attribute-check-in-foreign/_config.js
@@ -0,0 +1,5 @@
+export default {
+ options: {
+ hydratable: true
+ }
+};
diff --git a/test/js/samples/src-attribute-check-in-foreign/expected.js b/test/js/samples/src-attribute-check-in-foreign/expected.js
new file mode 100644
index 0000000000..3d781b72d4
--- /dev/null
+++ b/test/js/samples/src-attribute-check-in-foreign/expected.js
@@ -0,0 +1,70 @@
+/* generated by Svelte vX.Y.Z */
+import {
+ SvelteComponent,
+ append_hydration,
+ attr,
+ children,
+ claim_element,
+ detach,
+ init,
+ insert_hydration,
+ noop,
+ safe_not_equal
+} from "svelte/internal";
+
+function create_fragment(ctx) {
+ let svg;
+ let img;
+
+ return {
+ c() {
+ svg = document.createElementNS("https://svelte.dev/docs#svelte_options", "svg");
+ img = document.createElementNS("https://svelte.dev/docs#svelte_options", "img");
+ this.h();
+ },
+ l(nodes) {
+ svg = claim_element(nodes, "svg", {});
+ var svg_nodes = children(svg);
+ img = claim_element(svg_nodes, "img", { alt: true, src: true });
+ svg_nodes.forEach(detach);
+ this.h();
+ },
+ h() {
+ attr(img, "alt", "potato");
+ attr(img, "src", /*url*/ ctx[0]);
+ },
+ m(target, anchor) {
+ insert_hydration(target, svg, anchor);
+ append_hydration(svg, img);
+ },
+ p(ctx, [dirty]) {
+ if (dirty & /*url*/ 1) {
+ attr(img, "src", /*url*/ ctx[0]);
+ }
+ },
+ i: noop,
+ o: noop,
+ d(detaching) {
+ if (detaching) detach(svg);
+ }
+ };
+}
+
+function instance($$self, $$props, $$invalidate) {
+ let { url } = $$props;
+
+ $$self.$$set = $$props => {
+ if ('url' in $$props) $$invalidate(0, url = $$props.url);
+ };
+
+ return [url];
+}
+
+class Component extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(this, options, instance, create_fragment, safe_not_equal, { url: 0 });
+ }
+}
+
+export default Component;
diff --git a/test/js/samples/src-attribute-check-in-foreign/input.svelte b/test/js/samples/src-attribute-check-in-foreign/input.svelte
new file mode 100644
index 0000000000..6d04f0fa55
--- /dev/null
+++ b/test/js/samples/src-attribute-check-in-foreign/input.svelte
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
diff --git a/test/js/samples/src-attribute-check-in-svg/_config.js b/test/js/samples/src-attribute-check-in-svg/_config.js
new file mode 100644
index 0000000000..af1bf11a52
--- /dev/null
+++ b/test/js/samples/src-attribute-check-in-svg/_config.js
@@ -0,0 +1,5 @@
+export default {
+ options: {
+ hydratable: true
+ }
+};
diff --git a/test/js/samples/src-attribute-check-in-svg/expected.js b/test/js/samples/src-attribute-check-in-svg/expected.js
new file mode 100644
index 0000000000..551a23e50e
--- /dev/null
+++ b/test/js/samples/src-attribute-check-in-svg/expected.js
@@ -0,0 +1,71 @@
+/* generated by Svelte vX.Y.Z */
+import {
+ SvelteComponent,
+ append_hydration,
+ attr,
+ children,
+ claim_svg_element,
+ detach,
+ init,
+ insert_hydration,
+ noop,
+ safe_not_equal,
+ svg_element
+} from "svelte/internal";
+
+function create_fragment(ctx) {
+ let svg;
+ let img;
+
+ return {
+ c() {
+ svg = svg_element("svg");
+ img = svg_element("img");
+ this.h();
+ },
+ l(nodes) {
+ svg = claim_svg_element(nodes, "svg", {});
+ var svg_nodes = children(svg);
+ img = claim_svg_element(svg_nodes, "img", { alt: true, src: true });
+ svg_nodes.forEach(detach);
+ this.h();
+ },
+ h() {
+ attr(img, "alt", "potato");
+ attr(img, "src", /*url*/ ctx[0]);
+ },
+ m(target, anchor) {
+ insert_hydration(target, svg, anchor);
+ append_hydration(svg, img);
+ },
+ p(ctx, [dirty]) {
+ if (dirty & /*url*/ 1) {
+ attr(img, "src", /*url*/ ctx[0]);
+ }
+ },
+ i: noop,
+ o: noop,
+ d(detaching) {
+ if (detaching) detach(svg);
+ }
+ };
+}
+
+function instance($$self, $$props, $$invalidate) {
+ let { url } = $$props;
+
+ $$self.$$set = $$props => {
+ if ('url' in $$props) $$invalidate(0, url = $$props.url);
+ };
+
+ return [url];
+}
+
+class Component extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(this, options, instance, create_fragment, safe_not_equal, { url: 0 });
+ }
+}
+
+export default Component;
diff --git a/test/js/samples/src-attribute-check-in-svg/input.svelte b/test/js/samples/src-attribute-check-in-svg/input.svelte
new file mode 100644
index 0000000000..05dbc37608
--- /dev/null
+++ b/test/js/samples/src-attribute-check-in-svg/input.svelte
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/test/js/samples/src-attribute-check/_config.js b/test/js/samples/src-attribute-check/_config.js
index 84c0d733ef..af1bf11a52 100644
--- a/test/js/samples/src-attribute-check/_config.js
+++ b/test/js/samples/src-attribute-check/_config.js
@@ -2,4 +2,4 @@ export default {
options: {
hydratable: true
}
-};
\ No newline at end of file
+};
diff --git a/test/js/samples/src-attribute-check/expected.js b/test/js/samples/src-attribute-check/expected.js
index 93638edfb4..10ff49bb81 100644
--- a/test/js/samples/src-attribute-check/expected.js
+++ b/test/js/samples/src-attribute-check/expected.js
@@ -7,10 +7,11 @@ import {
detach,
element,
init,
- insert,
+ insert_hydration,
noop,
safe_not_equal,
- space
+ space,
+ src_url_equal
} from "svelte/internal";
function create_fragment(ctx) {
@@ -35,21 +36,21 @@ function create_fragment(ctx) {
},
h() {
attr(img0, "alt", "potato");
- if (img0.src !== (img0_src_value = /*url*/ ctx[0])) attr(img0, "src", img0_src_value);
+ if (!src_url_equal(img0.src, img0_src_value = /*url*/ ctx[0])) attr(img0, "src", img0_src_value);
attr(img1, "alt", "potato");
- if (img1.src !== (img1_src_value = "" + (/*slug*/ ctx[1] + ".jpg"))) attr(img1, "src", img1_src_value);
+ if (!src_url_equal(img1.src, img1_src_value = "" + (/*slug*/ ctx[1] + ".jpg"))) attr(img1, "src", img1_src_value);
},
m(target, anchor) {
- insert(target, img0, anchor);
- insert(target, t, anchor);
- insert(target, img1, anchor);
+ insert_hydration(target, img0, anchor);
+ insert_hydration(target, t, anchor);
+ insert_hydration(target, img1, anchor);
},
p(ctx, [dirty]) {
- if (dirty & /*url*/ 1 && img0.src !== (img0_src_value = /*url*/ ctx[0])) {
+ if (dirty & /*url*/ 1 && !src_url_equal(img0.src, img0_src_value = /*url*/ ctx[0])) {
attr(img0, "src", img0_src_value);
}
- if (dirty & /*slug*/ 2 && img1.src !== (img1_src_value = "" + (/*slug*/ ctx[1] + ".jpg"))) {
+ if (dirty & /*slug*/ 2 && !src_url_equal(img1.src, img1_src_value = "" + (/*slug*/ ctx[1] + ".jpg"))) {
attr(img1, "src", img1_src_value);
}
},
@@ -68,8 +69,8 @@ function instance($$self, $$props, $$invalidate) {
let { slug } = $$props;
$$self.$$set = $$props => {
- if ("url" in $$props) $$invalidate(0, url = $$props.url);
- if ("slug" in $$props) $$invalidate(1, slug = $$props.slug);
+ if ('url' in $$props) $$invalidate(0, url = $$props.url);
+ if ('slug' in $$props) $$invalidate(1, slug = $$props.slug);
};
return [url, slug];
@@ -82,4 +83,4 @@ class Component extends SvelteComponent {
}
}
-export default Component;
\ No newline at end of file
+export default Component;
diff --git a/test/js/samples/ssr-no-oncreate-etc/_config.js b/test/js/samples/ssr-no-oncreate-etc/_config.js
index 803712adec..bee4ab630c 100644
--- a/test/js/samples/ssr-no-oncreate-etc/_config.js
+++ b/test/js/samples/ssr-no-oncreate-etc/_config.js
@@ -2,4 +2,4 @@ export default {
options: {
generate: 'ssr'
}
-};
\ No newline at end of file
+};
diff --git a/test/js/samples/ssr-no-oncreate-etc/expected.js b/test/js/samples/ssr-no-oncreate-etc/expected.js
index b91deb3e97..09ae6fd4a6 100644
--- a/test/js/samples/ssr-no-oncreate-etc/expected.js
+++ b/test/js/samples/ssr-no-oncreate-etc/expected.js
@@ -1,14 +1,14 @@
/* generated by Svelte vX.Y.Z */
import { create_ssr_component } from "svelte/internal";
-import { onDestroy, onMount } from "svelte";
+import { onDestroy, onMount } from 'svelte';
function preload(input) {
return output;
}
function foo() {
- console.log("foo");
+ console.log('foo');
}
function swipe(node, callback) {
@@ -17,11 +17,11 @@ function swipe(node, callback) {
const Component = create_ssr_component(($$result, $$props, $$bindings, slots) => {
onMount(() => {
- console.log("onMount");
+ console.log('onMount');
});
onDestroy(() => {
- console.log("onDestroy");
+ console.log('onDestroy');
});
return ``;
diff --git a/test/js/samples/ssr-preserve-comments/expected.js b/test/js/samples/ssr-preserve-comments/expected.js
index de9fa7582e..4f3326cec5 100644
--- a/test/js/samples/ssr-preserve-comments/expected.js
+++ b/test/js/samples/ssr-preserve-comments/expected.js
@@ -3,8 +3,8 @@ import { create_ssr_component } from "svelte/internal";
const Component = create_ssr_component(($$result, $$props, $$bindings, slots) => {
return `content
-
+
more content
`;
});
-export default Component;
\ No newline at end of file
+export default Component;
diff --git a/test/js/samples/title/expected.js b/test/js/samples/title/expected.js
index b10f569759..6385f36acc 100644
--- a/test/js/samples/title/expected.js
+++ b/test/js/samples/title/expected.js
@@ -23,7 +23,7 @@ function instance($$self, $$props, $$invalidate) {
let { custom } = $$props;
$$self.$$set = $$props => {
- if ("custom" in $$props) $$invalidate(0, custom = $$props.custom);
+ if ('custom' in $$props) $$invalidate(0, custom = $$props.custom);
};
return [custom];
diff --git a/test/js/samples/transition-local/expected.js b/test/js/samples/transition-local/expected.js
index ea3d9db3d7..1824ccb066 100644
--- a/test/js/samples/transition-local/expected.js
+++ b/test/js/samples/transition-local/expected.js
@@ -125,8 +125,8 @@ function instance($$self, $$props, $$invalidate) {
let { y } = $$props;
$$self.$$set = $$props => {
- if ("x" in $$props) $$invalidate(0, x = $$props.x);
- if ("y" in $$props) $$invalidate(1, y = $$props.y);
+ if ('x' in $$props) $$invalidate(0, x = $$props.x);
+ if ('y' in $$props) $$invalidate(1, y = $$props.y);
};
return [x, y];
diff --git a/test/js/samples/transition-repeated-outro/expected.js b/test/js/samples/transition-repeated-outro/expected.js
index 12483ab91a..a2cbedffea 100644
--- a/test/js/samples/transition-repeated-outro/expected.js
+++ b/test/js/samples/transition-repeated-outro/expected.js
@@ -14,7 +14,7 @@ import {
transition_out
} from "svelte/internal";
-import { fade } from "svelte/transition";
+import { fade } from 'svelte/transition';
function create_if_block(ctx) {
let div;
@@ -103,7 +103,7 @@ function instance($$self, $$props, $$invalidate) {
let { num = 1 } = $$props;
$$self.$$set = $$props => {
- if ("num" in $$props) $$invalidate(0, num = $$props.num);
+ if ('num' in $$props) $$invalidate(0, num = $$props.num);
};
return [num];
diff --git a/test/js/samples/unchanged-expression/expected.js b/test/js/samples/unchanged-expression/expected.js
index 673d5b6abc..48ae8131ff 100644
--- a/test/js/samples/unchanged-expression/expected.js
+++ b/test/js/samples/unchanged-expression/expected.js
@@ -69,14 +69,14 @@ function create_fragment(ctx) {
};
}
-let world1 = "world";
-let world2 = "world";
+let world1 = 'world';
+let world2 = 'world';
function instance($$self, $$props, $$invalidate) {
- const world3 = "world";
+ const world3 = 'world';
function foo() {
- $$invalidate(0, world3 = "svelte");
+ $$invalidate(0, world3 = 'svelte');
}
return [world3];
diff --git a/test/js/samples/unreferenced-state-not-invalidated/expected.js b/test/js/samples/unreferenced-state-not-invalidated/expected.js
index b10ea815b9..8c238a8397 100644
--- a/test/js/samples/unreferenced-state-not-invalidated/expected.js
+++ b/test/js/samples/unreferenced-state-not-invalidated/expected.js
@@ -12,7 +12,7 @@ import {
text
} from "svelte/internal";
-import { onMount } from "svelte";
+import { onMount } from 'svelte';
function create_fragment(ctx) {
let p;
@@ -39,6 +39,8 @@ function create_fragment(ctx) {
}
function instance($$self, $$props, $$invalidate) {
+ let x;
+ let y;
let a = 1, b = 2, c = 3;
onMount(() => {
@@ -54,9 +56,6 @@ function instance($$self, $$props, $$invalidate) {
return () => clearInterval(interval);
});
- let x;
- let y;
-
$$self.$$.update = () => {
if ($$self.$$.dirty & /*b*/ 2) {
$: $$invalidate(0, y = b * 2);
@@ -64,7 +63,7 @@ function instance($$self, $$props, $$invalidate) {
};
$: x = a * 2;
- return [y];
+ return [y, b];
}
class Component extends SvelteComponent {
diff --git a/test/js/samples/use-elements-as-anchors/expected.js b/test/js/samples/use-elements-as-anchors/expected.js
index d07411518e..8a45cb54c8 100644
--- a/test/js/samples/use-elements-as-anchors/expected.js
+++ b/test/js/samples/use-elements-as-anchors/expected.js
@@ -244,11 +244,11 @@ function instance($$self, $$props, $$invalidate) {
let { e } = $$props;
$$self.$$set = $$props => {
- if ("a" in $$props) $$invalidate(0, a = $$props.a);
- if ("b" in $$props) $$invalidate(1, b = $$props.b);
- if ("c" in $$props) $$invalidate(2, c = $$props.c);
- if ("d" in $$props) $$invalidate(3, d = $$props.d);
- if ("e" in $$props) $$invalidate(4, e = $$props.e);
+ if ('a' in $$props) $$invalidate(0, a = $$props.a);
+ if ('b' in $$props) $$invalidate(1, b = $$props.b);
+ if ('c' in $$props) $$invalidate(2, c = $$props.c);
+ if ('d' in $$props) $$invalidate(3, d = $$props.d);
+ if ('e' in $$props) $$invalidate(4, e = $$props.e);
};
return [a, b, c, d, e];
diff --git a/test/js/samples/video-bindings/expected.js b/test/js/samples/video-bindings/expected.js
index 8afa670bbb..020bab574c 100644
--- a/test/js/samples/video-bindings/expected.js
+++ b/test/js/samples/video-bindings/expected.js
@@ -94,10 +94,10 @@ function instance($$self, $$props, $$invalidate) {
}
$$self.$$set = $$props => {
- if ("currentTime" in $$props) $$invalidate(0, currentTime = $$props.currentTime);
- if ("videoHeight" in $$props) $$invalidate(1, videoHeight = $$props.videoHeight);
- if ("videoWidth" in $$props) $$invalidate(2, videoWidth = $$props.videoWidth);
- if ("offsetWidth" in $$props) $$invalidate(3, offsetWidth = $$props.offsetWidth);
+ if ('currentTime' in $$props) $$invalidate(0, currentTime = $$props.currentTime);
+ if ('videoHeight' in $$props) $$invalidate(1, videoHeight = $$props.videoHeight);
+ if ('videoWidth' in $$props) $$invalidate(2, videoWidth = $$props.videoWidth);
+ if ('offsetWidth' in $$props) $$invalidate(3, offsetWidth = $$props.offsetWidth);
};
return [
diff --git a/test/js/samples/window-binding-scroll/expected.js b/test/js/samples/window-binding-scroll/expected.js
index 09a4d3737d..ae155d42bf 100644
--- a/test/js/samples/window-binding-scroll/expected.js
+++ b/test/js/samples/window-binding-scroll/expected.js
@@ -79,7 +79,7 @@ function instance($$self, $$props, $$invalidate) {
}
$$self.$$set = $$props => {
- if ("y" in $$props) $$invalidate(0, y = $$props.y);
+ if ('y' in $$props) $$invalidate(0, y = $$props.y);
};
return [y, onwindowscroll];
diff --git a/test/parser/samples/action-duplicate/input.svelte b/test/parser/samples/action-duplicate/input.svelte
new file mode 100644
index 0000000000..11b2515483
--- /dev/null
+++ b/test/parser/samples/action-duplicate/input.svelte
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/test/parser/samples/action-duplicate/output.json b/test/parser/samples/action-duplicate/output.json
new file mode 100644
index 0000000000..30469ceb48
--- /dev/null
+++ b/test/parser/samples/action-duplicate/output.json
@@ -0,0 +1,34 @@
+{
+ "html": {
+ "start": 0,
+ "end": 35,
+ "type": "Fragment",
+ "children": [
+ {
+ "start": 0,
+ "end": 35,
+ "type": "Element",
+ "name": "input",
+ "attributes": [
+ {
+ "start": 7,
+ "end": 20,
+ "type": "Action",
+ "name": "autofocus",
+ "modifiers": [],
+ "expression": null
+ },
+ {
+ "start": 21,
+ "end": 34,
+ "type": "Action",
+ "name": "autofocus",
+ "modifiers": [],
+ "expression": null
+ }
+ ],
+ "children": []
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/test/parser/samples/attribute-curly-bracket/input.svelte b/test/parser/samples/attribute-curly-bracket/input.svelte
new file mode 100644
index 0000000000..4e40713771
--- /dev/null
+++ b/test/parser/samples/attribute-curly-bracket/input.svelte
@@ -0,0 +1 @@
+
diff --git a/test/parser/samples/attribute-curly-bracket/output.json b/test/parser/samples/attribute-curly-bracket/output.json
new file mode 100644
index 0000000000..7fa04859f3
--- /dev/null
+++ b/test/parser/samples/attribute-curly-bracket/output.json
@@ -0,0 +1,55 @@
+{
+ "html": {
+ "start": 0,
+ "end": 18,
+ "type": "Fragment",
+ "children": [
+ {
+ "start": 0,
+ "end": 18,
+ "type": "Element",
+ "name": "input",
+ "attributes": [
+ {
+ "start": 7,
+ "end": 15,
+ "type": "Attribute",
+ "name": "foo",
+ "value": [
+ {
+ "start": 11,
+ "end": 12,
+ "type": "Text",
+ "raw": "a",
+ "data": "a"
+ },
+ {
+ "start": 12,
+ "end": 15,
+ "type": "MustacheTag",
+ "expression": {
+ "type": "Literal",
+ "start": 13,
+ "end": 14,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 14
+ }
+ },
+ "value": 1,
+ "raw": "1"
+ }
+ }
+ ]
+ }
+ ],
+ "children": []
+ }
+ ]
+ }
+}
diff --git a/test/parser/samples/attribute-dynamic/output.json b/test/parser/samples/attribute-dynamic/output.json
index 28b9da1dea..4926b645ab 100644
--- a/test/parser/samples/attribute-dynamic/output.json
+++ b/test/parser/samples/attribute-dynamic/output.json
@@ -18,7 +18,7 @@
"value": [
{
"start": 12,
- "end": 20,
+ "end": 19,
"type": "Text",
"raw": "color: ",
"data": "color: "
@@ -80,4 +80,4 @@
}
]
}
-}
\ No newline at end of file
+}
diff --git a/test/parser/samples/attribute-empty-error/error.json b/test/parser/samples/attribute-empty-error/error.json
new file mode 100644
index 0000000000..8c004d34ed
--- /dev/null
+++ b/test/parser/samples/attribute-empty-error/error.json
@@ -0,0 +1,10 @@
+{
+ "code": "missing-attribute-value",
+ "message": "Expected value for the attribute",
+ "pos": 12,
+ "start": {
+ "character": 12,
+ "column": 12,
+ "line": 1
+ }
+}
\ No newline at end of file
diff --git a/test/parser/samples/attribute-empty-error/input.svelte b/test/parser/samples/attribute-empty-error/input.svelte
new file mode 100644
index 0000000000..ee1b8935f1
--- /dev/null
+++ b/test/parser/samples/attribute-empty-error/input.svelte
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/test/parser/samples/attribute-empty/input.svelte b/test/parser/samples/attribute-empty/input.svelte
new file mode 100644
index 0000000000..d500678c37
--- /dev/null
+++ b/test/parser/samples/attribute-empty/input.svelte
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/test/parser/samples/attribute-empty/output.json b/test/parser/samples/attribute-empty/output.json
new file mode 100644
index 0000000000..22420b9fda
--- /dev/null
+++ b/test/parser/samples/attribute-empty/output.json
@@ -0,0 +1,108 @@
+{
+ "html": {
+ "start": 0,
+ "end": 38,
+ "type": "Fragment",
+ "children": [
+ {
+ "start": 0,
+ "end": 38,
+ "type": "Element",
+ "name": "div",
+ "attributes": [
+ {
+ "start": 5,
+ "end": 9,
+ "type": "Attribute",
+ "name": "a",
+ "value": [
+ {
+ "start": 8,
+ "end": 8,
+ "type": "Text",
+ "raw": "",
+ "data": ""
+ }
+ ]
+ },
+ {
+ "start": 10,
+ "end": 16,
+ "type": "Attribute",
+ "name": "b",
+ "value": [
+ {
+ "start": 12,
+ "end": 16,
+ "type": "MustacheTag",
+ "expression": {
+ "type": "Literal",
+ "start": 13,
+ "end": 15,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 13
+ },
+ "end": {
+ "line": 1,
+ "column": 15
+ }
+ },
+ "value": "",
+ "raw": "''"
+ }
+ }
+ ]
+ },
+ {
+ "start": 17,
+ "end": 21,
+ "type": "Attribute",
+ "name": "c",
+ "value": [
+ {
+ "start": 20,
+ "end": 20,
+ "type": "Text",
+ "raw": "",
+ "data": ""
+ }
+ ]
+ },
+ {
+ "start": 22,
+ "end": 30,
+ "type": "Attribute",
+ "name": "d",
+ "value": [
+ {
+ "start": 25,
+ "end": 29,
+ "type": "MustacheTag",
+ "expression": {
+ "type": "Literal",
+ "start": 26,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 26
+ },
+ "end": {
+ "line": 1,
+ "column": 28
+ }
+ },
+ "value": "",
+ "raw": "''"
+ }
+ }
+ ]
+ }
+ ],
+ "children": []
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/test/parser/samples/comment-with-ignores/input.svelte b/test/parser/samples/comment-with-ignores/input.svelte
new file mode 100644
index 0000000000..c4fcec5e50
--- /dev/null
+++ b/test/parser/samples/comment-with-ignores/input.svelte
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/test/parser/samples/comment-with-ignores/output.json b/test/parser/samples/comment-with-ignores/output.json
new file mode 100644
index 0000000000..2705ec6658
--- /dev/null
+++ b/test/parser/samples/comment-with-ignores/output.json
@@ -0,0 +1,16 @@
+{
+ "html": {
+ "start": 0,
+ "end": 30,
+ "type": "Fragment",
+ "children": [
+ {
+ "start": 0,
+ "end": 30,
+ "type": "Comment",
+ "data": " svelte-ignore foo bar ",
+ "ignores": ["foo", "bar"]
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/test/parser/samples/comment/output.json b/test/parser/samples/comment/output.json
index 2a57c4fa5d..097fe994cf 100644
--- a/test/parser/samples/comment/output.json
+++ b/test/parser/samples/comment/output.json
@@ -8,7 +8,8 @@
"start": 0,
"end": 18,
"type": "Comment",
- "data": " a comment "
+ "data": " a comment ",
+ "ignores": []
}
]
}
diff --git a/test/parser/samples/css/output.json b/test/parser/samples/css/output.json
index 676b11f6a9..a39f718cf1 100644
--- a/test/parser/samples/css/output.json
+++ b/test/parser/samples/css/output.json
@@ -37,7 +37,7 @@
"children": [
{
"type": "Rule",
- "selector": {
+ "prelude": {
"type": "SelectorList",
"children": [
{
@@ -74,7 +74,7 @@
"end": 43
}
],
- "start": 39,
+ "start": 40,
"end": 43
},
"start": 33,
diff --git a/test/parser/samples/element-with-attribute-empty-string/input.svelte b/test/parser/samples/element-with-attribute-empty-string/input.svelte
new file mode 100644
index 0000000000..685c0995d5
--- /dev/null
+++ b/test/parser/samples/element-with-attribute-empty-string/input.svelte
@@ -0,0 +1,2 @@
+
+
diff --git a/test/parser/samples/element-with-attribute-empty-string/output.json b/test/parser/samples/element-with-attribute-empty-string/output.json
new file mode 100644
index 0000000000..8e8768eb62
--- /dev/null
+++ b/test/parser/samples/element-with-attribute-empty-string/output.json
@@ -0,0 +1,64 @@
+{
+ "html": {
+ "start": 0,
+ "end": 43,
+ "type": "Fragment",
+ "children": [
+ {
+ "start": 0,
+ "end": 21,
+ "type": "Element",
+ "name": "span",
+ "attributes": [
+ {
+ "start": 6,
+ "end": 13,
+ "type": "Attribute",
+ "name": "attr",
+ "value": [
+ {
+ "start": 12,
+ "end": 12,
+ "type": "Text",
+ "raw": "",
+ "data": ""
+ }
+ ]
+ }
+ ],
+ "children": []
+ },
+ {
+ "start": 21,
+ "end": 22,
+ "type": "Text",
+ "raw": "\n",
+ "data": "\n"
+ },
+ {
+ "start": 22,
+ "end": 43,
+ "type": "Element",
+ "name": "span",
+ "attributes": [
+ {
+ "start": 28,
+ "end": 35,
+ "type": "Attribute",
+ "name": "attr",
+ "value": [
+ {
+ "start": 34,
+ "end": 34,
+ "type": "Text",
+ "raw": "",
+ "data": ""
+ }
+ ]
+ }
+ ],
+ "children": []
+ }
+ ]
+ }
+}
diff --git a/test/parser/samples/element-with-attribute/input.svelte b/test/parser/samples/element-with-attribute/input.svelte
new file mode 100644
index 0000000000..f564fd0541
--- /dev/null
+++ b/test/parser/samples/element-with-attribute/input.svelte
@@ -0,0 +1,2 @@
+
+
diff --git a/test/parser/samples/element-with-attribute/output.json b/test/parser/samples/element-with-attribute/output.json
new file mode 100644
index 0000000000..a80344101e
--- /dev/null
+++ b/test/parser/samples/element-with-attribute/output.json
@@ -0,0 +1,64 @@
+{
+ "html": {
+ "start": 0,
+ "end": 49,
+ "type": "Fragment",
+ "children": [
+ {
+ "start": 0,
+ "end": 24,
+ "type": "Element",
+ "name": "span",
+ "attributes": [
+ {
+ "start": 6,
+ "end": 16,
+ "type": "Attribute",
+ "name": "attr",
+ "value": [
+ {
+ "start": 12,
+ "end": 15,
+ "type": "Text",
+ "raw": "foo",
+ "data": "foo"
+ }
+ ]
+ }
+ ],
+ "children": []
+ },
+ {
+ "start": 24,
+ "end": 25,
+ "type": "Text",
+ "raw": "\n",
+ "data": "\n"
+ },
+ {
+ "start": 25,
+ "end": 49,
+ "type": "Element",
+ "name": "span",
+ "attributes": [
+ {
+ "start": 31,
+ "end": 41,
+ "type": "Attribute",
+ "name": "attr",
+ "value": [
+ {
+ "start": 37,
+ "end": 40,
+ "type": "Text",
+ "raw": "bar",
+ "data": "bar"
+ }
+ ]
+ }
+ ],
+ "children": []
+ }
+ ]
+ }
+}
diff --git a/test/parser/samples/error-comment-unclosed/error.json b/test/parser/samples/error-comment-unclosed/error.json
index 8e355fb821..95fa28c35a 100644
--- a/test/parser/samples/error-comment-unclosed/error.json
+++ b/test/parser/samples/error-comment-unclosed/error.json
@@ -1,5 +1,5 @@
{
- "code": "unexpected-eof",
+ "code": "unclosed-comment",
"message": "comment was left open, expected -->",
"start": {
"line": 1,
diff --git a/test/parser/samples/error-empty-attribute-shorthand/error.json b/test/parser/samples/error-empty-attribute-shorthand/error.json
new file mode 100644
index 0000000000..f465b3468a
--- /dev/null
+++ b/test/parser/samples/error-empty-attribute-shorthand/error.json
@@ -0,0 +1,10 @@
+{
+ "code": "empty-attribute-shorthand",
+ "message": "Attribute shorthand cannot be empty",
+ "start": {
+ "line": 1,
+ "column": 6,
+ "character": 6
+ },
+ "pos": 6
+}
\ No newline at end of file
diff --git a/test/parser/samples/error-empty-attribute-shorthand/input.svelte b/test/parser/samples/error-empty-attribute-shorthand/input.svelte
new file mode 100644
index 0000000000..2e137c8c6d
--- /dev/null
+++ b/test/parser/samples/error-empty-attribute-shorthand/input.svelte
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/test/parser/samples/error-empty-classname-binding/error.json b/test/parser/samples/error-empty-classname-binding/error.json
new file mode 100644
index 0000000000..6ece5ff373
--- /dev/null
+++ b/test/parser/samples/error-empty-classname-binding/error.json
@@ -0,0 +1,10 @@
+{
+ "code": "empty-directive-name",
+ "message": "Class name cannot be empty",
+ "start": {
+ "line": 1,
+ "column": 10,
+ "character": 10
+ },
+ "pos": 10
+}
diff --git a/test/parser/samples/error-empty-classname-binding/input.svelte b/test/parser/samples/error-empty-classname-binding/input.svelte
new file mode 100644
index 0000000000..3a4e5980ee
--- /dev/null
+++ b/test/parser/samples/error-empty-classname-binding/input.svelte
@@ -0,0 +1 @@
+Hello
diff --git a/test/parser/samples/error-empty-directive-name/error.json b/test/parser/samples/error-empty-directive-name/error.json
new file mode 100644
index 0000000000..4fed0d8606
--- /dev/null
+++ b/test/parser/samples/error-empty-directive-name/error.json
@@ -0,0 +1,10 @@
+{
+ "code": "empty-directive-name",
+ "message": "Action name cannot be empty",
+ "start": {
+ "line": 1,
+ "column": 8,
+ "character": 8
+ },
+ "pos": 8
+}
diff --git a/test/parser/samples/error-empty-directive-name/input.svelte b/test/parser/samples/error-empty-directive-name/input.svelte
new file mode 100644
index 0000000000..b07875f398
--- /dev/null
+++ b/test/parser/samples/error-empty-directive-name/input.svelte
@@ -0,0 +1 @@
+Hello
diff --git a/test/parser/samples/error-script-unclosed-eof/error.json b/test/parser/samples/error-script-unclosed-eof/error.json
new file mode 100644
index 0000000000..277acd4196
--- /dev/null
+++ b/test/parser/samples/error-script-unclosed-eof/error.json
@@ -0,0 +1,10 @@
+{
+ "code": "unclosed-script",
+ "message": "
+
+Hello {name}!
\ No newline at end of file
diff --git a/test/parser/samples/whitespace-after-script-tag/output.json b/test/parser/samples/whitespace-after-script-tag/output.json
new file mode 100644
index 0000000000..903c392685
--- /dev/null
+++ b/test/parser/samples/whitespace-after-script-tag/output.json
@@ -0,0 +1,150 @@
+{
+ "html": {
+ "start": 51,
+ "end": 73,
+ "type": "Fragment",
+ "children": [
+ {
+ "start": 49,
+ "end": 51,
+ "type": "Text",
+ "raw": "\n\n",
+ "data": "\n\n"
+ },
+ {
+ "start": 51,
+ "end": 73,
+ "type": "Element",
+ "name": "h1",
+ "attributes": [],
+ "children": [
+ {
+ "start": 55,
+ "end": 61,
+ "type": "Text",
+ "raw": "Hello ",
+ "data": "Hello "
+ },
+ {
+ "start": 61,
+ "end": 67,
+ "type": "MustacheTag",
+ "expression": {
+ "type": "Identifier",
+ "start": 62,
+ "end": 66,
+ "loc": {
+ "start": {
+ "line": 10,
+ "column": 11
+ },
+ "end": {
+ "line": 10,
+ "column": 15
+ }
+ },
+ "name": "name"
+ }
+ },
+ {
+ "start": 67,
+ "end": 68,
+ "type": "Text",
+ "raw": "!",
+ "data": "!"
+ }
+ ]
+ }
+ ]
+ },
+ "instance": {
+ "type": "Script",
+ "start": 0,
+ "end": 49,
+ "context": "default",
+ "content": {
+ "type": "Program",
+ "start": 8,
+ "end": 30,
+ "loc": {
+ "start": {
+ "line": 1,
+ "column": 0
+ },
+ "end": {
+ "line": 3,
+ "column": 0
+ }
+ },
+ "body": [
+ {
+ "type": "VariableDeclaration",
+ "start": 10,
+ "end": 29,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 1
+ },
+ "end": {
+ "line": 2,
+ "column": 20
+ }
+ },
+ "declarations": [
+ {
+ "type": "VariableDeclarator",
+ "start": 14,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "id": {
+ "type": "Identifier",
+ "start": 14,
+ "end": 18,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 5
+ },
+ "end": {
+ "line": 2,
+ "column": 9
+ }
+ },
+ "name": "name"
+ },
+ "init": {
+ "type": "Literal",
+ "start": 21,
+ "end": 28,
+ "loc": {
+ "start": {
+ "line": 2,
+ "column": 12
+ },
+ "end": {
+ "line": 2,
+ "column": 19
+ }
+ },
+ "value": "world",
+ "raw": "'world'"
+ }
+ }
+ ],
+ "kind": "let"
+ }
+ ],
+ "sourceType": "module"
+ }
+ }
+}
\ No newline at end of file
diff --git a/test/parser/samples/whitespace-after-style-tag/input.svelte b/test/parser/samples/whitespace-after-style-tag/input.svelte
new file mode 100644
index 0000000000..ae4277b697
--- /dev/null
+++ b/test/parser/samples/whitespace-after-style-tag/input.svelte
@@ -0,0 +1,12 @@
+foo
+
+
\ No newline at end of file
diff --git a/test/parser/samples/whitespace-after-style-tag/output.json b/test/parser/samples/whitespace-after-style-tag/output.json
new file mode 100644
index 0000000000..5eee81f034
--- /dev/null
+++ b/test/parser/samples/whitespace-after-style-tag/output.json
@@ -0,0 +1,97 @@
+{
+ "html": {
+ "start": 0,
+ "end": 14,
+ "type": "Fragment",
+ "children": [
+ {
+ "start": 0,
+ "end": 14,
+ "type": "Element",
+ "name": "div",
+ "attributes": [],
+ "children": [
+ {
+ "start": 5,
+ "end": 8,
+ "type": "Text",
+ "raw": "foo",
+ "data": "foo"
+ }
+ ]
+ },
+ {
+ "start": 14,
+ "end": 16,
+ "type": "Text",
+ "raw": "\n\n",
+ "data": "\n\n"
+ }
+ ]
+ },
+ "css": {
+ "type": "Style",
+ "start": 16,
+ "end": 66,
+ "attributes": [],
+ "children": [
+ {
+ "type": "Rule",
+ "prelude": {
+ "type": "SelectorList",
+ "children": [
+ {
+ "type": "Selector",
+ "children": [
+ {
+ "type": "TypeSelector",
+ "name": "div",
+ "start": 25,
+ "end": 28
+ }
+ ],
+ "start": 25,
+ "end": 28
+ }
+ ],
+ "start": 25,
+ "end": 28
+ },
+ "block": {
+ "type": "Block",
+ "children": [
+ {
+ "type": "Declaration",
+ "important": false,
+ "property": "color",
+ "value": {
+ "type": "Value",
+ "children": [
+ {
+ "type": "Identifier",
+ "name": "red",
+ "start": 40,
+ "end": 43
+ }
+ ],
+ "start": 40,
+ "end": 43
+ },
+ "start": 33,
+ "end": 43
+ }
+ ],
+ "start": 29,
+ "end": 47
+ },
+ "start": 25,
+ "end": 47
+ }
+ ],
+ "content": {
+ "start": 23,
+ "end": 48,
+ "styles": "\n\tdiv {\n\t\tcolor: red;\n\t}\n"
+ }
+ }
+}
\ No newline at end of file
diff --git a/test/preprocess/index.ts b/test/preprocess/index.ts
index abb45012ce..be898bbbfd 100644
--- a/test/preprocess/index.ts
+++ b/test/preprocess/index.ts
@@ -8,17 +8,25 @@ describe('preprocess', () => {
const config = loadConfig(`${__dirname}/samples/${dir}/_config.js`);
const solo = config.solo || /\.solo/.test(dir);
+ const skip = config.skip || /\.skip/.test(dir);
if (solo && process.env.CI) {
throw new Error('Forgot to remove `solo: true` from test');
}
- (config.skip ? it.skip : solo ? it.only : it)(dir, async () => {
+ (skip ? it.skip : solo ? it.only : it)(dir, async () => {
const input = fs.readFileSync(`${__dirname}/samples/${dir}/input.svelte`, 'utf-8');
const expected = fs.readFileSync(`${__dirname}/samples/${dir}/output.svelte`, 'utf-8');
- const result = await svelte.preprocess(input, config.preprocess);
+ const result = await svelte.preprocess(
+ input,
+ config.preprocess || {},
+ config.options || { filename: 'input.svelte' }
+ );
fs.writeFileSync(`${__dirname}/samples/${dir}/_actual.html`, result.code);
+ if (result.map) {
+ fs.writeFileSync(`${__dirname}/samples/${dir}/_actual.html.map`, JSON.stringify(result.map, null, 2));
+ }
assert.equal(result.code, expected);
diff --git a/test/preprocess/samples/dependencies/_config.js b/test/preprocess/samples/dependencies/_config.js
index fa2d8b40c9..4656cd98f9 100644
--- a/test/preprocess/samples/dependencies/_config.js
+++ b/test/preprocess/samples/dependencies/_config.js
@@ -12,4 +12,4 @@ export default {
},
dependencies: ['./foo.css']
-};
\ No newline at end of file
+};
diff --git a/test/preprocess/samples/empty-sourcemap/_config.js b/test/preprocess/samples/empty-sourcemap/_config.js
new file mode 100644
index 0000000000..941661ce01
--- /dev/null
+++ b/test/preprocess/samples/empty-sourcemap/_config.js
@@ -0,0 +1,7 @@
+export default {
+ preprocess: {
+ style: ({ content }) => {
+ return { code: content, map: { mappings: '' } };
+ }
+ }
+};
diff --git a/test/preprocess/samples/empty-sourcemap/input.svelte b/test/preprocess/samples/empty-sourcemap/input.svelte
new file mode 100644
index 0000000000..d2380c00cb
--- /dev/null
+++ b/test/preprocess/samples/empty-sourcemap/input.svelte
@@ -0,0 +1,7 @@
+bar
+
+
\ No newline at end of file
diff --git a/test/preprocess/samples/empty-sourcemap/output.svelte b/test/preprocess/samples/empty-sourcemap/output.svelte
new file mode 100644
index 0000000000..d2380c00cb
--- /dev/null
+++ b/test/preprocess/samples/empty-sourcemap/output.svelte
@@ -0,0 +1,7 @@
+bar
+
+
\ No newline at end of file
diff --git a/test/preprocess/samples/filename/_config.js b/test/preprocess/samples/filename/_config.js
index c71cdafcac..161f084730 100644
--- a/test/preprocess/samples/filename/_config.js
+++ b/test/preprocess/samples/filename/_config.js
@@ -1,6 +1,5 @@
export default {
preprocess: {
- filename: 'file.svelte',
markup: ({ content, filename }) => {
return {
code: content.replace('__MARKUP_FILENAME__', filename)
@@ -16,5 +15,8 @@ export default {
code: content.replace('__SCRIPT_FILENAME__', filename)
};
}
+ },
+ options: {
+ filename: 'file.svelte'
}
-};
\ No newline at end of file
+};
diff --git a/test/preprocess/samples/ignores-null/_config.js b/test/preprocess/samples/ignores-null/_config.js
index 042ee89aed..08ba71c748 100644
--- a/test/preprocess/samples/ignores-null/_config.js
+++ b/test/preprocess/samples/ignores-null/_config.js
@@ -2,4 +2,4 @@ export default {
preprocess: {
script: () => null
}
-};
\ No newline at end of file
+};
diff --git a/test/preprocess/samples/markup/_config.js b/test/preprocess/samples/markup/_config.js
index 857da608af..13044d4132 100644
--- a/test/preprocess/samples/markup/_config.js
+++ b/test/preprocess/samples/markup/_config.js
@@ -6,4 +6,4 @@ export default {
};
}
}
-};
\ No newline at end of file
+};
diff --git a/test/preprocess/samples/multiple-preprocessors/_config.js b/test/preprocess/samples/multiple-preprocessors/_config.js
index 8a57567f6b..d6226203cc 100644
--- a/test/preprocess/samples/multiple-preprocessors/_config.js
+++ b/test/preprocess/samples/multiple-preprocessors/_config.js
@@ -11,4 +11,4 @@ export default {
style: ({ content }) => ({ code: content.replace(/three/g, 'four') })
}
]
-};
\ No newline at end of file
+};
diff --git a/test/preprocess/samples/script-multiple/_config.js b/test/preprocess/samples/script-multiple/_config.js
index d6656ff48e..a523efe9bc 100644
--- a/test/preprocess/samples/script-multiple/_config.js
+++ b/test/preprocess/samples/script-multiple/_config.js
@@ -6,4 +6,4 @@ export default {
};
}
}
-};
\ No newline at end of file
+};
diff --git a/test/preprocess/samples/script/_config.js b/test/preprocess/samples/script/_config.js
index 8e8ac1d2f9..1a21045465 100644
--- a/test/preprocess/samples/script/_config.js
+++ b/test/preprocess/samples/script/_config.js
@@ -6,4 +6,4 @@ export default {
};
}
}
-};
\ No newline at end of file
+};
diff --git a/test/preprocess/samples/style-async/_config.js b/test/preprocess/samples/style-async/_config.js
index a91f8f4307..00298a0bfb 100644
--- a/test/preprocess/samples/style-async/_config.js
+++ b/test/preprocess/samples/style-async/_config.js
@@ -6,4 +6,4 @@ export default {
});
}
}
-};
\ No newline at end of file
+};
diff --git a/test/preprocess/samples/style-attributes/_config.js b/test/preprocess/samples/style-attributes/_config.js
index 7a619054bd..ac2955397b 100644
--- a/test/preprocess/samples/style-attributes/_config.js
+++ b/test/preprocess/samples/style-attributes/_config.js
@@ -11,4 +11,4 @@ export default {
return { code: 'PROCESSED' };
}
}
-};
\ No newline at end of file
+};
diff --git a/test/preprocess/samples/style/_config.js b/test/preprocess/samples/style/_config.js
index 59040eccdd..19da7ea384 100644
--- a/test/preprocess/samples/style/_config.js
+++ b/test/preprocess/samples/style/_config.js
@@ -6,4 +6,4 @@ export default {
};
}
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime-puppeteer/assert.js b/test/runtime-puppeteer/assert.js
new file mode 100644
index 0000000000..4ee8d9dda0
--- /dev/null
+++ b/test/runtime-puppeteer/assert.js
@@ -0,0 +1,54 @@
+export function deepEqual(a, b, message) {
+ if (!is_equal(a, b)) {
+ throw new Error(message || `Expected ${JSON.stringify(a)} to equal ${JSON.stringify(b)}`);
+ }
+}
+
+function is_equal(a, b) {
+ if (a && typeof a === 'object') {
+ const is_array = Array.isArray(a);
+ if (Array.isArray(b) !== is_array) return false;
+
+ if (is_array) {
+ if (a.length !== b.length) return false;
+ return a.every((value, i) => is_equal(value, b[i]));
+ }
+
+ const a_keys = Object.keys(a).sort();
+ const b_keys = Object.keys(b).sort();
+ if (a_keys.join(',') !== b_keys.join(',')) return false;
+
+ return a_keys.every(key => is_equal(a[key], b[key]));
+ }
+
+ return a === b;
+}
+
+export function equal(a, b, message) {
+ if (a != b) throw new Error(message || `Expected ${a} to equal ${b}`);
+}
+
+export function ok(condition, message) {
+ if (!condition) throw new Error(message || `Expected ${condition} to be truthy`);
+}
+
+export function htmlEqual(actual, expected, message) {
+ return deepEqual(
+ normalizeHtml(window, actual),
+ normalizeHtml(window, expected),
+ message
+ );
+}
+
+function normalizeHtml(window, html) {
+ try {
+ const node = window.document.createElement('div');
+ node.innerHTML = html
+ .replace(//g, '')
+ .replace(/>[\s\r\n]+<')
+ .trim();
+ return node.innerHTML.replace(/<\/?noscript\/?>/g, '');
+ } catch (err) {
+ throw new Error(`Failed to normalize HTML:\n${html}`);
+ }
+}
diff --git a/test/runtime-puppeteer/index.ts b/test/runtime-puppeteer/index.ts
new file mode 100644
index 0000000000..b700d47945
--- /dev/null
+++ b/test/runtime-puppeteer/index.ts
@@ -0,0 +1,250 @@
+import * as path from 'path';
+import * as fs from 'fs';
+import * as http from 'http';
+import { rollup } from 'rollup';
+import virtual from '@rollup/plugin-virtual';
+import puppeteer from 'puppeteer';
+
+import {
+ loadConfig,
+ loadSvelte,
+ mkdirp,
+ prettyPrintPuppeteerAssertionError
+} from '../helpers';
+import { deepEqual } from 'assert';
+
+const page = `
+
+
+
+
+`;
+
+let svelte;
+let server;
+let code;
+let browser;
+
+const internal = path.resolve('internal/index.mjs');
+const index = path.resolve('index.mjs');
+
+function create_server() {
+ return new Promise((fulfil, reject) => {
+ const server = http.createServer((req, res) => {
+ if (req.url === '/') {
+ res.end(page);
+ }
+
+ if (req.url === '/bundle.js') {
+ res.end(code);
+ }
+ });
+
+ server.on('error', reject);
+
+ server.listen('6789', () => {
+ fulfil(server);
+ });
+ });
+}
+
+const assert = fs.readFileSync(`${__dirname}/assert.js`, 'utf-8');
+
+describe('runtime (puppeteer)', () => {
+ before(async () => {
+ svelte = loadSvelte(false);
+ console.log('[runtime-puppeteer] Loaded Svelte');
+ server = await create_server();
+ console.log('[runtime-puppeteer] Started server');
+ browser = await puppeteer.launch();
+ console.log('[runtime-puppeteer] Launched puppeteer browser');
+ });
+
+ after(async () => {
+ if (server) server.close();
+ if (browser) await browser.close();
+ });
+
+ const failed = new Set();
+
+ function runTest(dir, hydrate) {
+ if (dir[0] === '.') return;
+
+ const config = loadConfig(`${__dirname}/samples/${dir}/_config.js`);
+ const solo = config.solo || /\.solo/.test(dir);
+ const skip = config.skip || /\.skip/.test(dir);
+
+ if (hydrate && config.skip_if_hydrate) return;
+
+ if (solo && process.env.CI) {
+ throw new Error('Forgot to remove `solo: true` from test');
+ }
+
+ (skip ? it.skip : solo ? it.only : it)(`${dir} ${hydrate ? '(with hydration)' : ''}`, async () => {
+ if (failed.has(dir)) {
+ // this makes debugging easier, by only printing compiled output once
+ throw new Error('skipping test, already failed');
+ }
+
+ const warnings = [];
+
+ const bundle = await rollup({
+ input: 'main',
+ plugins: [
+ {
+ name: 'testing-runtime-puppeteer',
+ resolveId(importee) {
+ if (importee === 'svelte/internal' || importee === './internal') {
+ return internal;
+ }
+
+ if (importee === 'svelte') {
+ return index;
+ }
+
+ if (importee === 'main') {
+ return 'main';
+ }
+ },
+ load(id) {
+ if (id === 'main') {
+ return `
+ import SvelteComponent from ${JSON.stringify(path.join(__dirname, 'samples', dir, 'main.svelte'))};
+ import config from ${JSON.stringify(path.join(__dirname, 'samples', dir, '_config.js'))};
+ import * as assert from 'assert';
+
+ export default async function (target) {
+ let unhandled_rejection = false;
+ function unhandled_rejection_handler(event) {
+ unhandled_rejection = event.reason;
+ }
+ window.addEventListener('unhandledrejection', unhandled_rejection_handler);
+
+ try {
+ if (config.before_test) config.before_test();
+
+ const options = Object.assign({}, {
+ target,
+ hydrate: ${String(!!hydrate)},
+ props: config.props,
+ intro: config.intro
+ }, config.options || {});
+
+ const component = new SvelteComponent(options);
+
+ if (config.html) {
+ assert.htmlEqual(target.innerHTML, config.html);
+ }
+
+ if (config.test) {
+ await config.test({
+ assert,
+ component,
+ target,
+ window,
+ });
+
+ component.$destroy();
+
+ if (unhandled_rejection) {
+ throw unhandled_rejection;
+ }
+ } else {
+ component.$destroy();
+ assert.htmlEqual(target.innerHTML, '');
+
+ if (unhandled_rejection) {
+ throw unhandled_rejection;
+ }
+ }
+
+ if (config.after_test) config.after_test();
+ } catch (error) {
+ if (config.error) {
+ assert.equal(err.message, config.error);
+ } else {
+ throw error;
+ }
+ } finally {
+ window.removeEventListener('unhandledrejection', unhandled_rejection_handler);
+ }
+ }
+ `;
+ }
+ return null;
+ },
+ transform(code, id) {
+ if (id.endsWith('.svelte')) {
+ const compiled = svelte.compile(code.replace(/\r/g, ''), {
+ ...config.compileOptions,
+ hydratable: hydrate,
+ immutable: config.immutable,
+ accessors: 'accessors' in config ? config.accessors : true
+ });
+
+ const out_dir = `${__dirname}/samples/${dir}/_output/${hydrate ? 'hydratable' : 'normal'}`;
+ const out = `${out_dir}/${path.basename(id).replace(/\.svelte$/, '.js')}`;
+
+ if (fs.existsSync(out)) {
+ fs.unlinkSync(out);
+ }
+
+ mkdirp(out_dir);
+ fs.writeFileSync(out, compiled.js.code, 'utf8');
+
+ compiled.warnings.forEach(w => warnings.push(w));
+
+ return compiled.js;
+ }
+ }
+ },
+ virtual({ assert })
+ ]
+ });
+
+ const result = await bundle.generate({ format: 'iife', name: 'test' });
+ code = result.output[0].code;
+
+ const page = await browser.newPage();
+
+ page.on('console', (type) => {
+ console[type._type](type._text);
+ });
+
+ page.on('error', error => {
+ console.log('>>> an error happened');
+ console.error(error);
+ });
+
+ try {
+ await page.goto('http://localhost:6789');
+
+ const result = await page.evaluate(() => test(document.querySelector('main')));
+ if (result) console.log(result);
+ } catch (err) {
+ failed.add(dir);
+ prettyPrintPuppeteerAssertionError(err.message);
+ throw err;
+ } finally {
+ if (config.warnings) {
+ deepEqual(warnings.map(w => ({
+ code: w.code,
+ message: w.message,
+ pos: w.pos,
+ start: w.start,
+ end: w.end
+ })), config.warnings);
+ } else if (warnings.length) {
+ failed.add(dir);
+ /* eslint-disable no-unsafe-finally */
+ throw new Error('Received unexpected warnings');
+ }
+ }
+ });
+ }
+
+ fs.readdirSync(`${__dirname}/samples`).forEach(dir => {
+ runTest(dir, false);
+ runTest(dir, true);
+ });
+});
diff --git a/test/runtime-puppeteer/samples/component-css-custom-properties-dynamic/Slider.svelte b/test/runtime-puppeteer/samples/component-css-custom-properties-dynamic/Slider.svelte
new file mode 100644
index 0000000000..4863966f85
--- /dev/null
+++ b/test/runtime-puppeteer/samples/component-css-custom-properties-dynamic/Slider.svelte
@@ -0,0 +1,17 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/test/runtime-puppeteer/samples/component-css-custom-properties-dynamic/_config.js b/test/runtime-puppeteer/samples/component-css-custom-properties-dynamic/_config.js
new file mode 100644
index 0000000000..96965c223b
--- /dev/null
+++ b/test/runtime-puppeteer/samples/component-css-custom-properties-dynamic/_config.js
@@ -0,0 +1,41 @@
+export default {
+ props: {
+ railColor1: 'black',
+ trackColor1: 'red',
+ railColor2: 'green',
+ trackColor2: 'blue'
+ },
+ html: `
+
+
+ `,
+ test({ component, assert, target }) {
+ component.railColor1 = 'yellow';
+ component.trackColor2 = 'orange';
+
+ assert.htmlEqual(target.innerHTML, `
+
+
+ `);
+ }
+};
diff --git a/test/runtime-puppeteer/samples/component-css-custom-properties-dynamic/main.svelte b/test/runtime-puppeteer/samples/component-css-custom-properties-dynamic/main.svelte
new file mode 100644
index 0000000000..94e68e38a2
--- /dev/null
+++ b/test/runtime-puppeteer/samples/component-css-custom-properties-dynamic/main.svelte
@@ -0,0 +1,23 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/test/runtime-puppeteer/samples/component-css-custom-properties/Slider.svelte b/test/runtime-puppeteer/samples/component-css-custom-properties/Slider.svelte
new file mode 100644
index 0000000000..4863966f85
--- /dev/null
+++ b/test/runtime-puppeteer/samples/component-css-custom-properties/Slider.svelte
@@ -0,0 +1,17 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/test/runtime-puppeteer/samples/component-css-custom-properties/_config.js b/test/runtime-puppeteer/samples/component-css-custom-properties/_config.js
new file mode 100644
index 0000000000..9c3b7cbdea
--- /dev/null
+++ b/test/runtime-puppeteer/samples/component-css-custom-properties/_config.js
@@ -0,0 +1,27 @@
+export default {
+ html: `
+
+
+ `,
+ test({ target, window, assert }) {
+ const railColor1 = target.querySelector('#slider-1 p');
+ const trackColor1 = target.querySelector('#slider-1 span');
+ const railColor2 = target.querySelector('#slider-2 p');
+ const trackColor2 = target.querySelector('#slider-2 span');
+
+ assert.htmlEqual(window.getComputedStyle(railColor1).color, 'rgb(0, 0, 0)');
+ assert.htmlEqual(window.getComputedStyle(trackColor1).color, 'rgb(255, 0, 0)');
+ assert.htmlEqual(window.getComputedStyle(railColor2).color, 'rgb(0, 255, 0)');
+ assert.htmlEqual(window.getComputedStyle(trackColor2).color, 'rgb(0, 0, 255)');
+ }
+};
diff --git a/test/runtime-puppeteer/samples/component-css-custom-properties/main.svelte b/test/runtime-puppeteer/samples/component-css-custom-properties/main.svelte
new file mode 100644
index 0000000000..0d92b7ae87
--- /dev/null
+++ b/test/runtime-puppeteer/samples/component-css-custom-properties/main.svelte
@@ -0,0 +1,15 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/test/runtime/index.ts b/test/runtime/index.ts
index 153ac9dbb8..e777196ae2 100644
--- a/test/runtime/index.ts
+++ b/test/runtime/index.ts
@@ -25,12 +25,13 @@ let compile = null;
const sveltePath = process.cwd().split('\\').join('/');
let unhandled_rejection = false;
-process.on('unhandledRejection', err => {
+function unhandledRejection_handler(err) {
unhandled_rejection = err;
-});
+}
describe('runtime', () => {
before(() => {
+ process.on('unhandledRejection', unhandledRejection_handler);
svelte = loadSvelte(false);
svelte$ = loadSvelte(true);
@@ -46,22 +47,25 @@ describe('runtime', () => {
return setupHtmlEqual();
});
+ after(() => process.removeListener('unhandledRejection', unhandledRejection_handler));
const failed = new Set();
- function runTest(dir, hydrate) {
+ function runTest(dir, hydrate, from_ssr_html) {
if (dir[0] === '.') return;
const config = loadConfig(`${__dirname}/samples/${dir}/_config.js`);
const solo = config.solo || /\.solo/.test(dir);
if (hydrate && config.skip_if_hydrate) return;
+ if (hydrate && from_ssr_html && config.skip_if_hydrate_from_ssr) return;
if (solo && process.env.CI) {
throw new Error('Forgot to remove `solo: true` from test');
}
- (config.skip ? it.skip : solo ? it.only : it)(`${dir} ${hydrate ? '(with hydration)' : ''}`, () => {
+ const testName = `${dir} ${hydrate ? `(with hydration${from_ssr_html ? ' from ssr rendered html' : ''})` : ''}`;
+ (config.skip ? it.skip : solo ? it.only : it)(testName, () => {
if (failed.has(dir)) {
// this makes debugging easier, by only printing compiled output once
throw new Error('skipping test, already failed');
@@ -146,13 +150,25 @@ describe('runtime', () => {
throw err;
}
- if (config.before_test) config.before_test();
-
// Put things we need on window for testing
window.SvelteComponent = SvelteComponent;
const target = window.document.querySelector('main');
+ if (hydrate && from_ssr_html) {
+ // ssr into target
+ compileOptions.generate = 'ssr';
+ cleanRequireCache();
+ const SsrSvelteComponent = require(`./samples/${dir}/main.svelte`).default;
+ const { html } = SsrSvelteComponent.render(config.props);
+ target.innerHTML = html;
+ delete compileOptions.generate;
+ } else {
+ target.innerHTML = '';
+ }
+
+ if (config.before_test) config.before_test();
+
const warnings = [];
const warn = console.warn;
console.warn = warning => {
@@ -245,7 +261,8 @@ describe('runtime', () => {
fs.readdirSync(`${__dirname}/samples`).forEach(dir => {
runTest(dir, false);
- runTest(dir, true);
+ runTest(dir, true, false);
+ runTest(dir, true, true);
});
async function create_component(src = '
') {
diff --git a/test/runtime/samples/$$slot/_config.js b/test/runtime/samples/$$slot/_config.js
index 13b2137cdb..46e435ae97 100644
--- a/test/runtime/samples/$$slot/_config.js
+++ b/test/runtime/samples/$$slot/_config.js
@@ -11,7 +11,7 @@ export default {
hello world
`,
- async test({ assert, target, component }) {
+ async test({ assert, component }) {
assert.equal(component.getA(), '');
assert.equal(component.getB(), 'foo');
}
diff --git a/test/runtime/samples/action-body/_config.js b/test/runtime/samples/action-body/_config.js
new file mode 100644
index 0000000000..c882499e0e
--- /dev/null
+++ b/test/runtime/samples/action-body/_config.js
@@ -0,0 +1,18 @@
+export default {
+ html: '
',
+
+ async test({ assert, target, window }) {
+ const enter = new window.MouseEvent('mouseenter');
+ const leave = new window.MouseEvent('mouseleave');
+
+ await window.document.body.dispatchEvent(enter);
+ assert.htmlEqual(target.innerHTML, `
+
+ `);
+
+ await window.document.body.dispatchEvent(leave);
+ assert.htmlEqual(target.innerHTML, '
');
+ }
+};
diff --git a/test/runtime/samples/action-body/main.svelte b/test/runtime/samples/action-body/main.svelte
new file mode 100644
index 0000000000..dd57116577
--- /dev/null
+++ b/test/runtime/samples/action-body/main.svelte
@@ -0,0 +1,32 @@
+
+
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/action-custom-event-handler-node-context/_config.js b/test/runtime/samples/action-custom-event-handler-node-context/_config.js
index ea94abe9b3..9a5d0d5f82 100644
--- a/test/runtime/samples/action-custom-event-handler-node-context/_config.js
+++ b/test/runtime/samples/action-custom-event-handler-node-context/_config.js
@@ -3,7 +3,7 @@ export default {
html: '10 ',
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const event = new window.MouseEvent('click');
const button = target.querySelector('button');
diff --git a/test/runtime/samples/action-custom-event-handler-this/_config.js b/test/runtime/samples/action-custom-event-handler-this/_config.js
index ec3fa373eb..29c2059d9f 100644
--- a/test/runtime/samples/action-custom-event-handler-this/_config.js
+++ b/test/runtime/samples/action-custom-event-handler-this/_config.js
@@ -1,7 +1,7 @@
export default {
html: ' ',
- test({ assert, component, target, window }) {
+ test({ assert, target, window }) {
const input = target.querySelector('input');
const event = new window.KeyboardEvent('keydown', {
key: 'Enter'
diff --git a/test/runtime/samples/action-custom-event-handler-with-context/_config.js b/test/runtime/samples/action-custom-event-handler-with-context/_config.js
index 104ec27503..41ea15151a 100644
--- a/test/runtime/samples/action-custom-event-handler-with-context/_config.js
+++ b/test/runtime/samples/action-custom-event-handler-with-context/_config.js
@@ -1,7 +1,7 @@
export default {
html: '??? ',
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const event = new window.MouseEvent('click', {
clientX: 42,
clientY: 42
diff --git a/test/runtime/samples/action-function/_config.js b/test/runtime/samples/action-function/_config.js
index 07b4087dcc..6aa972f1a8 100644
--- a/test/runtime/samples/action-function/_config.js
+++ b/test/runtime/samples/action-function/_config.js
@@ -3,7 +3,7 @@ export default {
action
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const button = target.querySelector('button');
const eventEnter = new window.MouseEvent('mouseenter');
const eventLeave = new window.MouseEvent('mouseleave');
diff --git a/test/runtime/samples/action-object-deep/_config.js b/test/runtime/samples/action-object-deep/_config.js
new file mode 100644
index 0000000000..ce4981c568
--- /dev/null
+++ b/test/runtime/samples/action-object-deep/_config.js
@@ -0,0 +1,8 @@
+export default {
+ html: `
+ action
+ `,
+ async test({ assert, target }) {
+ assert.equal(target.querySelector('button').foo, 'bar1337');
+ }
+};
diff --git a/test/runtime/samples/action-object-deep/main.svelte b/test/runtime/samples/action-object-deep/main.svelte
new file mode 100644
index 0000000000..75c35d628d
--- /dev/null
+++ b/test/runtime/samples/action-object-deep/main.svelte
@@ -0,0 +1,12 @@
+
+
+action
\ No newline at end of file
diff --git a/test/runtime/samples/action-object/_config.js b/test/runtime/samples/action-object/_config.js
index 7fdc11af2b..ce4981c568 100644
--- a/test/runtime/samples/action-object/_config.js
+++ b/test/runtime/samples/action-object/_config.js
@@ -2,7 +2,7 @@ export default {
html: `
action
`,
- async test({ assert, target, window }) {
+ async test({ assert, target }) {
assert.equal(target.querySelector('button').foo, 'bar1337');
}
};
diff --git a/test/runtime/samples/action-receives-element-mounted/_config.js b/test/runtime/samples/action-receives-element-mounted/_config.js
index 0806d0fa90..c6f3fcd89f 100644
--- a/test/runtime/samples/action-receives-element-mounted/_config.js
+++ b/test/runtime/samples/action-receives-element-mounted/_config.js
@@ -2,7 +2,7 @@ const result = {};
export default {
props: { result },
- async test({ assert, component, target, window }) {
+ async test({ assert }) {
assert.notEqual(result.parentElement, null);
}
};
diff --git a/test/runtime/samples/action-ternary-template/_config.js b/test/runtime/samples/action-ternary-template/_config.js
index ecb18dceec..8e5e8e2236 100644
--- a/test/runtime/samples/action-ternary-template/_config.js
+++ b/test/runtime/samples/action-ternary-template/_config.js
@@ -8,7 +8,7 @@ export default {
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const header = target.querySelector('h1');
const click = new window.MouseEvent('click');
diff --git a/test/runtime/samples/action-this/_config.js b/test/runtime/samples/action-this/_config.js
index 933ce993b9..85cb917d96 100644
--- a/test/runtime/samples/action-this/_config.js
+++ b/test/runtime/samples/action-this/_config.js
@@ -1,5 +1,5 @@
export default {
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const button = target.querySelector('button');
const click = new window.MouseEvent('click');
diff --git a/test/runtime/samples/animation-css/_config.js b/test/runtime/samples/animation-css/_config.js
index 9410fb91e7..b80545de3a 100644
--- a/test/runtime/samples/animation-css/_config.js
+++ b/test/runtime/samples/animation-css/_config.js
@@ -54,4 +54,4 @@ export default {
divs[4].style.animation
], ['', '']);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/animation-js-delay/_config.js b/test/runtime/samples/animation-js-delay/_config.js
index 6bd02d17e6..d7eba13bd4 100644
--- a/test/runtime/samples/animation-js-delay/_config.js
+++ b/test/runtime/samples/animation-js-delay/_config.js
@@ -17,8 +17,8 @@ export default {
e
`,
- test({ assert, component, target, window, raf }) {
- let divs = document.querySelectorAll('div');
+ test({ assert, component, window, raf }) {
+ let divs = window.document.querySelectorAll('div');
divs.forEach(div => {
div.getBoundingClientRect = function() {
const index = [...this.parentNode.children].indexOf(this);
@@ -41,7 +41,7 @@ export default {
{ id: 1, name: 'a' }
];
- divs = document.querySelectorAll('div');
+ divs = window.document.querySelectorAll('div');
assert.equal(divs[0].dy, 120);
assert.equal(divs[4].dy, -120);
@@ -56,5 +56,29 @@ export default {
raf.tick(150);
assert.equal(divs[0].dy, 0);
assert.equal(divs[4].dy, 0);
+
+ component.things = [
+ { id: 1, name: 'a' },
+ { id: 2, name: 'b' },
+ { id: 3, name: 'c' },
+ { id: 4, name: 'd' },
+ { id: 5, name: 'e' }
+ ];
+
+ divs = document.querySelectorAll('div');
+ assert.equal(divs[0].dy, 120);
+ assert.equal(divs[4].dy, -120);
+
+ raf.tick(200);
+ assert.equal(divs[0].dy, 108);
+ assert.equal(divs[4].dy, -60);
+
+ raf.tick(250);
+ assert.equal(divs[0].dy, 48);
+ assert.equal(divs[4].dy, 0);
+
+ raf.tick(300);
+ assert.equal(divs[0].dy, 0);
+ assert.equal(divs[4].dy, 0);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/animation-js-easing/_config.js b/test/runtime/samples/animation-js-easing/_config.js
index 415af042a9..9cbb77275a 100644
--- a/test/runtime/samples/animation-js-easing/_config.js
+++ b/test/runtime/samples/animation-js-easing/_config.js
@@ -17,7 +17,7 @@ export default {
e
`,
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, raf }) {
let divs = document.querySelectorAll('div');
divs.forEach(div => {
div.getBoundingClientRect = function() {
@@ -53,4 +53,4 @@ export default {
assert.equal(divs[0].dy, 0);
assert.equal(divs[4].dy, 0);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/animation-js-easing/easing.js b/test/runtime/samples/animation-js-easing/easing.js
index fecc4d96f6..6399b8858c 100644
--- a/test/runtime/samples/animation-js-easing/easing.js
+++ b/test/runtime/samples/animation-js-easing/easing.js
@@ -1,3 +1,3 @@
export function linear(t) {
return t;
-}
\ No newline at end of file
+}
diff --git a/test/runtime/samples/animation-js/_config.js b/test/runtime/samples/animation-js/_config.js
index 521753633d..64373d08a3 100644
--- a/test/runtime/samples/animation-js/_config.js
+++ b/test/runtime/samples/animation-js/_config.js
@@ -17,7 +17,7 @@ export default {
e
`,
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, raf }) {
let divs = document.querySelectorAll('div');
divs.forEach(div => {
div.getBoundingClientRect = function() {
@@ -74,4 +74,4 @@ export default {
assert.equal(divs[0].dy, 0);
assert.equal(divs[4].dy, 0);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/apply-directives-in-order-2/_config.js b/test/runtime/samples/apply-directives-in-order-2/_config.js
index caff97a5b9..6072a18b27 100644
--- a/test/runtime/samples/apply-directives-in-order-2/_config.js
+++ b/test/runtime/samples/apply-directives-in-order-2/_config.js
@@ -4,7 +4,7 @@ export default {
value
},
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const inputs = target.querySelectorAll('input');
const event = new window.Event('input');
diff --git a/test/runtime/samples/apply-directives-in-order/_config.js b/test/runtime/samples/apply-directives-in-order/_config.js
index 7c8f87ef85..2e057118b4 100644
--- a/test/runtime/samples/apply-directives-in-order/_config.js
+++ b/test/runtime/samples/apply-directives-in-order/_config.js
@@ -9,11 +9,11 @@ export default {
`,
ssrHtml: `
-
+
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const input = target.querySelector('input');
const event = new window.Event('input');
diff --git a/test/runtime/samples/assignment-in-init/_config.js b/test/runtime/samples/assignment-in-init/_config.js
index bcf227f8e6..52428c607d 100644
--- a/test/runtime/samples/assignment-in-init/_config.js
+++ b/test/runtime/samples/assignment-in-init/_config.js
@@ -3,4 +3,4 @@ export default {
assert.equal(component.get_foo(), 1);
assert.equal(component.get_bar(), 2);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/assignment-to-computed-property/_config.js b/test/runtime/samples/assignment-to-computed-property/_config.js
index 7ba090abe9..25f94c844e 100644
--- a/test/runtime/samples/assignment-to-computed-property/_config.js
+++ b/test/runtime/samples/assignment-to-computed-property/_config.js
@@ -2,4 +2,4 @@ export default {
test({ assert, component }) {
assert.deepEqual(component.foo, { baz: 1 });
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/attribute-boolean-false/_config.js b/test/runtime/samples/attribute-boolean-false/_config.js
index 935b709fab..e4aaabecaf 100644
--- a/test/runtime/samples/attribute-boolean-false/_config.js
+++ b/test/runtime/samples/attribute-boolean-false/_config.js
@@ -1,6 +1,6 @@
export default {
html: '',
- test({ assert, component, target }) {
+ test({ assert, target }) {
const textarea = target.querySelector('textarea');
assert.ok(textarea.readOnly === false);
}
diff --git a/test/runtime/samples/attribute-boolean-indeterminate/_config.js b/test/runtime/samples/attribute-boolean-indeterminate/_config.js
index 0e24f92c51..d6e97ffc0e 100644
--- a/test/runtime/samples/attribute-boolean-indeterminate/_config.js
+++ b/test/runtime/samples/attribute-boolean-indeterminate/_config.js
@@ -7,9 +7,11 @@ export default {
indeterminate: true
},
- html: `
-
- `,
+ html: " ",
+
+ // somehow ssr will render indeterminate=""
+ // the hydrated html will still contain that attribute
+ ssrHtml: " ",
test({ assert, component, target }) {
const input = target.querySelector('input');
@@ -18,4 +20,4 @@ export default {
component.indeterminate = false;
assert.ok(!input.indeterminate);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/attribute-boolean-true/_config.js b/test/runtime/samples/attribute-boolean-true/_config.js
index ccc0814296..79c8ea1ad6 100644
--- a/test/runtime/samples/attribute-boolean-true/_config.js
+++ b/test/runtime/samples/attribute-boolean-true/_config.js
@@ -1,6 +1,6 @@
export default {
html: '',
- test({ assert, component, target }) {
+ test({ assert, target }) {
const textarea = target.querySelector('textarea');
assert.ok(textarea.readOnly);
}
diff --git a/test/runtime/samples/attribute-casing-foreign-namespace-compiler-option/_config.js b/test/runtime/samples/attribute-casing-foreign-namespace-compiler-option/_config.js
new file mode 100644
index 0000000000..9f8ee61c7a
--- /dev/null
+++ b/test/runtime/samples/attribute-casing-foreign-namespace-compiler-option/_config.js
@@ -0,0 +1,24 @@
+// Test support for the `foreign` namespace preserving attribute case,
+// including ensuring that SVG elements don't interfere.
+
+export default {
+ html: `
+
+
+
+
+ `,
+ options: {
+ hydrate: false // Hydration test will fail as case sensitivity is only handled for svg elements.
+ },
+ skip_if_hydrate_from_ssr: true,
+ compileOptions: {
+ namespace: 'foreign'
+ },
+ test({ assert, target }) {
+ const attr = sel => target.querySelector(sel).attributes[0].name;
+ assert.equal(attr('page'), 'horizontalAlignment');
+ assert.equal(attr('button'), 'textWrap');
+ assert.equal(attr('text'), 'wordWrap');
+ }
+};
diff --git a/test/runtime/samples/attribute-casing-foreign-namespace-compiler-option/main.svelte b/test/runtime/samples/attribute-casing-foreign-namespace-compiler-option/main.svelte
new file mode 100644
index 0000000000..52b3e646e1
--- /dev/null
+++ b/test/runtime/samples/attribute-casing-foreign-namespace-compiler-option/main.svelte
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/test/runtime/samples/attribute-casing-foreign-namespace/_config.js b/test/runtime/samples/attribute-casing-foreign-namespace/_config.js
new file mode 100644
index 0000000000..f74f622524
--- /dev/null
+++ b/test/runtime/samples/attribute-casing-foreign-namespace/_config.js
@@ -0,0 +1,19 @@
+// Test support for the `foreign` namespace preserving attribute case.
+
+export default {
+ html: `
+
+
+
+ `,
+ options: {
+ hydrate: false // Hydration test will fail as case sensitivity is only handled for svg elements.
+ },
+ skip_if_hydrate_from_ssr: true,
+
+ test({ assert, target }) {
+ const attr = sel => target.querySelector(sel).attributes[0].name;
+ assert.equal(attr('page'), 'horizontalAlignment');
+ assert.equal(attr('button'), 'textWrap');
+ }
+};
diff --git a/test/runtime/samples/attribute-casing-foreign-namespace/main.svelte b/test/runtime/samples/attribute-casing-foreign-namespace/main.svelte
new file mode 100644
index 0000000000..f5ff10a3eb
--- /dev/null
+++ b/test/runtime/samples/attribute-casing-foreign-namespace/main.svelte
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/attribute-dynamic-type/_config.js b/test/runtime/samples/attribute-dynamic-type/_config.js
index 19aa33d65e..fa00cb6bc3 100644
--- a/test/runtime/samples/attribute-dynamic-type/_config.js
+++ b/test/runtime/samples/attribute-dynamic-type/_config.js
@@ -1,12 +1,11 @@
export default {
- skip_if_ssr: true,
-
props: {
inputType: 'text',
inputValue: 42
},
html: ' ',
+ ssrHtml: ' ',
test({ assert, component, target }) {
const input = target.querySelector('input');
diff --git a/test/runtime/samples/attribute-namespaced/_config.js b/test/runtime/samples/attribute-namespaced/_config.js
index f8c0cb03fb..f3a7f28a93 100644
--- a/test/runtime/samples/attribute-namespaced/_config.js
+++ b/test/runtime/samples/attribute-namespaced/_config.js
@@ -7,8 +7,8 @@ export default {
`,
- test({ assert, component, target }) {
+ test({ assert, target }) {
const use = target.querySelector( 'use' );
assert.equal( use.getAttributeNS( 'http://www.w3.org/1999/xlink', 'href' ), '#bar' );
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/attribute-prefer-expression/_config.js b/test/runtime/samples/attribute-prefer-expression/_config.js
index 2388ff35df..22bed8a6bc 100644
--- a/test/runtime/samples/attribute-prefer-expression/_config.js
+++ b/test/runtime/samples/attribute-prefer-expression/_config.js
@@ -1,5 +1,4 @@
export default {
- skip_if_ssr: true,
props: {
foo: false
diff --git a/test/runtime/samples/attribute-static-at-symbol/_config.js b/test/runtime/samples/attribute-static-at-symbol/_config.js
index b2fb3afb87..0be19f091f 100644
--- a/test/runtime/samples/attribute-static-at-symbol/_config.js
+++ b/test/runtime/samples/attribute-static-at-symbol/_config.js
@@ -1,3 +1,3 @@
export default {
html: "email "
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/attribute-static-boolean/_config.js b/test/runtime/samples/attribute-static-boolean/_config.js
index 3dba036319..2d31b26747 100644
--- a/test/runtime/samples/attribute-static-boolean/_config.js
+++ b/test/runtime/samples/attribute-static-boolean/_config.js
@@ -1,6 +1,6 @@
export default {
html: '',
- test({ assert, component, target }) {
+ test({ assert, target }) {
const textarea = target.querySelector( 'textarea' );
assert.ok( textarea.readOnly );
}
diff --git a/test/runtime/samples/attribute-static-quotemarks/_config.js b/test/runtime/samples/attribute-static-quotemarks/_config.js
index 3d389c2273..e908052b4f 100644
--- a/test/runtime/samples/attribute-static-quotemarks/_config.js
+++ b/test/runtime/samples/attribute-static-quotemarks/_config.js
@@ -5,4 +5,4 @@ export default {
bar
`
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/attribute-unknown-without-value/_config.js b/test/runtime/samples/attribute-unknown-without-value/_config.js
index 4f7cf1cbbf..9645e86ef4 100644
--- a/test/runtime/samples/attribute-unknown-without-value/_config.js
+++ b/test/runtime/samples/attribute-unknown-without-value/_config.js
@@ -1,3 +1,3 @@
export default {
html: '
'
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/autofocus/_config.js b/test/runtime/samples/autofocus/_config.js
index faf9cf9f48..b0131f8bfe 100644
--- a/test/runtime/samples/autofocus/_config.js
+++ b/test/runtime/samples/autofocus/_config.js
@@ -2,7 +2,23 @@ export default {
html: '',
test({ assert, component, target, window }) {
- component.visible = true;
- assert.equal(target.querySelector('input'), window.document.activeElement);
+ component.active = 'default';
+ assert.equal(target.querySelector('input[title="default"]'), window.document.activeElement);
+
+ component.active = 'dynamic-false';
+ assert.notEqual(target.querySelector('input[title="dynamic-false"]'), window.document.activeElement);
+
+ // when dynamically set autofocus to true, don't autofocus
+ component.autofocusFalse = true;
+ assert.notEqual(target.querySelector('input[title="dynamic-false"]'), window.document.activeElement);
+
+ component.active = 'dynamic-true';
+ assert.equal(target.querySelector('input[title="dynamic-true"]'), window.document.activeElement);
+
+ component.active = 'spread';
+ assert.equal(target.querySelector('input[title="spread"]'), window.document.activeElement);
+
+ component.active = 'spread-override';
+ assert.notEqual(target.querySelector('input[title="spread-override"]'), window.document.activeElement);
}
};
diff --git a/test/runtime/samples/autofocus/main.svelte b/test/runtime/samples/autofocus/main.svelte
index 561596e9cf..ecdb1beb5e 100644
--- a/test/runtime/samples/autofocus/main.svelte
+++ b/test/runtime/samples/autofocus/main.svelte
@@ -1,8 +1,18 @@
-{#if visible}
-
+{#if active === 'default'}
+
+{:else if active === 'dynamic-false'}
+
+{:else if active === 'dynamic-true'}
+
+{:else if active === 'spread'}
+
+{:else if active === 'spread-override'}
+
{/if}
\ No newline at end of file
diff --git a/test/runtime/samples/await-catch-no-expression/_config.js b/test/runtime/samples/await-catch-no-expression/_config.js
new file mode 100644
index 0000000000..5274e60e2d
--- /dev/null
+++ b/test/runtime/samples/await-catch-no-expression/_config.js
@@ -0,0 +1,47 @@
+let fulfil;
+
+let thePromise = new Promise(f => {
+ fulfil = f;
+});
+
+export default {
+ props: {
+ thePromise
+ },
+
+ html: `
+
+ the promise is pending
+ `,
+
+ async test({ assert, component, target }) {
+ fulfil(42);
+
+ await thePromise;
+
+ assert.htmlEqual(target.innerHTML, ' ');
+
+ let reject;
+
+ thePromise = new Promise((f, r) => {
+ reject = r;
+ });
+
+ component.thePromise = thePromise;
+
+ assert.htmlEqual(target.innerHTML, `
+
+ the promise is pending
+ `);
+
+ reject(new Error());
+
+ await thePromise.catch(() => {});
+
+ assert.htmlEqual(target.innerHTML, `
+ oh no! Something broke!
+
+ oh no! Something broke!
+ `);
+ }
+};
diff --git a/test/runtime/samples/await-catch-no-expression/main.svelte b/test/runtime/samples/await-catch-no-expression/main.svelte
new file mode 100644
index 0000000000..0da0d12092
--- /dev/null
+++ b/test/runtime/samples/await-catch-no-expression/main.svelte
@@ -0,0 +1,15 @@
+
+
+{#await thePromise catch}
+ oh no! Something broke!
+{/await}
+
+
+
+{#await thePromise}
+ the promise is pending
+{:catch}
+ oh no! Something broke!
+{/await}
diff --git a/test/runtime/samples/await-catch-shorthand/_config.js b/test/runtime/samples/await-catch-shorthand/_config.js
index aea2eb0905..fc65773107 100644
--- a/test/runtime/samples/await-catch-shorthand/_config.js
+++ b/test/runtime/samples/await-catch-shorthand/_config.js
@@ -38,4 +38,4 @@ export default {
`);
});
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/await-component-oncreate/_config.js b/test/runtime/samples/await-component-oncreate/_config.js
index 3cb8fa0864..1de86c9f44 100644
--- a/test/runtime/samples/await-component-oncreate/_config.js
+++ b/test/runtime/samples/await-component-oncreate/_config.js
@@ -13,4 +13,4 @@ export default {
`);
});
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/await-conservative-update/_config.js b/test/runtime/samples/await-conservative-update/_config.js
index 4e81ff8e37..c548a400af 100644
--- a/test/runtime/samples/await-conservative-update/_config.js
+++ b/test/runtime/samples/await-conservative-update/_config.js
@@ -5,7 +5,7 @@ export default {
loading...
`,
- test({ assert, component, target }) {
+ test({ assert, target }) {
return sleep(50).then(() => {
assert.htmlEqual(target.innerHTML, `
the answer is 42
@@ -13,4 +13,4 @@ export default {
`);
});
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/await-conservative-update/sleep.js b/test/runtime/samples/await-conservative-update/sleep.js
index 994f85f38a..be592a4ea4 100644
--- a/test/runtime/samples/await-conservative-update/sleep.js
+++ b/test/runtime/samples/await-conservative-update/sleep.js
@@ -8,4 +8,4 @@ export const sleep = ms => new Promise(f => {
if (stopped) return;
f();
}, ms);
-});
\ No newline at end of file
+});
diff --git a/test/runtime/samples/await-containing-if/_config.js b/test/runtime/samples/await-containing-if/_config.js
index 5bf94ed012..a81b040a12 100644
--- a/test/runtime/samples/await-containing-if/_config.js
+++ b/test/runtime/samples/await-containing-if/_config.js
@@ -32,4 +32,4 @@ export default {
`);
});
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/await-in-dynamic-component/_config.js b/test/runtime/samples/await-in-dynamic-component/_config.js
index 797298c554..d92757b68b 100644
--- a/test/runtime/samples/await-in-dynamic-component/_config.js
+++ b/test/runtime/samples/await-in-dynamic-component/_config.js
@@ -2,4 +2,4 @@ export default {
test({ component }) {
component.flag = false;
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/await-in-each/_config.js b/test/runtime/samples/await-in-each/_config.js
index 6c7da69ee3..617194a95c 100644
--- a/test/runtime/samples/await-in-each/_config.js
+++ b/test/runtime/samples/await-in-each/_config.js
@@ -18,7 +18,7 @@ export default {
a title: loading...
`,
- test({ assert, component, target }) {
+ test({ assert, target }) {
fulfil(42);
return thePromise
@@ -28,4 +28,4 @@ export default {
`);
});
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/await-in-removed-if/_config.js b/test/runtime/samples/await-in-removed-if/_config.js
index 0746a66fa0..18b2ac7b74 100644
--- a/test/runtime/samples/await-in-removed-if/_config.js
+++ b/test/runtime/samples/await-in-removed-if/_config.js
@@ -19,4 +19,4 @@ export default {
assert.htmlEqual(target.innerHTML, '');
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/await-set-simultaneous-reactive/_config.js b/test/runtime/samples/await-set-simultaneous-reactive/_config.js
index acbd7aea1f..0b5c0b8c74 100644
--- a/test/runtime/samples/await-set-simultaneous-reactive/_config.js
+++ b/test/runtime/samples/await-set-simultaneous-reactive/_config.js
@@ -10,4 +10,4 @@ export default {
`);
});
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/await-set-simultaneous/_config.js b/test/runtime/samples/await-set-simultaneous/_config.js
index d928e39c23..fb75a9f6f0 100644
--- a/test/runtime/samples/await-set-simultaneous/_config.js
+++ b/test/runtime/samples/await-set-simultaneous/_config.js
@@ -15,4 +15,4 @@ export default {
`);
});
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/await-then-catch-event/_config.js b/test/runtime/samples/await-then-catch-event/_config.js
index e42d16c4d8..0f4ce27628 100644
--- a/test/runtime/samples/await-then-catch-event/_config.js
+++ b/test/runtime/samples/await-then-catch-event/_config.js
@@ -42,4 +42,4 @@ export default {
assert.equal(component.clicked, 43);
});
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/await-then-catch-in-slot/_config.js b/test/runtime/samples/await-then-catch-in-slot/_config.js
index b0600a0f27..14f3e7fdf5 100644
--- a/test/runtime/samples/await-then-catch-in-slot/_config.js
+++ b/test/runtime/samples/await-then-catch-in-slot/_config.js
@@ -44,4 +44,4 @@ export default {
`);
});
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/await-then-catch-multiple/_config.js b/test/runtime/samples/await-then-catch-multiple/_config.js
index 2daac524a2..8d2de596df 100644
--- a/test/runtime/samples/await-then-catch-multiple/_config.js
+++ b/test/runtime/samples/await-then-catch-multiple/_config.js
@@ -48,4 +48,4 @@ export default {
`);
});
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/await-then-catch-non-promise/_config.js b/test/runtime/samples/await-then-catch-non-promise/_config.js
index dbc2f5eddc..c05236cc5f 100644
--- a/test/runtime/samples/await-then-catch-non-promise/_config.js
+++ b/test/runtime/samples/await-then-catch-non-promise/_config.js
@@ -14,4 +14,4 @@ export default {
the value is still not a promise
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/await-then-catch-order/_config.js b/test/runtime/samples/await-then-catch-order/_config.js
index f972520904..29fc074162 100644
--- a/test/runtime/samples/await-then-catch-order/_config.js
+++ b/test/runtime/samples/await-then-catch-order/_config.js
@@ -13,7 +13,7 @@ export default {
loading...
true!
`,
- test({ assert, component, target }) {
+ test({ assert, target }) {
fulfil(42);
return thePromise
diff --git a/test/runtime/samples/await-then-catch-static/_config.js b/test/runtime/samples/await-then-catch-static/_config.js
index ada0dcc75b..6918986950 100644
--- a/test/runtime/samples/await-then-catch-static/_config.js
+++ b/test/runtime/samples/await-then-catch-static/_config.js
@@ -22,7 +22,7 @@ export default {
loaded
`);
- promise = new Promise((f, r) => {
+ promise = new Promise((f, _) => {
fulfil = f;
});
@@ -42,4 +42,4 @@ export default {
`);
});
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/await-then-catch/_config.js b/test/runtime/samples/await-then-catch/_config.js
index b0600a0f27..14f3e7fdf5 100644
--- a/test/runtime/samples/await-then-catch/_config.js
+++ b/test/runtime/samples/await-then-catch/_config.js
@@ -44,4 +44,4 @@ export default {
`);
});
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/await-then-destruct-array/_config.js b/test/runtime/samples/await-then-destruct-array/_config.js
index 55c48481e0..58a66a698d 100644
--- a/test/runtime/samples/await-then-destruct-array/_config.js
+++ b/test/runtime/samples/await-then-destruct-array/_config.js
@@ -1,6 +1,6 @@
export default {
props: {
- thePromise: new Promise(resolve => {})
+ thePromise: new Promise(_ => {})
},
html: `
diff --git a/test/runtime/samples/await-then-destruct-default/_config.js b/test/runtime/samples/await-then-destruct-default/_config.js
index d0e5a49f28..151f2c91f7 100644
--- a/test/runtime/samples/await-then-destruct-default/_config.js
+++ b/test/runtime/samples/await-then-destruct-default/_config.js
@@ -1,5 +1,5 @@
export default {
- async test({ assert, component, target }) {
+ async test({ assert, target }) {
await Promise.resolve();
assert.htmlEqual(
diff --git a/test/runtime/samples/await-then-destruct-object-if/_config.js b/test/runtime/samples/await-then-destruct-object-if/_config.js
new file mode 100644
index 0000000000..6a29b2db37
--- /dev/null
+++ b/test/runtime/samples/await-then-destruct-object-if/_config.js
@@ -0,0 +1,29 @@
+export default {
+ props: {
+ thePromise: Promise.resolve({ result: 1 })
+ },
+
+ html: '',
+
+ async test({ assert, component, target }) {
+ await (component.thePromise = Promise.resolve({ result: 1 }));
+
+ assert.htmlEqual(
+ target.innerHTML,
+ `
+ result: 1
+ count: 0
+ `
+ );
+
+ await new Promise(resolve => setTimeout(resolve, 1));
+
+ assert.htmlEqual(
+ target.innerHTML,
+ `
+ result: 1
+ count: 1
+ `
+ );
+ }
+};
diff --git a/test/runtime/samples/await-then-destruct-object-if/main.svelte b/test/runtime/samples/await-then-destruct-object-if/main.svelte
new file mode 100644
index 0000000000..3425979e2c
--- /dev/null
+++ b/test/runtime/samples/await-then-destruct-object-if/main.svelte
@@ -0,0 +1,19 @@
+
+
+{#await thePromise then { result }}
+ {#if result}
+ result: {result}
+ count: {count}
+ {:else}
+ result: {result}
+ count: {count}
+ {/if}
+{/await}
diff --git a/test/runtime/samples/await-then-destruct-object/_config.js b/test/runtime/samples/await-then-destruct-object/_config.js
index 7d08ad3711..47e8422cc4 100644
--- a/test/runtime/samples/await-then-destruct-object/_config.js
+++ b/test/runtime/samples/await-then-destruct-object/_config.js
@@ -1,6 +1,6 @@
export default {
props: {
- thePromise: new Promise(resolve => {})
+ thePromise: new Promise(_ => {})
},
html: `
diff --git a/test/runtime/samples/await-then-destruct-rest/_config.js b/test/runtime/samples/await-then-destruct-rest/_config.js
index 528568e569..0a7445b535 100644
--- a/test/runtime/samples/await-then-destruct-rest/_config.js
+++ b/test/runtime/samples/await-then-destruct-rest/_config.js
@@ -1,5 +1,5 @@
export default {
- async test({ assert, component, target }) {
+ async test({ assert, target }) {
await Promise.resolve();
assert.htmlEqual(
diff --git a/test/runtime/samples/await-then-if/_config.js b/test/runtime/samples/await-then-if/_config.js
index b26688d9f3..f29f5df0e5 100644
--- a/test/runtime/samples/await-then-if/_config.js
+++ b/test/runtime/samples/await-then-if/_config.js
@@ -13,13 +13,13 @@ export default {
loading...
`,
- async test({ assert, component, target }) {
+ async test({ assert, target }) {
fulfil([]);
await thePromise;
-
+
assert.htmlEqual(target.innerHTML, `
promise array is empty
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/await-then-no-expression/_config.js b/test/runtime/samples/await-then-no-expression/_config.js
new file mode 100644
index 0000000000..f684da52ed
--- /dev/null
+++ b/test/runtime/samples/await-then-no-expression/_config.js
@@ -0,0 +1,55 @@
+let fulfil;
+
+let thePromise = new Promise(f => {
+ fulfil = f;
+});
+
+export default {
+ props: {
+ thePromise
+ },
+
+ html: `
+
+
+ the promise is pending
+ `,
+
+ async test({ assert, component, target }) {
+ fulfil();
+
+ await thePromise;
+
+ assert.htmlEqual(target.innerHTML, `
+ the promise is resolved
+
+ the promise is resolved
+
+ the promise is resolved
+ `);
+
+ let reject;
+
+ thePromise = new Promise((f, r) => {
+ reject = r;
+ });
+
+ component.thePromise = thePromise;
+
+ assert.htmlEqual(target.innerHTML, `
+
+
+ the promise is pending
+ `);
+
+ reject(new Error('something broke'));
+
+ await thePromise.catch(() => {});
+
+ assert.htmlEqual(target.innerHTML, `
+ oh no! something broke
+
+
+ `);
+ }
+};
diff --git a/test/runtime/samples/await-then-no-expression/main.svelte b/test/runtime/samples/await-then-no-expression/main.svelte
new file mode 100644
index 0000000000..fedc7cd2b7
--- /dev/null
+++ b/test/runtime/samples/await-then-no-expression/main.svelte
@@ -0,0 +1,23 @@
+
+
+{#await thePromise then}
+ the promise is resolved
+{:catch theError}
+ oh no! {theError.message}
+{/await}
+
+
+
+{#await thePromise then}
+ the promise is resolved
+{/await}
+
+
+
+{#await thePromise}
+ the promise is pending
+{:then}
+ the promise is resolved
+{/await}
\ No newline at end of file
diff --git a/test/runtime/samples/await-then-shorthand/_config.js b/test/runtime/samples/await-then-shorthand/_config.js
index be517af70d..ca07dd19e0 100644
--- a/test/runtime/samples/await-then-shorthand/_config.js
+++ b/test/runtime/samples/await-then-shorthand/_config.js
@@ -40,4 +40,4 @@ export default {
`);
});
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/await-with-update-catch-scope/_config.js b/test/runtime/samples/await-with-update-catch-scope/_config.js
new file mode 100644
index 0000000000..4c60ef2150
--- /dev/null
+++ b/test/runtime/samples/await-with-update-catch-scope/_config.js
@@ -0,0 +1,51 @@
+export default {
+ props: {
+ thePromise: new Promise((_) => {})
+ },
+
+ html: `
+ error: undefined
+ `,
+
+ async test({ assert, component, target }) {
+ await (component.thePromise = Promise.resolve('abc'));
+
+ assert.htmlEqual(
+ target.innerHTML,
+ `
+
+ error: undefined
+ After Resolve: undefined
+
+ `
+ );
+
+ component.error = 'external error occurred';
+
+ assert.htmlEqual(
+ target.innerHTML,
+ `
+
+ error: ${component.error}
+ After Resolve: ${component.error}
+
+ `
+ );
+
+ try {
+ await (component.thePromise = Promise.reject('failure'));
+ } catch (error) {
+ // ignore
+ }
+
+ assert.htmlEqual(
+ target.innerHTML,
+ `
+
+ error: ${component.error}
+ Rejected: failure
+
+ `
+ );
+ }
+};
diff --git a/test/runtime/samples/await-with-update-catch-scope/main.svelte b/test/runtime/samples/await-with-update-catch-scope/main.svelte
new file mode 100644
index 0000000000..4d4eb53f0b
--- /dev/null
+++ b/test/runtime/samples/await-with-update-catch-scope/main.svelte
@@ -0,0 +1,13 @@
+
+
+
+ error: {error}
+ {#await thePromise then _}
+ After Resolve: {error}
+ {:catch error}
+ Rejected: {error}
+ {/await}
+
diff --git a/test/runtime/samples/await-without-catch/_config.js b/test/runtime/samples/await-without-catch/_config.js
index 1b7da5c0be..5bc291bf1f 100644
--- a/test/runtime/samples/await-without-catch/_config.js
+++ b/test/runtime/samples/await-without-catch/_config.js
@@ -42,4 +42,4 @@ export default {
assert.htmlEqual(target.innerHTML, '');
});
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/binding-circular/_config.js b/test/runtime/samples/binding-circular/_config.js
index 505ed22beb..3e58ab2f98 100644
--- a/test/runtime/samples/binding-circular/_config.js
+++ b/test/runtime/samples/binding-circular/_config.js
@@ -3,11 +3,5 @@ export default {
wheeee
- `,
-
- ssrHtml: `
-
- wheeee
-
`
};
diff --git a/test/runtime/samples/binding-indirect-computed/_config.js b/test/runtime/samples/binding-indirect-computed/_config.js
index 7519c4b0ed..68be22d1f8 100644
--- a/test/runtime/samples/binding-indirect-computed/_config.js
+++ b/test/runtime/samples/binding-indirect-computed/_config.js
@@ -31,4 +31,4 @@ export default {
B
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/binding-indirect-spread/_config.js b/test/runtime/samples/binding-indirect-spread/_config.js
index 1f24fcdbcb..b0701bdc7c 100644
--- a/test/runtime/samples/binding-indirect-spread/_config.js
+++ b/test/runtime/samples/binding-indirect-spread/_config.js
@@ -1,5 +1,13 @@
export default {
- skip_if_ssr: true,
+ ssrHtml: `
+
+
+
+
+
+
+
+ `,
async test({ assert, component, target, window }) {
const event = new window.MouseEvent('click');
diff --git a/test/runtime/samples/binding-indirect/_config.js b/test/runtime/samples/binding-indirect/_config.js
index a0a610f43f..e0f10b94bd 100644
--- a/test/runtime/samples/binding-indirect/_config.js
+++ b/test/runtime/samples/binding-indirect/_config.js
@@ -87,4 +87,4 @@ export default {
shake it all about
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/binding-input-checkbox-group-outside-each/_config.js b/test/runtime/samples/binding-input-checkbox-group-outside-each/_config.js
index ab89bc8daa..0948797865 100644
--- a/test/runtime/samples/binding-input-checkbox-group-outside-each/_config.js
+++ b/test/runtime/samples/binding-input-checkbox-group-outside-each/_config.js
@@ -25,6 +25,21 @@ export default {
Beta
`,
+ ssrHtml: `
+
+ Alpha
+
+
+
+ Beta
+
+
+
+ Gamma
+
+
+ Beta
`,
+
async test({ assert, component, target, window }) {
const inputs = target.querySelectorAll('input');
assert.equal(inputs[0].checked, false);
diff --git a/test/runtime/samples/binding-input-checkbox-group/_config.js b/test/runtime/samples/binding-input-checkbox-group/_config.js
index ab89bc8daa..0948797865 100644
--- a/test/runtime/samples/binding-input-checkbox-group/_config.js
+++ b/test/runtime/samples/binding-input-checkbox-group/_config.js
@@ -25,6 +25,21 @@ export default {
Beta
`,
+ ssrHtml: `
+
+ Alpha
+
+
+
+ Beta
+
+
+
+ Gamma
+
+
+ Beta
`,
+
async test({ assert, component, target, window }) {
const inputs = target.querySelectorAll('input');
assert.equal(inputs[0].checked, false);
diff --git a/test/runtime/samples/binding-input-group-duplicate-value/_config.js b/test/runtime/samples/binding-input-group-duplicate-value/_config.js
index b5f3ae0115..db7dd84dee 100644
--- a/test/runtime/samples/binding-input-group-duplicate-value/_config.js
+++ b/test/runtime/samples/binding-input-group-duplicate-value/_config.js
@@ -17,7 +17,7 @@ export default {
d
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const inputs = target.querySelectorAll('input');
const p = target.querySelector('p');
diff --git a/test/runtime/samples/binding-input-group-each-1/_config.js b/test/runtime/samples/binding-input-group-each-1/_config.js
index 92010296dc..9bdf784f73 100644
--- a/test/runtime/samples/binding-input-group-each-1/_config.js
+++ b/test/runtime/samples/binding-input-group-each-1/_config.js
@@ -64,6 +64,54 @@ export default {
`,
+ ssrHtml: `
+
+
+
+ `,
+
async test({ assert, component, target, window }) {
const inputs = target.querySelectorAll('input');
assert.equal(inputs[0].checked, false);
diff --git a/test/runtime/samples/binding-input-group-each-2/_config.js b/test/runtime/samples/binding-input-group-each-2/_config.js
index 78d692d979..880b183f88 100644
--- a/test/runtime/samples/binding-input-group-each-2/_config.js
+++ b/test/runtime/samples/binding-input-group-each-2/_config.js
@@ -12,6 +12,19 @@ export default {
1, 2, 3
`,
+ ssrHtml: `
+
+ 1
+
+
+ 2
+
+
+ 3
+
+
+ 1, 2, 3
`,
+
async test({ assert, component, target, window }) {
const inputs = target.querySelectorAll('input');
assert.equal(inputs[0].checked, true);
diff --git a/test/runtime/samples/binding-input-group-each-3/_config.js b/test/runtime/samples/binding-input-group-each-3/_config.js
index 92010296dc..f4018295d7 100644
--- a/test/runtime/samples/binding-input-group-each-3/_config.js
+++ b/test/runtime/samples/binding-input-group-each-3/_config.js
@@ -63,7 +63,53 @@ export default {
Gamma
`,
+ ssrHtml: `
+
+
+
+ `,
async test({ assert, component, target, window }) {
const inputs = target.querySelectorAll('input');
assert.equal(inputs[0].checked, false);
diff --git a/test/runtime/samples/binding-input-group-each-4/_config.js b/test/runtime/samples/binding-input-group-each-4/_config.js
index f1168858b0..da5edf18bc 100644
--- a/test/runtime/samples/binding-input-group-each-4/_config.js
+++ b/test/runtime/samples/binding-input-group-each-4/_config.js
@@ -17,7 +17,24 @@ export default {
3
3
`,
-
+ ssrHtml: `
+
1
+
2
+
3
+
1
+
1
+
2
+
3
+
2
+
1
+
2
+
3
+
+
1
+
2
+
3
+
3
+ `,
async test({ assert, component, target, window }) {
const inputs = target.querySelectorAll('input');
assert.equal(inputs[0].checked, true);
diff --git a/test/runtime/samples/binding-input-group-each-5/_config.js b/test/runtime/samples/binding-input-group-each-5/_config.js
index 579225c627..cdfe9308df 100644
--- a/test/runtime/samples/binding-input-group-each-5/_config.js
+++ b/test/runtime/samples/binding-input-group-each-5/_config.js
@@ -17,7 +17,24 @@ export default {
3
1
`,
-
+ ssrHtml: `
+
1
+
2
+
3
+
1
+
1
+
2
+
3
+
1, 2, 3
+
1
+
2
+
3
+
2
+
1
+
2
+
3
+
1
+ `,
async test({ assert, component, target, window }) {
const inputs = target.querySelectorAll('input');
assert.equal(inputs[0].checked, true);
diff --git a/test/runtime/samples/binding-input-group-each-6/_config.js b/test/runtime/samples/binding-input-group-each-6/_config.js
index 9eb251bf5d..7fd1232a27 100644
--- a/test/runtime/samples/binding-input-group-each-6/_config.js
+++ b/test/runtime/samples/binding-input-group-each-6/_config.js
@@ -13,8 +13,7 @@ export default {
z
`,
-
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const inputs = target.querySelectorAll('input');
assert.equal(inputs[0].checked, false);
assert.equal(inputs[1].checked, false);
diff --git a/test/runtime/samples/binding-input-group-each-7/_config.js b/test/runtime/samples/binding-input-group-each-7/_config.js
new file mode 100644
index 0000000000..7535001f67
--- /dev/null
+++ b/test/runtime/samples/binding-input-group-each-7/_config.js
@@ -0,0 +1,53 @@
+export default {
+ html: `
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `,
+
+ async test({ assert, target, window }) {
+ const inputs = target.querySelectorAll('input');
+ const checked = new Set();
+ const checkInbox = async (i) => {
+ checked.add(i);
+ inputs[i].checked = true;
+ await inputs[i].dispatchEvent(event);
+ };
+
+ for (let i = 0; i < 18; i++) {
+ assert.equal(inputs[i].checked, checked.has(i));
+ }
+
+ const event = new window.Event('change');
+
+ await checkInbox(2);
+ for (let i = 0; i < 18; i++) {
+ assert.equal(inputs[i].checked, checked.has(i));
+ }
+
+ await checkInbox(12);
+ for (let i = 0; i < 18; i++) {
+ assert.equal(inputs[i].checked, checked.has(i));
+ }
+
+ await checkInbox(8);
+ for (let i = 0; i < 18; i++) {
+ assert.equal(inputs[i].checked, checked.has(i));
+ }
+ }
+};
diff --git a/test/runtime/samples/binding-input-group-each-7/main.svelte b/test/runtime/samples/binding-input-group-each-7/main.svelte
new file mode 100644
index 0000000000..6680a49f32
--- /dev/null
+++ b/test/runtime/samples/binding-input-group-each-7/main.svelte
@@ -0,0 +1,15 @@
+
+
+{#each list as { id, data }}
+ {#each data as item}
+
+
+
+ {/each}
+{/each}
diff --git a/test/runtime/samples/binding-input-radio-group/_config.js b/test/runtime/samples/binding-input-radio-group/_config.js
index e289d48597..9684f60fa6 100644
--- a/test/runtime/samples/binding-input-radio-group/_config.js
+++ b/test/runtime/samples/binding-input-radio-group/_config.js
@@ -25,6 +25,21 @@ export default {
Beta
`,
+ ssrHtml: `
+
+ Alpha
+
+
+
+ Beta
+
+
+
+ Gamma
+
+
+
Beta
`,
+
async test({ assert, component, target, window }) {
const inputs = target.querySelectorAll('input');
assert.equal(inputs[0].checked, false);
diff --git a/test/runtime/samples/binding-input-text-undefined/_config.js b/test/runtime/samples/binding-input-text-undefined/_config.js
index fa59b1f796..82cada3b15 100644
--- a/test/runtime/samples/binding-input-text-undefined/_config.js
+++ b/test/runtime/samples/binding-input-text-undefined/_config.js
@@ -7,7 +7,7 @@ export default {
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, component, target }) {
const input = target.querySelector('input');
assert.equal(input.value, '');
diff --git a/test/runtime/samples/binding-select-implicit-option-value/_config.js b/test/runtime/samples/binding-select-implicit-option-value/_config.js
index cce1172f6a..1266602a47 100644
--- a/test/runtime/samples/binding-select-implicit-option-value/_config.js
+++ b/test/runtime/samples/binding-select-implicit-option-value/_config.js
@@ -14,16 +14,6 @@ export default {
foo: 2
`,
- ssrHtml: `
-
- 1
- 2
- 3
-
-
-
foo: 2
- `,
-
async test({ assert, component, target, window }) {
const select = target.querySelector('select');
const options = [...target.querySelectorAll('option')];
diff --git a/test/runtime/samples/binding-select-in-each-block/_config.js b/test/runtime/samples/binding-select-in-each-block/_config.js
index 89f40f8d48..80ea375b78 100644
--- a/test/runtime/samples/binding-select-in-each-block/_config.js
+++ b/test/runtime/samples/binding-select-in-each-block/_config.js
@@ -1,17 +1,4 @@
export default {
-
- ssrHtml: `
-
- Hullo
- World
-
-
-
- Hullo
- World
-
- `,
-
html: `
Hullo
diff --git a/test/runtime/samples/binding-select-initial-value-undefined/_config.js b/test/runtime/samples/binding-select-initial-value-undefined/_config.js
index 821a8a3c64..27bac7ef77 100644
--- a/test/runtime/samples/binding-select-initial-value-undefined/_config.js
+++ b/test/runtime/samples/binding-select-initial-value-undefined/_config.js
@@ -14,6 +14,7 @@ export default {
`,
test({ assert, component, target }) {
+ assert.equal(component.selected, 'a');
const select = target.querySelector('select');
const options = [...target.querySelectorAll('option')];
diff --git a/test/runtime/samples/binding-select-initial-value/_config.js b/test/runtime/samples/binding-select-initial-value/_config.js
index d34a987fa5..5dbd761b61 100644
--- a/test/runtime/samples/binding-select-initial-value/_config.js
+++ b/test/runtime/samples/binding-select-initial-value/_config.js
@@ -11,23 +11,11 @@ export default {
selected: b
`,
- ssrHtml: `
- selected: b
-
-
- a
- b
- c
-
-
- selected: b
- `,
-
props: {
selected: 'b'
},
- test({ assert, component, target }) {
+ test({ assert, target }) {
const select = target.querySelector('select');
const options = [...target.querySelectorAll('option')];
diff --git a/test/runtime/samples/binding-select-late-2/_config.js b/test/runtime/samples/binding-select-late-2/_config.js
index 42c45d1366..f4b0088fb9 100644
--- a/test/runtime/samples/binding-select-late-2/_config.js
+++ b/test/runtime/samples/binding-select-late-2/_config.js
@@ -9,11 +9,6 @@ export default {
selected: two
`,
- ssrHtml: `
-
- selected: two
- `,
-
test({ assert, component, target }) {
component.items = [ 'one', 'two', 'three' ];
diff --git a/test/runtime/samples/binding-select-multiple/_config.js b/test/runtime/samples/binding-select-multiple/_config.js
index b7d6c3589f..70a5620d05 100644
--- a/test/runtime/samples/binding-select-multiple/_config.js
+++ b/test/runtime/samples/binding-select-multiple/_config.js
@@ -4,16 +4,6 @@ export default {
selected: [ 'two', 'three' ]
},
- ssrHtml: `
-
- one
- two
- three
-
-
- selected: two, three
- `,
-
html: `
one
diff --git a/test/runtime/samples/binding-select-unmatched/_config.js b/test/runtime/samples/binding-select-unmatched/_config.js
new file mode 100644
index 0000000000..99e7d23927
--- /dev/null
+++ b/test/runtime/samples/binding-select-unmatched/_config.js
@@ -0,0 +1,60 @@
+export default {
+ html: `
+ selected: null
+
+
+ a
+ b
+ c
+
+
+ selected: null
+ `,
+
+ async test({ assert, component, target }) {
+ const select = target.querySelector('select');
+ const options = [...target.querySelectorAll('option')];
+
+ assert.equal(component.selected, null);
+
+ // no option should be selected since none of the options matches the bound value
+ assert.equal(select.value, '');
+ assert.equal(select.selectedIndex, -1);
+ assert.ok(!options[0].selected);
+
+ component.selected = 'a'; // first option should now be selected
+ assert.equal(select.value, 'a');
+ assert.ok(options[0].selected);
+
+ assert.htmlEqual(target.innerHTML, `
+ selected: a
+
+
+ a
+ b
+ c
+
+
+ selected: a
+ `);
+
+ component.selected = 'd'; // doesn't match an option
+
+ // now no option should be selected again
+ assert.equal(select.value, '');
+ assert.equal(select.selectedIndex, -1);
+ assert.ok(!options[0].selected);
+
+ assert.htmlEqual(target.innerHTML, `
+ selected: d
+
+
+ a
+ b
+ c
+
+
+ selected: d
+ `);
+ }
+};
diff --git a/test/runtime/samples/binding-select-unmatched/main.svelte b/test/runtime/samples/binding-select-unmatched/main.svelte
new file mode 100644
index 0000000000..20e13f4765
--- /dev/null
+++ b/test/runtime/samples/binding-select-unmatched/main.svelte
@@ -0,0 +1,14 @@
+
+
+selected: {selected}
+
+
+ a
+ b
+ c
+
+
+selected: {selected}
\ No newline at end of file
diff --git a/test/runtime/samples/binding-select/_config.js b/test/runtime/samples/binding-select/_config.js
index 310315176b..6cdef2651a 100644
--- a/test/runtime/samples/binding-select/_config.js
+++ b/test/runtime/samples/binding-select/_config.js
@@ -11,18 +11,6 @@ export default {
selected: one
`,
- ssrHtml: `
- selected: one
-
-
- one
- two
- three
-
-
- selected: one
- `,
-
props: {
selected: 'one'
},
diff --git a/test/runtime/samples/binding-this-each-block-property-2/_config.js b/test/runtime/samples/binding-this-each-block-property-2/_config.js
index b67d27050e..49131d6635 100644
--- a/test/runtime/samples/binding-this-each-block-property-2/_config.js
+++ b/test/runtime/samples/binding-this-each-block-property-2/_config.js
@@ -7,7 +7,7 @@ export default {
props: {
callback
},
- after_test() {
+ before_test() {
calls = [];
},
async test({ assert, component, target }) {
diff --git a/test/runtime/samples/binding-using-props/_config.js b/test/runtime/samples/binding-using-props/_config.js
index dcb34c4357..2e5fef1f4f 100644
--- a/test/runtime/samples/binding-using-props/_config.js
+++ b/test/runtime/samples/binding-using-props/_config.js
@@ -11,4 +11,4 @@ export default {
changed
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/binding-width-height-z-index/_config.js b/test/runtime/samples/binding-width-height-z-index/_config.js
new file mode 100644
index 0000000000..c90dd8079b
--- /dev/null
+++ b/test/runtime/samples/binding-width-height-z-index/_config.js
@@ -0,0 +1,7 @@
+export default {
+ async test({ assert, target }) {
+ const iframe = target.querySelector('iframe');
+
+ assert.equal(iframe.style.zIndex, '-1');
+ }
+};
diff --git a/test/runtime/samples/binding-width-height-z-index/main.svelte b/test/runtime/samples/binding-width-height-z-index/main.svelte
new file mode 100644
index 0000000000..bc14bd33f8
--- /dev/null
+++ b/test/runtime/samples/binding-width-height-z-index/main.svelte
@@ -0,0 +1,8 @@
+
+
+
+
Hello
+
diff --git a/test/runtime/samples/bindings-before-onmount/_config.js b/test/runtime/samples/bindings-before-onmount/_config.js
index d21751c528..1d2ac64fe8 100644
--- a/test/runtime/samples/bindings-before-onmount/_config.js
+++ b/test/runtime/samples/bindings-before-onmount/_config.js
@@ -2,4 +2,4 @@ export default {
test({ assert, component }) {
assert.equal(component.one.snapshot, 2);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/bindings-coalesced/_config.js b/test/runtime/samples/bindings-coalesced/_config.js
index 164d0b42e7..14ffd3ed89 100644
--- a/test/runtime/samples/bindings-coalesced/_config.js
+++ b/test/runtime/samples/bindings-coalesced/_config.js
@@ -14,4 +14,4 @@ export default {
assert.deepEqual(values, ['6']);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/bindings-global-dependency/_config.js b/test/runtime/samples/bindings-global-dependency/_config.js
index f5ab04de78..907aa52e6e 100644
--- a/test/runtime/samples/bindings-global-dependency/_config.js
+++ b/test/runtime/samples/bindings-global-dependency/_config.js
@@ -1,3 +1,4 @@
export default {
- html: ' '
-};
\ No newline at end of file
+ html: ' ',
+ ssrHtml: ' '
+};
diff --git a/test/runtime/samples/bitmask-overflow-2/_config.js b/test/runtime/samples/bitmask-overflow-2/_config.js
index 1b0f475e94..781c493245 100644
--- a/test/runtime/samples/bitmask-overflow-2/_config.js
+++ b/test/runtime/samples/bitmask-overflow-2/_config.js
@@ -1,3 +1,3 @@
export default {
error: 'potato is not defined'
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/bitmask-overflow-3/_config.js b/test/runtime/samples/bitmask-overflow-3/_config.js
index 7c237c48f6..bd415bfd49 100644
--- a/test/runtime/samples/bitmask-overflow-3/_config.js
+++ b/test/runtime/samples/bitmask-overflow-3/_config.js
@@ -1,3 +1,3 @@
export default {
error: 'A is not defined'
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/bitmask-overflow-if-2/_config.js b/test/runtime/samples/bitmask-overflow-if-2/_config.js
new file mode 100644
index 0000000000..bdcf45abba
--- /dev/null
+++ b/test/runtime/samples/bitmask-overflow-if-2/_config.js
@@ -0,0 +1,23 @@
+// `bitmask-overflow-if` tests the case where the if condition is made of first 32 variables
+// this tests the case where the if condition is made of the next 32 variables
+export default {
+ html: `
+ 012345678910111213141516171819202122232425262728293031323334353637383940
+ expected: true
+ if: true
+ `,
+
+ async test({ assert, component, target }) {
+ component._40 = '-';
+
+ assert.htmlEqual(
+ target.innerHTML,
+ `
+ 0123456789101112131415161718192021222324252627282930313233343536373839-
+ expected: false
+ if: false
+
+ `
+ );
+ }
+};
diff --git a/test/runtime/samples/bitmask-overflow-if-2/main.svelte b/test/runtime/samples/bitmask-overflow-if-2/main.svelte
new file mode 100644
index 0000000000..f2a461b5b4
--- /dev/null
+++ b/test/runtime/samples/bitmask-overflow-if-2/main.svelte
@@ -0,0 +1,56 @@
+
+
+
+{_0}{_1}{_2}{_3}{_4}{_5}{_6}{_7}{_8}{_9}{_10}{_11}{_12}{_13}{_14}{_15}{_16}{_17}{_18}{_19}{_20}{_21}{_22}{_23}{_24}{_25}{_26}{_27}{_28}{_29}{_30}{_31}{_32}{_33}{_34}{_35}{_36}{_37}{_38}{_39}{_40}
+
+expected: {_a.indexOf(_40) > -1 && _40 === '40' && _39 === '39'}
+{#if _a.indexOf(_40) > -1 && _40 === '40' && _39 === '39'}
+if: true
+{:else}
+if: false
+
+{/if}
diff --git a/test/runtime/samples/bitmask-overflow-if/_config.js b/test/runtime/samples/bitmask-overflow-if/_config.js
index 49f48925c5..39ddc997fc 100644
--- a/test/runtime/samples/bitmask-overflow-if/_config.js
+++ b/test/runtime/samples/bitmask-overflow-if/_config.js
@@ -6,7 +6,7 @@ export default {
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const button = target.querySelector('button');
await button.dispatchEvent(new window.MouseEvent('click'));
diff --git a/test/runtime/samples/bitmask-overflow-slot-2/_config.js b/test/runtime/samples/bitmask-overflow-slot-2/_config.js
index 08c0c2f902..1f9613711a 100644
--- a/test/runtime/samples/bitmask-overflow-slot-2/_config.js
+++ b/test/runtime/samples/bitmask-overflow-slot-2/_config.js
@@ -93,4 +93,4 @@ export default {
_1: 2
});
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/bitmask-overflow-slot-3/_config.js b/test/runtime/samples/bitmask-overflow-slot-3/_config.js
index 93e548e5f7..7921253e18 100644
--- a/test/runtime/samples/bitmask-overflow-slot-3/_config.js
+++ b/test/runtime/samples/bitmask-overflow-slot-3/_config.js
@@ -27,4 +27,4 @@ export default {
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/bitmask-overflow-slot-4/_config.js b/test/runtime/samples/bitmask-overflow-slot-4/_config.js
index cdaa5de77f..5aa339afd6 100644
--- a/test/runtime/samples/bitmask-overflow-slot-4/_config.js
+++ b/test/runtime/samples/bitmask-overflow-slot-4/_config.js
@@ -38,4 +38,4 @@ export default {
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/bitmask-overflow-slot-5/_config.js b/test/runtime/samples/bitmask-overflow-slot-5/_config.js
index 7dedb8f7eb..80900d0042 100644
--- a/test/runtime/samples/bitmask-overflow-slot-5/_config.js
+++ b/test/runtime/samples/bitmask-overflow-slot-5/_config.js
@@ -46,4 +46,4 @@ export default {
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/bitmask-overflow-slot-6/_config.js b/test/runtime/samples/bitmask-overflow-slot-6/_config.js
index 8cd8c07a65..3bcf4b98e4 100644
--- a/test/runtime/samples/bitmask-overflow-slot-6/_config.js
+++ b/test/runtime/samples/bitmask-overflow-slot-6/_config.js
@@ -7,11 +7,11 @@ export default {
Toggle outside
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const button = target.querySelectorAll('button')[1];
const div = target.querySelector('div');
await div.dispatchEvent(new window.MouseEvent('click'));
-
+
assert.htmlEqual(target.innerHTML, `
Toggle inside 1
@@ -19,7 +19,7 @@ export default {
Toggle outside
`);
-
+
await button.dispatchEvent(new window.MouseEvent('click'));
assert.htmlEqual(target.innerHTML, `
@@ -29,4 +29,4 @@ export default {
Toggle outside
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/bitmask-overflow-slot/_config.js b/test/runtime/samples/bitmask-overflow-slot/_config.js
index 9b24d5541f..a14ef3270f 100644
--- a/test/runtime/samples/bitmask-overflow-slot/_config.js
+++ b/test/runtime/samples/bitmask-overflow-slot/_config.js
@@ -121,4 +121,4 @@ export default {
_40: 1
});
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/bitmask-overflow/_config.js b/test/runtime/samples/bitmask-overflow/_config.js
index ada3195c81..e5e54ac10e 100644
--- a/test/runtime/samples/bitmask-overflow/_config.js
+++ b/test/runtime/samples/bitmask-overflow/_config.js
@@ -119,4 +119,4 @@ export default {
_40: 1
});
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/class-shortcut-with-class/_config.js b/test/runtime/samples/class-shortcut-with-class/_config.js
index 6d647e8f9d..5f2f28555e 100644
--- a/test/runtime/samples/class-shortcut-with-class/_config.js
+++ b/test/runtime/samples/class-shortcut-with-class/_config.js
@@ -7,7 +7,7 @@ export default {
html: '
',
- test({ assert, component, target, window }) {
+ test({ assert, component, target }) {
component.foo = false;
assert.htmlEqual(target.innerHTML, `
diff --git a/test/runtime/samples/class-shortcut/_config.js b/test/runtime/samples/class-shortcut/_config.js
index aba7e0e031..ac5be276b0 100644
--- a/test/runtime/samples/class-shortcut/_config.js
+++ b/test/runtime/samples/class-shortcut/_config.js
@@ -6,7 +6,7 @@ export default {
html: '
',
- test({ assert, component, target, window }) {
+ test({ assert, component, target }) {
component.foo = false;
assert.htmlEqual(target.innerHTML, `
diff --git a/test/runtime/samples/class-with-dynamic-attribute-and-spread/_config.js b/test/runtime/samples/class-with-dynamic-attribute-and-spread/_config.js
index f704e9327f..0c357926e2 100644
--- a/test/runtime/samples/class-with-dynamic-attribute-and-spread/_config.js
+++ b/test/runtime/samples/class-with-dynamic-attribute-and-spread/_config.js
@@ -8,7 +8,7 @@ export default {
html: '
',
- test({ assert, component, target, window }) {
+ test({ assert, component, target }) {
component.myClass = 'one';
component.attributes = {
'aria-label': 'Test'
diff --git a/test/runtime/samples/class-with-dynamic-attribute/_config.js b/test/runtime/samples/class-with-dynamic-attribute/_config.js
index 2be6500674..8e05c72065 100644
--- a/test/runtime/samples/class-with-dynamic-attribute/_config.js
+++ b/test/runtime/samples/class-with-dynamic-attribute/_config.js
@@ -5,7 +5,7 @@ export default {
html: '
',
- test({ assert, component, target, window }) {
+ test({ assert, component, target }) {
component.myClass = 'one';
assert.htmlEqual(target.innerHTML, `
diff --git a/test/runtime/samples/class-with-spread-and-bind/_config.js b/test/runtime/samples/class-with-spread-and-bind/_config.js
index 7b50502f34..d1f3503b6c 100644
--- a/test/runtime/samples/class-with-spread-and-bind/_config.js
+++ b/test/runtime/samples/class-with-spread-and-bind/_config.js
@@ -5,7 +5,7 @@ export default {
html: '
',
- test({ assert, component, target, window }) {
+ test({ assert, component, target }) {
component.primary = true;
assert.htmlEqual(
diff --git a/test/runtime/samples/class-with-spread/_config.js b/test/runtime/samples/class-with-spread/_config.js
index c7c85e38b0..d49b3f053e 100644
--- a/test/runtime/samples/class-with-spread/_config.js
+++ b/test/runtime/samples/class-with-spread/_config.js
@@ -8,7 +8,7 @@ export default {
html: '
',
- test({ assert, component, target, window }) {
+ test({ assert, component, target }) {
component.myClass = 'one';
component.attributes = {
'aria-label': 'Test'
diff --git a/test/runtime/samples/component-binding-accessors/Nested.svelte b/test/runtime/samples/component-binding-accessors/Nested.svelte
new file mode 100644
index 0000000000..a3ce2afd9f
--- /dev/null
+++ b/test/runtime/samples/component-binding-accessors/Nested.svelte
@@ -0,0 +1,5 @@
+
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-binding-accessors/_config.js b/test/runtime/samples/component-binding-accessors/_config.js
new file mode 100644
index 0000000000..4513b43a0b
--- /dev/null
+++ b/test/runtime/samples/component-binding-accessors/_config.js
@@ -0,0 +1,18 @@
+export default {
+ async test({ assert, target, window }) {
+ const [input1, input2] = target.querySelectorAll('input');
+ assert.equal(input1.value, 'something');
+ assert.equal(input2.value, 'something');
+
+ input1.value = 'abc';
+
+ await input1.dispatchEvent(new window.Event('input'));
+ assert.equal(input1.value, 'abc');
+ assert.equal(input2.value, 'abc');
+
+ await target.querySelector('button').dispatchEvent(new window.MouseEvent('click'));
+
+ assert.equal(input1.value, 'Reset');
+ assert.equal(input2.value, 'Reset');
+ }
+};
diff --git a/test/runtime/samples/component-binding-accessors/main.svelte b/test/runtime/samples/component-binding-accessors/main.svelte
new file mode 100644
index 0000000000..1d8576643d
--- /dev/null
+++ b/test/runtime/samples/component-binding-accessors/main.svelte
@@ -0,0 +1,12 @@
+
+
+
+
+
+
{
+ c.value = 'Reset';
+}}>Reset
\ No newline at end of file
diff --git a/test/runtime/samples/component-binding-blowback-b/_config.js b/test/runtime/samples/component-binding-blowback-b/_config.js
index 69af7917ca..2f6350c4fb 100644
--- a/test/runtime/samples/component-binding-blowback-b/_config.js
+++ b/test/runtime/samples/component-binding-blowback-b/_config.js
@@ -14,7 +14,7 @@ export default {
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const input = target.querySelector('input');
input.value = 4;
diff --git a/test/runtime/samples/component-binding-computed/_config.js b/test/runtime/samples/component-binding-computed/_config.js
index b287014065..f43a6834a8 100644
--- a/test/runtime/samples/component-binding-computed/_config.js
+++ b/test/runtime/samples/component-binding-computed/_config.js
@@ -3,6 +3,10 @@ export default {
firstname
lastname
`,
+ ssrHtml: `
+
firstname
+
lastname
+ `,
async test({ assert, component, target, window }) {
const input = new window.Event('input');
diff --git a/test/runtime/samples/component-binding-parent-supercedes-child-b/_config.js b/test/runtime/samples/component-binding-parent-supercedes-child-b/_config.js
index bf6312f5ad..4e31a4d79c 100644
--- a/test/runtime/samples/component-binding-parent-supercedes-child-b/_config.js
+++ b/test/runtime/samples/component-binding-parent-supercedes-child-b/_config.js
@@ -4,7 +4,7 @@ export default {
x in parent: yes
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, component, target }) {
component.a = false;
assert.htmlEqual(target.innerHTML, `
diff --git a/test/runtime/samples/component-binding-parent-supercedes-child-c/_config.js b/test/runtime/samples/component-binding-parent-supercedes-child-c/_config.js
index bf6312f5ad..4e31a4d79c 100644
--- a/test/runtime/samples/component-binding-parent-supercedes-child-c/_config.js
+++ b/test/runtime/samples/component-binding-parent-supercedes-child-c/_config.js
@@ -4,7 +4,7 @@ export default {
x in parent: yes
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, component, target }) {
component.a = false;
assert.htmlEqual(target.innerHTML, `
diff --git a/test/runtime/samples/component-binding-private-state/_config.js b/test/runtime/samples/component-binding-private-state/_config.js
index bd8a25d490..f4f2fd6f83 100644
--- a/test/runtime/samples/component-binding-private-state/_config.js
+++ b/test/runtime/samples/component-binding-private-state/_config.js
@@ -4,7 +4,7 @@ export default {
x in parent: undefined
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, component, target }) {
component.a = false;
assert.htmlEqual(target.innerHTML, `
diff --git a/test/runtime/samples/component-binding-reactive-property-no-extra-call/Component.svelte b/test/runtime/samples/component-binding-reactive-property-no-extra-call/Component.svelte
new file mode 100644
index 0000000000..f180f10cd8
--- /dev/null
+++ b/test/runtime/samples/component-binding-reactive-property-no-extra-call/Component.svelte
@@ -0,0 +1,6 @@
+
+
+{value}{value2}
diff --git a/test/runtime/samples/component-binding-reactive-property-no-extra-call/_config.js b/test/runtime/samples/component-binding-reactive-property-no-extra-call/_config.js
new file mode 100644
index 0000000000..7027c1a4e4
--- /dev/null
+++ b/test/runtime/samples/component-binding-reactive-property-no-extra-call/_config.js
@@ -0,0 +1,5 @@
+export default {
+ async test({ assert, component }) {
+ assert.equal(component.object_updates, component.primitive_updates);
+ }
+};
diff --git a/test/runtime/samples/component-binding-reactive-property-no-extra-call/main.svelte b/test/runtime/samples/component-binding-reactive-property-no-extra-call/main.svelte
new file mode 100644
index 0000000000..9d52ed675f
--- /dev/null
+++ b/test/runtime/samples/component-binding-reactive-property-no-extra-call/main.svelte
@@ -0,0 +1,13 @@
+
+
+
diff --git a/test/runtime/samples/component-binding-reactive-statement/_config.js b/test/runtime/samples/component-binding-reactive-statement/_config.js
index 49342d0645..8b8d091c73 100644
--- a/test/runtime/samples/component-binding-reactive-statement/_config.js
+++ b/test/runtime/samples/component-binding-reactive-statement/_config.js
@@ -4,7 +4,7 @@ export default {
button 0
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const event = new window.MouseEvent('click');
const buttons = target.querySelectorAll('button');
diff --git a/test/runtime/samples/component-binding-store/_config.js b/test/runtime/samples/component-binding-store/_config.js
index d17b9e2d80..8bbdab17ee 100644
--- a/test/runtime/samples/component-binding-store/_config.js
+++ b/test/runtime/samples/component-binding-store/_config.js
@@ -4,6 +4,11 @@ export default {
`,
+ ssrHtml: `
+
+
+
+ `,
async test({ assert, component, target, window }) {
let count = 0;
diff --git a/test/runtime/samples/component-event-handler-contenteditable/_config.js b/test/runtime/samples/component-event-handler-contenteditable/_config.js
index 3a85734975..1628e22d01 100644
--- a/test/runtime/samples/component-event-handler-contenteditable/_config.js
+++ b/test/runtime/samples/component-event-handler-contenteditable/_config.js
@@ -3,7 +3,7 @@ export default {
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const div = target.querySelector('div');
const text = window.document.createTextNode('a');
div.insertBefore(text, null);
diff --git a/test/runtime/samples/component-events-console/_config.js b/test/runtime/samples/component-events-console/_config.js
index 39ccbd719f..fc3b4daa85 100644
--- a/test/runtime/samples/component-events-console/_config.js
+++ b/test/runtime/samples/component-events-console/_config.js
@@ -1,7 +1,7 @@
export default {
html: '
click me ',
- test({ assert, component, target }) {
+ test({ assert, target }) {
const button = target.querySelector('button');
const messages = [];
diff --git a/test/runtime/samples/component-events-this/Inner.svelte b/test/runtime/samples/component-events-this/Inner.svelte
new file mode 100644
index 0000000000..377aa17c43
--- /dev/null
+++ b/test/runtime/samples/component-events-this/Inner.svelte
@@ -0,0 +1,7 @@
+
+
+
dispatch('bar')} />
\ No newline at end of file
diff --git a/test/runtime/samples/component-events-this/Widget.svelte b/test/runtime/samples/component-events-this/Widget.svelte
new file mode 100644
index 0000000000..30b95e94f1
--- /dev/null
+++ b/test/runtime/samples/component-events-this/Widget.svelte
@@ -0,0 +1,6 @@
+
+
+click me
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-events-this/_config.js b/test/runtime/samples/component-events-this/_config.js
new file mode 100644
index 0000000000..180ae7367d
--- /dev/null
+++ b/test/runtime/samples/component-events-this/_config.js
@@ -0,0 +1,11 @@
+export default {
+ test({ assert, component, target, window }) {
+ const [button1, button2] = target.querySelectorAll('button');
+
+ button1.dispatchEvent(new window.MouseEvent('click'));
+ button2.dispatchEvent(new window.MouseEvent('click'));
+
+ assert.strictEqual(component.logs[0], button1);
+ assert.ok(component.logs[1] instanceof component.Inner);
+ }
+};
diff --git a/test/runtime/samples/component-events-this/main.svelte b/test/runtime/samples/component-events-this/main.svelte
new file mode 100644
index 0000000000..328a524360
--- /dev/null
+++ b/test/runtime/samples/component-events-this/main.svelte
@@ -0,0 +1,16 @@
+
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-name-deconflicted-globals/_config.js b/test/runtime/samples/component-name-deconflicted-globals/_config.js
index 842b6a3a11..66d1d1a8f1 100644
--- a/test/runtime/samples/component-name-deconflicted-globals/_config.js
+++ b/test/runtime/samples/component-name-deconflicted-globals/_config.js
@@ -2,4 +2,4 @@ export default {
preserveIdentifiers: true,
error: 'Countdown is not defined'
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/component-name-deconflicted/_config.js b/test/runtime/samples/component-name-deconflicted/_config.js
index 97ea2290b6..5813042745 100644
--- a/test/runtime/samples/component-name-deconflicted/_config.js
+++ b/test/runtime/samples/component-name-deconflicted/_config.js
@@ -12,4 +12,4 @@ export default {
4
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/component-namespaced/_config.js b/test/runtime/samples/component-namespaced/_config.js
index b91795d6c8..7ec4a35c6d 100644
--- a/test/runtime/samples/component-namespaced/_config.js
+++ b/test/runtime/samples/component-namespaced/_config.js
@@ -1,5 +1,3 @@
-import * as path from 'path';
-
export default {
props: {
a: 1
@@ -9,14 +7,10 @@ export default {
foo 1
`,
- before_test() {
- delete require.cache[path.resolve(__dirname, 'components.js')];
- },
-
test({ assert, component, target }) {
component.a = 2;
assert.htmlEqual(target.innerHTML, `
foo 2
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/component-namespaced/components.js b/test/runtime/samples/component-namespaced/components.js
deleted file mode 100644
index 832d2412ee..0000000000
--- a/test/runtime/samples/component-namespaced/components.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import Foo from './Foo.svelte';
-
-export default { Foo };
\ No newline at end of file
diff --git a/test/runtime/samples/component-namespaced/components.svelte b/test/runtime/samples/component-namespaced/components.svelte
new file mode 100644
index 0000000000..5b9a6c5167
--- /dev/null
+++ b/test/runtime/samples/component-namespaced/components.svelte
@@ -0,0 +1,5 @@
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-namespaced/main.svelte b/test/runtime/samples/component-namespaced/main.svelte
index 541b68e47e..25862cf6f2 100644
--- a/test/runtime/samples/component-namespaced/main.svelte
+++ b/test/runtime/samples/component-namespaced/main.svelte
@@ -1,5 +1,5 @@
diff --git a/test/runtime/samples/component-nested-deep/_config.js b/test/runtime/samples/component-nested-deep/_config.js
index 0114e79223..3d5305529e 100644
--- a/test/runtime/samples/component-nested-deep/_config.js
+++ b/test/runtime/samples/component-nested-deep/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component }) {
+ test({ component }) {
component.l1.$destroy();
}
};
diff --git a/test/runtime/samples/component-nested-deeper/_config.js b/test/runtime/samples/component-nested-deeper/_config.js
index 86993b3e9a..828a3169ac 100644
--- a/test/runtime/samples/component-nested-deeper/_config.js
+++ b/test/runtime/samples/component-nested-deeper/_config.js
@@ -3,7 +3,7 @@ export default {
values: [1, 2, 3, 4]
},
- test({ assert, component }) {
+ test({ component }) {
component.values = [2, 3];
}
};
diff --git a/test/runtime/samples/component-slot-attribute-order/Component.svelte b/test/runtime/samples/component-slot-attribute-order/Component.svelte
new file mode 100644
index 0000000000..55c0858fb9
--- /dev/null
+++ b/test/runtime/samples/component-slot-attribute-order/Component.svelte
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-slot-attribute-order/_config.js b/test/runtime/samples/component-slot-attribute-order/_config.js
new file mode 100644
index 0000000000..f4572317ca
--- /dev/null
+++ b/test/runtime/samples/component-slot-attribute-order/_config.js
@@ -0,0 +1,15 @@
+export default {
+ html: `
+ Disable
+ Button
+ Button
+ `,
+ async test({ assert, target, window }) {
+ const [btn, btn1, btn2] = target.querySelectorAll('button');
+
+ await btn.dispatchEvent(new window.MouseEvent('click'));
+
+ assert.equal(btn1.disabled, true);
+ assert.equal(btn2.disabled, true);
+ }
+};
diff --git a/test/runtime/samples/component-slot-attribute-order/main.svelte b/test/runtime/samples/component-slot-attribute-order/main.svelte
new file mode 100644
index 0000000000..85f99d7579
--- /dev/null
+++ b/test/runtime/samples/component-slot-attribute-order/main.svelte
@@ -0,0 +1,15 @@
+
+
+ disabled = !disabled}>Disable
+
+
+ Button
+
+
+
+ Button
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-slot-component-named-b/Hello.svelte b/test/runtime/samples/component-slot-component-named-b/Hello.svelte
new file mode 100644
index 0000000000..ba726f62c9
--- /dev/null
+++ b/test/runtime/samples/component-slot-component-named-b/Hello.svelte
@@ -0,0 +1,5 @@
+
+
+Hello {name}
\ No newline at end of file
diff --git a/test/runtime/samples/component-slot-component-named-b/Nested.svelte b/test/runtime/samples/component-slot-component-named-b/Nested.svelte
new file mode 100644
index 0000000000..a94392ce5d
--- /dev/null
+++ b/test/runtime/samples/component-slot-component-named-b/Nested.svelte
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-slot-component-named-b/_config.js b/test/runtime/samples/component-slot-component-named-b/_config.js
new file mode 100644
index 0000000000..2b4af715c2
--- /dev/null
+++ b/test/runtime/samples/component-slot-component-named-b/_config.js
@@ -0,0 +1,7 @@
+export default {
+ preserveIdentifiers: true,
+
+ html: `
+ Hello world
+ `
+};
diff --git a/test/runtime/samples/component-slot-component-named-b/main.svelte b/test/runtime/samples/component-slot-component-named-b/main.svelte
new file mode 100644
index 0000000000..494a50a86c
--- /dev/null
+++ b/test/runtime/samples/component-slot-component-named-b/main.svelte
@@ -0,0 +1,10 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-slot-component-named-c/Hello.svelte b/test/runtime/samples/component-slot-component-named-c/Hello.svelte
new file mode 100644
index 0000000000..28a2bb436a
--- /dev/null
+++ b/test/runtime/samples/component-slot-component-named-c/Hello.svelte
@@ -0,0 +1 @@
+Hello
\ No newline at end of file
diff --git a/test/runtime/samples/component-slot-component-named-c/Nested.svelte b/test/runtime/samples/component-slot-component-named-c/Nested.svelte
new file mode 100644
index 0000000000..a94392ce5d
--- /dev/null
+++ b/test/runtime/samples/component-slot-component-named-c/Nested.svelte
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-slot-component-named-c/World.svelte b/test/runtime/samples/component-slot-component-named-c/World.svelte
new file mode 100644
index 0000000000..680e6dff5b
--- /dev/null
+++ b/test/runtime/samples/component-slot-component-named-c/World.svelte
@@ -0,0 +1 @@
+world
\ No newline at end of file
diff --git a/test/runtime/samples/component-slot-component-named-c/_config.js b/test/runtime/samples/component-slot-component-named-c/_config.js
new file mode 100644
index 0000000000..9dfed6ff53
--- /dev/null
+++ b/test/runtime/samples/component-slot-component-named-c/_config.js
@@ -0,0 +1,6 @@
+export default {
+ html: `
+ Hello
+ world
+ `
+};
diff --git a/test/runtime/samples/component-slot-component-named-c/main.svelte b/test/runtime/samples/component-slot-component-named-c/main.svelte
new file mode 100644
index 0000000000..4bf657d9cb
--- /dev/null
+++ b/test/runtime/samples/component-slot-component-named-c/main.svelte
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-slot-component-named/Bar.svelte b/test/runtime/samples/component-slot-component-named/Bar.svelte
new file mode 100644
index 0000000000..8124337d72
--- /dev/null
+++ b/test/runtime/samples/component-slot-component-named/Bar.svelte
@@ -0,0 +1 @@
+bar
\ No newline at end of file
diff --git a/test/runtime/samples/component-slot-component-named/Foo.svelte b/test/runtime/samples/component-slot-component-named/Foo.svelte
new file mode 100644
index 0000000000..998ea4094d
--- /dev/null
+++ b/test/runtime/samples/component-slot-component-named/Foo.svelte
@@ -0,0 +1 @@
+foo
\ No newline at end of file
diff --git a/test/runtime/samples/component-slot-component-named/Nested.svelte b/test/runtime/samples/component-slot-component-named/Nested.svelte
new file mode 100644
index 0000000000..665555820a
--- /dev/null
+++ b/test/runtime/samples/component-slot-component-named/Nested.svelte
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-slot-component-named/_config.js b/test/runtime/samples/component-slot-component-named/_config.js
new file mode 100644
index 0000000000..f7b74a7b4f
--- /dev/null
+++ b/test/runtime/samples/component-slot-component-named/_config.js
@@ -0,0 +1,9 @@
+export default {
+ html: `
+
+ `
+};
diff --git a/test/runtime/samples/component-slot-component-named/main.svelte b/test/runtime/samples/component-slot-component-named/main.svelte
new file mode 100644
index 0000000000..c16f005d5d
--- /dev/null
+++ b/test/runtime/samples/component-slot-component-named/main.svelte
@@ -0,0 +1,12 @@
+
+
+
+ Hello
+
+
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-slot-context-props-each-nested/Nested.svelte b/test/runtime/samples/component-slot-context-props-each-nested/Nested.svelte
new file mode 100644
index 0000000000..fab3ae1890
--- /dev/null
+++ b/test/runtime/samples/component-slot-context-props-each-nested/Nested.svelte
@@ -0,0 +1,14 @@
+
+
+{#each items as item (item)}
+ {#each keys as key (key)}
+ setKey(key, value, item)} />
+ {/each}
+{/each}
\ No newline at end of file
diff --git a/test/runtime/samples/component-slot-context-props-each-nested/_config.js b/test/runtime/samples/component-slot-context-props-each-nested/_config.js
new file mode 100644
index 0000000000..869cc555b1
--- /dev/null
+++ b/test/runtime/samples/component-slot-context-props-each-nested/_config.js
@@ -0,0 +1,36 @@
+export default {
+ html: `
+ Set a-c
+ Set b-c
+ Set a-d
+ Set b-d
+ `,
+ async test({ assert, target, window, component }) {
+ const [btn1, btn2, btn3, btn4] = target.querySelectorAll('button');
+ const click = new window.MouseEvent('click');
+
+ await btn1.dispatchEvent(click);
+ assert.deepEqual(component.log, ['setKey(a, value-a-c, c)']);
+
+ await btn2.dispatchEvent(click);
+ assert.deepEqual(component.log, [
+ 'setKey(a, value-a-c, c)',
+ 'setKey(b, value-b-c, c)'
+ ]);
+
+ await btn3.dispatchEvent(click);
+ assert.deepEqual(component.log, [
+ 'setKey(a, value-a-c, c)',
+ 'setKey(b, value-b-c, c)',
+ 'setKey(a, value-a-d, d)'
+ ]);
+
+ await btn4.dispatchEvent(click);
+ assert.deepEqual(component.log, [
+ 'setKey(a, value-a-c, c)',
+ 'setKey(b, value-b-c, c)',
+ 'setKey(a, value-a-d, d)',
+ 'setKey(b, value-b-d, d)'
+ ]);
+ }
+};
diff --git a/test/runtime/samples/component-slot-context-props-each-nested/main.svelte b/test/runtime/samples/component-slot-context-props-each-nested/main.svelte
new file mode 100644
index 0000000000..7feb55aaf6
--- /dev/null
+++ b/test/runtime/samples/component-slot-context-props-each-nested/main.svelte
@@ -0,0 +1,8 @@
+
+
+
+ set(`value-${key}-${item}`)}>Set {key}-{item}
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-slot-context-props-each/Nested.svelte b/test/runtime/samples/component-slot-context-props-each/Nested.svelte
new file mode 100644
index 0000000000..a29ffe0376
--- /dev/null
+++ b/test/runtime/samples/component-slot-context-props-each/Nested.svelte
@@ -0,0 +1,11 @@
+
+
+{#each keys as key (key)}
+ setKey(key, value)} />
+{/each}
\ No newline at end of file
diff --git a/test/runtime/samples/component-slot-context-props-each/_config.js b/test/runtime/samples/component-slot-context-props-each/_config.js
new file mode 100644
index 0000000000..f374e7f827
--- /dev/null
+++ b/test/runtime/samples/component-slot-context-props-each/_config.js
@@ -0,0 +1,19 @@
+export default {
+ html: `
+ Set a
+ Set b
+ `,
+ async test({ assert, target, window, component }) {
+ const [btn1, btn2] = target.querySelectorAll('button');
+ const click = new window.MouseEvent('click');
+
+ await btn1.dispatchEvent(click);
+ assert.deepEqual(component.log, ['setKey(a, value-a)']);
+
+ await btn2.dispatchEvent(click);
+ assert.deepEqual(component.log, [
+ 'setKey(a, value-a)',
+ 'setKey(b, value-b)'
+ ]);
+ }
+};
diff --git a/test/runtime/samples/component-slot-context-props-each/main.svelte b/test/runtime/samples/component-slot-context-props-each/main.svelte
new file mode 100644
index 0000000000..7dc17b4c95
--- /dev/null
+++ b/test/runtime/samples/component-slot-context-props-each/main.svelte
@@ -0,0 +1,8 @@
+
+
+
+ set(`value-${key}`)}>Set {key}
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-slot-context-props-let/Inner.svelte b/test/runtime/samples/component-slot-context-props-let/Inner.svelte
new file mode 100644
index 0000000000..6beaabbb68
--- /dev/null
+++ b/test/runtime/samples/component-slot-context-props-let/Inner.svelte
@@ -0,0 +1,9 @@
+
+
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-slot-context-props-let/Nested.svelte b/test/runtime/samples/component-slot-context-props-let/Nested.svelte
new file mode 100644
index 0000000000..97c44c5145
--- /dev/null
+++ b/test/runtime/samples/component-slot-context-props-let/Nested.svelte
@@ -0,0 +1,8 @@
+
+
+
+ set(key, value)} />
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-slot-context-props-let/_config.js b/test/runtime/samples/component-slot-context-props-let/_config.js
new file mode 100644
index 0000000000..f374e7f827
--- /dev/null
+++ b/test/runtime/samples/component-slot-context-props-let/_config.js
@@ -0,0 +1,19 @@
+export default {
+ html: `
+ Set a
+ Set b
+ `,
+ async test({ assert, target, window, component }) {
+ const [btn1, btn2] = target.querySelectorAll('button');
+ const click = new window.MouseEvent('click');
+
+ await btn1.dispatchEvent(click);
+ assert.deepEqual(component.log, ['setKey(a, value-a)']);
+
+ await btn2.dispatchEvent(click);
+ assert.deepEqual(component.log, [
+ 'setKey(a, value-a)',
+ 'setKey(b, value-b)'
+ ]);
+ }
+};
diff --git a/test/runtime/samples/component-slot-context-props-let/main.svelte b/test/runtime/samples/component-slot-context-props-let/main.svelte
new file mode 100644
index 0000000000..a061f73b3a
--- /dev/null
+++ b/test/runtime/samples/component-slot-context-props-let/main.svelte
@@ -0,0 +1,8 @@
+
+
+
+ set(`value-${key}`)}>Set {key}
+
diff --git a/test/runtime/samples/component-slot-duplicate-error-2/Nested.svelte b/test/runtime/samples/component-slot-duplicate-error-2/Nested.svelte
new file mode 100644
index 0000000000..32eee1534a
--- /dev/null
+++ b/test/runtime/samples/component-slot-duplicate-error-2/Nested.svelte
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-slot-duplicate-error-2/_config.js b/test/runtime/samples/component-slot-duplicate-error-2/_config.js
new file mode 100644
index 0000000000..1c9fa51dc3
--- /dev/null
+++ b/test/runtime/samples/component-slot-duplicate-error-2/_config.js
@@ -0,0 +1,3 @@
+export default {
+ error: 'Duplicate slot name "foo" in '
+};
diff --git a/test/runtime/samples/component-slot-duplicate-error-2/main.svelte b/test/runtime/samples/component-slot-duplicate-error-2/main.svelte
new file mode 100644
index 0000000000..fefa1dc861
--- /dev/null
+++ b/test/runtime/samples/component-slot-duplicate-error-2/main.svelte
@@ -0,0 +1,8 @@
+
+
+
+ {value}
+ {value}
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-slot-duplicate-error-3/Nested.svelte b/test/runtime/samples/component-slot-duplicate-error-3/Nested.svelte
new file mode 100644
index 0000000000..32eee1534a
--- /dev/null
+++ b/test/runtime/samples/component-slot-duplicate-error-3/Nested.svelte
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-slot-duplicate-error-3/_config.js b/test/runtime/samples/component-slot-duplicate-error-3/_config.js
new file mode 100644
index 0000000000..1c9fa51dc3
--- /dev/null
+++ b/test/runtime/samples/component-slot-duplicate-error-3/_config.js
@@ -0,0 +1,3 @@
+export default {
+ error: 'Duplicate slot name "foo" in '
+};
diff --git a/test/runtime/samples/component-slot-duplicate-error-3/main.svelte b/test/runtime/samples/component-slot-duplicate-error-3/main.svelte
new file mode 100644
index 0000000000..596c1313d6
--- /dev/null
+++ b/test/runtime/samples/component-slot-duplicate-error-3/main.svelte
@@ -0,0 +1,8 @@
+
+
+
+ {value}
+ {value}
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-slot-duplicate-error-4/Nested.svelte b/test/runtime/samples/component-slot-duplicate-error-4/Nested.svelte
new file mode 100644
index 0000000000..0385342cef
--- /dev/null
+++ b/test/runtime/samples/component-slot-duplicate-error-4/Nested.svelte
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-slot-duplicate-error-4/_config.js b/test/runtime/samples/component-slot-duplicate-error-4/_config.js
new file mode 100644
index 0000000000..cfe8e7054e
--- /dev/null
+++ b/test/runtime/samples/component-slot-duplicate-error-4/_config.js
@@ -0,0 +1,3 @@
+export default {
+ error: 'Found elements without slot attribute when using slot="default"'
+};
diff --git a/test/runtime/samples/component-slot-duplicate-error-4/main.svelte b/test/runtime/samples/component-slot-duplicate-error-4/main.svelte
new file mode 100644
index 0000000000..ee1dcfad7b
--- /dev/null
+++ b/test/runtime/samples/component-slot-duplicate-error-4/main.svelte
@@ -0,0 +1,8 @@
+
+
+
+ value
+ value
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-slot-duplicate-error/Nested.svelte b/test/runtime/samples/component-slot-duplicate-error/Nested.svelte
new file mode 100644
index 0000000000..32eee1534a
--- /dev/null
+++ b/test/runtime/samples/component-slot-duplicate-error/Nested.svelte
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-slot-duplicate-error/_config.js b/test/runtime/samples/component-slot-duplicate-error/_config.js
new file mode 100644
index 0000000000..1c9fa51dc3
--- /dev/null
+++ b/test/runtime/samples/component-slot-duplicate-error/_config.js
@@ -0,0 +1,3 @@
+export default {
+ error: 'Duplicate slot name "foo" in '
+};
diff --git a/test/runtime/samples/component-slot-duplicate-error/main.svelte b/test/runtime/samples/component-slot-duplicate-error/main.svelte
new file mode 100644
index 0000000000..9024bcd46f
--- /dev/null
+++ b/test/runtime/samples/component-slot-duplicate-error/main.svelte
@@ -0,0 +1,8 @@
+
+
+
+ {value}
+ {value}
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-slot-dynamic/_config.js b/test/runtime/samples/component-slot-dynamic/_config.js
index 9e43ff15fe..9a6ed1a057 100644
--- a/test/runtime/samples/component-slot-dynamic/_config.js
+++ b/test/runtime/samples/component-slot-dynamic/_config.js
@@ -3,7 +3,7 @@ export default {
override default slot
`,
- test({ assert, component }) {
+ test({ component }) {
component.nested.foo = 'b';
}
};
diff --git a/test/runtime/samples/component-slot-fallback-6/_config.js b/test/runtime/samples/component-slot-fallback-6/_config.js
index b32d96db2e..be47d31d03 100644
--- a/test/runtime/samples/component-slot-fallback-6/_config.js
+++ b/test/runtime/samples/component-slot-fallback-6/_config.js
@@ -4,6 +4,10 @@ export default {
{"value":""}
`,
+ ssrHtml: `
+
+ {"value":""}
+ `,
async test({ assert, target, window }) {
const input = target.querySelector('input');
diff --git a/test/runtime/samples/component-slot-let-destructured-2/_config.js b/test/runtime/samples/component-slot-let-destructured-2/_config.js
index 38b04b7b5e..e407dcf2f8 100644
--- a/test/runtime/samples/component-slot-let-destructured-2/_config.js
+++ b/test/runtime/samples/component-slot-let-destructured-2/_config.js
@@ -13,7 +13,7 @@ export default {
Increment
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const [button1, button2, button3] = target.querySelectorAll('button');
const event = new window.MouseEvent('click');
diff --git a/test/runtime/samples/component-slot-named-inherits-default-lets/_config.js b/test/runtime/samples/component-slot-named-inherits-default-lets/_config.js
index a07a1482bc..8297162b91 100644
--- a/test/runtime/samples/component-slot-named-inherits-default-lets/_config.js
+++ b/test/runtime/samples/component-slot-named-inherits-default-lets/_config.js
@@ -22,4 +22,4 @@ export default {
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/component-slot-nested-if/_config.js b/test/runtime/samples/component-slot-nested-if/_config.js
index 45c570fc22..e4af352970 100644
--- a/test/runtime/samples/component-slot-nested-if/_config.js
+++ b/test/runtime/samples/component-slot-nested-if/_config.js
@@ -2,7 +2,7 @@ export default {
html: `
`,
- async test({ assert, target, snapshot, component, window }) {
+ async test({ assert, target, window }) {
const input = target.querySelector('input');
input.value = 'a';
diff --git a/test/runtime/samples/component-slot-slot/Component.svelte b/test/runtime/samples/component-slot-slot/Component.svelte
new file mode 100644
index 0000000000..fdcb8e7f2b
--- /dev/null
+++ b/test/runtime/samples/component-slot-slot/Component.svelte
@@ -0,0 +1,3 @@
+
+
+
diff --git a/test/runtime/samples/component-slot-slot/Forward.svelte b/test/runtime/samples/component-slot-slot/Forward.svelte
new file mode 100644
index 0000000000..320be9df25
--- /dev/null
+++ b/test/runtime/samples/component-slot-slot/Forward.svelte
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/test/runtime/samples/component-slot-slot/_config.js b/test/runtime/samples/component-slot-slot/_config.js
new file mode 100644
index 0000000000..32af774fac
--- /dev/null
+++ b/test/runtime/samples/component-slot-slot/_config.js
@@ -0,0 +1,3 @@
+export default {
+ html: 'lol
'
+};
diff --git a/test/runtime/samples/component-slot-slot/main.svelte b/test/runtime/samples/component-slot-slot/main.svelte
new file mode 100644
index 0000000000..1718494b16
--- /dev/null
+++ b/test/runtime/samples/component-slot-slot/main.svelte
@@ -0,0 +1,9 @@
+
+
+
+
+ lol
+
+
diff --git a/test/runtime/samples/component-slot-spread-props/_config.js b/test/runtime/samples/component-slot-spread-props/_config.js
index 042bdca6ec..7beda8d3d5 100644
--- a/test/runtime/samples/component-slot-spread-props/_config.js
+++ b/test/runtime/samples/component-slot-spread-props/_config.js
@@ -5,6 +5,12 @@ export default {
`,
+ ssrHtml: `
+
+ `,
async test({ assert, component, target }) {
component.value = 'foo';
diff --git a/test/runtime/samples/component-slot-spread/Nested.svelte b/test/runtime/samples/component-slot-spread/Nested.svelte
new file mode 100644
index 0000000000..597f7bbb1b
--- /dev/null
+++ b/test/runtime/samples/component-slot-spread/Nested.svelte
@@ -0,0 +1,7 @@
+
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-slot-spread/_config.js b/test/runtime/samples/component-slot-spread/_config.js
new file mode 100644
index 0000000000..dfa2bd86fc
--- /dev/null
+++ b/test/runtime/samples/component-slot-spread/_config.js
@@ -0,0 +1,55 @@
+export default {
+ props: {
+ obj: { a: 1, b: 42 },
+ c: 5,
+ d: 10
+ },
+ html: `
+ 1
+ 42
+ 5
+ 10
+ `,
+
+ test({ assert, target, component }) {
+ component.obj = { a: 2, b: 50, c: 30 };
+ assert.htmlEqual(target.innerHTML, `
+ 2
+ 50
+ 30
+ 10
+ `);
+
+ component.c = 22;
+ assert.htmlEqual(target.innerHTML, `
+ 2
+ 50
+ 30
+ 10
+ `);
+
+ component.d = 44;
+ assert.htmlEqual(target.innerHTML, `
+ 2
+ 50
+ 30
+ 44
+ `);
+
+ component.obj = { a: 9, b: 12 };
+ assert.htmlEqual(target.innerHTML, `
+ 9
+ 12
+ 22
+ 44
+ `);
+
+ component.c = 88;
+ assert.htmlEqual(target.innerHTML, `
+ 9
+ 12
+ 88
+ 44
+ `);
+ }
+};
diff --git a/test/runtime/samples/component-slot-spread/main.svelte b/test/runtime/samples/component-slot-spread/main.svelte
new file mode 100644
index 0000000000..8b3b94325c
--- /dev/null
+++ b/test/runtime/samples/component-slot-spread/main.svelte
@@ -0,0 +1,14 @@
+
+
+
+ {a}
+ {b}
+ {c}
+ {d}
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-slot-warning/_config.js b/test/runtime/samples/component-slot-warning/_config.js
index 6ffe624782..c1785f2764 100644
--- a/test/runtime/samples/component-slot-warning/_config.js
+++ b/test/runtime/samples/component-slot-warning/_config.js
@@ -3,7 +3,6 @@ export default {
dev: true
},
warnings: [
- ' received an unexpected slot "default".',
' received an unexpected slot "slot1".'
]
};
diff --git a/test/runtime/samples/component-svelte-slot-2/Nested.svelte b/test/runtime/samples/component-svelte-slot-2/Nested.svelte
new file mode 100644
index 0000000000..a94392ce5d
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-2/Nested.svelte
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-svelte-slot-2/_config.js b/test/runtime/samples/component-svelte-slot-2/_config.js
new file mode 100644
index 0000000000..9dfed6ff53
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-2/_config.js
@@ -0,0 +1,6 @@
+export default {
+ html: `
+ Hello
+ world
+ `
+};
diff --git a/test/runtime/samples/component-svelte-slot-2/main.svelte b/test/runtime/samples/component-svelte-slot-2/main.svelte
new file mode 100644
index 0000000000..8212f54cf8
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-2/main.svelte
@@ -0,0 +1,15 @@
+
+
+
+
+ Hello
+
+
+
+
+
+ world
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-svelte-slot-let-aliased/Nested.svelte b/test/runtime/samples/component-svelte-slot-let-aliased/Nested.svelte
new file mode 100644
index 0000000000..6eaf6fe3ad
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-aliased/Nested.svelte
@@ -0,0 +1,9 @@
+
+
+
+ {#each things as thing}
+
+ {/each}
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-svelte-slot-let-aliased/_config.js b/test/runtime/samples/component-svelte-slot-let-aliased/_config.js
new file mode 100644
index 0000000000..d66f613bb4
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-aliased/_config.js
@@ -0,0 +1,24 @@
+export default {
+ props: {
+ things: [1, 2, 3]
+ },
+
+ html: `
+
+ 1
+ 2
+ 3
+
`,
+
+ test({ assert, component, target }) {
+ component.things = [1, 2, 3, 4];
+ assert.htmlEqual(target.innerHTML, `
+
+ 1
+ 2
+ 3
+ 4
+
+ `);
+ }
+};
diff --git a/test/runtime/samples/component-svelte-slot-let-aliased/main.svelte b/test/runtime/samples/component-svelte-slot-let-aliased/main.svelte
new file mode 100644
index 0000000000..dabf1d65ef
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-aliased/main.svelte
@@ -0,0 +1,11 @@
+
+
+
+
+ {x}
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-svelte-slot-let-b/Nested.svelte b/test/runtime/samples/component-svelte-slot-let-b/Nested.svelte
new file mode 100644
index 0000000000..36c10ecbc2
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-b/Nested.svelte
@@ -0,0 +1,6 @@
+
+
++1
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-svelte-slot-let-b/_config.js b/test/runtime/samples/component-svelte-slot-let-b/_config.js
new file mode 100644
index 0000000000..f13a3b2bb6
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-b/_config.js
@@ -0,0 +1,18 @@
+export default {
+ html: `
+ +1
+ 0
+ `,
+
+ async test({ assert, target, window }) {
+ const button = target.querySelector('button');
+ const click = new window.MouseEvent('click');
+
+ await button.dispatchEvent(click);
+
+ assert.htmlEqual(target.innerHTML, `
+ +1
+ 1
+ `);
+ }
+};
diff --git a/test/runtime/samples/component-svelte-slot-let-b/main.svelte b/test/runtime/samples/component-svelte-slot-let-b/main.svelte
new file mode 100644
index 0000000000..584240d14d
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-b/main.svelte
@@ -0,0 +1,9 @@
+
+
+
+
+ {count}
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-svelte-slot-let-c/Nested.svelte b/test/runtime/samples/component-svelte-slot-let-c/Nested.svelte
new file mode 100644
index 0000000000..1220440590
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-c/Nested.svelte
@@ -0,0 +1,6 @@
+
+
++1
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-svelte-slot-let-c/_config.js b/test/runtime/samples/component-svelte-slot-let-c/_config.js
new file mode 100644
index 0000000000..fe8e68b1ac
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-c/_config.js
@@ -0,0 +1,18 @@
+export default {
+ html: `
+ +1
+ 0 (undefined)
+ `,
+
+ async test({ assert, target, window }) {
+ const button = target.querySelector('button');
+ const click = new window.MouseEvent('click');
+
+ await button.dispatchEvent(click);
+
+ assert.htmlEqual(target.innerHTML, `
+ +1
+ 1 (undefined)
+ `);
+ }
+};
diff --git a/test/runtime/samples/component-svelte-slot-let-c/main.svelte b/test/runtime/samples/component-svelte-slot-let-c/main.svelte
new file mode 100644
index 0000000000..9753c45075
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-c/main.svelte
@@ -0,0 +1,9 @@
+
+
+
+
+ {c} ({count})
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-svelte-slot-let-d/Nested.svelte b/test/runtime/samples/component-svelte-slot-let-d/Nested.svelte
new file mode 100644
index 0000000000..9f3a345acd
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-d/Nested.svelte
@@ -0,0 +1,7 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-svelte-slot-let-d/_config.js b/test/runtime/samples/component-svelte-slot-let-d/_config.js
new file mode 100644
index 0000000000..e293ae136c
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-d/_config.js
@@ -0,0 +1,20 @@
+export default {
+ html: `
+
+ `,
+
+ async test({ assert, target, window }) {
+ const div = target.querySelector('div');
+ const click = new window.MouseEvent('click');
+
+ await div.dispatchEvent(click);
+
+ assert.htmlEqual(target.innerHTML, `
+
+ `);
+ }
+};
diff --git a/test/runtime/samples/component-svelte-slot-let-d/main.svelte b/test/runtime/samples/component-svelte-slot-let-d/main.svelte
new file mode 100644
index 0000000000..7ba94c7b8a
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-d/main.svelte
@@ -0,0 +1,9 @@
+
+
+
+
+ {bar}
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-svelte-slot-let-destructured-2/Nested.svelte b/test/runtime/samples/component-svelte-slot-let-destructured-2/Nested.svelte
new file mode 100644
index 0000000000..f46046c78e
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-destructured-2/Nested.svelte
@@ -0,0 +1,5 @@
+
+
+
diff --git a/test/runtime/samples/component-svelte-slot-let-destructured-2/_config.js b/test/runtime/samples/component-svelte-slot-let-destructured-2/_config.js
new file mode 100644
index 0000000000..e407dcf2f8
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-destructured-2/_config.js
@@ -0,0 +1,68 @@
+export default {
+ html: `
+
+ hello world 0 hello
+ Increment
+
+
+ hello world 0 hello
+ Increment
+
+
+ hello world 0 hello
+ Increment
+
+ `,
+ async test({ assert, target, window }) {
+ const [button1, button2, button3] = target.querySelectorAll('button');
+ const event = new window.MouseEvent('click');
+
+ await button1.dispatchEvent(event);
+ assert.htmlEqual(target.innerHTML, `
+
+ hello world 1 hello
+ Increment
+
+
+ hello world 0 hello
+ Increment
+
+
+ hello world 0 hello
+ Increment
+
+ `);
+
+ await button2.dispatchEvent(event);
+ assert.htmlEqual(target.innerHTML, `
+
+ hello world 1 hello
+ Increment
+
+
+ hello world 1 hello
+ Increment
+
+
+ hello world 0 hello
+ Increment
+
+ `);
+
+ await button3.dispatchEvent(event);
+ assert.htmlEqual(target.innerHTML, `
+
+ hello world 1 hello
+ Increment
+
+
+ hello world 1 hello
+ Increment
+
+
+ hello world 1 hello
+ Increment
+
+ `);
+ }
+};
diff --git a/test/runtime/samples/component-svelte-slot-let-destructured-2/main.svelte b/test/runtime/samples/component-svelte-slot-let-destructured-2/main.svelte
new file mode 100644
index 0000000000..d4d3991881
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-destructured-2/main.svelte
@@ -0,0 +1,34 @@
+
+
+
+
+
+ {pair[0]} {pair[1]} {c} {foo}
+
+
+
+ { c += 1; }}>Increment
+
+
+
+
+
+ {a} {b} {d} {foo}
+
+
+
+ { d += 1; }}>Increment
+
+
+
+
+
+ {a} {b} {e} {foo}
+
+
+
+ { e += 1; }}>Increment
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-svelte-slot-let-destructured/Nested.svelte b/test/runtime/samples/component-svelte-slot-let-destructured/Nested.svelte
new file mode 100644
index 0000000000..99afb32aa0
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-destructured/Nested.svelte
@@ -0,0 +1,9 @@
+
+
+
+ {#each things as thing}
+
+ {/each}
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-svelte-slot-let-destructured/_config.js b/test/runtime/samples/component-svelte-slot-let-destructured/_config.js
new file mode 100644
index 0000000000..d7aaae2d77
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-destructured/_config.js
@@ -0,0 +1,34 @@
+export default {
+ props: {
+ things: [
+ { num: 1 },
+ { num: 2 },
+ { num: 3 }
+ ]
+ },
+
+ html: `
+
+ 1
+ 2
+ 3
+
`,
+
+ test({ assert, component, target }) {
+ component.things = [
+ { num: 1 },
+ { num: 2 },
+ { num: 3 },
+ { num: 4 }
+ ];
+
+ assert.htmlEqual(target.innerHTML, `
+
+ 1
+ 2
+ 3
+ 4
+
+ `);
+ }
+};
diff --git a/test/runtime/samples/component-svelte-slot-let-destructured/main.svelte b/test/runtime/samples/component-svelte-slot-let-destructured/main.svelte
new file mode 100644
index 0000000000..923e96311c
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-destructured/main.svelte
@@ -0,0 +1,11 @@
+
+
+
+
+ {num}
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-svelte-slot-let-e/A.svelte b/test/runtime/samples/component-svelte-slot-let-e/A.svelte
new file mode 100644
index 0000000000..3ba0e62cd9
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-e/A.svelte
@@ -0,0 +1,11 @@
+
+
+
+
+ {reflected}
+
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-svelte-slot-let-e/B.svelte b/test/runtime/samples/component-svelte-slot-let-e/B.svelte
new file mode 100644
index 0000000000..352f10a249
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-e/B.svelte
@@ -0,0 +1,5 @@
+
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-svelte-slot-let-e/_config.js b/test/runtime/samples/component-svelte-slot-let-e/_config.js
new file mode 100644
index 0000000000..967955dfd8
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-e/_config.js
@@ -0,0 +1,19 @@
+export default {
+ html: `
+ 1
+ 1
+ 1
+ 1
+ `,
+
+ async test({ assert, target, component }) {
+ component.x = 2;
+
+ assert.htmlEqual(target.innerHTML, `
+ 2
+ 2
+ 2
+ 2
+ `);
+ }
+};
diff --git a/test/runtime/samples/component-svelte-slot-let-e/main.svelte b/test/runtime/samples/component-svelte-slot-let-e/main.svelte
new file mode 100644
index 0000000000..80c9a868cd
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-e/main.svelte
@@ -0,0 +1,16 @@
+
+
+
+
+ {reflected}
+
+
+
+
+
+ {reflected}
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-svelte-slot-let-f/A.svelte b/test/runtime/samples/component-svelte-slot-let-f/A.svelte
new file mode 100644
index 0000000000..4f4ac95014
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-f/A.svelte
@@ -0,0 +1,5 @@
+
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-svelte-slot-let-f/_config.js b/test/runtime/samples/component-svelte-slot-let-f/_config.js
new file mode 100644
index 0000000000..73b90885b5
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-f/_config.js
@@ -0,0 +1,22 @@
+export default {
+ html: `
+ 1
+ 0
+ `,
+ async test({ assert, target, component, window }) {
+ component.x = 2;
+
+ assert.htmlEqual(target.innerHTML, `
+ 2
+ 0
+ `);
+
+ const span = target.querySelector('span');
+ await span.dispatchEvent(new window.MouseEvent('click'));
+
+ assert.htmlEqual(target.innerHTML, `
+ 2
+ 2
+ `);
+ }
+};
diff --git a/test/runtime/samples/component-svelte-slot-let-f/main.svelte b/test/runtime/samples/component-svelte-slot-let-f/main.svelte
new file mode 100644
index 0000000000..a47f1ba6de
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-f/main.svelte
@@ -0,0 +1,17 @@
+
+
+
+
+ y = reflected}
+ class={reflected}
+ >
+ {reflected}
+
+
+
+{ y }
\ No newline at end of file
diff --git a/test/runtime/samples/component-svelte-slot-let-in-binding/Nested.svelte b/test/runtime/samples/component-svelte-slot-let-in-binding/Nested.svelte
new file mode 100644
index 0000000000..95b4842ee6
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-in-binding/Nested.svelte
@@ -0,0 +1,9 @@
+
+
+
+ {#each items as item, index}
+
+ {/each}
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-svelte-slot-let-in-binding/_config.js b/test/runtime/samples/component-svelte-slot-let-in-binding/_config.js
new file mode 100644
index 0000000000..41e77a9574
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-in-binding/_config.js
@@ -0,0 +1,26 @@
+export default {
+ html: `
+
+ 1:
+ 2:
+ 3:
+
+ `,
+
+ ssrHtml: `
+
+ 1:
+ 2:
+ 3:
+
+ `,
+
+ async test({ assert, component, target, window }) {
+ const inputs = target.querySelectorAll('input');
+
+ inputs[2].value = 'd';
+ await inputs[2].dispatchEvent(new window.Event('input'));
+
+ assert.deepEqual(component.letters, ['a', 'b', 'd']);
+ }
+};
diff --git a/test/runtime/samples/component-svelte-slot-let-in-binding/main.svelte b/test/runtime/samples/component-svelte-slot-let-in-binding/main.svelte
new file mode 100644
index 0000000000..c6edd82003
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-in-binding/main.svelte
@@ -0,0 +1,13 @@
+
+
+
+
+
+ {index + 1}:
+
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-svelte-slot-let-in-slot/Inner.svelte b/test/runtime/samples/component-svelte-slot-let-in-slot/Inner.svelte
new file mode 100644
index 0000000000..50baf3aa93
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-in-slot/Inner.svelte
@@ -0,0 +1 @@
+
diff --git a/test/runtime/samples/component-svelte-slot-let-in-slot/Outer.svelte b/test/runtime/samples/component-svelte-slot-let-in-slot/Outer.svelte
new file mode 100644
index 0000000000..d6c86307a5
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-in-slot/Outer.svelte
@@ -0,0 +1,5 @@
+
+
+
diff --git a/test/runtime/samples/component-svelte-slot-let-in-slot/_config.js b/test/runtime/samples/component-svelte-slot-let-in-slot/_config.js
new file mode 100644
index 0000000000..eb16c27fda
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-in-slot/_config.js
@@ -0,0 +1,12 @@
+export default {
+ props: {
+ prop: 'a'
+ },
+
+ html: 'a',
+
+ test({ assert, component, target }) {
+ component.prop = 'b';
+ assert.htmlEqual( target.innerHTML, 'b' );
+ }
+};
diff --git a/test/runtime/samples/component-svelte-slot-let-in-slot/main.svelte b/test/runtime/samples/component-svelte-slot-let-in-slot/main.svelte
new file mode 100644
index 0000000000..2de0cb11ef
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-in-slot/main.svelte
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+ {value}
+
+
+
+
diff --git a/test/runtime/samples/component-svelte-slot-let-named/Nested.svelte b/test/runtime/samples/component-svelte-slot-let-named/Nested.svelte
new file mode 100644
index 0000000000..a3b09ff5b2
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-named/Nested.svelte
@@ -0,0 +1,9 @@
+
+
+
+ {#each things as thing}
+
+ {/each}
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-svelte-slot-let-named/_config.js b/test/runtime/samples/component-svelte-slot-let-named/_config.js
new file mode 100644
index 0000000000..f65448af93
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-named/_config.js
@@ -0,0 +1,24 @@
+export default {
+ props: {
+ things: [1, 2, 3]
+ },
+
+ html: `
+ `,
+
+ test({ assert, component, target }) {
+ component.things = [1, 2, 3, 4];
+ assert.htmlEqual(target.innerHTML, `
+
+ `);
+ }
+};
diff --git a/test/runtime/samples/component-svelte-slot-let-named/main.svelte b/test/runtime/samples/component-svelte-slot-let-named/main.svelte
new file mode 100644
index 0000000000..f9e9e3a10f
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-named/main.svelte
@@ -0,0 +1,11 @@
+
+
+
+
+ {thing}
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-svelte-slot-let-static/Nested.svelte b/test/runtime/samples/component-svelte-slot-let-static/Nested.svelte
new file mode 100644
index 0000000000..32eee1534a
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-static/Nested.svelte
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-svelte-slot-let-static/_config.js b/test/runtime/samples/component-svelte-slot-let-static/_config.js
new file mode 100644
index 0000000000..ede7a679c5
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-static/_config.js
@@ -0,0 +1,3 @@
+export default {
+ html: 'Hi
'
+};
diff --git a/test/runtime/samples/component-svelte-slot-let-static/main.svelte b/test/runtime/samples/component-svelte-slot-let-static/main.svelte
new file mode 100644
index 0000000000..3eeaba976e
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let-static/main.svelte
@@ -0,0 +1,7 @@
+
+
+
+ {value}
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-svelte-slot-let/Nested.svelte b/test/runtime/samples/component-svelte-slot-let/Nested.svelte
new file mode 100644
index 0000000000..3758adbd7c
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let/Nested.svelte
@@ -0,0 +1,9 @@
+
+
+
+ {#each things as thing}
+
+ {/each}
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-svelte-slot-let/_config.js b/test/runtime/samples/component-svelte-slot-let/_config.js
new file mode 100644
index 0000000000..d66f613bb4
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let/_config.js
@@ -0,0 +1,24 @@
+export default {
+ props: {
+ things: [1, 2, 3]
+ },
+
+ html: `
+
+ 1
+ 2
+ 3
+
`,
+
+ test({ assert, component, target }) {
+ component.things = [1, 2, 3, 4];
+ assert.htmlEqual(target.innerHTML, `
+
+ 1
+ 2
+ 3
+ 4
+
+ `);
+ }
+};
diff --git a/test/runtime/samples/component-svelte-slot-let/main.svelte b/test/runtime/samples/component-svelte-slot-let/main.svelte
new file mode 100644
index 0000000000..d00bb8e41e
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-let/main.svelte
@@ -0,0 +1,9 @@
+
+
+
+ {thing}
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-svelte-slot-nested/Child.svelte b/test/runtime/samples/component-svelte-slot-nested/Child.svelte
new file mode 100644
index 0000000000..3f87a7dbf2
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-nested/Child.svelte
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-svelte-slot-nested/Nested.svelte b/test/runtime/samples/component-svelte-slot-nested/Nested.svelte
new file mode 100644
index 0000000000..a94392ce5d
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-nested/Nested.svelte
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/test/runtime/samples/component-svelte-slot-nested/_config.js b/test/runtime/samples/component-svelte-slot-nested/_config.js
new file mode 100644
index 0000000000..eecd155e1f
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-nested/_config.js
@@ -0,0 +1,6 @@
+export default {
+ html: `
+ Default
+ B slot
+ `
+};
diff --git a/test/runtime/samples/component-svelte-slot-nested/main.svelte b/test/runtime/samples/component-svelte-slot-nested/main.svelte
new file mode 100644
index 0000000000..e5b3e2f84a
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot-nested/main.svelte
@@ -0,0 +1,12 @@
+
+
+
+
+ Default
+
+
+ B slot
+
+
diff --git a/test/runtime/samples/component-svelte-slot/B.svelte b/test/runtime/samples/component-svelte-slot/B.svelte
new file mode 100644
index 0000000000..3bbf00a60c
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot/B.svelte
@@ -0,0 +1,6 @@
+
+
+Hello
+{name}
diff --git a/test/runtime/samples/component-svelte-slot/Nested.svelte b/test/runtime/samples/component-svelte-slot/Nested.svelte
new file mode 100644
index 0000000000..09cfc5aa39
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot/Nested.svelte
@@ -0,0 +1,2 @@
+a:
+b:
\ No newline at end of file
diff --git a/test/runtime/samples/component-svelte-slot/_config.js b/test/runtime/samples/component-svelte-slot/_config.js
new file mode 100644
index 0000000000..360b4709b5
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot/_config.js
@@ -0,0 +1,6 @@
+export default {
+ html: `
+ a: content a
+
+ `
+};
diff --git a/test/runtime/samples/component-svelte-slot/main.svelte b/test/runtime/samples/component-svelte-slot/main.svelte
new file mode 100644
index 0000000000..b27c3795ed
--- /dev/null
+++ b/test/runtime/samples/component-svelte-slot/main.svelte
@@ -0,0 +1,13 @@
+
+
+
+ content { a }
+
+
+
+
+
diff --git a/test/runtime/samples/component-yield-placement/_config.js b/test/runtime/samples/component-yield-placement/_config.js
index eaa600b07d..089b3ce752 100644
--- a/test/runtime/samples/component-yield-placement/_config.js
+++ b/test/runtime/samples/component-yield-placement/_config.js
@@ -12,7 +12,7 @@ export default {
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const button = target.querySelector('button');
const click = new window.MouseEvent('click');
diff --git a/test/runtime/samples/constructor-pass-context/Component.svelte b/test/runtime/samples/constructor-pass-context/Component.svelte
new file mode 100644
index 0000000000..ae27a0d57a
--- /dev/null
+++ b/test/runtime/samples/constructor-pass-context/Component.svelte
@@ -0,0 +1,9 @@
+
+
+{value}
+ fn('hello world')} />
\ No newline at end of file
diff --git a/test/runtime/samples/constructor-pass-context/_config.js b/test/runtime/samples/constructor-pass-context/_config.js
new file mode 100644
index 0000000000..02b58f5451
--- /dev/null
+++ b/test/runtime/samples/constructor-pass-context/_config.js
@@ -0,0 +1,32 @@
+export default {
+ async test({ assert, target, window }) {
+ const Component = require('./Component.svelte').default;
+
+ const called = [];
+ const component = new Component({
+ target,
+ context: new Map([
+ ['key', 'svelte'],
+ ['fn', (value) => called.push(value)]
+ ])
+ });
+ assert.htmlEqual(target.innerHTML, 'svelte
');
+
+ const button = target.querySelector('button');
+ await button.dispatchEvent(new window.MouseEvent('click'));
+
+ assert.deepEqual(called, ['hello world']);
+
+ component.$destroy();
+ },
+ test_ssr({ assert }) {
+ const Component = require('./Component.svelte').default;
+
+ const called = [];
+ const { html } = Component.render(undefined, { context: new Map([
+ ['key', 'svelte'],
+ ['fn', (value) => called.push(value)]
+ ]) });
+ assert.htmlEqual(html, 'svelte
');
+ }
+};
diff --git a/test/runtime/samples/constructor-pass-context/main.svelte b/test/runtime/samples/constructor-pass-context/main.svelte
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/test/runtime/samples/constructor-prefer-passed-context/ChildComponent.svelte b/test/runtime/samples/constructor-prefer-passed-context/ChildComponent.svelte
new file mode 100644
index 0000000000..af77418a1f
--- /dev/null
+++ b/test/runtime/samples/constructor-prefer-passed-context/ChildComponent.svelte
@@ -0,0 +1,6 @@
+
+
+Value in child component: {value}
diff --git a/test/runtime/samples/constructor-prefer-passed-context/_config.js b/test/runtime/samples/constructor-prefer-passed-context/_config.js
new file mode 100644
index 0000000000..5d5cf9e44a
--- /dev/null
+++ b/test/runtime/samples/constructor-prefer-passed-context/_config.js
@@ -0,0 +1,6 @@
+export default {
+ skip_if_ssr: true,
+ html: `
+ Value in child component: undefined
+ `
+};
diff --git a/test/runtime/samples/constructor-prefer-passed-context/main.svelte b/test/runtime/samples/constructor-prefer-passed-context/main.svelte
new file mode 100644
index 0000000000..dd051a123a
--- /dev/null
+++ b/test/runtime/samples/constructor-prefer-passed-context/main.svelte
@@ -0,0 +1,15 @@
+
+
+
diff --git a/test/runtime/samples/context-api-b/_config.js b/test/runtime/samples/context-api-b/_config.js
index 70dff54c06..314fd9f481 100644
--- a/test/runtime/samples/context-api-b/_config.js
+++ b/test/runtime/samples/context-api-b/_config.js
@@ -3,4 +3,4 @@ export default {
foo/bar
foo/baz
`
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/context-api-c/Leaf.svelte b/test/runtime/samples/context-api-c/Leaf.svelte
new file mode 100644
index 0000000000..ae61ba063c
--- /dev/null
+++ b/test/runtime/samples/context-api-c/Leaf.svelte
@@ -0,0 +1,7 @@
+
+
+{has}
\ No newline at end of file
diff --git a/test/runtime/samples/context-api-c/Nested.svelte b/test/runtime/samples/context-api-c/Nested.svelte
new file mode 100644
index 0000000000..775d55d8f1
--- /dev/null
+++ b/test/runtime/samples/context-api-c/Nested.svelte
@@ -0,0 +1,11 @@
+
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/context-api-c/_config.js b/test/runtime/samples/context-api-c/_config.js
new file mode 100644
index 0000000000..0041359a7f
--- /dev/null
+++ b/test/runtime/samples/context-api-c/_config.js
@@ -0,0 +1,6 @@
+export default {
+ html: `
+ true
+ false
+ `
+};
diff --git a/test/runtime/samples/context-api-c/main.svelte b/test/runtime/samples/context-api-c/main.svelte
new file mode 100644
index 0000000000..03ff1ae6eb
--- /dev/null
+++ b/test/runtime/samples/context-api-c/main.svelte
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
diff --git a/test/runtime/samples/context-api-d/Leaf.svelte b/test/runtime/samples/context-api-d/Leaf.svelte
new file mode 100644
index 0000000000..02b6b26e00
--- /dev/null
+++ b/test/runtime/samples/context-api-d/Leaf.svelte
@@ -0,0 +1,9 @@
+
+
+{#each [...context.keys()] as key}
+ {key}: {context.get(key)}
+{/each}
diff --git a/test/runtime/samples/context-api-d/Nested.svelte b/test/runtime/samples/context-api-d/Nested.svelte
new file mode 100644
index 0000000000..e8a7e083c3
--- /dev/null
+++ b/test/runtime/samples/context-api-d/Nested.svelte
@@ -0,0 +1,8 @@
+
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/context-api-d/_config.js b/test/runtime/samples/context-api-d/_config.js
new file mode 100644
index 0000000000..a5b0769f8b
--- /dev/null
+++ b/test/runtime/samples/context-api-d/_config.js
@@ -0,0 +1,7 @@
+export default {
+ html: `
+ a: 1
+ b: 2
+ c: 3
+ `
+};
diff --git a/test/runtime/samples/context-api-d/main.svelte b/test/runtime/samples/context-api-d/main.svelte
new file mode 100644
index 0000000000..82d1021574
--- /dev/null
+++ b/test/runtime/samples/context-api-d/main.svelte
@@ -0,0 +1,8 @@
+
+
+
+
+
diff --git a/test/runtime/samples/context-api/_config.js b/test/runtime/samples/context-api/_config.js
index 1bc475a156..3856aa5424 100644
--- a/test/runtime/samples/context-api/_config.js
+++ b/test/runtime/samples/context-api/_config.js
@@ -70,4 +70,4 @@ export default {
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/context-in-await/_config.js b/test/runtime/samples/context-in-await/_config.js
index 221f5fbcca..fc498a36c2 100644
--- a/test/runtime/samples/context-in-await/_config.js
+++ b/test/runtime/samples/context-in-await/_config.js
@@ -10,4 +10,4 @@ export default {
Context value: 123
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/contextual-callback/_config.js b/test/runtime/samples/contextual-callback/_config.js
index f0ec07f6c9..b27a7fc868 100644
--- a/test/runtime/samples/contextual-callback/_config.js
+++ b/test/runtime/samples/contextual-callback/_config.js
@@ -9,4 +9,4 @@ export default {
assert.equal(component.clicked, 'x');
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/css-comments/_config.js b/test/runtime/samples/css-comments/_config.js
index 7f11f792c7..baf571fcd1 100644
--- a/test/runtime/samples/css-comments/_config.js
+++ b/test/runtime/samples/css-comments/_config.js
@@ -1,6 +1,6 @@
// JSDOM makes this test pass when it should fail. weird
export default {
- test({ assert, component, target, window }) {
+ test({ assert, target, window }) {
const p = target.querySelector( 'p' );
assert.equal( window.getComputedStyle( p ).color, 'red' );
}
diff --git a/test/runtime/samples/css-false/_config.js b/test/runtime/samples/css-false/_config.js
index 2ade2acf83..320efce35b 100644
--- a/test/runtime/samples/css-false/_config.js
+++ b/test/runtime/samples/css-false/_config.js
@@ -3,7 +3,7 @@ export default {
css: false
},
- test({ assert, component, target, window }) {
+ test({ assert, target, window }) {
const [ control, test ] = target.querySelectorAll( 'p' );
assert.equal( window.getComputedStyle( control ).color, '' );
diff --git a/test/runtime/samples/css-space-in-attribute/_config.js b/test/runtime/samples/css-space-in-attribute/_config.js
index dc931217fc..c88f72cafa 100644
--- a/test/runtime/samples/css-space-in-attribute/_config.js
+++ b/test/runtime/samples/css-space-in-attribute/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window }) {
+ test({ assert, target, window }) {
const [ control, test ] = target.querySelectorAll( 'p' );
assert.equal( window.getComputedStyle( control ).color, '' );
diff --git a/test/runtime/samples/css/_config.js b/test/runtime/samples/css/_config.js
index c4500e7441..6119af94de 100644
--- a/test/runtime/samples/css/_config.js
+++ b/test/runtime/samples/css/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window }) {
+ test({ assert, target, window }) {
const [control, test] = target.querySelectorAll('p');
assert.equal(window.getComputedStyle(control).color, '');
diff --git a/test/runtime/samples/deconflict-builtins-2/_config.js b/test/runtime/samples/deconflict-builtins-2/_config.js
index 1bef35b2bd..fba811b880 100644
--- a/test/runtime/samples/deconflict-builtins-2/_config.js
+++ b/test/runtime/samples/deconflict-builtins-2/_config.js
@@ -1,4 +1,4 @@
export default {
- html: 'hello world ',
+ html: 'hello world ',
preserveIdentifiers: true
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/deconflict-builtins-2/main.svelte b/test/runtime/samples/deconflict-builtins-2/main.svelte
index 82f9213045..db10a81c74 100644
--- a/test/runtime/samples/deconflict-builtins-2/main.svelte
+++ b/test/runtime/samples/deconflict-builtins-2/main.svelte
@@ -1,5 +1,6 @@
-
-{foo}
\ No newline at end of file
+
+ {foo}
+
\ No newline at end of file
diff --git a/test/runtime/samples/deconflict-builtins/_config.js b/test/runtime/samples/deconflict-builtins/_config.js
index 4e9cbef4b2..3751bfc25d 100644
--- a/test/runtime/samples/deconflict-builtins/_config.js
+++ b/test/runtime/samples/deconflict-builtins/_config.js
@@ -4,4 +4,4 @@ export default {
test({ assert, component }) {
assert.equal(component.foo, 'got');
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/deconflict-builtins/get.js b/test/runtime/samples/deconflict-builtins/get.js
index cd846d9be9..78477cc40f 100644
--- a/test/runtime/samples/deconflict-builtins/get.js
+++ b/test/runtime/samples/deconflict-builtins/get.js
@@ -1,3 +1,3 @@
export function get () {
return 'got';
-}
\ No newline at end of file
+}
diff --git a/test/runtime/samples/deconflict-component-name-with-global/_config.js b/test/runtime/samples/deconflict-component-name-with-global/_config.js
index 0f25c32351..214483fc58 100644
--- a/test/runtime/samples/deconflict-component-name-with-global/_config.js
+++ b/test/runtime/samples/deconflict-component-name-with-global/_config.js
@@ -6,4 +6,4 @@ export default {
preserveIdentifiers: true,
html: 'true
'
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/deconflict-component-name-with-module-global/_config.js b/test/runtime/samples/deconflict-component-name-with-module-global/_config.js
index 0f25c32351..214483fc58 100644
--- a/test/runtime/samples/deconflict-component-name-with-module-global/_config.js
+++ b/test/runtime/samples/deconflict-component-name-with-module-global/_config.js
@@ -6,4 +6,4 @@ export default {
preserveIdentifiers: true,
html: 'true
'
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/deconflict-component-refs/_config.js b/test/runtime/samples/deconflict-component-refs/_config.js
index 8092aed7ca..992066d1e6 100644
--- a/test/runtime/samples/deconflict-component-refs/_config.js
+++ b/test/runtime/samples/deconflict-component-refs/_config.js
@@ -22,4 +22,4 @@ export default {
{ name: 'baz', edit: false }
]
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/deconflict-contexts/_config.js b/test/runtime/samples/deconflict-contexts/_config.js
index a32300e58a..5254655d89 100644
--- a/test/runtime/samples/deconflict-contexts/_config.js
+++ b/test/runtime/samples/deconflict-contexts/_config.js
@@ -6,4 +6,4 @@ export default {
props: {
components: [ 'foo', 'bar', 'baz' ]
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/deconflict-contextual-action/_config.js b/test/runtime/samples/deconflict-contextual-action/_config.js
new file mode 100644
index 0000000000..542ec2fe08
--- /dev/null
+++ b/test/runtime/samples/deconflict-contextual-action/_config.js
@@ -0,0 +1,13 @@
+let result;
+
+export default {
+ before_test() {
+ result = [];
+ },
+ props: {
+ collect: (str) => result.push(str)
+ },
+ test({ assert }) {
+ assert.deepEqual(result, ['each_action', 'import_action']);
+ }
+};
diff --git a/test/runtime/samples/deconflict-contextual-action/main.svelte b/test/runtime/samples/deconflict-contextual-action/main.svelte
new file mode 100644
index 0000000000..48862e5f9f
--- /dev/null
+++ b/test/runtime/samples/deconflict-contextual-action/main.svelte
@@ -0,0 +1,17 @@
+
+
+
+
+
+ {#each array as action}
+
+ {/each}
+
diff --git a/test/runtime/samples/deconflict-contextual-action/util.js b/test/runtime/samples/deconflict-contextual-action/util.js
new file mode 100644
index 0000000000..32bf0ffd2e
--- /dev/null
+++ b/test/runtime/samples/deconflict-contextual-action/util.js
@@ -0,0 +1,3 @@
+export default function (_, fn) {
+ fn('import_action');
+}
diff --git a/test/runtime/samples/deconflict-ctx/_config.js b/test/runtime/samples/deconflict-ctx/_config.js
index 88f3e2efca..b6d8bf51be 100644
--- a/test/runtime/samples/deconflict-ctx/_config.js
+++ b/test/runtime/samples/deconflict-ctx/_config.js
@@ -2,4 +2,4 @@ export default {
html: `
Hello world!
`
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/deconflict-elements-indexes/_config.js b/test/runtime/samples/deconflict-elements-indexes/_config.js
index b531603ac7..cb102638f2 100644
--- a/test/runtime/samples/deconflict-elements-indexes/_config.js
+++ b/test/runtime/samples/deconflict-elements-indexes/_config.js
@@ -19,4 +19,4 @@ export default {
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/deconflict-spread-i/_config.js b/test/runtime/samples/deconflict-spread-i/_config.js
index f147a4c1ff..7602cde023 100644
--- a/test/runtime/samples/deconflict-spread-i/_config.js
+++ b/test/runtime/samples/deconflict-spread-i/_config.js
@@ -1,3 +1,3 @@
export default {
preserveIdentifiers: true
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/destroy-twice/_config.js b/test/runtime/samples/destroy-twice/_config.js
index 041518d284..39f6cdcd57 100644
--- a/test/runtime/samples/destroy-twice/_config.js
+++ b/test/runtime/samples/destroy-twice/_config.js
@@ -1,6 +1,6 @@
export default {
- test({ assert, component }) {
+ test({ component }) {
component.$destroy();
component.$destroy();
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/destructured-assignment-pattern-with-object-pattern/_config.js b/test/runtime/samples/destructured-assignment-pattern-with-object-pattern/_config.js
new file mode 100644
index 0000000000..75025e4614
--- /dev/null
+++ b/test/runtime/samples/destructured-assignment-pattern-with-object-pattern/_config.js
@@ -0,0 +1,6 @@
+export default {
+ html: `
+ hello undefined
+ hello bar2
+ `
+};
diff --git a/test/runtime/samples/destructured-assignment-pattern-with-object-pattern/main.svelte b/test/runtime/samples/destructured-assignment-pattern-with-object-pattern/main.svelte
new file mode 100644
index 0000000000..b71b25bd67
--- /dev/null
+++ b/test/runtime/samples/destructured-assignment-pattern-with-object-pattern/main.svelte
@@ -0,0 +1,11 @@
+
+
+hello {bar}
+hello {bar2}
diff --git a/test/runtime/samples/destructured-props-1/A.svelte b/test/runtime/samples/destructured-props-1/A.svelte
new file mode 100644
index 0000000000..d1b392ef34
--- /dev/null
+++ b/test/runtime/samples/destructured-props-1/A.svelte
@@ -0,0 +1,24 @@
+
+
+
+a: {a},
+b: {typeof b},
+c: {c},
+d_one: {d_one},
+d_three: {$d_three},
+f: {f},
+g: {g},
+e: {typeof e},
+e_one: {e_one},
+A: {A},
+C: {C}
+
+{JSON.stringify(THING)}
\ No newline at end of file
diff --git a/test/runtime/samples/destructured-props-1/_config.js b/test/runtime/samples/destructured-props-1/_config.js
new file mode 100644
index 0000000000..29feaaabab
--- /dev/null
+++ b/test/runtime/samples/destructured-props-1/_config.js
@@ -0,0 +1,9 @@
+export default {
+ html: `
+ a: 1, b: undefined, c: 2, d_one: 3, d_three: 5, f: undefined, g: 9, e: undefined, e_one: 6, A: 1, C: 2
+ {"a":1,"b":{"c":2,"d":[3,4,{}]},"e":[6],"h":8}
+
+ a: a, b: undefined, c: 2, d_one: d_one, d_three: 5, f: f, g: g, e: undefined, e_one: 6, A: 1, C: 2
+ {"a":1,"b":{"c":2,"d":[3,4,{}]},"e":[6],"h":8}
+ `
+};
diff --git a/test/runtime/samples/destructured-props-1/main.svelte b/test/runtime/samples/destructured-props-1/main.svelte
new file mode 100644
index 0000000000..dbe7c88d33
--- /dev/null
+++ b/test/runtime/samples/destructured-props-1/main.svelte
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/test/runtime/samples/destructured-props-2/A.svelte b/test/runtime/samples/destructured-props-2/A.svelte
new file mode 100644
index 0000000000..51167edbc4
--- /dev/null
+++ b/test/runtime/samples/destructured-props-2/A.svelte
@@ -0,0 +1,21 @@
+
+
+
+ x: {x},
+ list_two_a: {list_two_a},
+ list_two_b: {list_two_b},
+ y: {$y},
+ m: {m},
+ n: {n},
+ o: {o},
+ p: {p},
+ q: {$q}
+
+{JSON.stringify(LIST)}
\ No newline at end of file
diff --git a/test/runtime/samples/destructured-props-2/_config.js b/test/runtime/samples/destructured-props-2/_config.js
new file mode 100644
index 0000000000..c647f31be1
--- /dev/null
+++ b/test/runtime/samples/destructured-props-2/_config.js
@@ -0,0 +1,19 @@
+export default {
+ html: `
+ x: 1, list_two_a: 2, list_two_b: 5, y: 4, m: 1, n: 2, o: 5, p: 3, q: 4
+ [1,{"a":2},[3,{}]]
+ x: 1, list_two_a: 2, list_two_b: 5, y: 4, m: m, n: n, o: o, p: p, q: q
+ [1,{"a":2},[3,{}]]
+ `,
+
+ async test({ component, assert, target }) {
+ await component.update();
+
+ assert.htmlEqual(target.innerHTML, `
+ x: 1, list_two_a: 2, list_two_b: 5, y: 4, m: 1, n: 2, o: 5, p: 3, q: 4
+ [1,{"a":2},[3,{}]]
+ x: 1, list_two_a: 2, list_two_b: 5, y: 4, m: MM, n: NN, o: OO, p: PP, q: QQ
+ [1,{"a":2},[3,{}]]
+ `);
+ }
+};
diff --git a/test/runtime/samples/destructured-props-2/main.svelte b/test/runtime/samples/destructured-props-2/main.svelte
new file mode 100644
index 0000000000..f0044bb567
--- /dev/null
+++ b/test/runtime/samples/destructured-props-2/main.svelte
@@ -0,0 +1,30 @@
+
+
+
+
+
diff --git a/test/runtime/samples/destructured-props-3/A.svelte b/test/runtime/samples/destructured-props-3/A.svelte
new file mode 100644
index 0000000000..6c5aca05b0
--- /dev/null
+++ b/test/runtime/samples/destructured-props-3/A.svelte
@@ -0,0 +1,10 @@
+
+
+i: {i}, j: {j}, k: {$k}, l: {l}, m: {m}, n: {$n}, a: {a}, b: {b}, c: {$c}, d: {d}, e: {e}, f: {$f}
\ No newline at end of file
diff --git a/test/runtime/samples/destructured-props-3/_config.js b/test/runtime/samples/destructured-props-3/_config.js
new file mode 100644
index 0000000000..6d2e516e0e
--- /dev/null
+++ b/test/runtime/samples/destructured-props-3/_config.js
@@ -0,0 +1,15 @@
+export default {
+ html: `
+ i: 9, j: 10, k: 11, l: 12, m: 13, n: 14, a: 9, b: 10, c: 11, d: 12, e: 13, f: 14
+
+ i: 9, j: 10, k: 11, l: 12, m: 13, n: 14, a: a, b: 10, c: c, d: d, e: 13, f: f
+ `,
+ async test({ component, target, assert }) {
+ await component.update();
+ assert.htmlEqual(target.innerHTML, `
+ i: 9, j: 10, k: 11, l: 12, m: 13, n: 14, a: 9, b: 10, c: 11, d: 12, e: 13, f: 14
+
+ i: 9, j: 10, k: 11, l: 12, m: 13, n: 14, a: aa, b: 10, c: cc, d: dd, e: 13, f: ff
+ `);
+ }
+};
diff --git a/test/runtime/samples/destructured-props-3/main.svelte b/test/runtime/samples/destructured-props-3/main.svelte
new file mode 100644
index 0000000000..8152d61aab
--- /dev/null
+++ b/test/runtime/samples/destructured-props-3/main.svelte
@@ -0,0 +1,29 @@
+
+
+
+
+
diff --git a/test/runtime/samples/destructuring-assignment-array/_config.js b/test/runtime/samples/destructuring-assignment-array/_config.js
index ede4552803..5b39a0b86e 100644
--- a/test/runtime/samples/destructuring-assignment-array/_config.js
+++ b/test/runtime/samples/destructuring-assignment-array/_config.js
@@ -20,4 +20,4 @@ export default {
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/destructuring-between-exports/_config.js b/test/runtime/samples/destructuring-between-exports/_config.js
index 56061f510f..3b2ee6e9ee 100644
--- a/test/runtime/samples/destructuring-between-exports/_config.js
+++ b/test/runtime/samples/destructuring-between-exports/_config.js
@@ -5,4 +5,4 @@ export default {
html: `
42
`
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/destructuring/_config.js b/test/runtime/samples/destructuring/_config.js
index c76a3bf649..93e4ed3936 100644
--- a/test/runtime/samples/destructuring/_config.js
+++ b/test/runtime/samples/destructuring/_config.js
@@ -22,4 +22,4 @@ export default {
assert.equal(count, 1);
assert.equal(number, 42);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/dev-warning-destroy-twice/_config.js b/test/runtime/samples/dev-warning-destroy-twice/_config.js
index 4f6090d4b6..69ef5b1713 100644
--- a/test/runtime/samples/dev-warning-destroy-twice/_config.js
+++ b/test/runtime/samples/dev-warning-destroy-twice/_config.js
@@ -20,4 +20,4 @@ export default {
console.warn = warn; // eslint-disable-line no-console
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/dev-warning-readonly-computed/_config.js b/test/runtime/samples/dev-warning-readonly-computed/_config.js
index 7d02d82eeb..86037d7e1f 100644
--- a/test/runtime/samples/dev-warning-readonly-computed/_config.js
+++ b/test/runtime/samples/dev-warning-readonly-computed/_config.js
@@ -15,4 +15,4 @@ export default {
assert.equal( err.message, ": Cannot set read-only property 'foo'" );
}
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/dev-warning-readonly-window-binding/_config.js b/test/runtime/samples/dev-warning-readonly-window-binding/_config.js
index 01c8717b0c..fc6075aef1 100644
--- a/test/runtime/samples/dev-warning-readonly-window-binding/_config.js
+++ b/test/runtime/samples/dev-warning-readonly-window-binding/_config.js
@@ -11,4 +11,4 @@ export default {
assert.equal(err.message, ": Cannot set read-only property 'width'");
}
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/dynamic-component-bindings-recreated-b/_config.js b/test/runtime/samples/dynamic-component-bindings-recreated-b/_config.js
index 0df87f06cd..2f73514e67 100644
--- a/test/runtime/samples/dynamic-component-bindings-recreated-b/_config.js
+++ b/test/runtime/samples/dynamic-component-bindings-recreated-b/_config.js
@@ -25,4 +25,4 @@ export default {
green green
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/dynamic-component-bindings-recreated/_config.js b/test/runtime/samples/dynamic-component-bindings-recreated/_config.js
index b57c49ed58..7882996a8b 100644
--- a/test/runtime/samples/dynamic-component-bindings-recreated/_config.js
+++ b/test/runtime/samples/dynamic-component-bindings-recreated/_config.js
@@ -22,4 +22,4 @@ export default {
green two
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/dynamic-component-bindings/_config.js b/test/runtime/samples/dynamic-component-bindings/_config.js
index 9ef9a87b91..4b76c89237 100644
--- a/test/runtime/samples/dynamic-component-bindings/_config.js
+++ b/test/runtime/samples/dynamic-component-bindings/_config.js
@@ -28,4 +28,4 @@ export default {
assert.equal(component.z, true);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/dynamic-component-destroy-null/_config.js b/test/runtime/samples/dynamic-component-destroy-null/_config.js
index 3c47aa5bae..c9bc1a05c0 100644
--- a/test/runtime/samples/dynamic-component-destroy-null/_config.js
+++ b/test/runtime/samples/dynamic-component-destroy-null/_config.js
@@ -3,7 +3,7 @@ export default {
x: true
},
- test({ assert, component }) {
+ test({ component }) {
component.x = false;
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/dynamic-component-events/_config.js b/test/runtime/samples/dynamic-component-events/_config.js
index 3c6bf370bb..cc54bef4e5 100644
--- a/test/runtime/samples/dynamic-component-events/_config.js
+++ b/test/runtime/samples/dynamic-component-events/_config.js
@@ -22,4 +22,4 @@ export default {
target.querySelector('button').dispatchEvent(click);
assert.equal(component.selected, 'bar');
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/dynamic-component-in-if/_config.js b/test/runtime/samples/dynamic-component-in-if/_config.js
index b481c229c4..0c6829dbcd 100644
--- a/test/runtime/samples/dynamic-component-in-if/_config.js
+++ b/test/runtime/samples/dynamic-component-in-if/_config.js
@@ -10,4 +10,4 @@ export default {
Bar
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/dynamic-component-inside-element/_config.js b/test/runtime/samples/dynamic-component-inside-element/_config.js
index 2e363f10da..ba144c96a6 100644
--- a/test/runtime/samples/dynamic-component-inside-element/_config.js
+++ b/test/runtime/samples/dynamic-component-inside-element/_config.js
@@ -14,4 +14,4 @@ export default {
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/dynamic-component-nulled-out-intro/_config.js b/test/runtime/samples/dynamic-component-nulled-out-intro/_config.js
index 9759ada538..18ccd5f21e 100644
--- a/test/runtime/samples/dynamic-component-nulled-out-intro/_config.js
+++ b/test/runtime/samples/dynamic-component-nulled-out-intro/_config.js
@@ -2,4 +2,4 @@ export default {
test({ component }) {
component.visible = true;
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/dynamic-component-nulled-out/_config.js b/test/runtime/samples/dynamic-component-nulled-out/_config.js
index 7dc48c82b6..7e928aba86 100644
--- a/test/runtime/samples/dynamic-component-nulled-out/_config.js
+++ b/test/runtime/samples/dynamic-component-nulled-out/_config.js
@@ -16,4 +16,4 @@ export default {
Foo
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/dynamic-component-slot/_config.js b/test/runtime/samples/dynamic-component-slot/_config.js
index 58f413e3c4..aedf8bbb5b 100644
--- a/test/runtime/samples/dynamic-component-slot/_config.js
+++ b/test/runtime/samples/dynamic-component-slot/_config.js
@@ -32,4 +32,4 @@ export default {
what goes up must come down
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/dynamic-component-update-existing-instance/_config.js b/test/runtime/samples/dynamic-component-update-existing-instance/_config.js
index 5e3d836382..adca76f5a7 100644
--- a/test/runtime/samples/dynamic-component-update-existing-instance/_config.js
+++ b/test/runtime/samples/dynamic-component-update-existing-instance/_config.js
@@ -14,4 +14,4 @@ export default {
Foo 2
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/dynamic-component/_config.js b/test/runtime/samples/dynamic-component/_config.js
index fe7ce5d65f..64abb9bd96 100644
--- a/test/runtime/samples/dynamic-component/_config.js
+++ b/test/runtime/samples/dynamic-component/_config.js
@@ -14,4 +14,4 @@ export default {
false, therefore Bar
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/each-block-destructured-default-before-initialised/_config.js b/test/runtime/samples/each-block-destructured-default-before-initialised/_config.js
new file mode 100644
index 0000000000..c42261df40
--- /dev/null
+++ b/test/runtime/samples/each-block-destructured-default-before-initialised/_config.js
@@ -0,0 +1,5 @@
+export default {
+ error(assert, err) {
+ assert.ok(err.message === "Cannot access 'c' before initialization" || err.message === 'c is not defined');
+ }
+};
diff --git a/test/runtime/samples/each-block-destructured-default-before-initialised/main.svelte b/test/runtime/samples/each-block-destructured-default-before-initialised/main.svelte
new file mode 100644
index 0000000000..76eb09c0de
--- /dev/null
+++ b/test/runtime/samples/each-block-destructured-default-before-initialised/main.svelte
@@ -0,0 +1,7 @@
+
+
+{#each array as { a, b = c, c }}
+ {a}{b}{c}
+{/each}
diff --git a/test/runtime/samples/each-block-destructured-default-binding/_config.js b/test/runtime/samples/each-block-destructured-default-binding/_config.js
new file mode 100644
index 0000000000..2ba27bff03
--- /dev/null
+++ b/test/runtime/samples/each-block-destructured-default-binding/_config.js
@@ -0,0 +1,23 @@
+export default {
+ html: `
+
+
+ `,
+ ssrHtml: `
+
+
+ `,
+
+ test({ assert, component, target, window }) {
+ const [input1, input2] = target.querySelectorAll('input');
+ assert.equal(input1.value, '');
+ assert.equal(input2.value, 'hello');
+
+ const inputEvent = new window.InputEvent('input');
+
+ input2.value = 'world';
+ input2.dispatchEvent(inputEvent);
+ assert.equal(input2.value, 'world');
+ assert.equal(component.array[1].value, 'world');
+ }
+};
diff --git a/test/runtime/samples/each-block-destructured-default-binding/main.svelte b/test/runtime/samples/each-block-destructured-default-binding/main.svelte
new file mode 100644
index 0000000000..e93a01038b
--- /dev/null
+++ b/test/runtime/samples/each-block-destructured-default-binding/main.svelte
@@ -0,0 +1,7 @@
+
+
+{#each array as { value = "hello" }}
+
+{/each}
diff --git a/test/runtime/samples/each-block-destructured-default/_config.js b/test/runtime/samples/each-block-destructured-default/_config.js
index 0e99fd589f..0115c9d1ce 100644
--- a/test/runtime/samples/each-block-destructured-default/_config.js
+++ b/test/runtime/samples/each-block-destructured-default/_config.js
@@ -1,22 +1,26 @@
export default {
props: {
animalEntries: [
- { animal: 'raccoon', class: 'mammal', species: 'P. lotor', kilogram: 25 },
- { animal: 'eagle', class: 'bird', kilogram: 5.4 }
+ { animal: 'raccoon', class: 'mammal', species: 'P. lotor', kilogram: 25, bmi: 0.04 },
+ { animal: 'eagle', class: 'bird', kilogram: 5.4 },
+ { animal: 'tiger', class: 'mammal', kilogram: 10, pound: 30 },
+ { animal: 'lion', class: 'mammal', kilogram: 10, height: 50 },
+ { animal: 'leopard', class: 'mammal', kilogram: 30, height: 50, bmi: 10 }
]
},
html: `
- raccoon - P. lotor - 25kg
- eagle - unknown - 5.4kg
+ raccoon - P. lotor - 25kg (55 lb) - 30cm - 0.04
+ eagle - unknown - 5.4kg (12 lb) - 30cm - 0.006
+ tiger - unknown - 10kg (30 lb) - 30cm - 0.011111111111111112
+ lion - unknown - 10kg (22 lb) - 50cm - 0.004
+ leopard - unknown - 30kg (66 lb) - 50cm - 10
`,
-
-
test({ assert, component, target }) {
component.animalEntries = [{ animal: 'cow', class: 'mammal', species: 'B. taurus' }];
assert.htmlEqual(target.innerHTML, `
- cow - B. taurus - 50kg
+ cow - B. taurus - 50kg (110 lb) - 30cm - 0.05555555555555555
`);
}
};
diff --git a/test/runtime/samples/each-block-destructured-default/main.svelte b/test/runtime/samples/each-block-destructured-default/main.svelte
index a91b45299e..44e720e174 100644
--- a/test/runtime/samples/each-block-destructured-default/main.svelte
+++ b/test/runtime/samples/each-block-destructured-default/main.svelte
@@ -1,7 +1,8 @@
-{#each animalEntries as { animal, species = 'unknown', kilogram: weight = 50 , ...props } }
- {animal} - {species} - {weight}kg
+{#each animalEntries as { animal, species = 'unknown', kilogram: weight = 50, pound = (weight * 2.2).toFixed(0), height = defaultHeight, bmi = weight / (height * height), ...props } }
+ {animal} - {species} - {weight}kg ({pound} lb) - {height}cm - {bmi}
{/each}
diff --git a/test/runtime/samples/each-block-empty-outro/_config.js b/test/runtime/samples/each-block-empty-outro/_config.js
index fe1657aa0c..0acf1f572f 100644
--- a/test/runtime/samples/each-block-empty-outro/_config.js
+++ b/test/runtime/samples/each-block-empty-outro/_config.js
@@ -15,4 +15,4 @@ export default {
assert.htmlEqual(target.innerHTML, '');
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/each-block-keyed-bind-group/_config.js b/test/runtime/samples/each-block-keyed-bind-group/_config.js
new file mode 100644
index 0000000000..0172c2efe7
--- /dev/null
+++ b/test/runtime/samples/each-block-keyed-bind-group/_config.js
@@ -0,0 +1,65 @@
+export default {
+ html: `
+ Vanilla
+ Strawberry
+ Chocolate
+ Lemon
+ Coconut
+ `,
+
+ async test({ assert, target, window }) {
+ const [input1, input2, input3, input4, input5] = target.querySelectorAll('input');
+ const event = new window.Event('change');
+
+ input3.checked = true;
+ await input3.dispatchEvent(event);
+
+ assert.htmlEqual(target.innerHTML, `
+ Chocolate
+ Vanilla
+ Strawberry
+ Lemon
+ Coconut
+ `);
+
+ assert.equal(input1.checked, false);
+ assert.equal(input2.checked, false);
+ assert.equal(input3.checked, true);
+ assert.equal(input4.checked, false);
+ assert.equal(input5.checked, false);
+
+ input4.checked = true;
+ await input4.dispatchEvent(event);
+
+ assert.htmlEqual(target.innerHTML, `
+ Chocolate
+ Lemon
+ Vanilla
+ Strawberry
+ Coconut
+ `);
+
+ assert.equal(input1.checked, false);
+ assert.equal(input2.checked, false);
+ assert.equal(input3.checked, true);
+ assert.equal(input4.checked, true);
+ assert.equal(input5.checked, false);
+
+ input3.checked = false;
+ await input3.dispatchEvent(event);
+
+ assert.htmlEqual(target.innerHTML, `
+ Lemon
+ Chocolate
+ Vanilla
+ Strawberry
+ Coconut
+ `);
+
+ assert.equal(input1.checked, false);
+ assert.equal(input2.checked, false);
+ assert.equal(input3.checked, false);
+ assert.equal(input4.checked, true);
+ assert.equal(input5.checked, false);
+ }
+};
diff --git a/test/runtime/samples/each-block-keyed-bind-group/main.svelte b/test/runtime/samples/each-block-keyed-bind-group/main.svelte
new file mode 100644
index 0000000000..80c0db4f83
--- /dev/null
+++ b/test/runtime/samples/each-block-keyed-bind-group/main.svelte
@@ -0,0 +1,21 @@
+
+
+{#each flavours as flavour (flavour)}
+
+
+ {flavour}
+
+{/each}
diff --git a/test/runtime/samples/each-block-keyed-changed/_config.js b/test/runtime/samples/each-block-keyed-changed/_config.js
new file mode 100644
index 0000000000..afb3593b94
--- /dev/null
+++ b/test/runtime/samples/each-block-keyed-changed/_config.js
@@ -0,0 +1,13 @@
+export default {
+ props: {
+ titles: [{ name: 'a' }, { name: 'b' }, { name: 'c' }]
+ },
+
+ html: '',
+
+ test({ assert, component, target }) {
+ component.titles = [{ name: 'b' }, { name: 'c' }, { name: 'a' }];
+
+ assert.htmlEqual(target.innerHTML, '');
+ }
+};
diff --git a/test/runtime/samples/each-block-keyed-changed/main.svelte b/test/runtime/samples/each-block-keyed-changed/main.svelte
new file mode 100644
index 0000000000..1e1ef513a7
--- /dev/null
+++ b/test/runtime/samples/each-block-keyed-changed/main.svelte
@@ -0,0 +1,8 @@
+
+
+ {#each titles as title (title.name)}
+
{title.name}
+ {/each}
+
diff --git a/test/runtime/samples/each-block-keyed-component-action/_config.js b/test/runtime/samples/each-block-keyed-component-action/_config.js
index a1afc44c93..af621330d3 100644
--- a/test/runtime/samples/each-block-keyed-component-action/_config.js
+++ b/test/runtime/samples/each-block-keyed-component-action/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, raf }) {
+ test({ assert, component }) {
assert.equal(component.count, 0);
component.arr = ['2'];
diff --git a/test/runtime/samples/each-block-keyed-dyanmic-key/_config.js b/test/runtime/samples/each-block-keyed-dyanmic-key/_config.js
index 0aed1b0e07..949235ee48 100644
--- a/test/runtime/samples/each-block-keyed-dyanmic-key/_config.js
+++ b/test/runtime/samples/each-block-keyed-dyanmic-key/_config.js
@@ -9,6 +9,10 @@ export default {
}
},
+ before_test() {
+ count = 0;
+ },
+
html: `
foo
foo
diff --git a/test/runtime/samples/each-block-keyed-dynamic-2/_config.js b/test/runtime/samples/each-block-keyed-dynamic-2/_config.js
index e25083c751..0c28656f5f 100644
--- a/test/runtime/samples/each-block-keyed-dynamic-2/_config.js
+++ b/test/runtime/samples/each-block-keyed-dynamic-2/_config.js
@@ -5,7 +5,7 @@ export default {
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const button = target.querySelector('button');
const event = new window.MouseEvent('click');
diff --git a/test/runtime/samples/each-blocks-assignment-2/_config.js b/test/runtime/samples/each-blocks-assignment-2/_config.js
index f69b4fe9f6..93f06956d0 100644
--- a/test/runtime/samples/each-blocks-assignment-2/_config.js
+++ b/test/runtime/samples/each-blocks-assignment-2/_config.js
@@ -3,7 +3,7 @@ export default {
foo
Test
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const button = target.querySelector('button');
const clickEvent = new window.MouseEvent('click');
diff --git a/test/runtime/samples/each-blocks-assignment/_config.js b/test/runtime/samples/each-blocks-assignment/_config.js
index b651e3e02b..5e22381e9e 100644
--- a/test/runtime/samples/each-blocks-assignment/_config.js
+++ b/test/runtime/samples/each-blocks-assignment/_config.js
@@ -8,7 +8,7 @@ export default {
3
Test
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
let [incrementBtn, ...buttons] = target.querySelectorAll('button');
const clickEvent = new window.MouseEvent('click');
@@ -92,6 +92,6 @@ export default {
8
Test
`
- );
+ );
}
};
diff --git a/test/runtime/samples/each-blocks-nested-b/_config.js b/test/runtime/samples/each-blocks-nested-b/_config.js
index 7b13d988b4..ab008b4249 100644
--- a/test/runtime/samples/each-blocks-nested-b/_config.js
+++ b/test/runtime/samples/each-blocks-nested-b/_config.js
@@ -29,7 +29,7 @@ export default {
]
},
html: 'animals: aardvark
animals: buffalo
animals: chinchilla
countries: albania
countries: brazil
countries: china
people: alice
people: bob
people: carol
people: dave
',
- test({ assert, component, target }) {
+ test() {
// TODO
}
};
diff --git a/test/runtime/samples/each-blocks-nested/_config.js b/test/runtime/samples/each-blocks-nested/_config.js
index 3318bc344d..04d9bd11c5 100644
--- a/test/runtime/samples/each-blocks-nested/_config.js
+++ b/test/runtime/samples/each-blocks-nested/_config.js
@@ -6,7 +6,6 @@ export default {
html: 'a, 1
a, 2
a, 3
b, 1
b, 2
b, 3
c, 1
c, 2
c, 3
',
- test({ assert, component, target }) {
- // TODO
- }
+ // TODO
+ test() {}
};
diff --git a/test/runtime/samples/element-source-location/_config.js b/test/runtime/samples/element-source-location/_config.js
index 61ae36d107..be528d15eb 100644
--- a/test/runtime/samples/element-source-location/_config.js
+++ b/test/runtime/samples/element-source-location/_config.js
@@ -5,7 +5,7 @@ export default {
dev: true
},
- test({ assert, component, target }) {
+ test({ assert, target }) {
const h1 = target.querySelector('h1');
const p = target.querySelector('p');
@@ -23,4 +23,4 @@ export default {
char: 7
});
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/empty-dom/_config.js b/test/runtime/samples/empty-dom/_config.js
index 7da2831db4..22dc25b41e 100644
--- a/test/runtime/samples/empty-dom/_config.js
+++ b/test/runtime/samples/empty-dom/_config.js
@@ -1,3 +1,3 @@
export default {
html: ''
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/event-handler-console-log/_config.js b/test/runtime/samples/event-handler-console-log/_config.js
index 35e447c45b..289a84e44c 100644
--- a/test/runtime/samples/event-handler-console-log/_config.js
+++ b/test/runtime/samples/event-handler-console-log/_config.js
@@ -7,7 +7,7 @@ export default {
click me
`,
- test({ assert, component, target, window }) {
+ test({ assert, target, window }) {
const button = target.querySelector('button');
const event = new window.MouseEvent('click');
diff --git a/test/runtime/samples/event-handler-destructured/_config.js b/test/runtime/samples/event-handler-destructured/_config.js
index b32fe76c0a..2c37a17c75 100644
--- a/test/runtime/samples/event-handler-destructured/_config.js
+++ b/test/runtime/samples/event-handler-destructured/_config.js
@@ -3,7 +3,7 @@ export default {
clicked: false
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const button = target.querySelector('button');
const event = new window.MouseEvent('click');
diff --git a/test/runtime/samples/event-handler-dynamic-bound-var/_config.js b/test/runtime/samples/event-handler-dynamic-bound-var/_config.js
index c490db000a..fbbfee221d 100644
--- a/test/runtime/samples/event-handler-dynamic-bound-var/_config.js
+++ b/test/runtime/samples/event-handler-dynamic-bound-var/_config.js
@@ -3,7 +3,7 @@ export default {
Click Me
Hello World
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const button = target.querySelector('button');
const event = new window.MouseEvent('click');
diff --git a/test/runtime/samples/event-handler-dynamic-expression/_config.js b/test/runtime/samples/event-handler-dynamic-expression/_config.js
index f479c9cef2..f2c876cdeb 100644
--- a/test/runtime/samples/event-handler-dynamic-expression/_config.js
+++ b/test/runtime/samples/event-handler-dynamic-expression/_config.js
@@ -1,7 +1,7 @@
export default {
html: 'bar ',
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const [button] = target.querySelectorAll(
'button'
);
@@ -10,10 +10,10 @@ export default {
await button.dispatchEvent(event);
assert.htmlEqual(target.innerHTML, 'foo ');
-
+
await button.dispatchEvent(event);
assert.htmlEqual(target.innerHTML, 'bar ');
-
+
await button.dispatchEvent(event);
assert.htmlEqual(target.innerHTML, 'foo ');
}
diff --git a/test/runtime/samples/event-handler-dynamic-hash/_config.js b/test/runtime/samples/event-handler-dynamic-hash/_config.js
index 35f5fa103d..e98d0f6104 100644
--- a/test/runtime/samples/event-handler-dynamic-hash/_config.js
+++ b/test/runtime/samples/event-handler-dynamic-hash/_config.js
@@ -8,7 +8,7 @@ export default {
click
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const [updateButton1, updateButton2, button] = target.querySelectorAll(
'button'
);
diff --git a/test/runtime/samples/event-handler-dynamic-invalid/_config.js b/test/runtime/samples/event-handler-dynamic-invalid/_config.js
index 0ed298c95a..beebd4459e 100644
--- a/test/runtime/samples/event-handler-dynamic-invalid/_config.js
+++ b/test/runtime/samples/event-handler-dynamic-invalid/_config.js
@@ -3,7 +3,7 @@ export default {
null
invalid `,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const [buttonUndef, buttonNull, buttonInvalid] = target.querySelectorAll(
'button'
);
diff --git a/test/runtime/samples/event-handler-dynamic/_config.js b/test/runtime/samples/event-handler-dynamic/_config.js
index 35f5fa103d..e98d0f6104 100644
--- a/test/runtime/samples/event-handler-dynamic/_config.js
+++ b/test/runtime/samples/event-handler-dynamic/_config.js
@@ -8,7 +8,7 @@ export default {
click
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const [updateButton1, updateButton2, button] = target.querySelectorAll(
'button'
);
diff --git a/test/runtime/samples/event-handler-each/_config.js b/test/runtime/samples/event-handler-each/_config.js
index 281f6d0d7c..9c0407860e 100644
--- a/test/runtime/samples/event-handler-each/_config.js
+++ b/test/runtime/samples/event-handler-each/_config.js
@@ -15,7 +15,7 @@ export default {
selected: foo
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const buttons = target.querySelectorAll('button');
const event = new window.MouseEvent('click');
diff --git a/test/runtime/samples/event-handler-modifier-trusted/_config.js b/test/runtime/samples/event-handler-modifier-trusted/_config.js
new file mode 100644
index 0000000000..ac269e674a
--- /dev/null
+++ b/test/runtime/samples/event-handler-modifier-trusted/_config.js
@@ -0,0 +1,9 @@
+export default {
+ async test({ assert, component, target, window }) {
+ const button = target.querySelector('button');
+ const event = new window.MouseEvent('click');
+
+ await button.dispatchEvent(event);
+ assert.equal(component.trusted, true);
+ }
+};
diff --git a/test/runtime/samples/event-handler-modifier-trusted/main.svelte b/test/runtime/samples/event-handler-modifier-trusted/main.svelte
new file mode 100644
index 0000000000..504326a498
--- /dev/null
+++ b/test/runtime/samples/event-handler-modifier-trusted/main.svelte
@@ -0,0 +1,5 @@
+
+
+ trusted = false}">Only trusted events: {trusted?'true':'false'}
diff --git a/test/runtime/samples/event-handler-sanitize/_config.js b/test/runtime/samples/event-handler-sanitize/_config.js
index 9f16b14093..ddc15724a3 100644
--- a/test/runtime/samples/event-handler-sanitize/_config.js
+++ b/test/runtime/samples/event-handler-sanitize/_config.js
@@ -3,7 +3,7 @@ export default {
toggle
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const div = target.querySelector('div');
const event = new window.MouseEvent('some-event');
diff --git a/test/runtime/samples/event-handler-this-methods/_config.js b/test/runtime/samples/event-handler-this-methods/_config.js
index 8be56cf1a6..d7907f752d 100644
--- a/test/runtime/samples/event-handler-this-methods/_config.js
+++ b/test/runtime/samples/event-handler-this-methods/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window }) {
+ test({ assert, target, window }) {
// Click events don't focus elements in JSDOM – obviously they would
// in real browsers. More realistically, you'd use this for e.g.
// this.select(), but that's harder to test than this.focus()
diff --git a/test/runtime/samples/event-handler/_config.js b/test/runtime/samples/event-handler/_config.js
index 3a5ac7a18b..f142fc9daa 100644
--- a/test/runtime/samples/event-handler/_config.js
+++ b/test/runtime/samples/event-handler/_config.js
@@ -3,7 +3,7 @@ export default {
toggle
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const button = target.querySelector('button');
const event = new window.MouseEvent('click');
diff --git a/test/runtime/samples/export-from/A.svelte b/test/runtime/samples/export-from/A.svelte
new file mode 100644
index 0000000000..7773727704
--- /dev/null
+++ b/test/runtime/samples/export-from/A.svelte
@@ -0,0 +1,23 @@
+
+
+
+
+a: {typeof a}
+b: {typeof b}
+c: {typeof c}
+d: {typeof d}
+e: {typeof e}
+f: {typeof f}
+g: {typeof g}
\ No newline at end of file
diff --git a/test/runtime/samples/export-from/B.svelte b/test/runtime/samples/export-from/B.svelte
new file mode 100644
index 0000000000..0cc1070cb5
--- /dev/null
+++ b/test/runtime/samples/export-from/B.svelte
@@ -0,0 +1,8 @@
+
diff --git a/test/runtime/samples/export-from/_config.js b/test/runtime/samples/export-from/_config.js
new file mode 100644
index 0000000000..9e65b7501d
--- /dev/null
+++ b/test/runtime/samples/export-from/_config.js
@@ -0,0 +1,28 @@
+export default {
+ html: `
+ a,b,undefined,c
+
+ a: undefined
+ b: number
+ c: undefined
+ d: undefined
+ e: number
+ f: undefined
+ g: undefined
+
+ {"d":"d","e":"e","g":"f"}
+ `,
+ ssrHtml: `
+ a,b,undefined,c
+
+ a: undefined
+ b: number
+ c: undefined
+ d: undefined
+ e: number
+ f: undefined
+ g: undefined
+
+ {}
+ `
+};
diff --git a/test/runtime/samples/export-from/main.svelte b/test/runtime/samples/export-from/main.svelte
new file mode 100644
index 0000000000..18cc066c1f
--- /dev/null
+++ b/test/runtime/samples/export-from/main.svelte
@@ -0,0 +1,21 @@
+
+
+{a},{b},{c},{d}
+
+
+
+{JSON.stringify(props)}
\ No newline at end of file
diff --git a/test/runtime/samples/flush-before-bindings/_config.js b/test/runtime/samples/flush-before-bindings/_config.js
index 7bb6ebfc15..4f20299771 100644
--- a/test/runtime/samples/flush-before-bindings/_config.js
+++ b/test/runtime/samples/flush-before-bindings/_config.js
@@ -20,4 +20,4 @@ export default {
// TODO minimise the number of recomputations during oncreate
// assert.equal(counter.count, 1);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/flush-before-bindings/counter.js b/test/runtime/samples/flush-before-bindings/counter.js
index 63872cd6a2..f0fc271f84 100644
--- a/test/runtime/samples/flush-before-bindings/counter.js
+++ b/test/runtime/samples/flush-before-bindings/counter.js
@@ -1,3 +1,3 @@
export default {
count: 0
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/function-expression-inline/_config.js b/test/runtime/samples/function-expression-inline/_config.js
index 6916be45b1..a5dc3f7080 100644
--- a/test/runtime/samples/function-expression-inline/_config.js
+++ b/test/runtime/samples/function-expression-inline/_config.js
@@ -19,4 +19,4 @@ export default {
6
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/function-in-expression/_config.js b/test/runtime/samples/function-in-expression/_config.js
index 6b6fb29895..d3086863d3 100644
--- a/test/runtime/samples/function-in-expression/_config.js
+++ b/test/runtime/samples/function-in-expression/_config.js
@@ -10,4 +10,4 @@ export default {
assert.htmlEqual(target.innerHTML, '11, 13, 15');
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/globals-accessible-directly/_config.js b/test/runtime/samples/globals-accessible-directly/_config.js
index ad010356c8..30e176ae1b 100644
--- a/test/runtime/samples/globals-accessible-directly/_config.js
+++ b/test/runtime/samples/globals-accessible-directly/_config.js
@@ -1,7 +1,7 @@
export default {
html: '',
- test({ assert, component, target }) {
+ test({ assert, target }) {
assert.htmlEqual(target.innerHTML, 'NaN');
}
};
diff --git a/test/runtime/samples/hash-in-attribute/_config.js b/test/runtime/samples/hash-in-attribute/_config.js
index 5e5726c48f..a6fe8eb909 100644
--- a/test/runtime/samples/hash-in-attribute/_config.js
+++ b/test/runtime/samples/hash-in-attribute/_config.js
@@ -23,4 +23,4 @@ export default {
x#f
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/head-if-else-block/_config.js b/test/runtime/samples/head-if-else-block/_config.js
index 7665bfe90b..64da6ff796 100644
--- a/test/runtime/samples/head-if-else-block/_config.js
+++ b/test/runtime/samples/head-if-else-block/_config.js
@@ -3,7 +3,7 @@ export default {
condition: false
},
- test({ assert, component, target, window }) {
+ test({ assert, component, window }) {
assert.equal(window.document.title, '');
assert.equal(Boolean(window.document.getElementById('meta')), true);
diff --git a/test/runtime/samples/head-title-dynamic-simple/_config.js b/test/runtime/samples/head-title-dynamic-simple/_config.js
index 682a841fcd..7a086419ee 100644
--- a/test/runtime/samples/head-title-dynamic-simple/_config.js
+++ b/test/runtime/samples/head-title-dynamic-simple/_config.js
@@ -3,10 +3,10 @@ export default {
foo: 'A Title'
},
- test({ assert, component, target, window }) {
+ test({ assert, component, window }) {
assert.equal(window.document.title, 'A Title');
component.foo = 'Also A Title';
assert.equal(window.document.title, 'Also A Title');
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/head-title-dynamic/_config.js b/test/runtime/samples/head-title-dynamic/_config.js
index ddb04bf0a3..2555e55b8c 100644
--- a/test/runtime/samples/head-title-dynamic/_config.js
+++ b/test/runtime/samples/head-title-dynamic/_config.js
@@ -3,10 +3,10 @@ export default {
adjective: 'custom'
},
- test({ assert, component, target, window }) {
+ test({ assert, component, window }) {
assert.equal(window.document.title, 'a custom title');
component.adjective = 'different';
assert.equal(window.document.title, 'a different title');
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/head-title-empty/_config.js b/test/runtime/samples/head-title-empty/_config.js
index 497855156c..5b0785c797 100644
--- a/test/runtime/samples/head-title-empty/_config.js
+++ b/test/runtime/samples/head-title-empty/_config.js
@@ -2,4 +2,4 @@ export default {
test({ assert, window }) {
assert.equal(window.document.title, '');
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/head-title-static/_config.js b/test/runtime/samples/head-title-static/_config.js
index e6d5d9aaff..184d04c092 100644
--- a/test/runtime/samples/head-title-static/_config.js
+++ b/test/runtime/samples/head-title-static/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window }) {
+ test({ assert, window }) {
assert.equal(window.document.title, 'changed');
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/html-entities-inside-elements/_config.js b/test/runtime/samples/html-entities-inside-elements/_config.js
index a53af0a297..2537da2654 100644
--- a/test/runtime/samples/html-entities-inside-elements/_config.js
+++ b/test/runtime/samples/html-entities-inside-elements/_config.js
@@ -2,4 +2,4 @@ export default {
html: `
this <em>should</em> not be <strong>bold</strong>
`
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/html-entities/_config.js b/test/runtime/samples/html-entities/_config.js
index c8c2de8403..ddcc318e28 100644
--- a/test/runtime/samples/html-entities/_config.js
+++ b/test/runtime/samples/html-entities/_config.js
@@ -11,4 +11,4 @@ export default {
¬anentity;
`
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/html-non-entities-inside-elements/_config.js b/test/runtime/samples/html-non-entities-inside-elements/_config.js
index bc217d6d02..d8e128a117 100644
--- a/test/runtime/samples/html-non-entities-inside-elements/_config.js
+++ b/test/runtime/samples/html-non-entities-inside-elements/_config.js
@@ -2,4 +2,4 @@ export default {
html: `
'foo'
`
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/if-block-conservative-update/_config.js b/test/runtime/samples/if-block-conservative-update/_config.js
index 9be7e29fef..f7ba01a8fd 100644
--- a/test/runtime/samples/if-block-conservative-update/_config.js
+++ b/test/runtime/samples/if-block-conservative-update/_config.js
@@ -11,6 +11,9 @@ export default {
html: 'potato
',
+ before_test() {
+ count = 0;
+ },
test({ assert, component, target }) {
assert.equal(count, 1);
@@ -19,4 +22,4 @@ export default {
assert.htmlEqual(target.innerHTML, 'soup
');
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/if-block-else-conservative-update/_config.js b/test/runtime/samples/if-block-else-conservative-update/_config.js
index bb6cfef05f..b3db0bca54 100644
--- a/test/runtime/samples/if-block-else-conservative-update/_config.js
+++ b/test/runtime/samples/if-block-else-conservative-update/_config.js
@@ -17,6 +17,11 @@ export default {
html: 'potato
',
+ before_test() {
+ count_a = 0;
+ count_b = 0;
+ },
+
test({ assert, component, target }) {
assert.equal(count_a, 1);
assert.equal(count_b, 0);
@@ -34,4 +39,4 @@ export default {
assert.htmlEqual(target.innerHTML, 'SALAD
');
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/if-block-outro-computed-function/Foo.svelte b/test/runtime/samples/if-block-outro-computed-function/Foo.svelte
new file mode 100644
index 0000000000..1910281566
--- /dev/null
+++ b/test/runtime/samples/if-block-outro-computed-function/Foo.svelte
@@ -0,0 +1 @@
+foo
\ No newline at end of file
diff --git a/test/runtime/samples/if-block-outro-computed-function/_config.js b/test/runtime/samples/if-block-outro-computed-function/_config.js
new file mode 100644
index 0000000000..69fd95d008
--- /dev/null
+++ b/test/runtime/samples/if-block-outro-computed-function/_config.js
@@ -0,0 +1,12 @@
+export default {
+ props: {
+ foo: true
+ },
+
+ html: 'foo',
+
+ test({ assert, component, target }) {
+ component.foo = false;
+ assert.htmlEqual(target.innerHTML, 'bar');
+ }
+};
diff --git a/test/runtime/samples/if-block-outro-computed-function/main.svelte b/test/runtime/samples/if-block-outro-computed-function/main.svelte
new file mode 100644
index 0000000000..adf7cc3e0b
--- /dev/null
+++ b/test/runtime/samples/if-block-outro-computed-function/main.svelte
@@ -0,0 +1,13 @@
+
+
+{#if foo}
+
+{:else if bar()}
+ bar
+{:else}
+ else
+{/if}
diff --git a/test/runtime/samples/if-block-outro-nested-else/_config.js b/test/runtime/samples/if-block-outro-nested-else/_config.js
index 226116fe13..06b89ea723 100644
--- a/test/runtime/samples/if-block-outro-nested-else/_config.js
+++ b/test/runtime/samples/if-block-outro-nested-else/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target }) {
+ test({ component }) {
// Would cause "TypeError: Cannot read property 'o' of undefined"
component.foo = false;
}
diff --git a/test/runtime/samples/ignore-unchanged-attribute-compound/counter.js b/test/runtime/samples/ignore-unchanged-attribute-compound/counter.js
index 63872cd6a2..f0fc271f84 100644
--- a/test/runtime/samples/ignore-unchanged-attribute-compound/counter.js
+++ b/test/runtime/samples/ignore-unchanged-attribute-compound/counter.js
@@ -1,3 +1,3 @@
export default {
count: 0
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/ignore-unchanged-attribute/counter.js b/test/runtime/samples/ignore-unchanged-attribute/counter.js
index 63872cd6a2..f0fc271f84 100644
--- a/test/runtime/samples/ignore-unchanged-attribute/counter.js
+++ b/test/runtime/samples/ignore-unchanged-attribute/counter.js
@@ -1,3 +1,3 @@
export default {
count: 0
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/ignore-unchanged-raw/counter.js b/test/runtime/samples/ignore-unchanged-raw/counter.js
index 63872cd6a2..f0fc271f84 100644
--- a/test/runtime/samples/ignore-unchanged-raw/counter.js
+++ b/test/runtime/samples/ignore-unchanged-raw/counter.js
@@ -1,3 +1,3 @@
export default {
count: 0
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/ignore-unchanged-tag/counter.js b/test/runtime/samples/ignore-unchanged-tag/counter.js
index 63872cd6a2..f0fc271f84 100644
--- a/test/runtime/samples/ignore-unchanged-tag/counter.js
+++ b/test/runtime/samples/ignore-unchanged-tag/counter.js
@@ -1,3 +1,3 @@
export default {
count: 0
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/inline-style-important/_config.js b/test/runtime/samples/inline-style-important/_config.js
index b7c8d2c352..53f4e98db3 100644
--- a/test/runtime/samples/inline-style-important/_config.js
+++ b/test/runtime/samples/inline-style-important/_config.js
@@ -15,4 +15,4 @@ export default {
styles = window.getComputedStyle(p);
assert.equal(styles.color, 'green');
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/inline-style-optimisation-bailout/_config.js b/test/runtime/samples/inline-style-optimisation-bailout/_config.js
index 836a3e2e6e..acc41e3160 100644
--- a/test/runtime/samples/inline-style-optimisation-bailout/_config.js
+++ b/test/runtime/samples/inline-style-optimisation-bailout/_config.js
@@ -17,4 +17,4 @@ export default {
assert.equal(styles.color, '');
assert.equal(styles.fontSize, '20px');
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/innerhtml-interpolated-literal/_config.js b/test/runtime/samples/innerhtml-interpolated-literal/_config.js
index 022c70f717..d2f4d94a31 100644
--- a/test/runtime/samples/innerhtml-interpolated-literal/_config.js
+++ b/test/runtime/samples/innerhtml-interpolated-literal/_config.js
@@ -4,4 +4,4 @@ export default {
`
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/innerhtml-with-comments/_config.js b/test/runtime/samples/innerhtml-with-comments/_config.js
index 95d4a6fa96..897d54c573 100644
--- a/test/runtime/samples/innerhtml-with-comments/_config.js
+++ b/test/runtime/samples/innerhtml-with-comments/_config.js
@@ -5,4 +5,4 @@ export default {
Bootstrap .
`
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/instrumentation-auto-subscription-self-assignment/_config.js b/test/runtime/samples/instrumentation-auto-subscription-self-assignment/_config.js
index 450562bebe..32cd6fc22d 100644
--- a/test/runtime/samples/instrumentation-auto-subscription-self-assignment/_config.js
+++ b/test/runtime/samples/instrumentation-auto-subscription-self-assignment/_config.js
@@ -5,4 +5,4 @@ export default {
await component.go();
assert.htmlEqual(target.innerHTML, '[42]');
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/instrumentation-script-destructuring/_config.js b/test/runtime/samples/instrumentation-script-destructuring/_config.js
index a0b2de9e77..b8ccf586ae 100644
--- a/test/runtime/samples/instrumentation-script-destructuring/_config.js
+++ b/test/runtime/samples/instrumentation-script-destructuring/_config.js
@@ -6,7 +6,7 @@ export default {
x: 0
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const buttons = target.querySelectorAll('button');
const click = new window.MouseEvent('click');
@@ -26,4 +26,4 @@ export default {
x: 2
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/instrumentation-script-loop-scope/_config.js b/test/runtime/samples/instrumentation-script-loop-scope/_config.js
index 1195055c45..1b57ed1e72 100644
--- a/test/runtime/samples/instrumentation-script-loop-scope/_config.js
+++ b/test/runtime/samples/instrumentation-script-loop-scope/_config.js
@@ -4,7 +4,7 @@ export default {
x: 0
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const buttons = target.querySelectorAll('button');
const click = new window.MouseEvent('click');
@@ -14,4 +14,4 @@ export default {
x: 42
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/instrumentation-script-multiple-assignments/_config.js b/test/runtime/samples/instrumentation-script-multiple-assignments/_config.js
index c5107e4964..1c4663938f 100644
--- a/test/runtime/samples/instrumentation-script-multiple-assignments/_config.js
+++ b/test/runtime/samples/instrumentation-script-multiple-assignments/_config.js
@@ -25,4 +25,4 @@ export default {
bar: 2
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/instrumentation-script-update/_config.js b/test/runtime/samples/instrumentation-script-update/_config.js
index 4e97140faf..d662856a7b 100644
--- a/test/runtime/samples/instrumentation-script-update/_config.js
+++ b/test/runtime/samples/instrumentation-script-update/_config.js
@@ -4,7 +4,7 @@ export default {
x: 0
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const buttons = target.querySelectorAll('button');
const click = new window.MouseEvent('click');
@@ -14,4 +14,4 @@ export default {
x: 1
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/instrumentation-template-destructuring/_config.js b/test/runtime/samples/instrumentation-template-destructuring/_config.js
index a0b2de9e77..b8ccf586ae 100644
--- a/test/runtime/samples/instrumentation-template-destructuring/_config.js
+++ b/test/runtime/samples/instrumentation-template-destructuring/_config.js
@@ -6,7 +6,7 @@ export default {
x: 0
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const buttons = target.querySelectorAll('button');
const click = new window.MouseEvent('click');
@@ -26,4 +26,4 @@ export default {
x: 2
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/instrumentation-template-loop-scope/_config.js b/test/runtime/samples/instrumentation-template-loop-scope/_config.js
index 1195055c45..1b57ed1e72 100644
--- a/test/runtime/samples/instrumentation-template-loop-scope/_config.js
+++ b/test/runtime/samples/instrumentation-template-loop-scope/_config.js
@@ -4,7 +4,7 @@ export default {
x: 0
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const buttons = target.querySelectorAll('button');
const click = new window.MouseEvent('click');
@@ -14,4 +14,4 @@ export default {
x: 42
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/instrumentation-template-multiple-assignments/_config.js b/test/runtime/samples/instrumentation-template-multiple-assignments/_config.js
index c5107e4964..1c4663938f 100644
--- a/test/runtime/samples/instrumentation-template-multiple-assignments/_config.js
+++ b/test/runtime/samples/instrumentation-template-multiple-assignments/_config.js
@@ -25,4 +25,4 @@ export default {
bar: 2
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/instrumentation-template-update/_config.js b/test/runtime/samples/instrumentation-template-update/_config.js
index 4e97140faf..d662856a7b 100644
--- a/test/runtime/samples/instrumentation-template-update/_config.js
+++ b/test/runtime/samples/instrumentation-template-update/_config.js
@@ -4,7 +4,7 @@ export default {
x: 0
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const buttons = target.querySelectorAll('button');
const click = new window.MouseEvent('click');
@@ -14,4 +14,4 @@ export default {
x: 1
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/invalidation-in-if-condition/_config.js b/test/runtime/samples/invalidation-in-if-condition/_config.js
index c9b551c918..25e7811889 100644
--- a/test/runtime/samples/invalidation-in-if-condition/_config.js
+++ b/test/runtime/samples/invalidation-in-if-condition/_config.js
@@ -14,4 +14,4 @@ export default {
await button.dispatchEvent(click);
assert.htmlEqual(target.innerHTML, 'true 2 ');
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/isolated-text/_config.js b/test/runtime/samples/isolated-text/_config.js
index ec4332be5c..4dc29eb838 100644
--- a/test/runtime/samples/isolated-text/_config.js
+++ b/test/runtime/samples/isolated-text/_config.js
@@ -3,4 +3,4 @@ export default {
before
after
`
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/key-block-2/_config.js b/test/runtime/samples/key-block-2/_config.js
index 9bbf1f199f..9bb7f17140 100644
--- a/test/runtime/samples/key-block-2/_config.js
+++ b/test/runtime/samples/key-block-2/_config.js
@@ -1,7 +1,7 @@
// with reactive content beside `key`
export default {
html: '00
',
- async test({ assert, component, target, window }) {
+ async test({ assert, component, target }) {
const div = target.querySelector('div');
component.reactive = 2;
assert.htmlEqual(target.innerHTML, '02
');
diff --git a/test/runtime/samples/key-block-3/_config.js b/test/runtime/samples/key-block-3/_config.js
index 17b6146827..6a41869f9b 100644
--- a/test/runtime/samples/key-block-3/_config.js
+++ b/test/runtime/samples/key-block-3/_config.js
@@ -1,7 +1,7 @@
// key is not used in the template
export default {
html: '
',
- async test({ assert, component, target, window }) {
+ async test({ assert, component, target }) {
const div = target.querySelector('div');
component.value = 5;
diff --git a/test/runtime/samples/key-block-array-immutable/_config.js b/test/runtime/samples/key-block-array-immutable/_config.js
index b1ffd6cd15..02823ec98a 100644
--- a/test/runtime/samples/key-block-array-immutable/_config.js
+++ b/test/runtime/samples/key-block-array-immutable/_config.js
@@ -1,6 +1,6 @@
export default {
html: '1
',
- async test({ assert, component, target, window }) {
+ async test({ assert, component, target }) {
let div = target.querySelector('div');
await component.append(2);
assert.htmlEqual(target.innerHTML, '1
');
diff --git a/test/runtime/samples/key-block-array/_config.js b/test/runtime/samples/key-block-array/_config.js
index 374175177d..6c22a03ed4 100644
--- a/test/runtime/samples/key-block-array/_config.js
+++ b/test/runtime/samples/key-block-array/_config.js
@@ -1,6 +1,6 @@
export default {
html: '1
',
- async test({ assert, component, target, window }) {
+ async test({ assert, component, target }) {
let div = target.querySelector('div');
await component.append(2);
assert.htmlEqual(target.innerHTML, '1,2
');
diff --git a/test/runtime/samples/key-block-expression-2/_config.js b/test/runtime/samples/key-block-expression-2/_config.js
index bab23d2a84..602a8364ee 100644
--- a/test/runtime/samples/key-block-expression-2/_config.js
+++ b/test/runtime/samples/key-block-expression-2/_config.js
@@ -1,6 +1,6 @@
export default {
html: '3
',
- async test({ assert, component, target, window }) {
+ async test({ assert, component, target }) {
const div = target.querySelector('div');
await component.mutate();
diff --git a/test/runtime/samples/key-block-expression/_config.js b/test/runtime/samples/key-block-expression/_config.js
index c04d55bd29..85de9f8e88 100644
--- a/test/runtime/samples/key-block-expression/_config.js
+++ b/test/runtime/samples/key-block-expression/_config.js
@@ -1,6 +1,6 @@
export default {
html: '000
',
- async test({ assert, component, target, window }) {
+ async test({ assert, component, target }) {
let div = target.querySelector('div');
component.value = 2;
assert.htmlEqual(target.innerHTML, '200
');
diff --git a/test/runtime/samples/key-block-post-hydrate/_config.js b/test/runtime/samples/key-block-post-hydrate/_config.js
new file mode 100644
index 0000000000..e989d678e9
--- /dev/null
+++ b/test/runtime/samples/key-block-post-hydrate/_config.js
@@ -0,0 +1,19 @@
+export default {
+ html: `
+
+
item 1 something
+
item 2 something
+
item 3 something
+
+ `,
+ test({ assert, component, target }) {
+ component.sortById = false;
+ assert.htmlEqual( target.innerHTML, `
+
+
item 3 something
+
item 2 something
+
item 1 something
+
+ `);
+ }
+};
diff --git a/test/runtime/samples/key-block-post-hydrate/main.svelte b/test/runtime/samples/key-block-post-hydrate/main.svelte
new file mode 100644
index 0000000000..8ea316a0d7
--- /dev/null
+++ b/test/runtime/samples/key-block-post-hydrate/main.svelte
@@ -0,0 +1,23 @@
+
+
+
+ {#each items as item (item.id)}
+
+ {#if item.name}
+
+ {item.name}
+
+ {/if}
+ something
+
+ {/each}
+
diff --git a/test/runtime/samples/key-block-static-if/_config.js b/test/runtime/samples/key-block-static-if/_config.js
new file mode 100644
index 0000000000..2dfca9d8b6
--- /dev/null
+++ b/test/runtime/samples/key-block-static-if/_config.js
@@ -0,0 +1,21 @@
+export default {
+ html: `
+
+ Click
+ `,
+ async test({ assert, target, window }) {
+ const button = target.querySelector('button');
+
+ await button.dispatchEvent(new window.Event('click'));
+
+ assert.htmlEqual(target.innerHTML, `
+
+ Click
+ `);
+ }
+};
diff --git a/test/runtime/samples/key-block-static-if/main.svelte b/test/runtime/samples/key-block-static-if/main.svelte
new file mode 100644
index 0000000000..cbacb77674
--- /dev/null
+++ b/test/runtime/samples/key-block-static-if/main.svelte
@@ -0,0 +1,17 @@
+
+
+
+ {#key slide}
+ {#if num}
+ First
+ {/if}
+ {/key}
+ Second
+
+
+Click
\ No newline at end of file
diff --git a/test/runtime/samples/key-block-static/_config.js b/test/runtime/samples/key-block-static/_config.js
index 8323336615..8c327bcefd 100644
--- a/test/runtime/samples/key-block-static/_config.js
+++ b/test/runtime/samples/key-block-static/_config.js
@@ -1,6 +1,6 @@
export default {
html: '00
',
- async test({ assert, component, target, window }) {
+ async test({ assert, component, target }) {
const div = target.querySelector('div');
component.anotherValue = 2;
assert.htmlEqual(target.innerHTML, '02
');
diff --git a/test/runtime/samples/key-block-transition/_config.js b/test/runtime/samples/key-block-transition/_config.js
index 53de6b333c..d4bef20311 100644
--- a/test/runtime/samples/key-block-transition/_config.js
+++ b/test/runtime/samples/key-block-transition/_config.js
@@ -1,8 +1,8 @@
export default {
html: '0
',
- async test({ assert, component, target, window, raf }) {
+ async test({ assert, component, target, raf }) {
component.value = 2;
-
+
const [div1, div2] = target.querySelectorAll('div');
assert.htmlEqual(div1.outerHTML, '0
');
diff --git a/test/runtime/samples/key-block/_config.js b/test/runtime/samples/key-block/_config.js
index b25ca901f8..119c50e21d 100644
--- a/test/runtime/samples/key-block/_config.js
+++ b/test/runtime/samples/key-block/_config.js
@@ -1,6 +1,6 @@
export default {
html: '0
0
',
- async test({ assert, component, target, window }) {
+ async test({ assert, component, target }) {
let [div1, div2] = target.querySelectorAll('div');
component.value = 5;
@@ -8,7 +8,7 @@ export default {
assert.notStrictEqual(div1, target.querySelectorAll('div')[0]);
assert.strictEqual(div2, target.querySelectorAll('div')[1]);
[div1, div2] = target.querySelectorAll('div');
-
+
component.reactive = 10;
assert.htmlEqual(target.innerHTML, '5
10
');
assert.strictEqual(div1, target.querySelectorAll('div')[0]);
diff --git a/test/runtime/samples/lifecycle-render-order-for-children/_config.js b/test/runtime/samples/lifecycle-render-order-for-children/_config.js
index d182d5a97e..32bc35d49c 100644
--- a/test/runtime/samples/lifecycle-render-order-for-children/_config.js
+++ b/test/runtime/samples/lifecycle-render-order-for-children/_config.js
@@ -2,8 +2,10 @@ import order from './order.js';
export default {
skip_if_ssr: true,
-
- test({ assert, component, target, compileOptions }) {
+ before_test() {
+ order.length = 0;
+ },
+ test({ assert, compileOptions }) {
if (compileOptions.hydratable) {
assert.deepEqual(order, [
'0: beforeUpdate',
@@ -43,7 +45,5 @@ export default {
'0: afterUpdate'
]);
}
-
- order.length = 0;
}
};
diff --git a/test/runtime/samples/lifecycle-render-order-for-children/order.js b/test/runtime/samples/lifecycle-render-order-for-children/order.js
index 109fa8b38c..d6d1738de6 100644
--- a/test/runtime/samples/lifecycle-render-order-for-children/order.js
+++ b/test/runtime/samples/lifecycle-render-order-for-children/order.js
@@ -1 +1 @@
-export default [];
\ No newline at end of file
+export default [];
diff --git a/test/runtime/samples/lifecycle-render-order/_config.js b/test/runtime/samples/lifecycle-render-order/_config.js
index 5080973cef..2bbab7a838 100644
--- a/test/runtime/samples/lifecycle-render-order/_config.js
+++ b/test/runtime/samples/lifecycle-render-order/_config.js
@@ -3,6 +3,9 @@ import order from './order.js';
export default {
skip_if_ssr: true,
+ before_test() {
+ order.length = 0;
+ },
test({ assert }) {
assert.deepEqual(order, [
'beforeUpdate',
@@ -10,7 +13,5 @@ export default {
'onMount',
'afterUpdate'
]);
-
- order.length = 0;
}
};
diff --git a/test/runtime/samples/lifecycle-render-order/order.js b/test/runtime/samples/lifecycle-render-order/order.js
index 109fa8b38c..d6d1738de6 100644
--- a/test/runtime/samples/lifecycle-render-order/order.js
+++ b/test/runtime/samples/lifecycle-render-order/order.js
@@ -1 +1 @@
-export default [];
\ No newline at end of file
+export default [];
diff --git a/test/runtime/samples/module-context-export/_config.js b/test/runtime/samples/module-context-export/_config.js
index 4d77becea9..4c4595483a 100644
--- a/test/runtime/samples/module-context-export/_config.js
+++ b/test/runtime/samples/module-context-export/_config.js
@@ -1,3 +1,3 @@
export default {
html: '(42)(99)
'
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/module-context-with-instance-script/_config.js b/test/runtime/samples/module-context-with-instance-script/_config.js
index 4d77becea9..4c4595483a 100644
--- a/test/runtime/samples/module-context-with-instance-script/_config.js
+++ b/test/runtime/samples/module-context-with-instance-script/_config.js
@@ -1,3 +1,3 @@
export default {
html: '(42)(99)
'
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/module-context/_config.js b/test/runtime/samples/module-context/_config.js
index 947138e795..83138d08f9 100644
--- a/test/runtime/samples/module-context/_config.js
+++ b/test/runtime/samples/module-context/_config.js
@@ -1,3 +1,3 @@
export default {
html: '42
'
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/mutation-tracking-across-sibling-scopes/_config.js b/test/runtime/samples/mutation-tracking-across-sibling-scopes/_config.js
index 038db6dbbb..8d51c61394 100644
--- a/test/runtime/samples/mutation-tracking-across-sibling-scopes/_config.js
+++ b/test/runtime/samples/mutation-tracking-across-sibling-scopes/_config.js
@@ -9,4 +9,4 @@ export default {
assert.htmlEqual(component.div.innerHTML, '-
-
');
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/nbsp-div/_config.js b/test/runtime/samples/nbsp-div/_config.js
index 5ab7a7f04b..0d3264b720 100644
--- a/test/runtime/samples/nbsp-div/_config.js
+++ b/test/runtime/samples/nbsp-div/_config.js
@@ -3,7 +3,7 @@ export default {
hello
hello hello
`,
- test({ assert, component, target }) {
+ test({ assert, target }) {
const divList = target.querySelectorAll('div');
assert.equal( divList[0].textContent.charCodeAt( 0 ), 160 );
assert.equal( divList[1].textContent.charCodeAt( 0 ), 160 );
diff --git a/test/runtime/samples/nbsp/_config.js b/test/runtime/samples/nbsp/_config.js
index f5636bfebd..89fea253d2 100644
--- a/test/runtime/samples/nbsp/_config.js
+++ b/test/runtime/samples/nbsp/_config.js
@@ -1,8 +1,8 @@
export default {
html: ' ',
- test({ assert, component, target }) {
+ test({ assert, target }) {
const text = target.querySelector( 'span' ).textContent;
assert.equal( text.charCodeAt( 0 ), 160 );
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/nested-transition-detach-each/_config.js b/test/runtime/samples/nested-transition-detach-each/_config.js
index 41d32e597c..8737cfa0fa 100644
--- a/test/runtime/samples/nested-transition-detach-each/_config.js
+++ b/test/runtime/samples/nested-transition-detach-each/_config.js
@@ -11,7 +11,7 @@ export default {
dev: true
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
assert.htmlEqual(target.innerHTML, `
diff --git a/test/runtime/samples/noscript-removal/_config.js b/test/runtime/samples/noscript-removal/_config.js
index 709792c14a..0fd03ea223 100644
--- a/test/runtime/samples/noscript-removal/_config.js
+++ b/test/runtime/samples/noscript-removal/_config.js
@@ -1,9 +1,33 @@
export default {
- skip_if_ssr: true,
+ ssrHtml: `
+
foo
- html: `
-
foo
+
foofoo
-
-`
+
+ `,
+ test({ assert, target, compileOptions }) {
+ // if created on client side, should not build noscript
+ if (!compileOptions.hydratable) {
+ assert.equal(target.querySelectorAll('noscript').length, 0);
+ }
+
+ // it's okay not to remove the node during hydration
+ // will not be seen by user anyway
+ removeNoScript(target);
+
+ assert.htmlEqual(
+ target.innerHTML,
+ `
+
foo
+
+ `
+ );
+ }
};
+
+function removeNoScript(target) {
+ target.querySelectorAll('noscript').forEach(elem => {
+ elem.parentNode.removeChild(elem);
+ });
+}
diff --git a/test/runtime/samples/numeric-seperator/main.svelte b/test/runtime/samples/numeric-seperator/main.svelte
deleted file mode 100644
index e491b8a107..0000000000
--- a/test/runtime/samples/numeric-seperator/main.svelte
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-{num} {2_048}
\ No newline at end of file
diff --git a/test/runtime/samples/observable-auto-subscribe/_config.js b/test/runtime/samples/observable-auto-subscribe/_config.js
index b5b1e8b974..5570413395 100644
--- a/test/runtime/samples/observable-auto-subscribe/_config.js
+++ b/test/runtime/samples/observable-auto-subscribe/_config.js
@@ -46,4 +46,4 @@ export default {
assert.equal(subscribers.length, 0);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/ondestroy-before-cleanup/_config.js b/test/runtime/samples/ondestroy-before-cleanup/_config.js
index 80cc54bd6b..e33b154b64 100644
--- a/test/runtime/samples/ondestroy-before-cleanup/_config.js
+++ b/test/runtime/samples/ondestroy-before-cleanup/_config.js
@@ -9,4 +9,4 @@ export default {
component.visible = false;
assert.equal(container.div, div);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/ondestroy-before-cleanup/container.js b/test/runtime/samples/ondestroy-before-cleanup/container.js
index 7c645e42fb..ff8b4c5632 100644
--- a/test/runtime/samples/ondestroy-before-cleanup/container.js
+++ b/test/runtime/samples/ondestroy-before-cleanup/container.js
@@ -1 +1 @@
-export default {};
\ No newline at end of file
+export default {};
diff --git a/test/runtime/samples/ondestroy-deep/_config.js b/test/runtime/samples/ondestroy-deep/_config.js
index 4431a2e163..397d8c5684 100644
--- a/test/runtime/samples/ondestroy-deep/_config.js
+++ b/test/runtime/samples/ondestroy-deep/_config.js
@@ -2,9 +2,12 @@ import { destroyed, reset } from './destroyed.js';
export default {
test({ assert, component }) {
+ // for hydration, ssr may have pushed to `destroyed`
+ reset();
+
component.visible = false;
assert.deepEqual(destroyed, ['A', 'B', 'C']);
reset();
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/ondestroy-deep/destroyed.js b/test/runtime/samples/ondestroy-deep/destroyed.js
index fe05c1d241..45845cbd83 100644
--- a/test/runtime/samples/ondestroy-deep/destroyed.js
+++ b/test/runtime/samples/ondestroy-deep/destroyed.js
@@ -1,3 +1,3 @@
export const destroyed = [];
-export const reset = () => destroyed.length = 0;
\ No newline at end of file
+export const reset = () => destroyed.length = 0;
diff --git a/test/runtime/samples/onmount-sibling-order/result.js b/test/runtime/samples/onmount-sibling-order/result.js
index 109fa8b38c..d6d1738de6 100644
--- a/test/runtime/samples/onmount-sibling-order/result.js
+++ b/test/runtime/samples/onmount-sibling-order/result.js
@@ -1 +1 @@
-export default [];
\ No newline at end of file
+export default [];
diff --git a/test/runtime/samples/option-without-select/_config.js b/test/runtime/samples/option-without-select/_config.js
index 75d4d6583f..9925069bb1 100644
--- a/test/runtime/samples/option-without-select/_config.js
+++ b/test/runtime/samples/option-without-select/_config.js
@@ -11,4 +11,4 @@ export default {
goodbye
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/preload/_config.js b/test/runtime/samples/preload/_config.js
index 1b35ebbe74..d7d5fd0851 100644
--- a/test/runtime/samples/preload/_config.js
+++ b/test/runtime/samples/preload/_config.js
@@ -2,4 +2,4 @@ export default {
test({ assert, mod }) {
assert.deepEqual(mod.preload({ foo: 1 }), { bar: 2 });
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/prop-const/_config.js b/test/runtime/samples/prop-const/_config.js
index 489a48476f..991063a754 100644
--- a/test/runtime/samples/prop-const/_config.js
+++ b/test/runtime/samples/prop-const/_config.js
@@ -20,4 +20,4 @@ export default {
b: 2
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/prop-not-action/_config.js b/test/runtime/samples/prop-not-action/_config.js
index 17ab47b584..1f4ffa4749 100644
--- a/test/runtime/samples/prop-not-action/_config.js
+++ b/test/runtime/samples/prop-not-action/_config.js
@@ -6,4 +6,4 @@ export default {
html: `
Hello world!
`
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/prop-quoted/_config.js b/test/runtime/samples/prop-quoted/_config.js
index e3e553ded8..aa2f2ec329 100644
--- a/test/runtime/samples/prop-quoted/_config.js
+++ b/test/runtime/samples/prop-quoted/_config.js
@@ -9,4 +9,4 @@ export default {
component.foo = 2;
assert.htmlEqual(target.innerHTML, '2');
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/prop-subscribable/_config.js b/test/runtime/samples/prop-subscribable/_config.js
index 84cde8c9af..fcd8fb8b07 100644
--- a/test/runtime/samples/prop-subscribable/_config.js
+++ b/test/runtime/samples/prop-subscribable/_config.js
@@ -8,4 +8,4 @@ export default {
html: `
42
`
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/prop-without-semicolon-b/_config.js b/test/runtime/samples/prop-without-semicolon-b/_config.js
index 3ded1a72d8..6cdc86c521 100644
--- a/test/runtime/samples/prop-without-semicolon-b/_config.js
+++ b/test/runtime/samples/prop-without-semicolon-b/_config.js
@@ -4,4 +4,4 @@ export default {
},
html: '
Hello world! '
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/prop-without-semicolon/_config.js b/test/runtime/samples/prop-without-semicolon/_config.js
index 0655d02a2c..26b3554f9f 100644
--- a/test/runtime/samples/prop-without-semicolon/_config.js
+++ b/test/runtime/samples/prop-without-semicolon/_config.js
@@ -1,3 +1,3 @@
export default {
html: '
Hello world! '
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/props-reactive-b/_config.js b/test/runtime/samples/props-reactive-b/_config.js
index 43eaee23aa..541fd26e02 100644
--- a/test/runtime/samples/props-reactive-b/_config.js
+++ b/test/runtime/samples/props-reactive-b/_config.js
@@ -27,4 +27,4 @@ export default {
c: 9
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/props-reactive-only-with-change/_config.js b/test/runtime/samples/props-reactive-only-with-change/_config.js
index dcf12868f9..8ed82fc8ec 100644
--- a/test/runtime/samples/props-reactive-only-with-change/_config.js
+++ b/test/runtime/samples/props-reactive-only-with-change/_config.js
@@ -11,7 +11,7 @@ export default {
callbacks = [];
},
- async test({ assert, component, target }) {
+ async test({ assert, component }) {
assert.equal(callbacks.length, 2);
assert.equal(JSON.stringify(callbacks), '["1","2"]');
diff --git a/test/runtime/samples/props-reactive-slot/_config.js b/test/runtime/samples/props-reactive-slot/_config.js
index 266f0fc8a8..6129866605 100644
--- a/test/runtime/samples/props-reactive-slot/_config.js
+++ b/test/runtime/samples/props-reactive-slot/_config.js
@@ -4,7 +4,7 @@ export default {
Change
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const btn = target.querySelector('button');
const clickEvent = new window.MouseEvent('click');
diff --git a/test/runtime/samples/props-reactive/_config.js b/test/runtime/samples/props-reactive/_config.js
index a44687069e..4c27ac0618 100644
--- a/test/runtime/samples/props-reactive/_config.js
+++ b/test/runtime/samples/props-reactive/_config.js
@@ -17,4 +17,4 @@ export default {
5
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/props/_config.js b/test/runtime/samples/props/_config.js
index fc3c71d6f0..64015cdc6b 100644
--- a/test/runtime/samples/props/_config.js
+++ b/test/runtime/samples/props/_config.js
@@ -14,4 +14,4 @@ export default {
{"x":2}
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/raw-anchor-first-child/_config.js b/test/runtime/samples/raw-anchor-first-child/_config.js
index 02297675c5..f9e6b76626 100644
--- a/test/runtime/samples/raw-anchor-first-child/_config.js
+++ b/test/runtime/samples/raw-anchor-first-child/_config.js
@@ -8,5 +8,6 @@ export default {
assert.ok(!span.previousSibling);
component.raw = '
bar ';
+ assert.htmlEqual(target.innerHTML, '
bar
');
}
};
diff --git a/test/runtime/samples/raw-mustaches/_config.js b/test/runtime/samples/raw-mustaches/_config.js
index 9eda8289ce..a69b91d2d8 100644
--- a/test/runtime/samples/raw-mustaches/_config.js
+++ b/test/runtime/samples/raw-mustaches/_config.js
@@ -1,5 +1,4 @@
export default {
- skip_if_ssr: true,
props: {
raw: '
raw html!!!\\o/ '
diff --git a/test/runtime/samples/reactive-assignment-in-assignment-rhs/_config.js b/test/runtime/samples/reactive-assignment-in-assignment-rhs/_config.js
index cb79802589..0402f34a2f 100644
--- a/test/runtime/samples/reactive-assignment-in-assignment-rhs/_config.js
+++ b/test/runtime/samples/reactive-assignment-in-assignment-rhs/_config.js
@@ -1,3 +1,3 @@
export default {
html: '
1 1 '
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/reactive-assignment-in-complex-declaration-with-store-2/_config.js b/test/runtime/samples/reactive-assignment-in-complex-declaration-with-store-2/_config.js
index 3fd83aa9b2..62f47a01c3 100644
--- a/test/runtime/samples/reactive-assignment-in-complex-declaration-with-store-2/_config.js
+++ b/test/runtime/samples/reactive-assignment-in-complex-declaration-with-store-2/_config.js
@@ -1,9 +1,8 @@
// destructure to store value
export default {
- skip_if_ssr: true, // pending https://github.com/sveltejs/svelte/issues/3582
html: '
2 2 xxx 5 6 9 10 2 ',
async test({ assert, target, component }) {
await component.update();
assert.htmlEqual(target.innerHTML, '
11 11 yyy 12 13 14 15 11 ');
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/reactive-assignment-in-complex-declaration-with-store-3/_config.js b/test/runtime/samples/reactive-assignment-in-complex-declaration-with-store-3/_config.js
new file mode 100644
index 0000000000..bc34b3893c
--- /dev/null
+++ b/test/runtime/samples/reactive-assignment-in-complex-declaration-with-store-3/_config.js
@@ -0,0 +1,20 @@
+import { store } from './store.js';
+
+export default {
+ html: '
0 ',
+ before_test() {
+ store.reset();
+ },
+ async test({ assert, target }) {
+ store.set(42);
+
+ await Promise.resolve();
+
+ assert.htmlEqual(target.innerHTML, '
42 ');
+
+ assert.equal(store.numberOfTimesSubscribeCalled(), 1);
+ },
+ test_ssr({ assert }) {
+ assert.equal(store.numberOfTimesSubscribeCalled(), 1);
+ }
+};
diff --git a/test/runtime/samples/reactive-assignment-in-complex-declaration-with-store-3/main.svelte b/test/runtime/samples/reactive-assignment-in-complex-declaration-with-store-3/main.svelte
new file mode 100644
index 0000000000..3486dedaf1
--- /dev/null
+++ b/test/runtime/samples/reactive-assignment-in-complex-declaration-with-store-3/main.svelte
@@ -0,0 +1,5 @@
+
+
+
{$store}
diff --git a/test/runtime/samples/reactive-assignment-in-complex-declaration-with-store-3/store.js b/test/runtime/samples/reactive-assignment-in-complex-declaration-with-store-3/store.js
new file mode 100644
index 0000000000..3917a96b17
--- /dev/null
+++ b/test/runtime/samples/reactive-assignment-in-complex-declaration-with-store-3/store.js
@@ -0,0 +1,18 @@
+import { writable } from '../../../../store';
+const _store = writable(0);
+let count = 0;
+
+export const store = {
+ ..._store,
+ subscribe(fn) {
+ count++;
+ return _store.subscribe(fn);
+ },
+ reset() {
+ count = 0;
+ _store.set(0);
+ },
+ numberOfTimesSubscribeCalled() {
+ return count;
+ }
+};
diff --git a/test/runtime/samples/reactive-assignment-in-complex-declaration-with-store/_config.js b/test/runtime/samples/reactive-assignment-in-complex-declaration-with-store/_config.js
index b57ae31d48..d235d2a1a0 100644
--- a/test/runtime/samples/reactive-assignment-in-complex-declaration-with-store/_config.js
+++ b/test/runtime/samples/reactive-assignment-in-complex-declaration-with-store/_config.js
@@ -1,9 +1,8 @@
// destructure to store
export default {
html: '
2 2 xxx 5 6 9 10 2 ',
- skip_if_ssr: true,
async test({ assert, target, component }) {
await component.update();
assert.htmlEqual(target.innerHTML, '
11 11 yyy 12 13 14 15 11 ');
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/reactive-assignment-in-complex-declaration/_config.js b/test/runtime/samples/reactive-assignment-in-complex-declaration/_config.js
index a24254044a..0636620619 100644
--- a/test/runtime/samples/reactive-assignment-in-complex-declaration/_config.js
+++ b/test/runtime/samples/reactive-assignment-in-complex-declaration/_config.js
@@ -1,3 +1,3 @@
export default {
html: '
2 2 '
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/reactive-assignment-in-declaration/_config.js b/test/runtime/samples/reactive-assignment-in-declaration/_config.js
index cb79802589..0402f34a2f 100644
--- a/test/runtime/samples/reactive-assignment-in-declaration/_config.js
+++ b/test/runtime/samples/reactive-assignment-in-declaration/_config.js
@@ -1,3 +1,3 @@
export default {
html: '
1 1 '
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/reactive-assignment-in-for-loop-head/_config.js b/test/runtime/samples/reactive-assignment-in-for-loop-head/_config.js
index 01dcabe073..8f57423d5c 100644
--- a/test/runtime/samples/reactive-assignment-in-for-loop-head/_config.js
+++ b/test/runtime/samples/reactive-assignment-in-for-loop-head/_config.js
@@ -1,3 +1,3 @@
export default {
html: '
0 0 '
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/reactive-block-break/_config.js b/test/runtime/samples/reactive-block-break/_config.js
index a7fdffaaf1..e00bb9f480 100644
--- a/test/runtime/samples/reactive-block-break/_config.js
+++ b/test/runtime/samples/reactive-block-break/_config.js
@@ -1,3 +1,3 @@
export default {
html: '
1 2 '
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/reactive-function-called-reassigned/_config.js b/test/runtime/samples/reactive-function-called-reassigned/_config.js
index 7b2a8b72fe..3469c285af 100644
--- a/test/runtime/samples/reactive-function-called-reassigned/_config.js
+++ b/test/runtime/samples/reactive-function-called-reassigned/_config.js
@@ -9,7 +9,10 @@ export default {
props: {
callback
},
- async test({ assert, component, target, window }) {
+ before_test() {
+ called = 0;
+ },
+ async test({ assert, target, window }) {
assert.equal(called, 1);
const input = target.querySelector('input');
diff --git a/test/runtime/samples/reactive-import-statement/data.js b/test/runtime/samples/reactive-import-statement/data.js
index ad494c7cb0..22f2f374ab 100644
--- a/test/runtime/samples/reactive-import-statement/data.js
+++ b/test/runtime/samples/reactive-import-statement/data.js
@@ -1 +1 @@
-export const numbers = [1, 2, 3, 4];
\ No newline at end of file
+export const numbers = [1, 2, 3, 4];
diff --git a/test/runtime/samples/reactive-statement-module-vars/_config.js b/test/runtime/samples/reactive-statement-module-vars/_config.js
new file mode 100644
index 0000000000..63b89cd164
--- /dev/null
+++ b/test/runtime/samples/reactive-statement-module-vars/_config.js
@@ -0,0 +1,18 @@
+export default {
+ html: `
+ a: moduleA
+ b: moduleB
+ moduleA: moduleA
+ moduleB: moduleB
+ `,
+ async test({ assert, target, component }) {
+ await component.updateModuleA();
+
+ assert.htmlEqual(target.innerHTML, `
+ a: moduleA
+ b: moduleB
+ moduleA: moduleA
+ moduleB: moduleB
+ `);
+ }
+};
diff --git a/test/runtime/samples/reactive-statement-module-vars/main.svelte b/test/runtime/samples/reactive-statement-module-vars/main.svelte
new file mode 100644
index 0000000000..70e0404657
--- /dev/null
+++ b/test/runtime/samples/reactive-statement-module-vars/main.svelte
@@ -0,0 +1,15 @@
+
+
+a: {a}
+b: {b}
+moduleA: {moduleA}
+moduleB: {moduleB}
diff --git a/test/runtime/samples/reactive-value-dependency-not-referenced/_config.js b/test/runtime/samples/reactive-value-dependency-not-referenced/_config.js
new file mode 100644
index 0000000000..893b183d78
--- /dev/null
+++ b/test/runtime/samples/reactive-value-dependency-not-referenced/_config.js
@@ -0,0 +1,26 @@
+export default {
+ html: `
+
42
+
42
+ `,
+
+ async test({ assert, component, target }) {
+ await component.updateStore(undefined);
+ assert.htmlEqual(target.innerHTML, '
undefined
42
');
+
+ await component.updateStore(33);
+ assert.htmlEqual(target.innerHTML, '
33
42
');
+
+ await component.updateStore(undefined);
+ assert.htmlEqual(target.innerHTML, '
undefined
42
');
+
+ await component.updateVar(undefined);
+ assert.htmlEqual(target.innerHTML, '
undefined
undefined
');
+
+ await component.updateVar(33);
+ assert.htmlEqual(target.innerHTML, '
undefined
33
');
+
+ await component.updateVar(undefined);
+ assert.htmlEqual(target.innerHTML, '
undefined
undefined
');
+ }
+};
diff --git a/test/runtime/samples/reactive-value-dependency-not-referenced/main.svelte b/test/runtime/samples/reactive-value-dependency-not-referenced/main.svelte
new file mode 100644
index 0000000000..57e6ba84f3
--- /dev/null
+++ b/test/runtime/samples/reactive-value-dependency-not-referenced/main.svelte
@@ -0,0 +1,19 @@
+
+
+
{ value }
+
{ value2 }
\ No newline at end of file
diff --git a/test/runtime/samples/reactive-values-exported/_config.js b/test/runtime/samples/reactive-values-exported/_config.js
index 56220d3993..9f782835f3 100644
--- a/test/runtime/samples/reactive-values-exported/_config.js
+++ b/test/runtime/samples/reactive-values-exported/_config.js
@@ -7,7 +7,7 @@ export default {
1 1 1
`,
- test({ assert, component, target }) {
+ test({ assert, component }) {
assert.equal(component.y, 1);
assert.equal(component.z, 1);
diff --git a/test/runtime/samples/reactive-values-fixed/_config.js b/test/runtime/samples/reactive-values-fixed/_config.js
index 58aee09c35..9f25b3e24e 100644
--- a/test/runtime/samples/reactive-values-fixed/_config.js
+++ b/test/runtime/samples/reactive-values-fixed/_config.js
@@ -3,7 +3,7 @@ export default {
4
`,
- test({ assert, component, target }) {
+ test({ assert, target }) {
assert.htmlEqual(target.innerHTML, `
4
`);
diff --git a/test/runtime/samples/reactive-values-second-order/_config.js b/test/runtime/samples/reactive-values-second-order/_config.js
index c1dee87e2c..c70fb0641c 100644
--- a/test/runtime/samples/reactive-values-second-order/_config.js
+++ b/test/runtime/samples/reactive-values-second-order/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target }) {
+ test({ assert, component }) {
assert.equal(component.qux, 2);
component.foo = 2;
diff --git a/test/runtime/samples/reactive-values-uninitialised/_config.js b/test/runtime/samples/reactive-values-uninitialised/_config.js
new file mode 100644
index 0000000000..ef72d70652
--- /dev/null
+++ b/test/runtime/samples/reactive-values-uninitialised/_config.js
@@ -0,0 +1,3 @@
+export default {
+ html: '
aca
'
+};
diff --git a/test/runtime/samples/reactive-values-uninitialised/main.svelte b/test/runtime/samples/reactive-values-uninitialised/main.svelte
new file mode 100644
index 0000000000..2cacc411d2
--- /dev/null
+++ b/test/runtime/samples/reactive-values-uninitialised/main.svelte
@@ -0,0 +1,12 @@
+
+
+
{a}{b}{c}
diff --git a/test/runtime/samples/script-style-non-top-level/_config.js b/test/runtime/samples/script-style-non-top-level/_config.js
index 86eddf4611..22186b345d 100644
--- a/test/runtime/samples/script-style-non-top-level/_config.js
+++ b/test/runtime/samples/script-style-non-top-level/_config.js
@@ -5,4 +5,4 @@ export default {
`
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/select-bind-in-array/_config.js b/test/runtime/samples/select-bind-in-array/_config.js
index d104743d44..79c5641324 100644
--- a/test/runtime/samples/select-bind-in-array/_config.js
+++ b/test/runtime/samples/select-bind-in-array/_config.js
@@ -7,7 +7,7 @@ export default {
items
},
- test({ assert, component, target }) {
+ test({ assert, component }) {
const items = component.items;
assert.equal( items[0].id, 'a' );
diff --git a/test/runtime/samples/select-no-whitespace/_config.js b/test/runtime/samples/select-no-whitespace/_config.js
index 7388527849..b00b800033 100644
--- a/test/runtime/samples/select-no-whitespace/_config.js
+++ b/test/runtime/samples/select-no-whitespace/_config.js
@@ -1,6 +1,6 @@
export default {
- test({ assert, component, target }) {
+ test({ assert, target }) {
const select = target.querySelector( 'select' );
assert.equal( select.childNodes.length, 3 );
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/select-props/_config.js b/test/runtime/samples/select-props/_config.js
index 640fee0ef7..93915d5b82 100644
--- a/test/runtime/samples/select-props/_config.js
+++ b/test/runtime/samples/select-props/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window }) {
+ test({ assert, component, window }) {
const selects = document.querySelectorAll('select');
const event1 = new window.Event('change');
diff --git a/test/runtime/samples/self-reference-component/_config.js b/test/runtime/samples/self-reference-component/_config.js
index e9cd0ac440..c3456b59c2 100644
--- a/test/runtime/samples/self-reference-component/_config.js
+++ b/test/runtime/samples/self-reference-component/_config.js
@@ -1,3 +1,3 @@
export default {
html: '5 4 3 2 1 0'
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/self-reference-tree/_config.js b/test/runtime/samples/self-reference-tree/_config.js
index 581f03eade..cfa7528d31 100644
--- a/test/runtime/samples/self-reference-tree/_config.js
+++ b/test/runtime/samples/self-reference-tree/_config.js
@@ -62,4 +62,4 @@ export default {
`
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/self-reference/_config.js b/test/runtime/samples/self-reference/_config.js
index 69be606bbe..1bcb660621 100644
--- a/test/runtime/samples/self-reference/_config.js
+++ b/test/runtime/samples/self-reference/_config.js
@@ -11,4 +11,4 @@ export default {
1
0
`
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/semicolon-hoisting/_config.js b/test/runtime/samples/semicolon-hoisting/_config.js
index 7da2831db4..22dc25b41e 100644
--- a/test/runtime/samples/semicolon-hoisting/_config.js
+++ b/test/runtime/samples/semicolon-hoisting/_config.js
@@ -1,3 +1,3 @@
export default {
html: ''
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/set-after-destroy/_config.js b/test/runtime/samples/set-after-destroy/_config.js
index 9d79329546..3411f0cc79 100644
--- a/test/runtime/samples/set-after-destroy/_config.js
+++ b/test/runtime/samples/set-after-destroy/_config.js
@@ -3,8 +3,8 @@ export default {
x: 1
},
- test({ assert, component }) {
+ test({ component }) {
component.$destroy();
component.x = 2;
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/set-in-onstate-dedupes-renders/_config.js b/test/runtime/samples/set-in-onstate-dedupes-renders/_config.js
index 1d572f52fa..9f50a3cf25 100644
--- a/test/runtime/samples/set-in-onstate-dedupes-renders/_config.js
+++ b/test/runtime/samples/set-in-onstate-dedupes-renders/_config.js
@@ -1,7 +1,7 @@
export default {
skip: true, // nice-to-have – tricky though, so skipping for now
- test({ assert, component }) {
+ test({ component }) {
component.foo = { x: 2 };
}
};
diff --git a/test/runtime/samples/set-null-text-node/_config.js b/test/runtime/samples/set-null-text-node/_config.js
index 6bc775f3b7..a106ee9069 100644
--- a/test/runtime/samples/set-null-text-node/_config.js
+++ b/test/runtime/samples/set-null-text-node/_config.js
@@ -10,4 +10,4 @@ export default {
component.foo = null;
assert.htmlEqual(target.innerHTML, 'foo is null');
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/shorthand-method-in-template/_config.js b/test/runtime/samples/shorthand-method-in-template/_config.js
index ddd282644d..b097a46716 100644
--- a/test/runtime/samples/shorthand-method-in-template/_config.js
+++ b/test/runtime/samples/shorthand-method-in-template/_config.js
@@ -1,3 +1,3 @@
export default {
html: '42'
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/sigil-static-#/_config.js b/test/runtime/samples/sigil-static-#/_config.js
index 2f75f5cda2..3bf2601f70 100644
--- a/test/runtime/samples/sigil-static-#/_config.js
+++ b/test/runtime/samples/sigil-static-#/_config.js
@@ -1,3 +1,3 @@
export default {
html: '#foo'
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/sigil-static-@/_config.js b/test/runtime/samples/sigil-static-@/_config.js
index 7155a3d1d0..8d88d1fd08 100644
--- a/test/runtime/samples/sigil-static-@/_config.js
+++ b/test/runtime/samples/sigil-static-@/_config.js
@@ -1,3 +1,3 @@
export default {
html: '@foo'
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/slot-in-custom-element/_config.js b/test/runtime/samples/slot-in-custom-element/_config.js
index f17cc9adcb..a0b97ec6d0 100644
--- a/test/runtime/samples/slot-in-custom-element/_config.js
+++ b/test/runtime/samples/slot-in-custom-element/_config.js
@@ -4,4 +4,4 @@ export default {
`
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/spread-component-with-bind/_config.js b/test/runtime/samples/spread-component-with-bind/_config.js
index 96eb3c9475..5394fa80e0 100644
--- a/test/runtime/samples/spread-component-with-bind/_config.js
+++ b/test/runtime/samples/spread-component-with-bind/_config.js
@@ -9,7 +9,7 @@ export default {
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const input = target.querySelector('input');
input.value = 'bar';
diff --git a/test/runtime/samples/spread-element-input-bind-group-with-value-attr/_config.js b/test/runtime/samples/spread-element-input-bind-group-with-value-attr/_config.js
index 4bbc9d278c..5176fb976c 100644
--- a/test/runtime/samples/spread-element-input-bind-group-with-value-attr/_config.js
+++ b/test/runtime/samples/spread-element-input-bind-group-with-value-attr/_config.js
@@ -7,7 +7,7 @@ export default {
html: ' ',
- async test({ assert, component, target, window }) {
+ async test({ assert, target }) {
const input = target.querySelector('input');
assert.equal(input.value, 'abc');
assert.equal(input.__value, 'abc');
diff --git a/test/runtime/samples/spread-element-input-select/_config.js b/test/runtime/samples/spread-element-input-select/_config.js
new file mode 100644
index 0000000000..7971a2a3fc
--- /dev/null
+++ b/test/runtime/samples/spread-element-input-select/_config.js
@@ -0,0 +1,25 @@
+export default {
+ async test({ assert, component, target }) {
+ const select = target.querySelector('select');
+ const [option1, option2] = select.childNodes;
+
+ let selections = Array.from(select.selectedOptions);
+ assert.equal(selections.length, 1);
+ assert.ok(!selections.includes(option1));
+ assert.ok(selections.includes(option2));
+
+ component.value = 'Hello';
+
+ selections = Array.from(select.selectedOptions);
+ assert.equal(selections.length, 1);
+ assert.ok(selections.includes(option1));
+ assert.ok(!selections.includes(option2));
+
+ component.spread = { value: 'World' };
+
+ selections = Array.from(select.selectedOptions);
+ assert.equal(selections.length, 1);
+ assert.ok(!selections.includes(option1));
+ assert.ok(selections.includes(option2));
+ }
+};
diff --git a/test/runtime/samples/spread-element-input-select/main.svelte b/test/runtime/samples/spread-element-input-select/main.svelte
new file mode 100644
index 0000000000..41554d794f
--- /dev/null
+++ b/test/runtime/samples/spread-element-input-select/main.svelte
@@ -0,0 +1,9 @@
+
+
+
+ Hello
+ World
+
diff --git a/test/runtime/samples/spread-element-input-value-undefined/_config.js b/test/runtime/samples/spread-element-input-value-undefined/_config.js
index 9a83dccd80..9f5c0b8e77 100644
--- a/test/runtime/samples/spread-element-input-value-undefined/_config.js
+++ b/test/runtime/samples/spread-element-input-value-undefined/_config.js
@@ -1,5 +1,5 @@
export default {
- async test({ assert, component, target, window }) {
+ async test({ assert, component, target }) {
const input = target.querySelector('input');
component.value = undefined;
diff --git a/test/runtime/samples/spread-element-select-value-undefined/Select.svelte b/test/runtime/samples/spread-element-select-value-undefined/Select.svelte
new file mode 100644
index 0000000000..6f5dadf001
--- /dev/null
+++ b/test/runtime/samples/spread-element-select-value-undefined/Select.svelte
@@ -0,0 +1,12 @@
+
+
+
+ {#each options as option}
+ {option}
+ {/each}
+
+{label}
diff --git a/test/runtime/samples/spread-element-select-value-undefined/_config.js b/test/runtime/samples/spread-element-select-value-undefined/_config.js
new file mode 100644
index 0000000000..0c2c76a119
--- /dev/null
+++ b/test/runtime/samples/spread-element-select-value-undefined/_config.js
@@ -0,0 +1,11 @@
+export default {
+ async test({ assert, component, target }) {
+ const select = target.querySelector('select');
+
+ assert.equal(select.value, '1');
+
+ component.label = 'hoge';
+
+ assert.equal(select.value, '1');
+ }
+};
diff --git a/test/runtime/samples/spread-element-select-value-undefined/main.svelte b/test/runtime/samples/spread-element-select-value-undefined/main.svelte
new file mode 100644
index 0000000000..57a2e3cf3e
--- /dev/null
+++ b/test/runtime/samples/spread-element-select-value-undefined/main.svelte
@@ -0,0 +1,11 @@
+
+
+
diff --git a/test/runtime/samples/state-deconflicted/_config.js b/test/runtime/samples/state-deconflicted/_config.js
index 3258754400..ff1b10b481 100644
--- a/test/runtime/samples/state-deconflicted/_config.js
+++ b/test/runtime/samples/state-deconflicted/_config.js
@@ -49,4 +49,4 @@ export default {
` );
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/store-assignment-updates-destructure/_config.js b/test/runtime/samples/store-assignment-updates-destructure/_config.js
new file mode 100644
index 0000000000..7a1023614c
--- /dev/null
+++ b/test/runtime/samples/store-assignment-updates-destructure/_config.js
@@ -0,0 +1,11 @@
+export default {
+ html: `
+ $userName1: user1
+ $userName2: undefined
+ $userName3: undefined
+ $userName4: user4
+ $userName5: undefined
+ $userName6: user6
+ $userName7: undefined
+ `
+};
diff --git a/test/runtime/samples/store-assignment-updates-destructure/main.svelte b/test/runtime/samples/store-assignment-updates-destructure/main.svelte
new file mode 100644
index 0000000000..71e02fe16d
--- /dev/null
+++ b/test/runtime/samples/store-assignment-updates-destructure/main.svelte
@@ -0,0 +1,34 @@
+
+
+$userName1: {$userName1}
+$userName2: {$userName2}
+$userName3: {$userName3}
+$userName4: {$userName4}
+$userName5: {$userName5}
+$userName6: {$userName6}
+$userName7: {$userName7}
diff --git a/test/runtime/samples/store-assignment-updates-property/_config.js b/test/runtime/samples/store-assignment-updates-property/_config.js
index 65df38f9e4..467e7782d6 100644
--- a/test/runtime/samples/store-assignment-updates-property/_config.js
+++ b/test/runtime/samples/store-assignment-updates-property/_config.js
@@ -5,9 +5,8 @@ export default {
`,
- skip_if_ssr: true,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const [btn1, btn2] = target.querySelectorAll('button');
const click = new window.MouseEvent('click');
@@ -29,4 +28,4 @@ export default {
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/store-assignment-updates-reactive/_config.js b/test/runtime/samples/store-assignment-updates-reactive/_config.js
index e81b3bb180..a9606d9d68 100644
--- a/test/runtime/samples/store-assignment-updates-reactive/_config.js
+++ b/test/runtime/samples/store-assignment-updates-reactive/_config.js
@@ -39,4 +39,4 @@ export default {
+1
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/store-assignment-updates/_config.js b/test/runtime/samples/store-assignment-updates/_config.js
index 1b36d92863..c4a09a978e 100644
--- a/test/runtime/samples/store-assignment-updates/_config.js
+++ b/test/runtime/samples/store-assignment-updates/_config.js
@@ -28,4 +28,4 @@ export default {
doubled: 84
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/store-auto-resubscribe-immediate/_config.js b/test/runtime/samples/store-auto-resubscribe-immediate/_config.js
new file mode 100644
index 0000000000..47a901d793
--- /dev/null
+++ b/test/runtime/samples/store-auto-resubscribe-immediate/_config.js
@@ -0,0 +1,3 @@
+export default {
+ html: '{"answer":4}'
+};
diff --git a/test/runtime/samples/store-auto-resubscribe-immediate/main.svelte b/test/runtime/samples/store-auto-resubscribe-immediate/main.svelte
new file mode 100644
index 0000000000..8dd40ae7ae
--- /dev/null
+++ b/test/runtime/samples/store-auto-resubscribe-immediate/main.svelte
@@ -0,0 +1,31 @@
+
+
+{JSON.stringify($value)}
diff --git a/test/runtime/samples/store-auto-subscribe-immediate-multiple-vars/_config.js b/test/runtime/samples/store-auto-subscribe-immediate-multiple-vars/_config.js
index 9cfd765cde..fdaa951666 100644
--- a/test/runtime/samples/store-auto-subscribe-immediate-multiple-vars/_config.js
+++ b/test/runtime/samples/store-auto-subscribe-immediate-multiple-vars/_config.js
@@ -6,4 +6,4 @@ export default {
async test({ assert, component }) {
assert.equal(component.initial_foo, 42);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/store-auto-subscribe-immediate/_config.js b/test/runtime/samples/store-auto-subscribe-immediate/_config.js
index 9cfd765cde..fdaa951666 100644
--- a/test/runtime/samples/store-auto-subscribe-immediate/_config.js
+++ b/test/runtime/samples/store-auto-subscribe-immediate/_config.js
@@ -6,4 +6,4 @@ export default {
async test({ assert, component }) {
assert.equal(component.initial_foo, 42);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/store-auto-subscribe-implicit/_config.js b/test/runtime/samples/store-auto-subscribe-implicit/_config.js
index eca1f314ff..f132901bf0 100644
--- a/test/runtime/samples/store-auto-subscribe-implicit/_config.js
+++ b/test/runtime/samples/store-auto-subscribe-implicit/_config.js
@@ -25,4 +25,4 @@ export default {
count 42
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/store-auto-subscribe-in-each/_config.js b/test/runtime/samples/store-auto-subscribe-in-each/_config.js
index a49dbab85c..8c8fa001d8 100644
--- a/test/runtime/samples/store-auto-subscribe-in-each/_config.js
+++ b/test/runtime/samples/store-auto-subscribe-in-each/_config.js
@@ -37,4 +37,4 @@ export default {
c
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/store-auto-subscribe-in-reactive-declaration-2/App.svelte b/test/runtime/samples/store-auto-subscribe-in-reactive-declaration-2/App.svelte
new file mode 100644
index 0000000000..250305b62c
--- /dev/null
+++ b/test/runtime/samples/store-auto-subscribe-in-reactive-declaration-2/App.svelte
@@ -0,0 +1,8 @@
+
+{value}
+{$store}
diff --git a/test/runtime/samples/store-auto-subscribe-in-reactive-declaration-2/_config.js b/test/runtime/samples/store-auto-subscribe-in-reactive-declaration-2/_config.js
new file mode 100644
index 0000000000..560eb44a9a
--- /dev/null
+++ b/test/runtime/samples/store-auto-subscribe-in-reactive-declaration-2/_config.js
@@ -0,0 +1,15 @@
+export default {
+ html: `
+ Hello World
+ Hello World
+ `,
+
+ async test({ assert, component, target }) {
+ await component.update_value('Hi Svelte');
+
+ assert.htmlEqual(target.innerHTML, `
+ Hi Svelte
+ Hi Svelte
+ `);
+ }
+};
diff --git a/test/runtime/samples/store-auto-subscribe-in-reactive-declaration-2/main.svelte b/test/runtime/samples/store-auto-subscribe-in-reactive-declaration-2/main.svelte
new file mode 100644
index 0000000000..4e771617bb
--- /dev/null
+++ b/test/runtime/samples/store-auto-subscribe-in-reactive-declaration-2/main.svelte
@@ -0,0 +1,12 @@
+
+
+
diff --git a/test/runtime/samples/store-auto-subscribe-in-reactive-declaration/_config.js b/test/runtime/samples/store-auto-subscribe-in-reactive-declaration/_config.js
index 2240425d91..cf1bdce68a 100644
--- a/test/runtime/samples/store-auto-subscribe-in-reactive-declaration/_config.js
+++ b/test/runtime/samples/store-auto-subscribe-in-reactive-declaration/_config.js
@@ -25,4 +25,4 @@ export default {
double 84
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/store-auto-subscribe-in-script/_config.js b/test/runtime/samples/store-auto-subscribe-in-script/_config.js
index cfd4475240..7ea7eac87b 100644
--- a/test/runtime/samples/store-auto-subscribe-in-script/_config.js
+++ b/test/runtime/samples/store-auto-subscribe-in-script/_config.js
@@ -23,4 +23,4 @@ export default {
await count.set(42);
assert.equal(component.get_count(), 42);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/store-auto-subscribe-missing-global-script/_config.js b/test/runtime/samples/store-auto-subscribe-missing-global-script/_config.js
index c4eb72b553..f3df26c0de 100644
--- a/test/runtime/samples/store-auto-subscribe-missing-global-script/_config.js
+++ b/test/runtime/samples/store-auto-subscribe-missing-global-script/_config.js
@@ -1,3 +1,3 @@
export default {
error: 'missingGlobal is not defined'
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/store-auto-subscribe-missing-global-template/_config.js b/test/runtime/samples/store-auto-subscribe-missing-global-template/_config.js
index c4eb72b553..f3df26c0de 100644
--- a/test/runtime/samples/store-auto-subscribe-missing-global-template/_config.js
+++ b/test/runtime/samples/store-auto-subscribe-missing-global-template/_config.js
@@ -1,3 +1,3 @@
export default {
error: 'missingGlobal is not defined'
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/store-auto-subscribe/_config.js b/test/runtime/samples/store-auto-subscribe/_config.js
index eca1f314ff..f132901bf0 100644
--- a/test/runtime/samples/store-auto-subscribe/_config.js
+++ b/test/runtime/samples/store-auto-subscribe/_config.js
@@ -25,4 +25,4 @@ export default {
count 42
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/store-contextual/_config.js b/test/runtime/samples/store-contextual/_config.js
index 5600f9a661..0b7aa6cf33 100644
--- a/test/runtime/samples/store-contextual/_config.js
+++ b/test/runtime/samples/store-contextual/_config.js
@@ -30,7 +30,7 @@ export default {
`,
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const inputs = target.querySelectorAll('input');
const change = new window.MouseEvent('change');
@@ -73,4 +73,4 @@ export default {
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/store-dev-mode-error/_config.js b/test/runtime/samples/store-dev-mode-error/_config.js
index 420aa0c54a..74f4189c36 100644
--- a/test/runtime/samples/store-dev-mode-error/_config.js
+++ b/test/runtime/samples/store-dev-mode-error/_config.js
@@ -8,4 +8,4 @@ export default {
},
error: "'count' is not a store with a 'subscribe' method"
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/store-each-binding-deep/_config.js b/test/runtime/samples/store-each-binding-deep/_config.js
index 70776940dd..c5f2402ae2 100644
--- a/test/runtime/samples/store-each-binding-deep/_config.js
+++ b/test/runtime/samples/store-each-binding-deep/_config.js
@@ -11,4 +11,4 @@ export default {
changed
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/store-each-binding-destructuring/_config.js b/test/runtime/samples/store-each-binding-destructuring/_config.js
index 70776940dd..c5f2402ae2 100644
--- a/test/runtime/samples/store-each-binding-destructuring/_config.js
+++ b/test/runtime/samples/store-each-binding-destructuring/_config.js
@@ -11,4 +11,4 @@ export default {
changed
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/store-each-binding/_config.js b/test/runtime/samples/store-each-binding/_config.js
index 70776940dd..c5f2402ae2 100644
--- a/test/runtime/samples/store-each-binding/_config.js
+++ b/test/runtime/samples/store-each-binding/_config.js
@@ -11,4 +11,4 @@ export default {
changed
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/store-imported-module-b/_config.js b/test/runtime/samples/store-imported-module-b/_config.js
index 7c503c3905..f3c168e4c1 100644
--- a/test/runtime/samples/store-imported-module-b/_config.js
+++ b/test/runtime/samples/store-imported-module-b/_config.js
@@ -1,3 +1,3 @@
export default {
error: 'Cannot reference store value inside
+
+ {
+ derived(store, $store => {});
+ }}
+ on:test2={(store) => {
+ let $store;
+ }}
+/>
diff --git a/test/runtime/samples/store-unreferenced/_config.js b/test/runtime/samples/store-unreferenced/_config.js
index e15f202492..ce416bca5d 100644
--- a/test/runtime/samples/store-unreferenced/_config.js
+++ b/test/runtime/samples/store-unreferenced/_config.js
@@ -3,11 +3,13 @@ import { count } from './store.js';
export default {
html: '
count: 0
',
+ before_test() {
+ count.set(0);
+ },
+
async test({ assert, component, target }) {
await component.increment();
assert.htmlEqual(target.innerHTML, '
count: 1
');
-
- count.set(0);
}
};
diff --git a/test/runtime/samples/store-unreferenced/store.js b/test/runtime/samples/store-unreferenced/store.js
index 99e27e5584..b799c0ffc4 100644
--- a/test/runtime/samples/store-unreferenced/store.js
+++ b/test/runtime/samples/store-unreferenced/store.js
@@ -1,3 +1,3 @@
import { writable } from '../../../../store';
-export const count = writable(0);
\ No newline at end of file
+export const count = writable(0);
diff --git a/test/runtime/samples/svg-attributes/_config.js b/test/runtime/samples/svg-attributes/_config.js
index 668fb391c0..44f7d3a368 100644
--- a/test/runtime/samples/svg-attributes/_config.js
+++ b/test/runtime/samples/svg-attributes/_config.js
@@ -7,7 +7,7 @@ export default {
`,
- test({ assert, component, target }) {
+ test({ assert, target }) {
const circle = target.querySelector('circle');
assert.equal(circle.getAttribute('class'), 'red');
}
diff --git a/test/runtime/samples/svg-class/_config.js b/test/runtime/samples/svg-class/_config.js
index 36f5d06b1c..ce32d1fb93 100644
--- a/test/runtime/samples/svg-class/_config.js
+++ b/test/runtime/samples/svg-class/_config.js
@@ -3,7 +3,7 @@
export default {
html: "
",
- test({ assert, component, target }) {
+ test({ assert, target }) {
const svg = target.querySelector('svg');
assert.equal(svg.namespaceURI, 'http://www.w3.org/2000/svg');
diff --git a/test/runtime/samples/svg-each-block-namespace/_config.js b/test/runtime/samples/svg-each-block-namespace/_config.js
index 795510c879..c43734885f 100644
--- a/test/runtime/samples/svg-each-block-namespace/_config.js
+++ b/test/runtime/samples/svg-each-block-namespace/_config.js
@@ -5,7 +5,7 @@ export default {
`,
- test({ assert, component, target }) {
+ test({ assert, target }) {
const circles = target.querySelectorAll('circle');
assert.equal(circles[0].namespaceURI, 'http://www.w3.org/2000/svg');
assert.equal(circles[1].namespaceURI, 'http://www.w3.org/2000/svg');
diff --git a/test/runtime/samples/svg-no-whitespace/_config.js b/test/runtime/samples/svg-no-whitespace/_config.js
index 6d4cefba21..2f7a917f16 100644
--- a/test/runtime/samples/svg-no-whitespace/_config.js
+++ b/test/runtime/samples/svg-no-whitespace/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target }) {
+ test({ assert, target }) {
const svg = target.querySelector( 'svg' );
assert.equal( svg.childNodes.length, 2 );
diff --git a/test/runtime/samples/svg-xlink/_config.js b/test/runtime/samples/svg-xlink/_config.js
index 6e0ad4664c..d3018b3698 100644
--- a/test/runtime/samples/svg-xlink/_config.js
+++ b/test/runtime/samples/svg-xlink/_config.js
@@ -8,7 +8,7 @@ export default {
`,
- test({ assert, component, target }) {
+ test({ assert, target }) {
const use = target.querySelector('use');
const href = use.attributes[ 'xlink:href' ];
diff --git a/test/runtime/samples/target-dom-detached/App.svelte b/test/runtime/samples/target-dom-detached/App.svelte
new file mode 100644
index 0000000000..251e480307
--- /dev/null
+++ b/test/runtime/samples/target-dom-detached/App.svelte
@@ -0,0 +1,11 @@
+
+
+
Hello {name}
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/target-dom-detached/_config.js b/test/runtime/samples/target-dom-detached/_config.js
new file mode 100644
index 0000000000..055d1868eb
--- /dev/null
+++ b/test/runtime/samples/target-dom-detached/_config.js
@@ -0,0 +1,16 @@
+export default {
+ skip_if_ssr: true,
+ compileOptions: {
+ cssHash: () => 'svelte-xyz'
+ },
+ async test({ assert, component, window }) {
+ assert.htmlEqual(
+ window.document.head.innerHTML,
+ ''
+ );
+ assert.htmlEqual(
+ component.div.innerHTML,
+ '
Hello World
'
+ );
+ }
+};
diff --git a/test/runtime/samples/target-dom-detached/main.svelte b/test/runtime/samples/target-dom-detached/main.svelte
new file mode 100644
index 0000000000..42e7dffee9
--- /dev/null
+++ b/test/runtime/samples/target-dom-detached/main.svelte
@@ -0,0 +1,18 @@
+
diff --git a/test/runtime/samples/target-dom/App.svelte b/test/runtime/samples/target-dom/App.svelte
new file mode 100644
index 0000000000..251e480307
--- /dev/null
+++ b/test/runtime/samples/target-dom/App.svelte
@@ -0,0 +1,11 @@
+
+
+
Hello {name}
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/target-dom/_config.js b/test/runtime/samples/target-dom/_config.js
new file mode 100644
index 0000000000..055d1868eb
--- /dev/null
+++ b/test/runtime/samples/target-dom/_config.js
@@ -0,0 +1,16 @@
+export default {
+ skip_if_ssr: true,
+ compileOptions: {
+ cssHash: () => 'svelte-xyz'
+ },
+ async test({ assert, component, window }) {
+ assert.htmlEqual(
+ window.document.head.innerHTML,
+ ''
+ );
+ assert.htmlEqual(
+ component.div.innerHTML,
+ '
Hello World
'
+ );
+ }
+};
diff --git a/test/runtime/samples/target-dom/main.svelte b/test/runtime/samples/target-dom/main.svelte
new file mode 100644
index 0000000000..68d2990552
--- /dev/null
+++ b/test/runtime/samples/target-dom/main.svelte
@@ -0,0 +1,18 @@
+
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/target-shadow-dom/App.svelte b/test/runtime/samples/target-shadow-dom/App.svelte
new file mode 100644
index 0000000000..251e480307
--- /dev/null
+++ b/test/runtime/samples/target-shadow-dom/App.svelte
@@ -0,0 +1,11 @@
+
+
+
Hello {name}
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/target-shadow-dom/_config.js b/test/runtime/samples/target-shadow-dom/_config.js
new file mode 100644
index 0000000000..ff775d15fd
--- /dev/null
+++ b/test/runtime/samples/target-shadow-dom/_config.js
@@ -0,0 +1,13 @@
+export default {
+ skip_if_ssr: true,
+ compileOptions: {
+ cssHash: () => 'svelte-xyz'
+ },
+ async test({ assert, component, window }) {
+ assert.htmlEqual(window.document.head.innerHTML, '');
+ assert.htmlEqual(component.div.shadowRoot.innerHTML, `
+
+
Hello World
+ `);
+ }
+};
diff --git a/test/runtime/samples/target-shadow-dom/main.svelte b/test/runtime/samples/target-shadow-dom/main.svelte
new file mode 100644
index 0000000000..cb47ad01f0
--- /dev/null
+++ b/test/runtime/samples/target-shadow-dom/main.svelte
@@ -0,0 +1,19 @@
+
+
+
\ No newline at end of file
diff --git a/test/runtime/samples/template/_config.js b/test/runtime/samples/template/_config.js
index ccc04a1c91..f5117d3808 100644
--- a/test/runtime/samples/template/_config.js
+++ b/test/runtime/samples/template/_config.js
@@ -7,7 +7,7 @@ export default {
`,
- test({ assert, component, target }) {
+ test({ assert, target }) {
const template = target.querySelector('template');
assert.htmlEqual(template.innerHTML, `
@@ -20,4 +20,4 @@ export default {
foo
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/textarea-children/_config.js b/test/runtime/samples/textarea-children/_config.js
index ca59c76a42..f80b66df1f 100644
--- a/test/runtime/samples/textarea-children/_config.js
+++ b/test/runtime/samples/textarea-children/_config.js
@@ -14,4 +14,4 @@ export default {
component.foo = 43;
assert.strictEqual( textarea.value, '\n\t
not actually an element. 43
\n' );
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/textarea-value/_config.js b/test/runtime/samples/textarea-value/_config.js
index 785aae94cb..93079e5928 100644
--- a/test/runtime/samples/textarea-value/_config.js
+++ b/test/runtime/samples/textarea-value/_config.js
@@ -14,4 +14,4 @@ export default {
component.foo = 43;
assert.strictEqual( textarea.value, '43' );
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/this-in-function-expressions/_config.js b/test/runtime/samples/this-in-function-expressions/_config.js
index 9aea4c3631..57f23a472b 100644
--- a/test/runtime/samples/this-in-function-expressions/_config.js
+++ b/test/runtime/samples/this-in-function-expressions/_config.js
@@ -1,6 +1,6 @@
export default {
async test({ assert, target, window }) {
- const [_, btn] = target.querySelectorAll('button');
+ const [, btn] = target.querySelectorAll('button');
const clickEvent = new window.MouseEvent('click');
await btn.dispatchEvent(clickEvent);
diff --git a/test/runtime/samples/transition-abort/_config.js b/test/runtime/samples/transition-abort/_config.js
new file mode 100644
index 0000000000..c0f702cb76
--- /dev/null
+++ b/test/runtime/samples/transition-abort/_config.js
@@ -0,0 +1,31 @@
+// expect aborting halfway through outro transition
+// to behave the same in `{#if}` block as in `{:else}` block
+export default {
+ html: `
+
a
+
+
a
+ `,
+
+ async test({ assert, component, target, raf }) {
+ component.visible = false;
+
+ // abort halfway through the outro transition
+ raf.tick(50);
+
+ await component.$set({
+ visible: true,
+ array: ['a', 'b', 'c']
+ });
+
+ assert.htmlEqual(target.innerHTML, `
+
a
+
b
+
c
+
+
a
+
b
+
c
+ `);
+ }
+};
diff --git a/test/runtime/samples/transition-abort/main.svelte b/test/runtime/samples/transition-abort/main.svelte
new file mode 100644
index 0000000000..b574229712
--- /dev/null
+++ b/test/runtime/samples/transition-abort/main.svelte
@@ -0,0 +1,21 @@
+
+
+{#if visible}
+ {#each array as item}
+
{item}
+ {/each}
+{/if}
+
+{#if !visible}
+{:else}
+ {#each array as item}
+
{item}
+ {/each}
+{/if}
\ No newline at end of file
diff --git a/test/runtime/samples/transition-css-deferred-removal/_config.js b/test/runtime/samples/transition-css-deferred-removal/_config.js
index 763f004835..9bf429cd9e 100644
--- a/test/runtime/samples/transition-css-deferred-removal/_config.js
+++ b/test/runtime/samples/transition-css-deferred-removal/_config.js
@@ -3,7 +3,7 @@ export default {
visible: true
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = false;
const outer = target.querySelector('.outer');
diff --git a/test/runtime/samples/transition-css-duration/_config.js b/test/runtime/samples/transition-css-duration/_config.js
index a448c3f164..b2a9fb3476 100644
--- a/test/runtime/samples/transition-css-duration/_config.js
+++ b/test/runtime/samples/transition-css-duration/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-css-iframe/_config.js b/test/runtime/samples/transition-css-iframe/_config.js
index 612ee8e5ba..a7d98dc474 100644
--- a/test/runtime/samples/transition-css-iframe/_config.js
+++ b/test/runtime/samples/transition-css-iframe/_config.js
@@ -1,7 +1,7 @@
export default {
skip_if_ssr: true,
- async test({ assert, component, target, window, raf }) {
+ async test({ assert, component, target, raf }) {
const frame = target.querySelector('iframe');
await Promise.resolve();
diff --git a/test/runtime/samples/transition-css-in-out-in-with-param/_config.js b/test/runtime/samples/transition-css-in-out-in-with-param/_config.js
new file mode 100644
index 0000000000..7d0dfa9a07
--- /dev/null
+++ b/test/runtime/samples/transition-css-in-out-in-with-param/_config.js
@@ -0,0 +1,21 @@
+export default {
+ test({ assert, component, target, raf }) {
+ component.visible = true;
+ const div = target.querySelector('div');
+
+ // animation duration of `in` should be 10ms.
+ assert.equal(div.style.animation, '__svelte_1670736059_0 10ms linear 0ms 1 both');
+
+ // animation duration of `out` should be 5ms.
+ component.visible = false;
+ assert.equal(div.style.animation, '__svelte_1670736059_0 10ms linear 0ms 1 both, __svelte_1998461463_0 5ms linear 0ms 1 both');
+
+ // change param
+ raf.tick(1);
+ component.param = true;
+ component.visible = true;
+
+ // animation duration of `in` should be 20ms.
+ assert.equal(div.style.animation, '__svelte_722598827_0 20ms linear 0ms 1 both');
+ }
+};
diff --git a/test/runtime/samples/transition-css-in-out-in-with-param/main.svelte b/test/runtime/samples/transition-css-in-out-in-with-param/main.svelte
new file mode 100644
index 0000000000..616e2e0e8b
--- /dev/null
+++ b/test/runtime/samples/transition-css-in-out-in-with-param/main.svelte
@@ -0,0 +1,26 @@
+
+
+{#if visible}
+
+{/if}
\ No newline at end of file
diff --git a/test/runtime/samples/transition-css-in-out-in/_config.js b/test/runtime/samples/transition-css-in-out-in/_config.js
index cd7ae14ce8..5debe6abd6 100644
--- a/test/runtime/samples/transition-css-in-out-in/_config.js
+++ b/test/runtime/samples/transition-css-in-out-in/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const div = target.querySelector('div');
@@ -15,6 +15,6 @@ export default {
component.visible = true;
// reset original styles
- assert.equal(div.style.animation, '__svelte_3809512021_1 100ms linear 0ms 1 both');
+ assert.equal(div.style.animation, '__svelte_3809512021_0 100ms linear 0ms 1 both');
}
};
diff --git a/test/runtime/samples/transition-js-args-dynamic/_config.js b/test/runtime/samples/transition-js-args-dynamic/_config.js
index 513a17486a..50bf9eeefc 100644
--- a/test/runtime/samples/transition-js-args-dynamic/_config.js
+++ b/test/runtime/samples/transition-js-args-dynamic/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-js-args/_config.js b/test/runtime/samples/transition-js-args/_config.js
index 00682894cd..5fb9f1e93d 100644
--- a/test/runtime/samples/transition-js-args/_config.js
+++ b/test/runtime/samples/transition-js-args/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-js-await-block-outros/_config.js b/test/runtime/samples/transition-js-await-block-outros/_config.js
new file mode 100644
index 0000000000..7233e3f67f
--- /dev/null
+++ b/test/runtime/samples/transition-js-await-block-outros/_config.js
@@ -0,0 +1,174 @@
+let fulfil;
+
+export default {
+ props: {
+ promise: new Promise((f) => {
+ fulfil = f;
+ })
+ },
+ intro: true,
+
+ async test({ assert, target, component, raf }) {
+ assert.htmlEqual(target.innerHTML, '
loading...
');
+
+ let time = 0;
+
+ raf.tick(time += 50);
+ assert.htmlEqual(target.innerHTML, '
loading...
');
+
+ await fulfil(42);
+
+ assert.htmlEqual(target.innerHTML, `
+
42
+
loading...
+ `);
+
+ // see the transition 30% complete
+ raf.tick(time += 30);
+ assert.htmlEqual(target.innerHTML, `
+
42
+
loading...
+ `);
+
+ // completely transition in the {:then} block
+ raf.tick(time += 70);
+ assert.htmlEqual(target.innerHTML, `
+
42
+ `);
+
+ // update promise #1
+ component.promise = new Promise((f) => {
+ fulfil = f;
+ });
+ await Promise.resolve();
+
+ assert.htmlEqual(target.innerHTML, `
+
42
+
loading...
+ `);
+
+ raf.tick(time += 100);
+
+ assert.htmlEqual(target.innerHTML, `
+
loading...
+ `);
+
+ await fulfil(43);
+ assert.htmlEqual(target.innerHTML, `
+
loading...
+
43
+ `);
+
+ raf.tick(time += 100);
+ assert.htmlEqual(target.innerHTML, `
+
43
+ `);
+
+ // update promise #2
+ component.promise = new Promise((f) => {
+ fulfil = f;
+ });
+ await Promise.resolve();
+
+ assert.htmlEqual(target.innerHTML, `
+
43
+
loading...
+ `);
+
+ raf.tick(time += 50);
+
+ assert.htmlEqual(target.innerHTML, `
+
43
+
loading...
+ `);
+
+ await fulfil(44);
+ assert.htmlEqual(target.innerHTML, `
+
43
+
loading...
+
44
+ `);
+
+ raf.tick(time += 100);
+ assert.htmlEqual(target.innerHTML, `
+
44
+ `);
+
+ // update promise #3 - quick succession
+ component.promise = new Promise((f) => {
+ fulfil = f;
+ });
+ await Promise.resolve();
+ assert.htmlEqual(target.innerHTML, `
+
44
+
loading...
+ `);
+
+ raf.tick(time += 40);
+ assert.htmlEqual(target.innerHTML, `
+
44
+
loading...
+ `);
+
+ await fulfil(45);
+
+ assert.htmlEqual(target.innerHTML, `
+
44
+
loading...
+
45
+ `);
+
+ raf.tick(time += 20);
+ assert.htmlEqual(target.innerHTML, `
+
44
+
loading...
+
45
+ `);
+
+ component.promise = new Promise((f) => {
+ fulfil = f;
+ });
+ await Promise.resolve();
+
+ assert.htmlEqual(target.innerHTML, `
+
44
+
loading...
+
45
+
loading...
+ `);
+
+ raf.tick(time += 10);
+ assert.htmlEqual(target.innerHTML, `
+
44
+
loading...
+
45
+
loading...
+ `);
+
+ await fulfil(46);
+
+ assert.htmlEqual(target.innerHTML, `
+
44
+
loading...
+
45
+
loading...
+
46
+ `);
+
+ raf.tick(time += 10);
+ assert.htmlEqual(target.innerHTML, `
+
44
+
46
+ `);
+
+ raf.tick(time += 20);
+ assert.htmlEqual(target.innerHTML, `
+
46
+ `);
+
+ raf.tick(time += 70);
+ assert.htmlEqual(target.innerHTML, `
+
46
+ `);
+ }
+};
diff --git a/test/runtime/samples/transition-js-await-block-outros/main.svelte b/test/runtime/samples/transition-js-await-block-outros/main.svelte
new file mode 100644
index 0000000000..6060b7672b
--- /dev/null
+++ b/test/runtime/samples/transition-js-await-block-outros/main.svelte
@@ -0,0 +1,20 @@
+
+
+{#await promise}
+
loading...
+{:then value}
+
{value}
+{:catch error}
+
{error.message}
+{/await}
\ No newline at end of file
diff --git a/test/runtime/samples/transition-js-context/_config.js b/test/runtime/samples/transition-js-context/_config.js
index e2e7135180..6bc20d3dd1 100644
--- a/test/runtime/samples/transition-js-context/_config.js
+++ b/test/runtime/samples/transition-js-context/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-js-delay-in-out/_config.js b/test/runtime/samples/transition-js-delay-in-out/_config.js
index fb77fca015..5a17eead20 100644
--- a/test/runtime/samples/transition-js-delay-in-out/_config.js
+++ b/test/runtime/samples/transition-js-delay-in-out/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const div = target.querySelector('div');
assert.equal(div.foo, 0);
@@ -19,4 +19,4 @@ export default {
raf.tick(300);
assert.equal(div.bar, 0);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/transition-js-delay/_config.js b/test/runtime/samples/transition-js-delay/_config.js
index a0613737b2..aeb42b5d0f 100644
--- a/test/runtime/samples/transition-js-delay/_config.js
+++ b/test/runtime/samples/transition-js-delay/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const div = target.querySelector('div');
assert.equal(div.foo, 0);
@@ -24,4 +24,4 @@ export default {
raf.tick(250);
assert.equal(div.foo, 0);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/transition-js-destroyed-before-end/_config.js b/test/runtime/samples/transition-js-destroyed-before-end/_config.js
index 59615bd7a5..8033c7c00c 100644
--- a/test/runtime/samples/transition-js-destroyed-before-end/_config.js
+++ b/test/runtime/samples/transition-js-destroyed-before-end/_config.js
@@ -3,7 +3,7 @@ export default {
visible: true
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = false;
const div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-js-dynamic-component/_config.js b/test/runtime/samples/transition-js-dynamic-component/_config.js
index 1c1c7ff8c3..b59bd41af8 100644
--- a/test/runtime/samples/transition-js-dynamic-component/_config.js
+++ b/test/runtime/samples/transition-js-dynamic-component/_config.js
@@ -7,7 +7,7 @@ export default {
a
`,
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.x = false;
assert.htmlEqual(target.innerHTML, `
@@ -31,4 +31,4 @@ export default {
b
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/transition-js-dynamic-if-block-bidi/_config.js b/test/runtime/samples/transition-js-dynamic-if-block-bidi/_config.js
index aa0bd9e1aa..95fe7b01f3 100644
--- a/test/runtime/samples/transition-js-dynamic-if-block-bidi/_config.js
+++ b/test/runtime/samples/transition-js-dynamic-if-block-bidi/_config.js
@@ -33,4 +33,4 @@ export default {
raf.tick(225);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/transition-js-each-block-intro-outro/_config.js b/test/runtime/samples/transition-js-each-block-intro-outro/_config.js
index 3a764c5612..9a0326fbb0 100644
--- a/test/runtime/samples/transition-js-each-block-intro-outro/_config.js
+++ b/test/runtime/samples/transition-js-each-block-intro-outro/_config.js
@@ -4,7 +4,7 @@ export default {
things: [ 'a', 'b', 'c' ]
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const divs = target.querySelectorAll('div');
assert.equal(divs[0].foo, 0);
@@ -38,4 +38,4 @@ export default {
assert.equal(divs[1].bar, 1);
assert.equal(divs[2].bar, 1);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/transition-js-each-block-intro/_config.js b/test/runtime/samples/transition-js-each-block-intro/_config.js
index 3d143ea514..14e17ae8a9 100644
--- a/test/runtime/samples/transition-js-each-block-intro/_config.js
+++ b/test/runtime/samples/transition-js-each-block-intro/_config.js
@@ -5,7 +5,7 @@ export default {
intro: true,
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
let divs = target.querySelectorAll('div');
assert.equal(divs[0].foo, 0);
assert.equal(divs[1].foo, 0);
@@ -29,4 +29,4 @@ export default {
assert.equal(divs[2].foo, 0.75);
assert.equal(divs[3].foo, 0.25);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/transition-js-each-block-keyed-intro-outro/_config.js b/test/runtime/samples/transition-js-each-block-keyed-intro-outro/_config.js
index 083752cbd9..5d1ae5d3e9 100644
--- a/test/runtime/samples/transition-js-each-block-keyed-intro-outro/_config.js
+++ b/test/runtime/samples/transition-js-each-block-keyed-intro-outro/_config.js
@@ -9,7 +9,7 @@ export default {
intro: true,
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
const divs = target.querySelectorAll('div');
divs[0].i = 0; // for debugging
divs[1].i = 1;
@@ -60,4 +60,4 @@ export default {
assert.equal(divs[1].foo, 1);
assert.equal(divs[2].foo, 1);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/transition-js-each-block-keyed-intro/_config.js b/test/runtime/samples/transition-js-each-block-keyed-intro/_config.js
index 5886cc5c6f..f6b1416789 100644
--- a/test/runtime/samples/transition-js-each-block-keyed-intro/_config.js
+++ b/test/runtime/samples/transition-js-each-block-keyed-intro/_config.js
@@ -9,7 +9,7 @@ export default {
intro: true,
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
let divs = target.querySelectorAll('div');
assert.equal(divs[0].foo, 0);
assert.equal(divs[1].foo, 0);
@@ -44,4 +44,4 @@ export default {
assert.equal(divs[2].foo, 0.75);
assert.equal(divs[3].foo, 0.75);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/transition-js-each-block-keyed-outro/_config.js b/test/runtime/samples/transition-js-each-block-keyed-outro/_config.js
index 03e8c147cb..f3677ef89a 100644
--- a/test/runtime/samples/transition-js-each-block-keyed-outro/_config.js
+++ b/test/runtime/samples/transition-js-each-block-keyed-outro/_config.js
@@ -7,7 +7,7 @@ export default {
]
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
const divs = target.querySelectorAll( 'div' );
component.things = [
@@ -25,4 +25,4 @@ export default {
assert.equal( divs[1].foo, 0.5 );
assert.equal( divs[2].foo, undefined );
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/transition-js-each-block-outro/_config.js b/test/runtime/samples/transition-js-each-block-outro/_config.js
index f8d4410e99..b36a3d93eb 100644
--- a/test/runtime/samples/transition-js-each-block-outro/_config.js
+++ b/test/runtime/samples/transition-js-each-block-outro/_config.js
@@ -3,7 +3,7 @@ export default {
things: [ 'a', 'b', 'c' ]
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
const divs = target.querySelectorAll( 'div' );
component.things = [ 'a' ];
@@ -16,4 +16,4 @@ export default {
raf.tick( 100 );
assert.htmlEqual(target.innerHTML, '
a
');
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/transition-js-each-else-block-intro-outro/_config.js b/test/runtime/samples/transition-js-each-else-block-intro-outro/_config.js
index 13d0cf0b23..692713840d 100644
--- a/test/runtime/samples/transition-js-each-else-block-intro-outro/_config.js
+++ b/test/runtime/samples/transition-js-each-else-block-intro-outro/_config.js
@@ -3,7 +3,7 @@ export default {
things: ['a', 'b', 'c']
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.things = [];
let div = target.querySelector('div');
assert.equal(div.foo, 0);
@@ -51,4 +51,4 @@ export default {
raf.tick(2000);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/transition-js-each-else-block-intro/_config.js b/test/runtime/samples/transition-js-each-else-block-intro/_config.js
index f061e312ff..77edb37ef2 100644
--- a/test/runtime/samples/transition-js-each-else-block-intro/_config.js
+++ b/test/runtime/samples/transition-js-each-else-block-intro/_config.js
@@ -3,7 +3,7 @@ export default {
things: ['a', 'b', 'c']
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.things = [];
const div = target.querySelector('div');
assert.equal(div.foo, 0);
@@ -19,4 +19,4 @@ export default {
raf.tick(500);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/transition-js-each-else-block-outro/_config.js b/test/runtime/samples/transition-js-each-else-block-outro/_config.js
index 863753b34a..fb5d9cb823 100644
--- a/test/runtime/samples/transition-js-each-else-block-outro/_config.js
+++ b/test/runtime/samples/transition-js-each-else-block-outro/_config.js
@@ -2,7 +2,7 @@ export default {
props: {
things: []
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
const div = target.querySelector('div');
component.things = ['a', 'b', 'c'];
@@ -17,4 +17,4 @@ export default {
raf.tick(500);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/transition-js-each-keyed-unchanged/_config.js b/test/runtime/samples/transition-js-each-keyed-unchanged/_config.js
index b3a1882196..ddf83e4397 100644
--- a/test/runtime/samples/transition-js-each-keyed-unchanged/_config.js
+++ b/test/runtime/samples/transition-js-each-keyed-unchanged/_config.js
@@ -3,7 +3,7 @@ export default {
numbers: [1, 2, 3, 4, 5]
},
- test({ assert, component, target, raf }) {
+ test({ assert, component, target }) {
const divs1 = target.querySelectorAll('div');
assert.equal(divs1[0].foo, undefined);
@@ -22,4 +22,4 @@ export default {
assert.equal(divs1[3].foo, undefined);
assert.equal(divs1[4].foo, undefined);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/transition-js-each-outro-cancelled/_config.js b/test/runtime/samples/transition-js-each-outro-cancelled/_config.js
new file mode 100644
index 0000000000..9f9bd35f05
--- /dev/null
+++ b/test/runtime/samples/transition-js-each-outro-cancelled/_config.js
@@ -0,0 +1,57 @@
+export default {
+ html: '
',
+ async test({ assert, component, target, raf }) {
+ await component.add();
+ await component.add();
+
+ let time = 0;
+
+ assert.htmlEqual(target.innerHTML, `
+
+ `);
+
+ raf.tick(time += 400);
+
+ assert.htmlEqual(target.innerHTML, `
+
+ `);
+
+ await component.toggle();
+ // transition halfway
+ raf.tick(time += 200);
+
+ assert.htmlEqual(target.innerHTML, `
+
+ `);
+
+ await component.toggle();
+ // transition back
+ raf.tick(time += 200);
+
+ assert.htmlEqual(target.innerHTML, `
+
+ `);
+
+ await component.remove(1);
+
+ raf.tick(time += 400);
+
+ assert.htmlEqual(target.innerHTML, `
+
+ `);
+ }
+};
diff --git a/test/runtime/samples/transition-js-each-outro-cancelled/main.svelte b/test/runtime/samples/transition-js-each-outro-cancelled/main.svelte
new file mode 100644
index 0000000000..7c08be492f
--- /dev/null
+++ b/test/runtime/samples/transition-js-each-outro-cancelled/main.svelte
@@ -0,0 +1,29 @@
+
+
+{#if shown}
+
+ {#each items as thing (thing._id)}
+ {thing.name}
+ {/each}
+
+{/if}
diff --git a/test/runtime/samples/transition-js-each-unchanged/_config.js b/test/runtime/samples/transition-js-each-unchanged/_config.js
index 9bd2206211..2dfa1f65ac 100644
--- a/test/runtime/samples/transition-js-each-unchanged/_config.js
+++ b/test/runtime/samples/transition-js-each-unchanged/_config.js
@@ -3,7 +3,7 @@ export default {
numbers: [1, 2, 3, 4, 5]
},
- test({ assert, component, target, raf }) {
+ test({ assert, component, target }) {
const divs1 = target.querySelectorAll('div');
assert.equal(divs1[0].foo, undefined);
@@ -22,4 +22,4 @@ export default {
assert.equal(divs1[3].foo, undefined);
assert.equal(divs1[4].foo, undefined);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/transition-js-events-in-out/_config.js b/test/runtime/samples/transition-js-events-in-out/_config.js
index 854e7e2f4b..588a4edbd7 100644
--- a/test/runtime/samples/transition-js-events-in-out/_config.js
+++ b/test/runtime/samples/transition-js-events-in-out/_config.js
@@ -68,4 +68,4 @@ export default {
d
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/transition-js-events/_config.js b/test/runtime/samples/transition-js-events/_config.js
index 00d83cb275..54b068dace 100644
--- a/test/runtime/samples/transition-js-events/_config.js
+++ b/test/runtime/samples/transition-js-events/_config.js
@@ -67,4 +67,4 @@ export default {
d
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/transition-js-if-block-bidi/_config.js b/test/runtime/samples/transition-js-if-block-bidi/_config.js
index a070f978e2..68242ecbbf 100644
--- a/test/runtime/samples/transition-js-if-block-bidi/_config.js
+++ b/test/runtime/samples/transition-js-if-block-bidi/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
global.count = 0;
component.visible = true;
@@ -25,4 +25,4 @@ export default {
raf.tick(900);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/transition-js-if-block-in-each-block-bidi-2/_config.js b/test/runtime/samples/transition-js-if-block-in-each-block-bidi-2/_config.js
index 338586636b..ed88103f2c 100644
--- a/test/runtime/samples/transition-js-if-block-in-each-block-bidi-2/_config.js
+++ b/test/runtime/samples/transition-js-if-block-in-each-block-bidi-2/_config.js
@@ -12,7 +12,7 @@ export default {
5
`,
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
raf.tick(100);
component.threshold = 4;
@@ -25,4 +25,4 @@ export default {
4
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/transition-js-if-block-in-each-block-bidi-3/_config.js b/test/runtime/samples/transition-js-if-block-in-each-block-bidi-3/_config.js
index 04df38a09c..09511fe976 100644
--- a/test/runtime/samples/transition-js-if-block-in-each-block-bidi-3/_config.js
+++ b/test/runtime/samples/transition-js-if-block-in-each-block-bidi-3/_config.js
@@ -30,4 +30,4 @@ export default {
5
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/transition-js-if-block-in-each-block-bidi/_config.js b/test/runtime/samples/transition-js-if-block-in-each-block-bidi/_config.js
index 4c75e3ef06..b02ccffc81 100644
--- a/test/runtime/samples/transition-js-if-block-in-each-block-bidi/_config.js
+++ b/test/runtime/samples/transition-js-if-block-in-each-block-bidi/_config.js
@@ -13,7 +13,7 @@ export default {
intro: true,
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
const divs = target.querySelectorAll('div');
assert.equal(divs[0].foo, 0);
@@ -42,4 +42,4 @@ export default {
3
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/transition-js-if-block-intro-outro/_config.js b/test/runtime/samples/transition-js-if-block-intro-outro/_config.js
index e6512c93ed..89fbaac1e6 100644
--- a/test/runtime/samples/transition-js-if-block-intro-outro/_config.js
+++ b/test/runtime/samples/transition-js-if-block-intro-outro/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
let div = target.querySelector('div');
assert.equal(div.foo, 0);
@@ -41,4 +41,4 @@ export default {
raf.tick(2000);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/transition-js-if-block-intro/_config.js b/test/runtime/samples/transition-js-if-block-intro/_config.js
index 93ef8391f5..8be3b718f8 100644
--- a/test/runtime/samples/transition-js-if-block-intro/_config.js
+++ b/test/runtime/samples/transition-js-if-block-intro/_config.js
@@ -12,4 +12,4 @@ export default {
raf.tick(500);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/transition-js-if-block-outro-timeout/_config.js b/test/runtime/samples/transition-js-if-block-outro-timeout/_config.js
index 5c6e103a5a..3ead1ad6b4 100644
--- a/test/runtime/samples/transition-js-if-block-outro-timeout/_config.js
+++ b/test/runtime/samples/transition-js-if-block-outro-timeout/_config.js
@@ -16,4 +16,4 @@ export default {
assert.equal(component.div, undefined);
assert.equal(target.querySelector('div'), undefined);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/transition-js-if-else-block-dynamic-outro/_config.js b/test/runtime/samples/transition-js-if-else-block-dynamic-outro/_config.js
index c15b3ac9c9..c3f6334576 100644
--- a/test/runtime/samples/transition-js-if-else-block-dynamic-outro/_config.js
+++ b/test/runtime/samples/transition-js-if-else-block-dynamic-outro/_config.js
@@ -3,7 +3,7 @@ export default {
z: 'z'
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
assert.equal(target.querySelector('div'), component.no);
component.x = true;
@@ -18,4 +18,4 @@ export default {
raf.tick(100);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/transition-js-if-else-block-intro/_config.js b/test/runtime/samples/transition-js-if-else-block-intro/_config.js
index c5eccf50e5..1f3b6fd118 100644
--- a/test/runtime/samples/transition-js-if-else-block-intro/_config.js
+++ b/test/runtime/samples/transition-js-if-else-block-intro/_config.js
@@ -18,4 +18,4 @@ export default {
raf.tick(1000);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/transition-js-if-else-block-not-dynamic-outro/_config.js b/test/runtime/samples/transition-js-if-else-block-not-dynamic-outro/_config.js
new file mode 100644
index 0000000000..9bd793c3ad
--- /dev/null
+++ b/test/runtime/samples/transition-js-if-else-block-not-dynamic-outro/_config.js
@@ -0,0 +1,38 @@
+export default {
+ async test({ assert, component, target, raf }) {
+ const t = target.querySelector('#t');
+
+ await (component.condition = false);
+
+ let time = 0;
+ raf.tick(time += 25);
+
+ assert.htmlEqual(target.innerHTML, `
+
TRUE
+
FALSE
+ `);
+
+ // toggling back in the middle of the out transition
+ // will reuse the previous element
+ await (component.condition = true);
+
+ assert.htmlEqual(target.innerHTML, `
+
FALSE
+
TRUE
+ `);
+ assert.equal(target.querySelector('#t'), t);
+
+ raf.tick(time += 25);
+
+ assert.htmlEqual(target.innerHTML, `
+
FALSE
+
TRUE
+ `);
+
+ raf.tick(time += 75);
+
+ assert.htmlEqual(target.innerHTML, `
+
TRUE
+ `);
+ }
+};
diff --git a/test/runtime/samples/transition-js-if-else-block-not-dynamic-outro/main.svelte b/test/runtime/samples/transition-js-if-else-block-not-dynamic-outro/main.svelte
new file mode 100644
index 0000000000..93205aeaac
--- /dev/null
+++ b/test/runtime/samples/transition-js-if-else-block-not-dynamic-outro/main.svelte
@@ -0,0 +1,18 @@
+
+
+{#if condition}
+
TRUE
+{:else}
+
FALSE
+{/if}
\ No newline at end of file
diff --git a/test/runtime/samples/transition-js-if-else-block-outro/_config.js b/test/runtime/samples/transition-js-if-else-block-outro/_config.js
index 4332ce82aa..0d56cba09b 100644
--- a/test/runtime/samples/transition-js-if-else-block-outro/_config.js
+++ b/test/runtime/samples/transition-js-if-else-block-outro/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
assert.equal(target.querySelector('div'), component.no);
component.x = true;
@@ -14,4 +14,4 @@ export default {
raf.tick(100);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/transition-js-if-elseif-block-outro/_config.js b/test/runtime/samples/transition-js-if-elseif-block-outro/_config.js
index f8886f889d..9a61c2e45b 100644
--- a/test/runtime/samples/transition-js-if-elseif-block-outro/_config.js
+++ b/test/runtime/samples/transition-js-if-elseif-block-outro/_config.js
@@ -4,7 +4,7 @@ export default {
y: true
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
assert.equal(target.querySelector('div'), component.no);
component.x = true;
@@ -20,4 +20,4 @@ export default {
raf.tick(100);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/transition-js-initial/_config.js b/test/runtime/samples/transition-js-initial/_config.js
index 3760a1cbfb..770b2a8cc9 100644
--- a/test/runtime/samples/transition-js-initial/_config.js
+++ b/test/runtime/samples/transition-js-initial/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-js-intro-enabled-by-option/_config.js b/test/runtime/samples/transition-js-intro-enabled-by-option/_config.js
index af8e957b19..b4d4dd2053 100644
--- a/test/runtime/samples/transition-js-intro-enabled-by-option/_config.js
+++ b/test/runtime/samples/transition-js-intro-enabled-by-option/_config.js
@@ -3,7 +3,7 @@ export default {
skip_if_hydrate: true,
- test({ assert, component, target, window, raf }) {
+ test({ assert, target, raf }) {
const div = target.querySelector('div');
assert.equal(div.foo, 0);
diff --git a/test/runtime/samples/transition-js-intro-skipped-by-default-nested/_config.js b/test/runtime/samples/transition-js-intro-skipped-by-default-nested/_config.js
index e209e0a80c..cada0124c6 100644
--- a/test/runtime/samples/transition-js-intro-skipped-by-default-nested/_config.js
+++ b/test/runtime/samples/transition-js-intro-skipped-by-default-nested/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, target, raf }) {
const div = target.querySelector('div');
assert.equal(div.foo, undefined);
diff --git a/test/runtime/samples/transition-js-intro-skipped-by-default/_config.js b/test/runtime/samples/transition-js-intro-skipped-by-default/_config.js
index e209e0a80c..cada0124c6 100644
--- a/test/runtime/samples/transition-js-intro-skipped-by-default/_config.js
+++ b/test/runtime/samples/transition-js-intro-skipped-by-default/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, target, raf }) {
const div = target.querySelector('div');
assert.equal(div.foo, undefined);
diff --git a/test/runtime/samples/transition-js-local/_config.js b/test/runtime/samples/transition-js-local/_config.js
index 5f9cf9048a..f2d2c0384d 100644
--- a/test/runtime/samples/transition-js-local/_config.js
+++ b/test/runtime/samples/transition-js-local/_config.js
@@ -4,7 +4,7 @@ export default {
y: true
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.x = true;
let div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-js-nested-await/_config.js b/test/runtime/samples/transition-js-nested-await/_config.js
index 78dbe5ae41..e0f26580cc 100644
--- a/test/runtime/samples/transition-js-nested-await/_config.js
+++ b/test/runtime/samples/transition-js-nested-await/_config.js
@@ -10,7 +10,7 @@ export default {
promise
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.x = true;
fulfil();
diff --git a/test/runtime/samples/transition-js-nested-component/_config.js b/test/runtime/samples/transition-js-nested-component/_config.js
index f1ca81c52e..87d7aaa233 100644
--- a/test/runtime/samples/transition-js-nested-component/_config.js
+++ b/test/runtime/samples/transition-js-nested-component/_config.js
@@ -3,7 +3,7 @@ export default {
x: false
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.x = true;
const div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-js-nested-each-keyed-2/_config.js b/test/runtime/samples/transition-js-nested-each-keyed-2/_config.js
index c2d782c0f2..1040d1af53 100644
--- a/test/runtime/samples/transition-js-nested-each-keyed-2/_config.js
+++ b/test/runtime/samples/transition-js-nested-each-keyed-2/_config.js
@@ -4,7 +4,7 @@ export default {
things: ['a', 'b']
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target }) {
component.x = false;
assert.htmlEqual(target.innerHTML, '');
}
diff --git a/test/runtime/samples/transition-js-nested-each-keyed/_config.js b/test/runtime/samples/transition-js-nested-each-keyed/_config.js
index 5ec416afd9..a74aba5610 100644
--- a/test/runtime/samples/transition-js-nested-each-keyed/_config.js
+++ b/test/runtime/samples/transition-js-nested-each-keyed/_config.js
@@ -4,7 +4,7 @@ export default {
things: ['a']
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.x = true;
const div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-js-nested-if/_config.js b/test/runtime/samples/transition-js-nested-if/_config.js
index 7d48077aca..9e4c634967 100644
--- a/test/runtime/samples/transition-js-nested-if/_config.js
+++ b/test/runtime/samples/transition-js-nested-if/_config.js
@@ -4,7 +4,7 @@ export default {
y: true
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.x = true;
const div = target.querySelector('div');
diff --git a/test/runtime/samples/transition-js-nested-intro/_config.js b/test/runtime/samples/transition-js-nested-intro/_config.js
index 9072e885fc..5d27f84839 100644
--- a/test/runtime/samples/transition-js-nested-intro/_config.js
+++ b/test/runtime/samples/transition-js-nested-intro/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const div = target.querySelector('div');
assert.equal(div.foo, 0);
@@ -16,4 +16,4 @@ export default {
raf.tick(150);
assert.equal(div.foo, 1);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/transition-js-parameterised-with-state/_config.js b/test/runtime/samples/transition-js-parameterised-with-state/_config.js
index b143e8fdd6..07dd1ad906 100644
--- a/test/runtime/samples/transition-js-parameterised-with-state/_config.js
+++ b/test/runtime/samples/transition-js-parameterised-with-state/_config.js
@@ -3,7 +3,7 @@ export default {
duration: 200
},
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const div = target.querySelector('div');
assert.equal(div.foo, 0);
diff --git a/test/runtime/samples/transition-js-parameterised/_config.js b/test/runtime/samples/transition-js-parameterised/_config.js
index 6655cd374d..222e9e713e 100644
--- a/test/runtime/samples/transition-js-parameterised/_config.js
+++ b/test/runtime/samples/transition-js-parameterised/_config.js
@@ -1,5 +1,5 @@
export default {
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const div = target.querySelector('div');
assert.equal(div.foo, 0);
diff --git a/test/runtime/samples/transition-js-slot-2/Nested.svelte b/test/runtime/samples/transition-js-slot-2/Nested.svelte
new file mode 100644
index 0000000000..4cd6a9b375
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-2/Nested.svelte
@@ -0,0 +1,18 @@
+
+
+{#if visible}
+
+
+
+{/if}
\ No newline at end of file
diff --git a/test/runtime/samples/transition-js-slot-2/_config.js b/test/runtime/samples/transition-js-slot-2/_config.js
new file mode 100644
index 0000000000..1785941252
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-2/_config.js
@@ -0,0 +1,24 @@
+// cancelled the transition halfway
+export default {
+ html: `
+
Foo
+ `,
+
+ async test({ assert, component, target, raf }) {
+ await component.hide();
+ const div = target.querySelector('div');
+
+ raf.tick(50);
+ assert.equal(div.foo, 0.5);
+
+ await component.show();
+
+ assert.htmlEqual(target.innerHTML, '
Bar
');
+
+ raf.tick(75);
+ assert.equal(div.foo, 0.75);
+
+ raf.tick(100);
+ assert.equal(div.foo, 1);
+ }
+};
diff --git a/test/runtime/samples/transition-js-slot-2/main.svelte b/test/runtime/samples/transition-js-slot-2/main.svelte
new file mode 100644
index 0000000000..2d45b5ca30
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-2/main.svelte
@@ -0,0 +1,18 @@
+
+
+
+ {name}
+
diff --git a/test/runtime/samples/transition-js-slot-3/Nested.svelte b/test/runtime/samples/transition-js-slot-3/Nested.svelte
new file mode 100644
index 0000000000..8a5b9ec2df
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-3/Nested.svelte
@@ -0,0 +1,27 @@
+
+
+{#if visible}
+
+
+
+{/if}
\ No newline at end of file
diff --git a/test/runtime/samples/transition-js-slot-3/_config.js b/test/runtime/samples/transition-js-slot-3/_config.js
new file mode 100644
index 0000000000..0dfe3281fc
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-3/_config.js
@@ -0,0 +1,23 @@
+export default {
+ html: `
+
Foo
+ `,
+
+ async test({ assert, component, target, raf }) {
+ await component.hide();
+ const div = target.querySelector('div');
+
+ raf.tick(50);
+ assert.equal(div.foo, 0.5);
+
+ await component.show();
+
+ assert.htmlEqual(target.innerHTML, '
Bar
');
+
+ raf.tick(75);
+ assert.equal(div.foo, 0.75);
+
+ raf.tick(100);
+ assert.equal(div.foo, 1);
+ }
+};
diff --git a/test/runtime/samples/transition-js-slot-3/main.svelte b/test/runtime/samples/transition-js-slot-3/main.svelte
new file mode 100644
index 0000000000..f10ad356e1
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-3/main.svelte
@@ -0,0 +1,16 @@
+
+
+
+ {data}
+
diff --git a/test/runtime/samples/transition-js-slot-4-cancelled/Nested.svelte b/test/runtime/samples/transition-js-slot-4-cancelled/Nested.svelte
new file mode 100644
index 0000000000..04eea750fd
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-4-cancelled/Nested.svelte
@@ -0,0 +1,19 @@
+
+
+{#if visible}
+
+
+
+{/if}
\ No newline at end of file
diff --git a/test/runtime/samples/transition-js-slot-4-cancelled/_config.js b/test/runtime/samples/transition-js-slot-4-cancelled/_config.js
new file mode 100644
index 0000000000..8be95f0150
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-4-cancelled/_config.js
@@ -0,0 +1,35 @@
+// updated props in the middle of transitions
+// and cancelled the transition halfway
+export default {
+ html: `
+
outside Foo Foo Foo
+
inside Foo Foo Foo
+ `,
+ props: {
+ props: 'Foo'
+ },
+
+ async test({ assert, component, target, raf }) {
+ await component.hide();
+ const [, div] = target.querySelectorAll('div');
+
+ raf.tick(50);
+ assert.equal(div.foo, 0.5);
+
+ component.props = 'Bar';
+ assert.htmlEqual(target.innerHTML, `
+
outside Bar Bar Bar
+
inside Foo Foo Foo
+ `);
+
+ await component.show();
+
+ assert.htmlEqual(target.innerHTML, `
+
outside Bar Bar Bar
+
inside Bar Bar Bar
+ `);
+
+ raf.tick(100);
+ assert.equal(div.foo, 1);
+ }
+};
diff --git a/test/runtime/samples/transition-js-slot-4-cancelled/main.svelte b/test/runtime/samples/transition-js-slot-4-cancelled/main.svelte
new file mode 100644
index 0000000000..1003419244
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-4-cancelled/main.svelte
@@ -0,0 +1,22 @@
+
+
+
outside {state} {props} {slotProps}
+
+ inside {state} {props} {slotProps}
+
diff --git a/test/runtime/samples/transition-js-slot-5-cancelled-overflow/Nested.svelte b/test/runtime/samples/transition-js-slot-5-cancelled-overflow/Nested.svelte
new file mode 100644
index 0000000000..10050b6a10
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-5-cancelled-overflow/Nested.svelte
@@ -0,0 +1,19 @@
+
+
+{#if visible}
+
+
+
+{/if}
diff --git a/test/runtime/samples/transition-js-slot-5-cancelled-overflow/_config.js b/test/runtime/samples/transition-js-slot-5-cancelled-overflow/_config.js
new file mode 100644
index 0000000000..556f75eccd
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-5-cancelled-overflow/_config.js
@@ -0,0 +1,40 @@
+// updated props in the middle of transitions
+// and cancelled the transition halfway
+// + spreaded props + overflow context
+
+export default {
+ html: `
+
outside Foo Foo Foo
+
inside Foo Foo Foo
+ 0
+ `,
+ props: {
+ props: 'Foo'
+ },
+
+ async test({ assert, component, target, raf }) {
+ await component.hide();
+ const [, div] = target.querySelectorAll('div');
+
+ raf.tick(50);
+ assert.equal(div.foo, 0.5);
+
+ component.props = 'Bar';
+ assert.htmlEqual(target.innerHTML, `
+
outside Bar Bar Bar
+
inside Foo Foo Foo
+ 0
+ `);
+
+ await component.show();
+
+ assert.htmlEqual(target.innerHTML, `
+
outside Bar Bar Bar
+
inside Bar Bar Bar
+ 0
+ `);
+
+ raf.tick(100);
+ assert.equal(div.foo, 1);
+ }
+};
diff --git a/test/runtime/samples/transition-js-slot-5-cancelled-overflow/main.svelte b/test/runtime/samples/transition-js-slot-5-cancelled-overflow/main.svelte
new file mode 100644
index 0000000000..9c46fd0521
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-5-cancelled-overflow/main.svelte
@@ -0,0 +1,27 @@
+
+
+
outside {state} {props} {slotProps}
+
+
+ inside {state} {props} {slotProps}
+
+
+{a1+a2+a3+a4+a5+a6+a7+a8+a9+a10+a11+a12+a13+a14+a15+a16+a17+a18+a19+a20+a21+a22+a23+a24+a25+a26+a27+a28+a29+a30+a31+a32+a33}
\ No newline at end of file
diff --git a/test/runtime/samples/transition-js-slot-6-spread-cancelled/Nested.svelte b/test/runtime/samples/transition-js-slot-6-spread-cancelled/Nested.svelte
new file mode 100644
index 0000000000..b1853993d3
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-6-spread-cancelled/Nested.svelte
@@ -0,0 +1,19 @@
+
+
+{#if visible}
+
+
+
+{/if}
\ No newline at end of file
diff --git a/test/runtime/samples/transition-js-slot-6-spread-cancelled/Nested2.svelte b/test/runtime/samples/transition-js-slot-6-spread-cancelled/Nested2.svelte
new file mode 100644
index 0000000000..52f89858a0
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-6-spread-cancelled/Nested2.svelte
@@ -0,0 +1,19 @@
+
+
+{#if visible}
+
+
+
+{/if}
\ No newline at end of file
diff --git a/test/runtime/samples/transition-js-slot-6-spread-cancelled/_config.js b/test/runtime/samples/transition-js-slot-6-spread-cancelled/_config.js
new file mode 100644
index 0000000000..960e02a8f6
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-6-spread-cancelled/_config.js
@@ -0,0 +1,40 @@
+// updated props in the middle of transitions
+// and cancelled the transition halfway
+// with spreaded props
+
+export default {
+ html: `
+
outside Foo Foo Foo
+
inside Foo Foo Foo
+
inside Foo Foo XXX
+ `,
+ props: {
+ props: 'Foo'
+ },
+
+ async test({ assert, component, target, raf }) {
+ await component.hide();
+ const [, div] = target.querySelectorAll('div');
+
+ raf.tick(50);
+ assert.equal(div.foo, 0.5);
+
+ component.props = 'Bar';
+ assert.htmlEqual(target.innerHTML, `
+
outside Bar Bar Bar
+
inside Foo Foo Foo
+
inside Foo Foo XXX
+ `);
+
+ await component.show();
+
+ assert.htmlEqual(target.innerHTML, `
+
outside Bar Bar Bar
+
inside Bar Bar Bar
+
inside Bar Bar XXX
+ `);
+
+ raf.tick(100);
+ assert.equal(div.foo, 1);
+ }
+};
diff --git a/test/runtime/samples/transition-js-slot-6-spread-cancelled/main.svelte b/test/runtime/samples/transition-js-slot-6-spread-cancelled/main.svelte
new file mode 100644
index 0000000000..5dd8ce348e
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-6-spread-cancelled/main.svelte
@@ -0,0 +1,26 @@
+
+
+
outside {state} {props} {slotProps.slotProps}
+
+ inside {state} {props} {slotProps}
+
+
+ inside {state} {props} {slotProps}
+
diff --git a/test/runtime/samples/transition-js-slot-7-spread-cancelled-overflow/Nested.svelte b/test/runtime/samples/transition-js-slot-7-spread-cancelled-overflow/Nested.svelte
new file mode 100644
index 0000000000..b01200fd9f
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-7-spread-cancelled-overflow/Nested.svelte
@@ -0,0 +1,19 @@
+
+
+{#if visible}
+
+
+
+{/if}
diff --git a/test/runtime/samples/transition-js-slot-7-spread-cancelled-overflow/_config.js b/test/runtime/samples/transition-js-slot-7-spread-cancelled-overflow/_config.js
new file mode 100644
index 0000000000..556f75eccd
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-7-spread-cancelled-overflow/_config.js
@@ -0,0 +1,40 @@
+// updated props in the middle of transitions
+// and cancelled the transition halfway
+// + spreaded props + overflow context
+
+export default {
+ html: `
+
outside Foo Foo Foo
+
inside Foo Foo Foo
+ 0
+ `,
+ props: {
+ props: 'Foo'
+ },
+
+ async test({ assert, component, target, raf }) {
+ await component.hide();
+ const [, div] = target.querySelectorAll('div');
+
+ raf.tick(50);
+ assert.equal(div.foo, 0.5);
+
+ component.props = 'Bar';
+ assert.htmlEqual(target.innerHTML, `
+
outside Bar Bar Bar
+
inside Foo Foo Foo
+ 0
+ `);
+
+ await component.show();
+
+ assert.htmlEqual(target.innerHTML, `
+
outside Bar Bar Bar
+
inside Bar Bar Bar
+ 0
+ `);
+
+ raf.tick(100);
+ assert.equal(div.foo, 1);
+ }
+};
diff --git a/test/runtime/samples/transition-js-slot-7-spread-cancelled-overflow/main.svelte b/test/runtime/samples/transition-js-slot-7-spread-cancelled-overflow/main.svelte
new file mode 100644
index 0000000000..000b29ee7f
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-7-spread-cancelled-overflow/main.svelte
@@ -0,0 +1,27 @@
+
+
+
outside {state} {props} {slotProps.slotProps}
+
+
+ inside {state} {props} {slotProps}
+
+
+{a1+a2+a3+a4+a5+a6+a7+a8+a9+a10+a11+a12+a13+a14+a15+a16+a17+a18+a19+a20+a21+a22+a23+a24+a25+a26+a27+a28+a29+a30+a31+a32+a33}
\ No newline at end of file
diff --git a/test/runtime/samples/transition-js-slot-fallback/_config.js b/test/runtime/samples/transition-js-slot-fallback/_config.js
new file mode 100644
index 0000000000..0dfe3281fc
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-fallback/_config.js
@@ -0,0 +1,23 @@
+export default {
+ html: `
+
Foo
+ `,
+
+ async test({ assert, component, target, raf }) {
+ await component.hide();
+ const div = target.querySelector('div');
+
+ raf.tick(50);
+ assert.equal(div.foo, 0.5);
+
+ await component.show();
+
+ assert.htmlEqual(target.innerHTML, '
Bar
');
+
+ raf.tick(75);
+ assert.equal(div.foo, 0.75);
+
+ raf.tick(100);
+ assert.equal(div.foo, 1);
+ }
+};
diff --git a/test/runtime/samples/transition-js-slot-fallback/main.svelte b/test/runtime/samples/transition-js-slot-fallback/main.svelte
new file mode 100644
index 0000000000..3392792043
--- /dev/null
+++ b/test/runtime/samples/transition-js-slot-fallback/main.svelte
@@ -0,0 +1,27 @@
+
+
+{#if visible}
+
+ {data}
+
+{/if}
\ No newline at end of file
diff --git a/test/runtime/samples/transition-js-slot/_config.js b/test/runtime/samples/transition-js-slot/_config.js
index a32e4bda72..3c1cbeec10 100644
--- a/test/runtime/samples/transition-js-slot/_config.js
+++ b/test/runtime/samples/transition-js-slot/_config.js
@@ -7,7 +7,7 @@ export default {
`,
- test({ assert, component, target, window, raf }) {
+ test({ assert, component, target, raf }) {
component.visible = true;
const p = target.querySelector('p');
assert.equal(p.foo, 0);
@@ -23,4 +23,4 @@ export default {
raf.tick(100);
assert.equal(p.foo, 0);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/whitespace-each-block/_config.js b/test/runtime/samples/whitespace-each-block/_config.js
index fe9fefd7ee..9f3f5735ed 100644
--- a/test/runtime/samples/whitespace-each-block/_config.js
+++ b/test/runtime/samples/whitespace-each-block/_config.js
@@ -3,10 +3,10 @@ export default {
characters: ['a', 'b', 'c']
},
- test({ assert, component, target }) {
+ test({ assert, target }) {
assert.equal(
target.textContent,
'a b c '
);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/whitespace-list/_config.js b/test/runtime/samples/whitespace-list/_config.js
index 1ba852726c..c3c9d31333 100644
--- a/test/runtime/samples/whitespace-list/_config.js
+++ b/test/runtime/samples/whitespace-list/_config.js
@@ -14,7 +14,7 @@ export default {
`,
- test({ assert, component, target }) {
+ test({ assert, target }) {
const ul = target.querySelector('ul');
assert.equal(ul.childNodes.length, 5);
diff --git a/test/runtime/samples/whitespace-normal/_config.js b/test/runtime/samples/whitespace-normal/_config.js
index ea32292d74..90ca0b42c0 100644
--- a/test/runtime/samples/whitespace-normal/_config.js
+++ b/test/runtime/samples/whitespace-normal/_config.js
@@ -3,10 +3,10 @@ export default {
name: 'world'
},
- test({ assert, component, target }) {
+ test({ assert, target }) {
assert.equal(
target.textContent,
'Hello world! How are you?'
);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/window-bind-scroll-update/_config.js b/test/runtime/samples/window-bind-scroll-update/_config.js
index ac6f54ad55..60bdb4b7f6 100644
--- a/test/runtime/samples/window-bind-scroll-update/_config.js
+++ b/test/runtime/samples/window-bind-scroll-update/_config.js
@@ -24,7 +24,7 @@ export default {
clock = null;
},
- async test({ assert, component, target, window }) {
+ async test({ assert, component, window }) {
assert.equal(window.pageYOffset, 0);
// clear the previous 'scrolling' state
diff --git a/test/runtime/samples/window-binding-resize/_config.js b/test/runtime/samples/window-binding-resize/_config.js
index da58d083da..c99e92a07b 100644
--- a/test/runtime/samples/window-binding-resize/_config.js
+++ b/test/runtime/samples/window-binding-resize/_config.js
@@ -16,7 +16,7 @@ export default {
skip_if_ssr: true, // there's some kind of weird bug with this test... it compiles with the wrong require.extensions hook for some bizarre reason
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const event = new window.Event('resize');
Object.defineProperties(window, {
@@ -36,4 +36,4 @@ export default {
567x456
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/window-binding-scroll-store/_config.js b/test/runtime/samples/window-binding-scroll-store/_config.js
index 0ce87efee0..47951506bf 100644
--- a/test/runtime/samples/window-binding-scroll-store/_config.js
+++ b/test/runtime/samples/window-binding-scroll-store/_config.js
@@ -8,7 +8,7 @@ export default {
}
});
},
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
assert.equal(window.pageYOffset, 0);
const event = new window.Event('scroll');
diff --git a/test/runtime/samples/window-event-context/_config.js b/test/runtime/samples/window-event-context/_config.js
index 5a0f635bd4..c07dd811b5 100644
--- a/test/runtime/samples/window-event-context/_config.js
+++ b/test/runtime/samples/window-event-context/_config.js
@@ -19,4 +19,4 @@ export default {
assert.equal(component.foo, true);
assert.htmlEqual(target.innerHTML, 'true');
}
-};
\ No newline at end of file
+};
diff --git a/test/runtime/samples/window-event-custom/_config.js b/test/runtime/samples/window-event-custom/_config.js
index 15644bc8e8..2e3b577b86 100644
--- a/test/runtime/samples/window-event-custom/_config.js
+++ b/test/runtime/samples/window-event-custom/_config.js
@@ -1,7 +1,7 @@
export default {
html: '
escaped: false
',
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const event = new window.KeyboardEvent('keydown', {
key: 'Escape'
});
diff --git a/test/runtime/samples/window-event/_config.js b/test/runtime/samples/window-event/_config.js
index 1dd4ea4b6a..9abde274e9 100644
--- a/test/runtime/samples/window-event/_config.js
+++ b/test/runtime/samples/window-event/_config.js
@@ -3,7 +3,7 @@ export default {
skip_if_ssr: true, // there's some kind of weird bug with this test... it compiles with the wrong require.extensions hook for some bizarre reason
- async test({ assert, component, target, window }) {
+ async test({ assert, target, window }) {
const event = new window.Event('resize');
Object.defineProperties(window, {
@@ -23,4 +23,4 @@ export default {
567x456
`);
}
-};
\ No newline at end of file
+};
diff --git a/test/server-side-rendering/index.ts b/test/server-side-rendering/index.ts
index ef2a88ecbe..cc3f20d637 100644
--- a/test/server-side-rendering/index.ts
+++ b/test/server-side-rendering/index.ts
@@ -13,6 +13,7 @@ import {
shouldUpdateExpected,
mkdirp
} from '../helpers';
+import { set_current_component } from '../../internal';
function tryToReadFile(file) {
try {
@@ -33,6 +34,10 @@ describe('ssr', () => {
return setupHtmlEqual();
});
+ let saved_window;
+ before(() => saved_window = global.window);
+ after(() => global.window = saved_window);
+
fs.readdirSync(`${__dirname}/samples`).forEach(dir => {
if (dir[0] === '.') return;
@@ -76,7 +81,9 @@ describe('ssr', () => {
if (css.code) fs.writeFileSync(`${dir}/_actual.css`, css.code);
try {
- assert.htmlEqual(html, expectedHtml);
+ (compileOptions.preserveComments
+ ? assert.htmlEqualWithComments
+ : assert.htmlEqual)(html, expectedHtml);
} catch (error) {
if (shouldUpdateExpected()) {
fs.writeFileSync(`${dir}/_expected.html`, html);
@@ -123,99 +130,112 @@ describe('ssr', () => {
showOutput(dir, { generate: 'ssr', format: 'cjs' });
err.stack += `\n\ncmd-click: ${path.relative(process.cwd(), dir)}/main.svelte`;
throw err;
+ } finally {
+ set_current_component(null);
}
});
});
// duplicate client-side tests, as far as possible
- fs.readdirSync('test/runtime/samples').forEach(dir => {
- if (dir[0] === '.') return;
+ runRuntimeSamples('runtime');
+ runRuntimeSamples('runtime-puppeteer');
- const config = loadConfig(`./runtime/samples/${dir}/_config.js`);
- const solo = config.solo || /\.solo/.test(dir);
+ function runRuntimeSamples(suite) {
+ fs.readdirSync(`test/${suite}/samples`).forEach(dir => {
+ if (dir[0] === '.') return;
- if (solo && process.env.CI) {
- throw new Error('Forgot to remove `solo: true` from test');
- }
+ const config = loadConfig(`./${suite}/samples/${dir}/_config.js`);
+ const solo = config.solo || /\.solo/.test(dir);
- if (config.skip_if_ssr) return;
+ if (solo && process.env.CI) {
+ throw new Error('Forgot to remove `solo: true` from test');
+ }
- (config.skip ? it.skip : solo ? it.only : it)(dir, () => {
- const cwd = path.resolve('test/runtime/samples', dir);
+ if (config.skip_if_ssr) return;
- cleanRequireCache();
+ (config.skip ? it.skip : solo ? it.only : it)(dir, () => {
+ const cwd = path.resolve(`test/${suite}/samples`, dir);
- delete global.window;
+ cleanRequireCache();
- const compileOptions = {
- sveltePath,
- ...config.compileOptions,
- generate: 'ssr',
- format: 'cjs'
- };
+ delete global.window;
- require('../../register')(compileOptions);
+ const compileOptions = {
+ sveltePath,
+ ...config.compileOptions,
+ generate: 'ssr',
+ format: 'cjs'
+ };
- glob('**/*.svelte', { cwd }).forEach(file => {
- if (file[0] === '_') return;
+ require('../../register')(compileOptions);
- const dir = `${cwd}/_output/ssr`;
- const out = `${dir}/${file.replace(/\.svelte$/, '.js')}`;
+ glob('**/*.svelte', { cwd }).forEach(file => {
+ if (file[0] === '_') return;
- if (fs.existsSync(out)) {
- fs.unlinkSync(out);
- }
+ const dir = `${cwd}/_output/ssr`;
+ const out = `${dir}/${file.replace(/\.svelte$/, '.js')}`;
- mkdirp(dir);
+ if (fs.existsSync(out)) {
+ fs.unlinkSync(out);
+ }
- try {
- const { js } = compile(
- fs.readFileSync(`${cwd}/${file}`, 'utf-8'),
- {
- ...compileOptions,
- filename: file
- }
- );
+ mkdirp(dir);
- fs.writeFileSync(out, js.code);
- } catch (err) {
- // do nothing
- }
- });
-
- try {
- if (config.before_test) config.before_test();
+ try {
+ const { js } = compile(
+ fs.readFileSync(`${cwd}/${file}`, 'utf-8'),
+ {
+ ...compileOptions,
+ filename: file
+ }
+ );
- const Component = require(`../runtime/samples/${dir}/main.svelte`).default;
- const { html } = Component.render(config.props, {
- store: (config.store !== true) && config.store
+ fs.writeFileSync(out, js.code);
+ } catch (err) {
+ // do nothing
+ }
});
- if (config.ssrHtml) {
- assert.htmlEqual(html, config.ssrHtml);
- } else if (config.html) {
- assert.htmlEqual(html, config.html);
- }
+ try {
+ if (config.before_test) config.before_test();
- if (config.after_test) config.after_test();
+ const Component = require(`../${suite}/samples/${dir}/main.svelte`).default;
+ const { html } = Component.render(config.props, {
+ store: (config.store !== true) && config.store
+ });
- if (config.show) {
- showOutput(cwd, compileOptions);
- }
- } catch (err) {
- err.stack += `\n\ncmd-click: ${path.relative(process.cwd(), cwd)}/main.svelte`;
+ if (config.ssrHtml) {
+ assert.htmlEqual(html, config.ssrHtml);
+ } else if (config.html) {
+ assert.htmlEqual(html, config.html);
+ }
+
+ if (config.test_ssr) {
+ config.test_ssr({ assert });
+ }
+
+ if (config.after_test) config.after_test();
+
+ if (config.show) {
+ showOutput(cwd, compileOptions);
+ }
+ } catch (err) {
+ err.stack += `\n\ncmd-click: ${path.relative(process.cwd(), cwd)}/main.svelte`;
- if (config.error) {
- if (typeof config.error === 'function') {
- config.error(assert, err);
+ if (config.error) {
+ if (typeof config.error === 'function') {
+ config.error(assert, err);
+ } else {
+ assert.equal(err.message, config.error);
+ }
} else {
- assert.equal(err.message, config.error);
+ showOutput(cwd, compileOptions);
+ throw err;
}
- } else {
- showOutput(cwd, compileOptions);
- throw err;
+ } finally {
+ set_current_component(null);
}
- }
+ });
});
- });
+ }
});
diff --git a/test/server-side-rendering/samples/attribute-escape-quotes-spread-2/_expected.html b/test/server-side-rendering/samples/attribute-escape-quotes-spread-2/_expected.html
new file mode 100644
index 0000000000..b3970f88ba
--- /dev/null
+++ b/test/server-side-rendering/samples/attribute-escape-quotes-spread-2/_expected.html
@@ -0,0 +1,5 @@
+
\ No newline at end of file
diff --git a/test/server-side-rendering/samples/attribute-escape-quotes-spread-2/main.svelte b/test/server-side-rendering/samples/attribute-escape-quotes-spread-2/main.svelte
new file mode 100644
index 0000000000..22f5526f3e
--- /dev/null
+++ b/test/server-side-rendering/samples/attribute-escape-quotes-spread-2/main.svelte
@@ -0,0 +1,10 @@
+
+
+
\ No newline at end of file
diff --git a/test/server-side-rendering/samples/attribute-escaped-quotes-spread/_expected.html b/test/server-side-rendering/samples/attribute-escaped-quotes-spread/_expected.html
index bc31ce8bc3..b3970f88ba 100644
--- a/test/server-side-rendering/samples/attribute-escaped-quotes-spread/_expected.html
+++ b/test/server-side-rendering/samples/attribute-escaped-quotes-spread/_expected.html
@@ -1,4 +1,5 @@
\ No newline at end of file
diff --git a/test/server-side-rendering/samples/attribute-escaped-quotes-spread/main.svelte b/test/server-side-rendering/samples/attribute-escaped-quotes-spread/main.svelte
index ff6c15981d..66047eb09a 100644
--- a/test/server-side-rendering/samples/attribute-escaped-quotes-spread/main.svelte
+++ b/test/server-side-rendering/samples/attribute-escaped-quotes-spread/main.svelte
@@ -2,7 +2,8 @@
export let props = {
foo: '">
diff --git a/test/server-side-rendering/samples/attribute-spread-with-null/_expected.html b/test/server-side-rendering/samples/attribute-spread-with-null/_expected.html
new file mode 100644
index 0000000000..281c6866c3
--- /dev/null
+++ b/test/server-side-rendering/samples/attribute-spread-with-null/_expected.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/test/server-side-rendering/samples/attribute-spread-with-null/main.svelte b/test/server-side-rendering/samples/attribute-spread-with-null/main.svelte
new file mode 100644
index 0000000000..adfa9e6919
--- /dev/null
+++ b/test/server-side-rendering/samples/attribute-spread-with-null/main.svelte
@@ -0,0 +1,5 @@
+
+
+
\ No newline at end of file
diff --git a/test/server-side-rendering/samples/bindings-empty-string/_expected.html b/test/server-side-rendering/samples/bindings-empty-string/_expected.html
new file mode 100644
index 0000000000..8344e198fa
--- /dev/null
+++ b/test/server-side-rendering/samples/bindings-empty-string/_expected.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/test/server-side-rendering/samples/bindings-empty-string/main.svelte b/test/server-side-rendering/samples/bindings-empty-string/main.svelte
new file mode 100644
index 0000000000..7257d0f85e
--- /dev/null
+++ b/test/server-side-rendering/samples/bindings-empty-string/main.svelte
@@ -0,0 +1,5 @@
+
+
+
\ No newline at end of file
diff --git a/test/server-side-rendering/samples/bindings-group/_expected.html b/test/server-side-rendering/samples/bindings-group/_expected.html
new file mode 100644
index 0000000000..06d4242b07
--- /dev/null
+++ b/test/server-side-rendering/samples/bindings-group/_expected.html
@@ -0,0 +1,5 @@
+Cheese
+
+
+
+
diff --git a/test/server-side-rendering/samples/bindings-group/main.svelte b/test/server-side-rendering/samples/bindings-group/main.svelte
new file mode 100644
index 0000000000..a88d3fb200
--- /dev/null
+++ b/test/server-side-rendering/samples/bindings-group/main.svelte
@@ -0,0 +1,12 @@
+
+
+{fillings.toString()}
+
+
+
+
+
+
diff --git a/test/server-side-rendering/samples/bindings-zero/_expected.html b/test/server-side-rendering/samples/bindings-zero/_expected.html
new file mode 100644
index 0000000000..d634c4b80f
--- /dev/null
+++ b/test/server-side-rendering/samples/bindings-zero/_expected.html
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/test/server-side-rendering/samples/bindings-zero/main.svelte b/test/server-side-rendering/samples/bindings-zero/main.svelte
new file mode 100644
index 0000000000..5689bb8d9c
--- /dev/null
+++ b/test/server-side-rendering/samples/bindings-zero/main.svelte
@@ -0,0 +1,6 @@
+
+
+
+
\ No newline at end of file
diff --git a/test/server-side-rendering/samples/comment-preserve/_config.js b/test/server-side-rendering/samples/comment-preserve/_config.js
new file mode 100644
index 0000000000..f440f86013
--- /dev/null
+++ b/test/server-side-rendering/samples/comment-preserve/_config.js
@@ -0,0 +1,5 @@
+export default {
+ compileOptions: {
+ preserveComments: true
+ }
+};
diff --git a/test/server-side-rendering/samples/comment-preserve/_expected.html b/test/server-side-rendering/samples/comment-preserve/_expected.html
new file mode 100644
index 0000000000..8ecd344816
--- /dev/null
+++ b/test/server-side-rendering/samples/comment-preserve/_expected.html
@@ -0,0 +1,3 @@
+before
+
+after
diff --git a/test/server-side-rendering/samples/comment-preserve/main.svelte b/test/server-side-rendering/samples/comment-preserve/main.svelte
new file mode 100644
index 0000000000..8ecd344816
--- /dev/null
+++ b/test/server-side-rendering/samples/comment-preserve/main.svelte
@@ -0,0 +1,3 @@
+before
+
+after
diff --git a/test/server-side-rendering/samples/constructor-prefer-passed-context/ChildComponent.svelte b/test/server-side-rendering/samples/constructor-prefer-passed-context/ChildComponent.svelte
new file mode 100644
index 0000000000..af77418a1f
--- /dev/null
+++ b/test/server-side-rendering/samples/constructor-prefer-passed-context/ChildComponent.svelte
@@ -0,0 +1,6 @@
+
+
+Value in child component: {value}
diff --git a/test/server-side-rendering/samples/constructor-prefer-passed-context/_expected.html b/test/server-side-rendering/samples/constructor-prefer-passed-context/_expected.html
new file mode 100644
index 0000000000..d9a67c64e9
--- /dev/null
+++ b/test/server-side-rendering/samples/constructor-prefer-passed-context/_expected.html
@@ -0,0 +1 @@
+Value in child component: undefined
diff --git a/test/server-side-rendering/samples/constructor-prefer-passed-context/main.svelte b/test/server-side-rendering/samples/constructor-prefer-passed-context/main.svelte
new file mode 100644
index 0000000000..eaf89dd813
--- /dev/null
+++ b/test/server-side-rendering/samples/constructor-prefer-passed-context/main.svelte
@@ -0,0 +1,10 @@
+
+
+{@html content}
diff --git a/test/server-side-rendering/samples/spread-attributes-white-space/_expected.html b/test/server-side-rendering/samples/spread-attributes-white-space/_expected.html
index a73bb17e8c..24473a7b12 100644
--- a/test/server-side-rendering/samples/spread-attributes-white-space/_expected.html
+++ b/test/server-side-rendering/samples/spread-attributes-white-space/_expected.html
@@ -2,7 +2,4 @@
bar
">
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/test/setup.js b/test/setup.js
index 7406a07dd9..74250c10eb 100644
--- a/test/setup.js
+++ b/test/setup.js
@@ -12,7 +12,7 @@ require.extensions['.js'] = function(module, filename) {
.replace(/^import (\w+) from ['"]([^'"]+)['"];?/gm, 'var {default: $1} = require("$2");')
.replace(/^import {([^}]+)} from ['"](.+)['"];?/gm, 'var {$1} = require("$2");')
.replace(/^export default /gm, 'exports.default = ')
- .replace(/^export (const|let|var|class|function) (\w+)/gm, (match, type, name) => {
+ .replace(/^export (const|let|var|class|function|async\s+function) (\w+)/gm, (match, type, name) => {
exports.push(name);
return `${type} ${name}`;
})
diff --git a/test/sourcemaps/helpers.ts b/test/sourcemaps/helpers.ts
new file mode 100644
index 0000000000..f546566a95
--- /dev/null
+++ b/test/sourcemaps/helpers.ts
@@ -0,0 +1,127 @@
+import * as assert from 'assert';
+import { getLocator } from 'locate-character';
+import MagicString, { Bundle } from 'magic-string';
+
+type AssertMappedParameters = {
+ code: string;
+ filename?: string;
+ input: string | ReturnType;
+ input_code?: string;
+ preprocessed: any;
+};
+
+export function assert_mapped(
+ { code, filename, input, input_code, preprocessed }: AssertMappedParameters
+) {
+ const locate_input = typeof input === 'function' ? input : getLocator(input);
+ if (filename === undefined) filename = 'input.svelte';
+ if (input_code === undefined) input_code = code;
+
+ const source_loc = locate_input(input_code);
+ assert.notEqual(
+ source_loc,
+ undefined,
+ `failed to locate "${input_code}" in "${filename}"`
+ );
+
+ const transformed_loc = preprocessed.locate_1(code);
+ assert.notEqual(
+ transformed_loc,
+ undefined,
+ `failed to locate "${code}" in transformed "${filename}"`
+ );
+
+ assert.deepEqual(
+ preprocessed.mapConsumer.originalPositionFor(transformed_loc),
+ {
+ source: filename,
+ name: null,
+ line: source_loc.line + 1,
+ column: source_loc.column
+ },
+ `incorrect mappings for "${input_code}" in "${filename}"`
+ );
+}
+
+type AssertNotMappedParameters = {
+ code: string;
+ filename?: string;
+ preprocessed: any;
+};
+
+export function assert_not_mapped(
+ { code, filename, preprocessed }: AssertNotMappedParameters
+) {
+ if (filename === undefined) filename = 'input.svelte';
+
+ const transformed_loc = preprocessed.locate_1(code);
+ assert.notEqual(
+ transformed_loc,
+ undefined,
+ `failed to locate "${code}" in transformed "${filename}"`
+ );
+
+ assert.deepEqual(
+ preprocessed.mapConsumer.originalPositionFor(transformed_loc),
+ {
+ source: null,
+ name: null,
+ line: null,
+ column: null
+ },
+ `incorrect mappings for "${code}" in "${filename}"`
+ );
+}
+
+export function assert_not_located(
+ code: string,
+ locate: ReturnType,
+ filename = 'input.svelte'
+) {
+ assert.equal(
+ locate(code),
+ undefined,
+ `located "${code}" that should be removed from ${filename}`
+ );
+}
+
+export function magic_string_bundle(
+ inputs: Array<{ code: string | MagicString, filename: string }>,
+ filename = 'bundle.js',
+ separator = '\n'
+) {
+ const bundle = new Bundle({ separator });
+ inputs.forEach(({ code, filename }) => {
+ bundle.addSource({
+ filename,
+ content: typeof code === 'string' ? new MagicString(code) : code
+ });
+ });
+ return {
+ code: bundle.toString(),
+ map: bundle.generateMap({
+ source: filename,
+ hires: true,
+ includeContent: false
+ })
+ };
+}
+
+export function magic_string_preprocessor_result(filename: string, src: MagicString) {
+ return {
+ code: src.toString(),
+ map: src.generateMap({
+ source: filename,
+ hires: true,
+ includeContent: false
+ })
+ };
+}
+
+export function magic_string_replace_all(src: MagicString, search: string, replace: string) {
+ let idx = src.original.indexOf(search);
+ if (idx == -1) throw new Error('search not found in src');
+ do {
+ src.overwrite(idx, idx + search.length, replace, { storeName: true });
+ } while ((idx = src.original.indexOf(search, idx + 1)) != -1);
+}
diff --git a/test/sourcemaps/index.ts b/test/sourcemaps/index.ts
index 2302685bae..fc021cd6a7 100644
--- a/test/sourcemaps/index.ts
+++ b/test/sourcemaps/index.ts
@@ -1,73 +1,120 @@
import * as fs from 'fs';
import * as path from 'path';
import * as assert from 'assert';
-import { svelte } from '../helpers';
-import { SourceMapConsumer } from 'source-map';
+import { loadConfig, svelte } from '../helpers';
+// keep source-map at version 0.7.x
+// https://github.com/mozilla/source-map/issues/400
import { getLocator } from 'locate-character';
+import { SourceMapConsumer } from 'source-map';
+
describe('sourcemaps', () => {
fs.readdirSync(`${__dirname}/samples`).forEach(dir => {
if (dir[0] === '.') return;
+ const config = loadConfig(`${__dirname}/samples/${dir}/_config.js`);
+
// add .solo to a sample directory name to only run that test
- const solo = /\.solo/.test(dir);
- const skip = /\.skip/.test(dir);
+ const solo = config.solo || /\.solo/.test(dir);
+ const skip = config.skip || /\.skip/.test(dir);
if (solo && process.env.CI) {
throw new Error('Forgot to remove `solo: true` from test');
}
(solo ? it.only : skip ? it.skip : it)(dir, async () => {
- const filename = path.resolve(
- `${__dirname}/samples/${dir}/input.svelte`
- );
- const outputFilename = path.resolve(
- `${__dirname}/samples/${dir}/output`
+ const { test } = require(`./samples/${dir}/test.js`);
+ const inputFile = path.resolve(`${__dirname}/samples/${dir}/input.svelte`);
+ const outputName = '_actual';
+ const outputBase = path.resolve(`${__dirname}/samples/${dir}/${outputName}`);
+
+ const inputCode = fs.readFileSync(inputFile, 'utf-8');
+ const input = {
+ code: inputCode,
+ locate: getLocator(inputCode),
+ locate_1: getLocator(inputCode, { offsetLine: 1 })
+ };
+
+ const preprocessed = await svelte.preprocess(
+ input.code,
+ config.preprocess || {},
+ config.options || {
+ filename: 'input.svelte'
+ }
);
- const input = fs.readFileSync(filename, 'utf-8').replace(/\s+$/, '');
- const { js, css } = svelte.compile(input, {
- filename,
- outputFilename: `${outputFilename}.js`,
- cssOutputFilename: `${outputFilename}.css`
+ const { js, css } = svelte.compile(
+ preprocessed.code, {
+ filename: 'input.svelte',
+ // filenames for sourcemaps
+ sourcemap: preprocessed.map,
+ outputFilename: `${outputName}.js`,
+ cssOutputFilename: `${outputName}.css`,
+ ...(config.compile_options || {})
});
- const _code = js.code.replace(/Svelte v\d+\.\d+\.\d+/, match => match.replace(/\d/g, 'x'));
+ js.code = js.code.replace(
+ /generated by Svelte v\d+\.\d+\.\d+/,
+ match => match.replace(/\d/g, 'x')
+ );
+ fs.writeFileSync(`${outputBase}.svelte`, preprocessed.code);
+ if (preprocessed.map) {
+ fs.writeFileSync(
+ `${outputBase}.svelte.map`,
+ // TODO encode mappings for output - svelte.preprocess returns decoded mappings
+ JSON.stringify(preprocessed.map, null, 2)
+ );
+ }
fs.writeFileSync(
- `${outputFilename}.js`,
- `${_code}\n//# sourceMappingURL=output.js.map`
+ `${outputBase}.js`,
+ `${js.code}\n//# sourceMappingURL=${outputName}.js.map`
);
fs.writeFileSync(
- `${outputFilename}.js.map`,
- JSON.stringify(js.map, null, ' ')
+ `${outputBase}.js.map`,
+ JSON.stringify(js.map, null, 2)
);
-
if (css.code) {
fs.writeFileSync(
- `${outputFilename}.css`,
- `${css.code}\n/*# sourceMappingURL=output.css.map */`
+ `${outputBase}.css`,
+ `${css.code}\n/*# sourceMappingURL=${outputName}.css.map */`
);
fs.writeFileSync(
- `${outputFilename}.css.map`,
+ `${outputBase}.css.map`,
JSON.stringify(css.map, null, ' ')
);
}
- assert.deepEqual(js.map.sources, ['input.svelte']);
- if (css.map) assert.deepEqual(css.map.sources, ['input.svelte']);
-
- const { test } = require(`./samples/${dir}/test.js`);
+ if (js.map) {
+ assert.deepEqual(
+ js.map.sources.slice().sort(),
+ (config.js_map_sources || ['input.svelte']).sort(),
+ 'js.map.sources is wrong'
+ );
+ }
+ if (css.map) {
+ assert.deepEqual(
+ css.map.sources.slice().sort(),
+ (config.css_map_sources || ['input.svelte']).sort(),
+ 'css.map.sources is wrong'
+ );
+ }
- const locateInSource = getLocator(input);
+ // use locate_1 with mapConsumer:
+ // lines are one-based, columns are zero-based
- const smc = await new SourceMapConsumer(js.map);
- const locateInGenerated = getLocator(_code);
+ preprocessed.mapConsumer = preprocessed.map && await new SourceMapConsumer(preprocessed.map);
+ preprocessed.locate = getLocator(preprocessed.code);
+ preprocessed.locate_1 = getLocator(preprocessed.code, { offsetLine: 1 });
- const smcCss = css.map && await new SourceMapConsumer(css.map);
- const locateInGeneratedCss = getLocator(css.code || '');
+ js.mapConsumer = js.map && await new SourceMapConsumer(js.map);
+ js.locate = getLocator(js.code);
+ js.locate_1 = getLocator(js.code, { offsetLine: 1 });
- test({ assert, code: _code, map: js.map, smc, smcCss, locateInSource, locateInGenerated, locateInGeneratedCss });
+ css.mapConsumer = css.map && await new SourceMapConsumer(css.map);
+ css.locate = getLocator(css.code || '');
+ css.locate_1 = getLocator(css.code || '', { offsetLine: 1 });
+ await test({ assert, input, preprocessed, js, css });
});
});
});
diff --git a/test/sourcemaps/samples/attached-sourcemap/_config.js b/test/sourcemaps/samples/attached-sourcemap/_config.js
new file mode 100644
index 0000000000..86498caeba
--- /dev/null
+++ b/test/sourcemaps/samples/attached-sourcemap/_config.js
@@ -0,0 +1,44 @@
+import MagicString from 'magic-string';
+
+let indent_size = 4;
+let comment_multi = true;
+function get_processor(tag_name, search, replace) {
+ return {
+ [tag_name]: ({ content, filename }) => {
+ let code = content.slice();
+ const ms = new MagicString(code);
+
+ const idx = ms.original.indexOf(search);
+ if (idx == -1) throw new Error('search not found in src');
+ ms.overwrite(idx, idx + search.length, replace, { storeName: true });
+
+ // change line + column
+ const indent = Array.from({ length: indent_size }).join(' ');
+ ms.prependLeft(idx, '\n' + indent);
+
+ const map_opts = { source: filename, hires: true, includeContent: false };
+ const map = ms.generateMap(map_opts);
+ const attach_line = (tag_name == 'style' || comment_multi)
+ ? `\n/*# sourceMappingURL=${map.toUrl()} */`
+ : `\n//# sourceMappingURL=${map.toUrl()}` // only in script
+ ;
+ code = ms.toString() + attach_line;
+
+ indent_size += 2;
+ if (tag_name == 'script') comment_multi = !comment_multi;
+ return { code };
+ }
+ };
+}
+
+export default {
+ preprocess: [
+
+ get_processor('script', 'replace_me_script', 'done_replace_script_1'),
+ get_processor('script', 'done_replace_script_1', 'done_replace_script_2'),
+
+ get_processor('style', '.replace_me_style', '.done_replace_style_1'),
+ get_processor('style', '.done_replace_style_1', '.done_replace_style_2')
+
+ ]
+};
diff --git a/test/sourcemaps/samples/attached-sourcemap/input.svelte b/test/sourcemaps/samples/attached-sourcemap/input.svelte
new file mode 100644
index 0000000000..21a47a72a9
--- /dev/null
+++ b/test/sourcemaps/samples/attached-sourcemap/input.svelte
@@ -0,0 +1,11 @@
+
+
+{done_replace_script_2}
diff --git a/test/sourcemaps/samples/attached-sourcemap/test.js b/test/sourcemaps/samples/attached-sourcemap/test.js
new file mode 100644
index 0000000000..ecb88ab11d
--- /dev/null
+++ b/test/sourcemaps/samples/attached-sourcemap/test.js
@@ -0,0 +1,45 @@
+import * as assert from 'assert';
+
+const get_line_column = obj => ({ line: obj.line, column: obj.column });
+
+export function test({ input, css, js }) {
+
+ let out_obj, loc_output, actual, loc_input, expected;
+
+ out_obj = js;
+ // we need the second occurrence of 'done_replace_script_2' in output.js
+ // the first occurrence is mapped back to markup '{done_replace_script_2}'
+ loc_output = out_obj.locate_1('done_replace_script_2');
+ loc_output = out_obj.locate_1('done_replace_script_2', loc_output.character + 1);
+ actual = out_obj.mapConsumer.originalPositionFor(loc_output);
+ loc_input = input.locate_1('replace_me_script');
+ expected = {
+ source: 'input.svelte',
+ name: 'replace_me_script',
+ ...get_line_column(loc_input)
+ };
+ assert.deepEqual(actual, expected);
+
+ out_obj = css;
+ loc_output = out_obj.locate_1('.done_replace_style_2');
+ actual = out_obj.mapConsumer.originalPositionFor(loc_output);
+ loc_input = input.locate_1('.replace_me_style');
+ expected = {
+ source: 'input.svelte',
+ name: '.replace_me_style',
+ ...get_line_column(loc_input)
+ };
+ assert.deepEqual(actual, expected);
+
+ assert.equal(
+ js.code.indexOf('\n/*# sourceMappingURL=data:application/json;base64,'),
+ -1,
+ 'magic-comment attachments were NOT removed'
+ );
+
+ assert.equal(
+ css.code.indexOf('\n/*# sourceMappingURL=data:application/json;base64,'),
+ -1,
+ 'magic-comment attachments were NOT removed'
+ );
+}
diff --git a/test/sourcemaps/samples/basic/test.js b/test/sourcemaps/samples/basic/test.js
index 7059761674..34c619c128 100644
--- a/test/sourcemaps/samples/basic/test.js
+++ b/test/sourcemaps/samples/basic/test.js
@@ -1,12 +1,12 @@
-export function test({ assert, smc, locateInSource, locateInGenerated }) {
- const expected = locateInSource('foo.bar.baz');
+export function test({ assert, input, js }) {
+ const expected = input.locate('foo.bar.baz');
let start;
let actual;
- start = locateInGenerated('ctx[0].bar.baz');
+ start = js.locate('ctx[0].bar.baz');
- actual = smc.originalPositionFor({
+ actual = js.mapConsumer.originalPositionFor({
line: start.line + 1,
column: start.column
});
@@ -18,9 +18,9 @@ export function test({ assert, smc, locateInSource, locateInGenerated }) {
column: expected.column
});
- start = locateInGenerated('ctx[0].bar.baz', start.character + 1);
+ start = js.locate('ctx[0].bar.baz', start.character + 1);
- actual = smc.originalPositionFor({
+ actual = js.mapConsumer.originalPositionFor({
line: start.line + 1,
column: start.column
});
diff --git a/test/sourcemaps/samples/binding-shorthand.skip/test.js b/test/sourcemaps/samples/binding-shorthand.skip/test.js
index cdfbbdc091..13ecdbf889 100644
--- a/test/sourcemaps/samples/binding-shorthand.skip/test.js
+++ b/test/sourcemaps/samples/binding-shorthand.skip/test.js
@@ -1,13 +1,14 @@
-export function test({ assert, smc, locateInSource, locateInGenerated }) {
- const expected = locateInSource('potato');
+export function test({ assert, input, js }) {
+ const expected = input.locate('potato');
let start;
- start = locateInGenerated('potato');
- start = locateInGenerated('potato', start.character + 1);
- start = locateInGenerated('potato', start.character + 1); // we need the third instance of 'potato'
+ start = js.locate('potato');
+ start = js.locate('potato', start.character + 1);
+ start = js.locate('potato', start.character + 1);
+ // we need the third instance of 'potato'
- const actual = smc.originalPositionFor({
+ const actual = js.mapConsumer.originalPositionFor({
line: start.line + 1,
column: start.column
});
diff --git a/test/sourcemaps/samples/binding/test.js b/test/sourcemaps/samples/binding/test.js
index 31c0e98442..3cb3246e50 100644
--- a/test/sourcemaps/samples/binding/test.js
+++ b/test/sourcemaps/samples/binding/test.js
@@ -1,12 +1,12 @@
-export function test({ assert, smc, locateInSource, locateInGenerated }) {
- const expected = locateInSource('bar.baz');
+export function test({ assert, input, js }) {
+ const expected = input.locate('bar.baz');
let start;
let actual;
- start = locateInGenerated('bar.baz');
+ start = js.locate('bar.baz');
- actual = smc.originalPositionFor({
+ actual = js.mapConsumer.originalPositionFor({
line: start.line + 1,
column: start.column
});
@@ -18,9 +18,9 @@ export function test({ assert, smc, locateInSource, locateInGenerated }) {
column: expected.column
});
- start = locateInGenerated('bar.baz', start.character + 1);
+ start = js.locate('bar.baz', start.character + 1);
- actual = smc.originalPositionFor({
+ actual = js.mapConsumer.originalPositionFor({
line: start.line + 1,
column: start.column
});
diff --git a/test/sourcemaps/samples/compile-option-dev/_config.js b/test/sourcemaps/samples/compile-option-dev/_config.js
new file mode 100644
index 0000000000..b6ea851b6d
--- /dev/null
+++ b/test/sourcemaps/samples/compile-option-dev/_config.js
@@ -0,0 +1,21 @@
+import MagicString from 'magic-string';
+import { magic_string_preprocessor_result, magic_string_replace_all } from '../../helpers';
+
+export default {
+ compile_options: {
+ dev: true
+ },
+ preprocess: [
+ { style: ({ content, filename }) => {
+ const src = new MagicString(content);
+ magic_string_replace_all(src, '--replace-me-once', '\n --done-replace-once');
+ magic_string_replace_all(src, '--replace-me-twice', '\n--almost-done-replace-twice');
+ return magic_string_preprocessor_result(filename, src);
+ } },
+ { style: ({ content, filename }) => {
+ const src = new MagicString(content);
+ magic_string_replace_all(src, '--almost-done-replace-twice', '\n --done-replace-twice');
+ return magic_string_preprocessor_result(filename, src);
+ } }
+ ]
+};
diff --git a/test/sourcemaps/samples/compile-option-dev/input.svelte b/test/sourcemaps/samples/compile-option-dev/input.svelte
new file mode 100644
index 0000000000..6d5f91158d
--- /dev/null
+++ b/test/sourcemaps/samples/compile-option-dev/input.svelte
@@ -0,0 +1,15 @@
+Testing Styles
+Testing Styles 2
+Testing Styles 3
+
+
diff --git a/test/sourcemaps/samples/compile-option-dev/test.js b/test/sourcemaps/samples/compile-option-dev/test.js
new file mode 100644
index 0000000000..f169ab8832
--- /dev/null
+++ b/test/sourcemaps/samples/compile-option-dev/test.js
@@ -0,0 +1,40 @@
+import { SourceMapConsumer } from 'source-map';
+
+const b64dec = s => Buffer.from(s, 'base64').toString();
+
+export async function test({ assert, css, js }) {
+
+ // We check that the css source map embedded in the js is accurate
+ const match = js.code.match(/\tappend_styles\(target, "svelte-.{6}", "(.*?)(?:\\n\/\*# sourceMappingURL=data:(.*?);charset=(.*?);base64,(.*?) \*\/)?"\);\n/);
+ assert.notEqual(match, null);
+
+ const [mimeType, encoding, cssMapBase64] = match.slice(2);
+ assert.equal(mimeType, 'application/json');
+ assert.equal(encoding, 'utf-8');
+
+ const cssMapJson = b64dec(cssMapBase64);
+ css.mapConsumer = await new SourceMapConsumer(cssMapJson);
+
+ // TODO make util fn + move to test index.js
+ const sourcefile = 'input.svelte';
+ [
+ // TODO how to get line + column numbers?
+ [css, '--keep-me', 13, 2],
+ [css, '--done-replace-once', 6, 5],
+ [css, '--done-replace-twice', 9, 5]
+ ]
+ .forEach(([where, content, line, column]) => {
+ assert.deepEqual(
+ where.mapConsumer.originalPositionFor(
+ where.locate_1(content)
+ ),
+ {
+ source: sourcefile,
+ name: null,
+ line,
+ column
+ },
+ `failed to locate "${content}" from "${sourcefile}"`
+ );
+ });
+}
diff --git a/test/sourcemaps/samples/css/test.js b/test/sourcemaps/samples/css/test.js
index 54082bd4ee..1e0dda1dff 100644
--- a/test/sourcemaps/samples/css/test.js
+++ b/test/sourcemaps/samples/css/test.js
@@ -1,14 +1,14 @@
-export function test({ assert, smcCss, locateInSource, locateInGeneratedCss }) {
- const expected = locateInSource( '.foo' );
+export function test({ assert, input, css }) {
+ const expected = input.locate('.foo');
- const start = locateInGeneratedCss( '.foo' );
+ const start = css.locate('.foo');
- const actual = smcCss.originalPositionFor({
+ const actual = css.mapConsumer.originalPositionFor({
line: start.line + 1,
column: start.column
});
- assert.deepEqual( actual, {
+ assert.deepEqual(actual, {
source: 'input.svelte',
name: null,
line: expected.line + 1,
diff --git a/test/sourcemaps/samples/decoded-sourcemap/_config.js b/test/sourcemaps/samples/decoded-sourcemap/_config.js
new file mode 100644
index 0000000000..a0b2c82692
--- /dev/null
+++ b/test/sourcemaps/samples/decoded-sourcemap/_config.js
@@ -0,0 +1,15 @@
+import MagicString from 'magic-string';
+import { magic_string_preprocessor_result, magic_string_replace_all } from '../../helpers';
+
+export default {
+
+ js_map_sources: ['input.svelte'],
+
+ preprocess: {
+ markup: ({ content, filename }) => {
+ const src = new MagicString(content);
+ magic_string_replace_all(src, 'replace me', 'success');
+ return magic_string_preprocessor_result(filename, src);
+ }
+ }
+};
diff --git a/test/sourcemaps/samples/decoded-sourcemap/input.svelte b/test/sourcemaps/samples/decoded-sourcemap/input.svelte
new file mode 100644
index 0000000000..b233d7f670
--- /dev/null
+++ b/test/sourcemaps/samples/decoded-sourcemap/input.svelte
@@ -0,0 +1,2 @@
+decoded-sourcemap
+replace me
diff --git a/test/sourcemaps/samples/decoded-sourcemap/test.js b/test/sourcemaps/samples/decoded-sourcemap/test.js
new file mode 100644
index 0000000000..5a44ee83cf
--- /dev/null
+++ b/test/sourcemaps/samples/decoded-sourcemap/test.js
@@ -0,0 +1,19 @@
+export function test({ assert, input, preprocessed }) {
+
+ const expected = input.locate('replace me');
+
+ const start = preprocessed.locate('success');
+
+ const actualbar = preprocessed.mapConsumer.originalPositionFor({
+ line: start.line + 1,
+ column: start.column
+ });
+
+ assert.deepEqual(actualbar, {
+ source: 'input.svelte',
+ name: 'replace me',
+ line: expected.line + 1,
+ column: expected.column
+ });
+
+}
diff --git a/test/sourcemaps/samples/each-block/test.js b/test/sourcemaps/samples/each-block/test.js
index 35479986a5..08b37686a4 100644
--- a/test/sourcemaps/samples/each-block/test.js
+++ b/test/sourcemaps/samples/each-block/test.js
@@ -1,10 +1,10 @@
-export function test({ assert, code, smc, map, locateInSource, locateInGenerated }) {
- const startIndex = code.indexOf('create_main_fragment');
+export function test({ assert, input, js }) {
+ const startIndex = js.code.indexOf('create_main_fragment');
- const expected = locateInSource('each');
- const start = locateInGenerated('length', startIndex);
+ const expected = input.locate('each');
+ const start = js.locate('length', startIndex);
- const actual = smc.originalPositionFor({
+ const actual = js.mapConsumer.originalPositionFor({
line: start.line + 1,
column: start.column
});
diff --git a/test/sourcemaps/samples/external/_config.js b/test/sourcemaps/samples/external/_config.js
new file mode 100644
index 0000000000..07a0903482
--- /dev/null
+++ b/test/sourcemaps/samples/external/_config.js
@@ -0,0 +1,24 @@
+import { magic_string_bundle } from '../../helpers';
+
+export const COMMON = ':global(html) { height: 100%; }\n';
+
+// TODO: removing '\n' breaks test
+// - _actual.svelte.map looks correct
+// - _actual.css.map adds reference to on input.svelte
+// - Most probably caused by bug in current magic-string version (fixed in 0.25.7)
+export const STYLES = '.awesome { color: orange; }\n';
+
+export default {
+ css_map_sources: ['common.scss', 'styles.scss'],
+ js_map_sources: ['input.svelte'],
+ preprocess: [
+ {
+ style: () => {
+ return magic_string_bundle([
+ { filename: 'common.scss', code: COMMON },
+ { filename: 'styles.scss', code: STYLES }
+ ]);
+ }
+ }
+ ]
+};
diff --git a/test/sourcemaps/samples/external/input.svelte b/test/sourcemaps/samples/external/input.svelte
new file mode 100644
index 0000000000..94d895e4a7
--- /dev/null
+++ b/test/sourcemaps/samples/external/input.svelte
@@ -0,0 +1,3 @@
+
+
+Divs ftw!
\ No newline at end of file
diff --git a/test/sourcemaps/samples/external/test.js b/test/sourcemaps/samples/external/test.js
new file mode 100644
index 0000000000..5193b62ba1
--- /dev/null
+++ b/test/sourcemaps/samples/external/test.js
@@ -0,0 +1,26 @@
+import { assert_mapped } from '../../helpers';
+import { COMMON, STYLES } from './_config';
+
+export function test({ input, preprocessed }) {
+ // Transformed script, main file
+ assert_mapped({
+ filename: 'input.svelte',
+ code: 'Divs ftw!',
+ input: input.locate,
+ preprocessed
+ });
+
+ // External files
+ assert_mapped({
+ filename: 'common.scss',
+ code: 'height: 100%;',
+ input: COMMON,
+ preprocessed
+ });
+ assert_mapped({
+ filename: 'styles.scss',
+ code: 'color: orange;',
+ input: STYLES,
+ preprocessed
+ });
+}
diff --git a/test/sourcemaps/samples/markup/input.svelte b/test/sourcemaps/samples/markup/input.svelte
new file mode 100644
index 0000000000..d5baaac693
--- /dev/null
+++ b/test/sourcemaps/samples/markup/input.svelte
@@ -0,0 +1,2 @@
+decoded-sourcemap
+replace me
\ No newline at end of file
diff --git a/test/sourcemaps/samples/markup/test.js b/test/sourcemaps/samples/markup/test.js
new file mode 100644
index 0000000000..2c6abfdf41
--- /dev/null
+++ b/test/sourcemaps/samples/markup/test.js
@@ -0,0 +1,34 @@
+export function test({ assert, input, js }) {
+ let expected;
+
+ let start;
+ let actual;
+
+ start = js.locate('insert(target, h1');
+ expected = input.locate('
+ export let foo;
+
+
+ {foo}
+
+
diff --git a/test/sourcemaps/samples/no-sourcemap/test.js b/test/sourcemaps/samples/no-sourcemap/test.js
new file mode 100644
index 0000000000..127459a54e
--- /dev/null
+++ b/test/sourcemaps/samples/no-sourcemap/test.js
@@ -0,0 +1,4 @@
+export function test({ assert, js, css }) {
+ assert.equal(js.map, null);
+ assert.equal(css.map, null);
+}
diff --git a/test/sourcemaps/samples/only-css-sourcemap/_config.js b/test/sourcemaps/samples/only-css-sourcemap/_config.js
new file mode 100644
index 0000000000..767e10a4b9
--- /dev/null
+++ b/test/sourcemaps/samples/only-css-sourcemap/_config.js
@@ -0,0 +1,5 @@
+export default {
+ compile_options: {
+ enableSourcemap: { css: true }
+ }
+};
diff --git a/test/sourcemaps/samples/only-css-sourcemap/input.svelte b/test/sourcemaps/samples/only-css-sourcemap/input.svelte
new file mode 100644
index 0000000000..6d39eaad0e
--- /dev/null
+++ b/test/sourcemaps/samples/only-css-sourcemap/input.svelte
@@ -0,0 +1,11 @@
+
+
+{foo}
+
+
diff --git a/test/sourcemaps/samples/only-css-sourcemap/test.js b/test/sourcemaps/samples/only-css-sourcemap/test.js
new file mode 100644
index 0000000000..a7ac6a9b0b
--- /dev/null
+++ b/test/sourcemaps/samples/only-css-sourcemap/test.js
@@ -0,0 +1,4 @@
+export function test({ assert, js, css }) {
+ assert.equal(js.map, null);
+ assert.notEqual(css.map, null);
+}
diff --git a/test/sourcemaps/samples/only-js-sourcemap/_config.js b/test/sourcemaps/samples/only-js-sourcemap/_config.js
new file mode 100644
index 0000000000..0b3b7987f1
--- /dev/null
+++ b/test/sourcemaps/samples/only-js-sourcemap/_config.js
@@ -0,0 +1,5 @@
+export default {
+ compile_options: {
+ enableSourcemap: { js: true }
+ }
+};
diff --git a/test/sourcemaps/samples/only-js-sourcemap/input.svelte b/test/sourcemaps/samples/only-js-sourcemap/input.svelte
new file mode 100644
index 0000000000..6d39eaad0e
--- /dev/null
+++ b/test/sourcemaps/samples/only-js-sourcemap/input.svelte
@@ -0,0 +1,11 @@
+
+
+{foo}
+
+
diff --git a/test/sourcemaps/samples/only-js-sourcemap/test.js b/test/sourcemaps/samples/only-js-sourcemap/test.js
new file mode 100644
index 0000000000..b150653c3d
--- /dev/null
+++ b/test/sourcemaps/samples/only-js-sourcemap/test.js
@@ -0,0 +1,4 @@
+export function test({ assert, js, css }) {
+ assert.notEqual(js.map, null);
+ assert.equal(css.map, null);
+}
diff --git a/test/sourcemaps/samples/preprocessed-markup/_config.js b/test/sourcemaps/samples/preprocessed-markup/_config.js
new file mode 100644
index 0000000000..0b2baeb49c
--- /dev/null
+++ b/test/sourcemaps/samples/preprocessed-markup/_config.js
@@ -0,0 +1,12 @@
+import MagicString from 'magic-string';
+import { magic_string_preprocessor_result, magic_string_replace_all } from '../../helpers';
+
+export default {
+ preprocess: {
+ markup: ({ content, filename }) => {
+ const src = new MagicString(content);
+ magic_string_replace_all(src, 'baritone', 'bar');
+ return magic_string_preprocessor_result(filename, src);
+ }
+ }
+};
diff --git a/test/sourcemaps/samples/preprocessed-markup/input.svelte b/test/sourcemaps/samples/preprocessed-markup/input.svelte
new file mode 100644
index 0000000000..ee4b90372a
--- /dev/null
+++ b/test/sourcemaps/samples/preprocessed-markup/input.svelte
@@ -0,0 +1,5 @@
+
+
+{foo.baritone.baz}
diff --git a/test/sourcemaps/samples/preprocessed-markup/test.js b/test/sourcemaps/samples/preprocessed-markup/test.js
new file mode 100644
index 0000000000..b587103969
--- /dev/null
+++ b/test/sourcemaps/samples/preprocessed-markup/test.js
@@ -0,0 +1,32 @@
+export function test({ assert, input, js }) {
+ const expectedBar = input.locate('baritone.baz');
+ const expectedBaz = input.locate('.baz');
+
+ let start = js.locate('bar.baz');
+
+ const actualbar = js.mapConsumer.originalPositionFor({
+ line: start.line + 1,
+ column: start.column
+ });
+
+ assert.deepEqual(actualbar, {
+ source: 'input.svelte',
+ name: 'baritone',
+ line: expectedBar.line + 1,
+ column: expectedBar.column
+ });
+
+ start = js.locate('.baz');
+
+ const actualbaz = js.mapConsumer.originalPositionFor({
+ line: start.line + 1,
+ column: start.column
+ });
+
+ assert.deepEqual(actualbaz, {
+ source: 'input.svelte',
+ name: null,
+ line: expectedBaz.line + 1,
+ column: expectedBaz.column
+ });
+}
diff --git a/test/sourcemaps/samples/preprocessed-multiple/_config.js b/test/sourcemaps/samples/preprocessed-multiple/_config.js
new file mode 100644
index 0000000000..39259a02a8
--- /dev/null
+++ b/test/sourcemaps/samples/preprocessed-multiple/_config.js
@@ -0,0 +1,25 @@
+import MagicString from 'magic-string';
+import { magic_string_preprocessor_result, magic_string_replace_all } from '../../helpers';
+
+export default {
+ preprocess: {
+ markup: ({ content, filename }) => {
+ const src = new MagicString(content);
+ magic_string_replace_all(src, 'baritone', 'bar');
+ magic_string_replace_all(src, '--bazitone', '--baz');
+ return magic_string_preprocessor_result(filename, src);
+ },
+ script: ({ content, filename }) => {
+ const src = new MagicString(content);
+ const idx = content.indexOf('bar');
+ src.prependLeft(idx, ' ');
+ return magic_string_preprocessor_result(filename, src);
+ },
+ style: ({ content, filename }) => {
+ const src = new MagicString(content);
+ const idx = content.indexOf('--baz');
+ src.prependLeft(idx, ' ');
+ return magic_string_preprocessor_result(filename, src);
+ }
+ }
+};
diff --git a/test/sourcemaps/samples/preprocessed-multiple/input.svelte b/test/sourcemaps/samples/preprocessed-multiple/input.svelte
new file mode 100644
index 0000000000..e656d399ae
--- /dev/null
+++ b/test/sourcemaps/samples/preprocessed-multiple/input.svelte
@@ -0,0 +1,9 @@
+
+
+multiple {foo}
diff --git a/test/sourcemaps/samples/preprocessed-multiple/test.js b/test/sourcemaps/samples/preprocessed-multiple/test.js
new file mode 100644
index 0000000000..a0cfe1fa8a
--- /dev/null
+++ b/test/sourcemaps/samples/preprocessed-multiple/test.js
@@ -0,0 +1,32 @@
+export function test({ assert, input, js, css }) {
+ const expectedBar = input.locate('baritone');
+ const expectedBaz = input.locate('--bazitone');
+
+ let start = js.locate('bar');
+
+ const actualbar = js.mapConsumer.originalPositionFor({
+ line: start.line + 1,
+ column: start.column
+ });
+
+ assert.deepEqual(actualbar, {
+ source: 'input.svelte',
+ name: 'baritone',
+ line: expectedBar.line + 1,
+ column: expectedBar.column
+ });
+
+ start = css.locate('--baz');
+
+ const actualbaz = css.mapConsumer.originalPositionFor({
+ line: start.line + 1,
+ column: start.column
+ });
+
+ assert.deepEqual(actualbaz, {
+ source: 'input.svelte',
+ name: '--bazitone',
+ line: expectedBaz.line + 1,
+ column: expectedBaz.column
+ });
+}
diff --git a/test/sourcemaps/samples/preprocessed-no-map/_config.js b/test/sourcemaps/samples/preprocessed-no-map/_config.js
new file mode 100644
index 0000000000..78b0ee626f
--- /dev/null
+++ b/test/sourcemaps/samples/preprocessed-no-map/_config.js
@@ -0,0 +1,15 @@
+export default {
+ css_map_sources: ['input.svelte'],
+ preprocess: [
+ {
+ style: ({ content }) => {
+ // Modified without source map
+ return { code: content + ' ' };
+ },
+ script: ({ content }) => {
+ // Not modified
+ return { code: content };
+ }
+ }
+ ]
+};
diff --git a/test/sourcemaps/samples/preprocessed-no-map/input.svelte b/test/sourcemaps/samples/preprocessed-no-map/input.svelte
new file mode 100644
index 0000000000..febfa5191b
--- /dev/null
+++ b/test/sourcemaps/samples/preprocessed-no-map/input.svelte
@@ -0,0 +1,13 @@
+
+
+
+ {name}
+
+
+
diff --git a/test/sourcemaps/samples/preprocessed-no-map/test.js b/test/sourcemaps/samples/preprocessed-no-map/test.js
new file mode 100644
index 0000000000..22286ae282
--- /dev/null
+++ b/test/sourcemaps/samples/preprocessed-no-map/test.js
@@ -0,0 +1,37 @@
+import { assert_mapped, assert_not_mapped } from '../../helpers';
+
+export function test({ input, preprocessed }) {
+ // markup (start)
+ assert_mapped({
+ code: '
+{foo.bar.baz}
diff --git a/test/sourcemaps/samples/preprocessed-script/test.js b/test/sourcemaps/samples/preprocessed-script/test.js
new file mode 100644
index 0000000000..20a366f6d2
--- /dev/null
+++ b/test/sourcemaps/samples/preprocessed-script/test.js
@@ -0,0 +1,32 @@
+export function test({ assert, input, js }) {
+ const expectedBar = input.locate('baritone:');
+ const expectedBaz = input.locate('baz:');
+
+ let start = js.locate('bar:');
+
+ const actualbar = js.mapConsumer.originalPositionFor({
+ line: start.line + 1,
+ column: start.column
+ });
+
+ assert.deepEqual(actualbar, {
+ source: 'input.svelte',
+ name: 'baritone',
+ line: expectedBar.line + 1,
+ column: expectedBar.column
+ }, "couldn't find bar: in source");
+
+ start = js.locate('baz:');
+
+ const actualbaz = js.mapConsumer.originalPositionFor({
+ line: start.line + 1,
+ column: start.column
+ });
+
+ assert.deepEqual(actualbaz, {
+ source: 'input.svelte',
+ name: null,
+ line: expectedBaz.line + 1,
+ column: expectedBaz.column
+ }, "couldn't find baz: in source");
+}
diff --git a/test/sourcemaps/samples/preprocessed-styles/_config.js b/test/sourcemaps/samples/preprocessed-styles/_config.js
new file mode 100644
index 0000000000..04c8bcda7a
--- /dev/null
+++ b/test/sourcemaps/samples/preprocessed-styles/_config.js
@@ -0,0 +1,12 @@
+import MagicString from 'magic-string';
+import { magic_string_preprocessor_result, magic_string_replace_all } from '../../helpers';
+
+export default {
+ preprocess: {
+ style: ({ content, filename }) => {
+ const src = new MagicString(content);
+ magic_string_replace_all(src, 'baritone', 'bar');
+ return magic_string_preprocessor_result(filename, src);
+ }
+ }
+};
diff --git a/test/sourcemaps/samples/preprocessed-styles/input.svelte b/test/sourcemaps/samples/preprocessed-styles/input.svelte
new file mode 100644
index 0000000000..0d942390f4
--- /dev/null
+++ b/test/sourcemaps/samples/preprocessed-styles/input.svelte
@@ -0,0 +1,12 @@
+Testing Styles
+Testing Styles 2
+
+
diff --git a/test/sourcemaps/samples/preprocessed-styles/test.js b/test/sourcemaps/samples/preprocessed-styles/test.js
new file mode 100644
index 0000000000..5b28a12514
--- /dev/null
+++ b/test/sourcemaps/samples/preprocessed-styles/test.js
@@ -0,0 +1,32 @@
+export function test({ assert, input, css }) {
+ const expectedBar = input.locate('--baritone');
+ const expectedBaz = input.locate('--baz');
+
+ let start = css.locate('--bar');
+
+ const actualbar = css.mapConsumer.originalPositionFor({
+ line: start.line + 1,
+ column: start.column
+ });
+
+ assert.deepEqual(actualbar, {
+ source: 'input.svelte',
+ name: null,
+ line: expectedBar.line + 1,
+ column: expectedBar.column
+ }, "couldn't find bar in source");
+
+ start = css.locate('--baz');
+
+ const actualbaz = css.mapConsumer.originalPositionFor({
+ line: start.line + 1,
+ column: start.column
+ });
+
+ assert.deepEqual(actualbaz, {
+ source: 'input.svelte',
+ name: null,
+ line: expectedBaz.line + 1,
+ column: expectedBaz.column
+ }, "couldn't find baz in source");
+}
diff --git a/test/sourcemaps/samples/script-after-comment/test.js b/test/sourcemaps/samples/script-after-comment/test.js
index b473970112..06ecc46929 100644
--- a/test/sourcemaps/samples/script-after-comment/test.js
+++ b/test/sourcemaps/samples/script-after-comment/test.js
@@ -1,13 +1,13 @@
-export function test({ assert, smc, locateInSource, locateInGenerated }) {
- const expected = locateInSource( 'assertThisLine' );
- const start = locateInGenerated( 'assertThisLine' );
+export function test({ assert, input, js }) {
+ const expected = input.locate('assertThisLine');
+ const start = js.locate('assertThisLine');
- const actual = smc.originalPositionFor({
+ const actual = js.mapConsumer.originalPositionFor({
line: start.line + 1,
column: start.column
});
- assert.deepEqual( actual, {
+ assert.deepEqual(actual, {
source: 'input.svelte',
name: null,
line: expected.line + 1,
diff --git a/test/sourcemaps/samples/script/test.js b/test/sourcemaps/samples/script/test.js
index 73971ef487..e6a91f51e1 100644
--- a/test/sourcemaps/samples/script/test.js
+++ b/test/sourcemaps/samples/script/test.js
@@ -1,8 +1,8 @@
-export function test({ assert, smc, locateInSource, locateInGenerated }) {
- const expected = locateInSource( '42' );
- const start = locateInGenerated( '42' );
+export function test({ assert, input, js }) {
+ const expected = input.locate('42');
+ const start = js.locate('42');
- const actual = smc.originalPositionFor({
+ const actual = js.mapConsumer.originalPositionFor({
line: start.line + 1,
column: start.column
});
diff --git a/test/sourcemaps/samples/source-map-generator/_config.js b/test/sourcemaps/samples/source-map-generator/_config.js
new file mode 100644
index 0000000000..3cd15d9dda
--- /dev/null
+++ b/test/sourcemaps/samples/source-map-generator/_config.js
@@ -0,0 +1,25 @@
+import MagicString from 'magic-string';
+import { SourceMapConsumer, SourceMapGenerator } from 'source-map';
+
+export default {
+ preprocess: {
+ style: async ({ content, filename }) => {
+ const src = new MagicString(content);
+ const idx = content.indexOf('baritone');
+ src.overwrite(idx, idx + 'baritone'.length, 'bar');
+
+ const map = SourceMapGenerator.fromSourceMap(
+ await new SourceMapConsumer(
+ // sourcemap must be encoded for SourceMapConsumer
+ src.generateMap({
+ source: filename,
+ hires: true,
+ includeContent: false
+ })
+ )
+ );
+
+ return { code: src.toString(), map };
+ }
+ }
+};
diff --git a/test/sourcemaps/samples/source-map-generator/input.svelte b/test/sourcemaps/samples/source-map-generator/input.svelte
new file mode 100644
index 0000000000..0d942390f4
--- /dev/null
+++ b/test/sourcemaps/samples/source-map-generator/input.svelte
@@ -0,0 +1,12 @@
+Testing Styles
+Testing Styles 2
+
+
diff --git a/test/sourcemaps/samples/source-map-generator/test.js b/test/sourcemaps/samples/source-map-generator/test.js
new file mode 100644
index 0000000000..72ad1da1d8
--- /dev/null
+++ b/test/sourcemaps/samples/source-map-generator/test.js
@@ -0,0 +1 @@
+export { test } from '../preprocessed-styles/test';
diff --git a/test/sourcemaps/samples/sourcemap-basename-without-outputname/_config.js b/test/sourcemaps/samples/sourcemap-basename-without-outputname/_config.js
new file mode 100644
index 0000000000..15c346bfb9
--- /dev/null
+++ b/test/sourcemaps/samples/sourcemap-basename-without-outputname/_config.js
@@ -0,0 +1,33 @@
+
+import {magic_string_bundle} from '../../helpers';
+
+export const component_filepath = 'src/some/deep/path/input.svelte';
+export const component_file_basename = 'input.svelte';
+export const css_file_basename = 'input.css';
+
+const input_css = ' h1 {color: blue;}';
+
+export default {
+ preprocess: [
+ {
+ style: ({ content, filename }) => {
+ const style_to_add = `/* Filename from preprocess: ${filename} */` + input_css;
+ return magic_string_bundle([
+ { code: content, filename: component_file_basename },
+ { code: style_to_add, filename: css_file_basename }
+ ],component_filepath);
+ }
+ }
+ ],
+ js_map_sources: [component_file_basename],
+ css_map_sources: [css_file_basename,component_file_basename],
+ options: {
+ filename: component_filepath
+ },
+ compile_options: {
+ filename: component_filepath,
+ // ../../index.ts initializes output filenames, reset to undefined for this test
+ outputFilename: undefined,
+ cssOutputFilename: undefined
+ }
+};
diff --git a/test/sourcemaps/samples/sourcemap-basename-without-outputname/input.svelte b/test/sourcemaps/samples/sourcemap-basename-without-outputname/input.svelte
new file mode 100644
index 0000000000..189f28c390
--- /dev/null
+++ b/test/sourcemaps/samples/sourcemap-basename-without-outputname/input.svelte
@@ -0,0 +1,2 @@
+sourcemap-basename-without-outputname
+
diff --git a/test/sourcemaps/samples/sourcemap-basename-without-outputname/test.js b/test/sourcemaps/samples/sourcemap-basename-without-outputname/test.js
new file mode 100644
index 0000000000..c5747713a7
--- /dev/null
+++ b/test/sourcemaps/samples/sourcemap-basename-without-outputname/test.js
@@ -0,0 +1,3 @@
+// no additional test needed, _config.js values and the js.map.sources assertion in ../../index.ts cover it
+export function test() {}
+
diff --git a/test/sourcemaps/samples/sourcemap-basename/_config.js b/test/sourcemaps/samples/sourcemap-basename/_config.js
new file mode 100644
index 0000000000..7692b7a6d9
--- /dev/null
+++ b/test/sourcemaps/samples/sourcemap-basename/_config.js
@@ -0,0 +1,33 @@
+import { magic_string_bundle } from '../../helpers';
+
+export const component_filepath = 'src/input.svelte';
+
+export const component_file_basename = 'input.svelte';
+
+// as output by external tool for src/external_code.css (relative to src/input.svelte)
+export const external_relative_filename = 'external_code.css';
+
+const external_code = `
+span {
+ --external_code-var: 1px;
+}
+`;
+
+export default {
+ css_map_sources: [external_relative_filename],
+ js_map_sources: ['input.svelte'],
+ preprocess: [
+ {
+ style: ({ content, filename }) => {
+ const external = `/* Filename from preprocess: ${filename} */` + external_code;
+ return magic_string_bundle([
+ { code: external, filename: external_relative_filename },
+ { code: content, filename }
+ ]);
+ }
+ }
+ ],
+ options: {
+ filename: component_filepath
+ }
+};
diff --git a/test/sourcemaps/samples/sourcemap-basename/input.svelte b/test/sourcemaps/samples/sourcemap-basename/input.svelte
new file mode 100644
index 0000000000..72e524a308
--- /dev/null
+++ b/test/sourcemaps/samples/sourcemap-basename/input.svelte
@@ -0,0 +1,3 @@
+
+
+Hello world
diff --git a/test/sourcemaps/samples/sourcemap-basename/test.js b/test/sourcemaps/samples/sourcemap-basename/test.js
new file mode 100644
index 0000000000..34f6504722
--- /dev/null
+++ b/test/sourcemaps/samples/sourcemap-basename/test.js
@@ -0,0 +1,15 @@
+import { component_filepath, component_file_basename, external_relative_filename } from './_config';
+
+export function test({ assert, preprocessed }) {
+ assert.notEqual(
+ preprocessed.locate(`/* Filename from preprocess: ${component_filepath} */`),
+ undefined,
+ 'Preprocessor should receive same value for filename as passed to preprocess function'
+ );
+
+ assert.deepEqual(
+ preprocessed.map.sources.slice().sort(),
+ [external_relative_filename, component_file_basename].sort(),
+ 'Preprocessed map should contain sources relative to filepath'
+ );
+}
diff --git a/test/sourcemaps/samples/sourcemap-concat/_config.js b/test/sourcemaps/samples/sourcemap-concat/_config.js
new file mode 100644
index 0000000000..835b3c9e48
--- /dev/null
+++ b/test/sourcemaps/samples/sourcemap-concat/_config.js
@@ -0,0 +1,15 @@
+import MagicString from 'magic-string';
+import { magic_string_preprocessor_result } from '../../helpers';
+
+export default {
+ js_map_sources: ['input.svelte'],
+ preprocess: [
+ {
+ script: ({ content }) => {
+ const src = new MagicString(content);
+ src.prepend('console.log("Injected first line");\n');
+ return magic_string_preprocessor_result('input.svelte', src);
+ }
+ }
+ ]
+};
diff --git a/test/sourcemaps/samples/sourcemap-concat/input.svelte b/test/sourcemaps/samples/sourcemap-concat/input.svelte
new file mode 100644
index 0000000000..18a1ac775f
--- /dev/null
+++ b/test/sourcemaps/samples/sourcemap-concat/input.svelte
@@ -0,0 +1,3 @@
+
+
+Hello
\ No newline at end of file
diff --git a/test/sourcemaps/samples/sourcemap-concat/test.js b/test/sourcemaps/samples/sourcemap-concat/test.js
new file mode 100644
index 0000000000..c68d7175dc
--- /dev/null
+++ b/test/sourcemaps/samples/sourcemap-concat/test.js
@@ -0,0 +1,9 @@
+import { assert_mapped } from '../../helpers';
+
+export function test({ input, preprocessed }) {
+ assert_mapped({
+ code: 'Target',
+ input: input.locate,
+ preprocessed
+ });
+}
diff --git a/test/sourcemaps/samples/sourcemap-names/_config.js b/test/sourcemaps/samples/sourcemap-names/_config.js
new file mode 100644
index 0000000000..c8557ba465
--- /dev/null
+++ b/test/sourcemaps/samples/sourcemap-names/_config.js
@@ -0,0 +1,33 @@
+import MagicString from 'magic-string';
+import { magic_string_preprocessor_result, magic_string_replace_all } from '../../helpers';
+
+export default {
+ preprocess: [
+ {
+ markup: ({ content, filename }) => {
+ const src = new MagicString(content);
+ magic_string_replace_all(src, 'baritone', 'bar');
+ magic_string_replace_all(src,'--bazitone', '--baz');
+ magic_string_replace_all(src,'old_name_1', 'temp_new_name_1');
+ magic_string_replace_all(src,'old_name_2', 'temp_new_name_2');
+ return magic_string_preprocessor_result(filename, src);
+ }
+ },
+ {
+ markup: ({ content, filename }) => {
+ const src = new MagicString(content);
+ magic_string_replace_all(src, 'temp_new_name_1', 'temp_temp_new_name_1');
+ magic_string_replace_all(src, 'temp_new_name_2', 'temp_temp_new_name_2');
+ return magic_string_preprocessor_result(filename, src);
+ }
+ },
+ {
+ markup: ({ content, filename }) => {
+ const src = new MagicString(content);
+ magic_string_replace_all(src, 'temp_temp_new_name_1', 'new_name_1');
+ magic_string_replace_all(src, 'temp_temp_new_name_2', 'new_name_2');
+ return magic_string_preprocessor_result(filename, src);
+ }
+ }
+ ]
+};
diff --git a/test/sourcemaps/samples/sourcemap-names/input.svelte b/test/sourcemaps/samples/sourcemap-names/input.svelte
new file mode 100644
index 0000000000..b62715a857
--- /dev/null
+++ b/test/sourcemaps/samples/sourcemap-names/input.svelte
@@ -0,0 +1,12 @@
+
+
+use-names
+{old_name_1.baritone}
+{old_name_2}
diff --git a/test/sourcemaps/samples/sourcemap-names/test.js b/test/sourcemaps/samples/sourcemap-names/test.js
new file mode 100644
index 0000000000..cd70bd25ce
--- /dev/null
+++ b/test/sourcemaps/samples/sourcemap-names/test.js
@@ -0,0 +1,42 @@
+// needed for workaround, TODO remove
+import { getLocator } from 'locate-character';
+
+export function test({ assert, preprocessed, js, css }) {
+
+ assert.deepEqual(
+ preprocessed.map.names.sort(),
+ ['baritone', '--bazitone', 'old_name_1', 'old_name_2'].sort()
+ );
+
+ function test_name(old_name, new_name, where) {
+
+ let loc = { character: -1 };
+ while (loc = where.locate(new_name, loc.character + 1)) {
+ const actualMapping = where.mapConsumer.originalPositionFor({
+ line: loc.line + 1, column: loc.column
+ });
+ if (actualMapping.line === null) {
+ // location is not mapped - ignore
+ continue;
+ }
+ assert.equal(actualMapping.name, old_name);
+ }
+ if (loc === undefined) {
+ // workaround for bug in locate-character, TODO remove
+ // https://github.com/Rich-Harris/locate-character/pull/5
+ where.locate = getLocator(where.code);
+ }
+ }
+
+ test_name('baritone', 'bar', js);
+ test_name('baritone', 'bar', preprocessed);
+
+ test_name('--bazitone', '--baz', css);
+ test_name('--bazitone', '--baz', preprocessed);
+
+ test_name('old_name_1', 'new_name_1', js);
+ test_name('old_name_1', 'new_name_1', preprocessed);
+
+ test_name('old_name_2', 'new_name_2', js);
+ test_name('old_name_2', 'new_name_2', preprocessed);
+}
diff --git a/test/sourcemaps/samples/sourcemap-offsets/_config.js b/test/sourcemaps/samples/sourcemap-offsets/_config.js
new file mode 100644
index 0000000000..bbc24c3225
--- /dev/null
+++ b/test/sourcemaps/samples/sourcemap-offsets/_config.js
@@ -0,0 +1,18 @@
+import { magic_string_bundle } from '../../helpers';
+
+export const EXTERNAL = 'span { --external-var: 1px; }';
+
+export default {
+ js_map_sources: ['input.svelte'],
+ css_map_sources: ['input.svelte', 'external.css'],
+ preprocess: [
+ {
+ style: ({ content, filename }) => {
+ return magic_string_bundle([
+ { code: EXTERNAL, filename: 'external.css' },
+ { code: content, filename }
+ ]);
+ }
+ }
+ ]
+};
diff --git a/test/sourcemaps/samples/sourcemap-offsets/input.svelte b/test/sourcemaps/samples/sourcemap-offsets/input.svelte
new file mode 100644
index 0000000000..51f7762e2a
--- /dev/null
+++ b/test/sourcemaps/samples/sourcemap-offsets/input.svelte
@@ -0,0 +1,9 @@
+
+
+
+
+Text
\ No newline at end of file
diff --git a/test/sourcemaps/samples/sourcemap-offsets/test.js b/test/sourcemaps/samples/sourcemap-offsets/test.js
new file mode 100644
index 0000000000..a6c328770c
--- /dev/null
+++ b/test/sourcemaps/samples/sourcemap-offsets/test.js
@@ -0,0 +1,19 @@
+import { assert_mapped } from '../../helpers';
+import { EXTERNAL } from './_config';
+
+export function test({ input, preprocessed }) {
+ // Part from component, should be with offset
+ assert_mapped({
+ code: '--component-var',
+ input: input.locate,
+ preprocessed
+ });
+
+ // Part from external file, should be without offset
+ assert_mapped({
+ filename: 'external.css',
+ code: '--external-var',
+ input: EXTERNAL,
+ preprocessed
+ });
+}
diff --git a/test/sourcemaps/samples/sourcemap-sources/_config.js b/test/sourcemaps/samples/sourcemap-sources/_config.js
new file mode 100644
index 0000000000..97024cea5f
--- /dev/null
+++ b/test/sourcemaps/samples/sourcemap-sources/_config.js
@@ -0,0 +1,60 @@
+/* eslint-disable import/no-duplicates */
+/* the code that transforms these to commonjs, can't handle "MagicString, { Bundle } from.." */
+
+import MagicString from 'magic-string';
+import { Bundle } from 'magic-string';
+
+
+function add(bundle, filename, source) {
+ bundle.addSource({
+ filename,
+ content: new MagicString(source),
+ separator: '\n'
+ //separator: '' // ERROR. probably a bug in magic-string
+ });
+}
+
+function result(bundle, filename) {
+ return {
+ code: bundle.toString(),
+ map: bundle.generateMap({
+ file: filename,
+ includeContent: false,
+ hires: true // required for remapping
+ })
+ };
+}
+
+export default {
+ js_map_sources: [
+ 'input.svelte',
+ 'foo.js',
+ 'bar.js',
+ 'foo2.js',
+ 'bar2.js'
+ ],
+ preprocess: [
+ {
+ script: ({ content, filename }) => {
+ const bundle = new Bundle();
+
+ add(bundle, filename, content);
+ add(bundle, 'foo.js', 'var answer = 42; // foo.js\n');
+ add(bundle, 'bar.js', 'console.log(answer); // bar.js\n');
+
+ return result(bundle, filename);
+ }
+ },
+ {
+ script: ({ content, filename }) => {
+ const bundle = new Bundle();
+
+ add(bundle, filename, content);
+ add(bundle, 'foo2.js', 'var answer2 = 84; // foo2.js\n');
+ add(bundle, 'bar2.js', 'console.log(answer2); // bar2.js\n');
+
+ return result(bundle, filename);
+ }
+ }
+ ]
+};
diff --git a/test/sourcemaps/samples/sourcemap-sources/input.svelte b/test/sourcemaps/samples/sourcemap-sources/input.svelte
new file mode 100644
index 0000000000..33c8a9d9a6
--- /dev/null
+++ b/test/sourcemaps/samples/sourcemap-sources/input.svelte
@@ -0,0 +1,4 @@
+
+sourcemap-sources
diff --git a/test/sourcemaps/samples/sourcemap-sources/test.js b/test/sourcemaps/samples/sourcemap-sources/test.js
new file mode 100644
index 0000000000..78a4c80a17
--- /dev/null
+++ b/test/sourcemaps/samples/sourcemap-sources/test.js
@@ -0,0 +1,29 @@
+export function test({ assert, preprocessed, js }) {
+
+ assert.equal(preprocessed.error, undefined);
+
+ // sourcemap stores location only for 'answer = 42;'
+ // not for 'var answer = 42;'
+ [
+ [js, 'foo.js', 'answer = 42;', 4],
+ [js, 'bar.js', 'console.log(answer);', 0],
+ [js, 'foo2.js', 'answer2 = 84;', 4],
+ [js, 'bar2.js', 'console.log(answer2);', 0]
+ ]
+ .forEach(([where, sourcefile, content, column]) => {
+
+ assert.deepEqual(
+ where.mapConsumer.originalPositionFor(
+ where.locate_1(content)
+ ),
+ {
+ source: sourcefile,
+ name: null,
+ line: 1,
+ column
+ },
+ `failed to locate "${content}" from "${sourcefile}"`
+ );
+
+ });
+}
diff --git a/test/sourcemaps/samples/static-no-script/test.js b/test/sourcemaps/samples/static-no-script/test.js
index a8f4d89ab8..c683c94d6b 100644
--- a/test/sourcemaps/samples/static-no-script/test.js
+++ b/test/sourcemaps/samples/static-no-script/test.js
@@ -1,9 +1,9 @@
-const fs = require( 'fs' );
-const path = require( 'path' );
+const fs = require('fs');
+const path = require('path');
-export function test({ assert, map }) {
- assert.deepEqual( map.sources, [ 'input.svelte' ]);
- assert.deepEqual( map.sourcesContent, [
- fs.readFileSync( path.join( __dirname, 'input.svelte' ), 'utf-8' )
+export function test({ assert, js }) {
+ assert.deepEqual(js.map.sources, ['input.svelte']);
+ assert.deepEqual(js.map.sourcesContent, [
+ fs.readFileSync(path.join(__dirname, 'input.svelte'), 'utf-8')
]);
}
diff --git a/test/sourcemaps/samples/two-scripts/test.js b/test/sourcemaps/samples/two-scripts/test.js
index b473970112..70901af8c9 100644
--- a/test/sourcemaps/samples/two-scripts/test.js
+++ b/test/sourcemaps/samples/two-scripts/test.js
@@ -1,8 +1,8 @@
-export function test({ assert, smc, locateInSource, locateInGenerated }) {
- const expected = locateInSource( 'assertThisLine' );
- const start = locateInGenerated( 'assertThisLine' );
+export function test({ assert, input, js }) {
+ const expected = input.locate( 'assertThisLine' );
+ const start = js.locate( 'assertThisLine' );
- const actual = smc.originalPositionFor({
+ const actual = js.mapConsumer.originalPositionFor({
line: start.line + 1,
column: start.column
});
diff --git a/test/sourcemaps/samples/typescript/_config.js b/test/sourcemaps/samples/typescript/_config.js
new file mode 100644
index 0000000000..c8a955dfbd
--- /dev/null
+++ b/test/sourcemaps/samples/typescript/_config.js
@@ -0,0 +1,26 @@
+import * as ts from 'typescript';
+
+export default {
+ js_map_sources: [
+ 'input.svelte'
+ ],
+ preprocess: [
+ {
+ script: ({ content, filename }) => {
+ const { outputText, sourceMapText } = ts.transpileModule(content, {
+ fileName: filename,
+ compilerOptions: {
+ target: ts.ScriptTarget.ES2015,
+ module: ts.ModuleKind.ES2015,
+ sourceMap: true
+ }
+ });
+
+ return {
+ code: outputText,
+ map: sourceMapText
+ };
+ }
+ }
+ ]
+};
diff --git a/test/sourcemaps/samples/typescript/input.svelte b/test/sourcemaps/samples/typescript/input.svelte
new file mode 100644
index 0000000000..93639544b6
--- /dev/null
+++ b/test/sourcemaps/samples/typescript/input.svelte
@@ -0,0 +1,18 @@
+
+
+Hello world!
+Counter value: {count}
diff --git a/test/sourcemaps/samples/typescript/test.js b/test/sourcemaps/samples/typescript/test.js
new file mode 100644
index 0000000000..bec397e33c
--- /dev/null
+++ b/test/sourcemaps/samples/typescript/test.js
@@ -0,0 +1,21 @@
+import { assert_mapped, assert_not_located } from '../../helpers';
+
+export function test({ input, preprocessed }) {
+ // TS => JS code
+ assert_mapped({
+ code: 'let count = 0;',
+ input_code: 'let count: number = 0;',
+ input: input.locate,
+ preprocessed
+ });
+
+ // Markup, not touched
+ assert_mapped({
+ code: 'Hello world! ',
+ input: input.locate,
+ preprocessed
+ });
+
+ // TS types, removed
+ assert_not_located('ITimeoutDestroyer', preprocessed.locate_1);
+}
diff --git a/test/stats/samples/basic/_config.js b/test/stats/samples/basic/_config.js
index 434e11bd76..7f1d557d23 100644
--- a/test/stats/samples/basic/_config.js
+++ b/test/stats/samples/basic/_config.js
@@ -3,4 +3,4 @@ export default {
assert.equal(typeof stats.timings, 'object');
assert.equal(typeof stats.timings.total, 'number');
}
-};
\ No newline at end of file
+};
diff --git a/test/store/index.js b/test/store/index.ts
similarity index 90%
rename from test/store/index.js
rename to test/store/index.ts
index 2af4a6f35d..b6fc5940e1 100644
--- a/test/store/index.js
+++ b/test/store/index.ts
@@ -22,6 +22,19 @@ describe('store', () => {
assert.deepEqual(values, [0, 1, 2]);
});
+ it('creates an undefined writable store', () => {
+ const store = writable();
+ const values = [];
+
+ const unsubscribe = store.subscribe(value => {
+ values.push(value);
+ });
+
+ unsubscribe();
+
+ assert.deepEqual(values, [undefined]);
+ });
+
it('calls provided subscribe handler', () => {
let called = 0;
@@ -114,6 +127,32 @@ describe('store', () => {
assert.deepEqual(values, [0, 1, 2]);
});
+
+ it('creates an undefined readable store', () => {
+ const store = readable();
+ const values = [];
+
+ const unsubscribe = store.subscribe(value => {
+ values.push(value);
+ });
+
+ unsubscribe();
+
+ assert.deepEqual(values, [undefined]);
+ });
+
+ it('creates a readable store without updater', () => {
+ const store = readable(100);
+ const values = [];
+
+ const unsubscribe = store.subscribe(value => {
+ values.push(value);
+ });
+
+ unsubscribe();
+
+ assert.deepEqual(values, [100]);
+ });
});
const fake_observable = {
diff --git a/test/utils/index.ts b/test/utils/index.ts
new file mode 100644
index 0000000000..a8aed9387a
--- /dev/null
+++ b/test/utils/index.ts
@@ -0,0 +1,16 @@
+import * as assert from 'assert';
+import { trim_start, trim_end } from '../../src/compiler/utils/trim';
+
+describe('utils', () => {
+ describe('trim', () => {
+ it('trim_start', () => {
+ const value = trim_start(' \r\n\t svelte content \r\n\t ');
+ assert.equal(value, 'svelte content \r\n\t ');
+ });
+
+ it('trim_end', () => {
+ const value = trim_end(' \r\n\t svelte content \r\n\t ');
+ assert.equal(value, ' \r\n\t svelte content');
+ });
+ });
+});
diff --git a/test/validator/index.ts b/test/validator/index.ts
index 1709b7a706..e58be87a3a 100644
--- a/test/validator/index.ts
+++ b/test/validator/index.ts
@@ -101,4 +101,35 @@ describe('validate', () => {
assert.deepEqual(warnings, []);
});
+
+ it('errors if namespace is provided but unrecognised', () => {
+ assert.throws(() => {
+ svelte.compile('
', {
+ name: 'test',
+ namespace: 'svefefe'
+ });
+ }, /Invalid namespace 'svefefe'/);
+ });
+
+ it('errors with a hint if namespace is provided but unrecognised but close', () => {
+ assert.throws(() => {
+ svelte.compile('
', {
+ name: 'test',
+ namespace: 'foriegn'
+ });
+ }, /Invalid namespace 'foriegn' \(did you mean 'foreign'\?\)/);
+ });
+
+ it('does not throw error if \'this\' is bound for foreign element', () => {
+ assert.doesNotThrow(() => {
+ svelte.compile(`
+
+
`, {
+ name: 'test',
+ namespace: 'foreign'
+ });
+ });
+ });
});
diff --git a/test/validator/samples/a11y-anchor-has-content/input.svelte b/test/validator/samples/a11y-anchor-has-content/input.svelte
index ca81f90ae8..e246a1e593 100644
--- a/test/validator/samples/a11y-anchor-has-content/input.svelte
+++ b/test/validator/samples/a11y-anchor-has-content/input.svelte
@@ -1 +1,2 @@
-
\ No newline at end of file
+
+bar
diff --git a/test/validator/samples/a11y-in-foreign-namespace/input.svelte b/test/validator/samples/a11y-in-foreign-namespace/input.svelte
new file mode 100644
index 0000000000..aeef580c73
--- /dev/null
+++ b/test/validator/samples/a11y-in-foreign-namespace/input.svelte
@@ -0,0 +1,7 @@
+
+
+ not actually a link
+ This isn't a html label
+ This is maybe a QT figure
+
+
diff --git a/test/validator/samples/a11y-in-foreign-namespace/warnings.json b/test/validator/samples/a11y-in-foreign-namespace/warnings.json
new file mode 100644
index 0000000000..fe51488c70
--- /dev/null
+++ b/test/validator/samples/a11y-in-foreign-namespace/warnings.json
@@ -0,0 +1 @@
+[]
diff --git a/test/validator/samples/a11y-media-has-caption/input.svelte b/test/validator/samples/a11y-media-has-caption/input.svelte
index 105269cddb..6d98fd3734 100644
--- a/test/validator/samples/a11y-media-has-caption/input.svelte
+++ b/test/validator/samples/a11y-media-has-caption/input.svelte
@@ -1,4 +1,4 @@
-
+
diff --git a/test/validator/samples/a11y-media-has-caption/warnings.json b/test/validator/samples/a11y-media-has-caption/warnings.json
index a8c894b1d4..72c2caae53 100644
--- a/test/validator/samples/a11y-media-has-caption/warnings.json
+++ b/test/validator/samples/a11y-media-has-caption/warnings.json
@@ -6,7 +6,7 @@
"column": 15,
"line": 2
},
- "message": "A11y: Media elements must have a ",
+ "message": "A11y: elements must have a ",
"pos": 40,
"start": {
"character": 40,
@@ -21,7 +21,7 @@
"column": 24,
"line": 3
},
- "message": "A11y: Media elements must have a ",
+ "message": "A11y: elements must have a ",
"pos": 56,
"start": {
"character": 56,
diff --git a/test/validator/samples/a11y-mouse-events-have-key-events/input.svelte b/test/validator/samples/a11y-mouse-events-have-key-events/input.svelte
new file mode 100644
index 0000000000..22de04f38a
--- /dev/null
+++ b/test/validator/samples/a11y-mouse-events-have-key-events/input.svelte
@@ -0,0 +1,15 @@
+
+
+ void 0} />
+
void 0} on:focus={() => void 0} />
+
void 0} {...otherProps} />
+
void 0} />
+
void 0} on:blur={() => void 0} />
+
void 0} {...otherProps} />
diff --git a/test/validator/samples/a11y-mouse-events-have-key-events/warnings.json b/test/validator/samples/a11y-mouse-events-have-key-events/warnings.json
new file mode 100644
index 0000000000..b3fe15feee
--- /dev/null
+++ b/test/validator/samples/a11y-mouse-events-have-key-events/warnings.json
@@ -0,0 +1,62 @@
+[
+ {
+ "code": "a11y-mouse-events-have-key-events",
+ "end": {
+ "character": 272,
+ "column": 35,
+ "line": 10
+ },
+ "message": "A11y: on:mouseover must be accompanied by on:focus",
+ "pos": 237,
+ "start": {
+ "character": 237,
+ "column": 0,
+ "line": 10
+ }
+ },
+ {
+ "code": "a11y-mouse-events-have-key-events",
+ "end": {
+ "character": 384,
+ "column": 51,
+ "line": 12
+ },
+ "message": "A11y: on:mouseover must be accompanied by on:focus",
+ "pos": 333,
+ "start": {
+ "character": 333,
+ "column": 0,
+ "line": 12
+ }
+ },
+ {
+ "code": "a11y-mouse-events-have-key-events",
+ "end": {
+ "character": 419,
+ "column": 34,
+ "line": 13
+ },
+ "message": "A11y: on:mouseout must be accompanied by on:blur",
+ "pos": 385,
+ "start": {
+ "character": 385,
+ "column": 0,
+ "line": 13
+ }
+ },
+ {
+ "code": "a11y-mouse-events-have-key-events",
+ "end": {
+ "character": 528,
+ "column": 50,
+ "line": 15
+ },
+ "message": "A11y: on:mouseout must be accompanied by on:blur",
+ "pos": 478,
+ "start": {
+ "character": 478,
+ "column": 0,
+ "line": 15
+ }
+ }
+]
\ No newline at end of file
diff --git a/test/validator/samples/a11y-no-onchange/input.svelte b/test/validator/samples/a11y-no-onchange/input.svelte
deleted file mode 100644
index af2041f406..0000000000
--- a/test/validator/samples/a11y-no-onchange/input.svelte
+++ /dev/null
@@ -1,16 +0,0 @@
-
{}}>
- foo
- bar
-
-
{}} on:blur={e => {}}>
- foo
- bar
-
-
- {}}>foo
- bar
-
-
- {}} on:blur={e => {}}>foo
- bar
-
\ No newline at end of file
diff --git a/test/validator/samples/a11y-no-onchange/warnings.json b/test/validator/samples/a11y-no-onchange/warnings.json
deleted file mode 100644
index 461f546c0b..0000000000
--- a/test/validator/samples/a11y-no-onchange/warnings.json
+++ /dev/null
@@ -1,32 +0,0 @@
-[
- {
- "code": "a11y-no-onchange",
- "end": {
- "character": 88,
- "column": 9,
- "line": 4
- },
- "message": "A11y: on:blur must be used instead of on:change, unless absolutely necessary and it causes no negative consequences for keyboard only or screen reader users.",
- "pos": 0,
- "start": {
- "character": 0,
- "column": 0,
- "line": 1
- }
- },
- {
- "code": "a11y-no-onchange",
- "end": {
- "character": 249,
- "column": 44,
- "line": 10
- },
- "message": "A11y: on:blur must be used instead of on:change, unless absolutely necessary and it causes no negative consequences for keyboard only or screen reader users.",
- "pos": 209,
- "start": {
- "character": 209,
- "column": 4,
- "line": 10
- }
- }
-]
diff --git a/test/validator/samples/animation-not-in-each/errors.json b/test/validator/samples/animation-not-in-each/errors.json
index 67e2ceb7c2..c737617f98 100644
--- a/test/validator/samples/animation-not-in-each/errors.json
+++ b/test/validator/samples/animation-not-in-each/errors.json
@@ -1,6 +1,6 @@
[{
"code": "invalid-animation",
- "message": "An element that use the animate directive must be the immediate child of a keyed each block",
+ "message": "An element that uses the animate directive must be the immediate child of a keyed each block",
"start": {
"line": 5,
"column": 5,
@@ -12,4 +12,4 @@
"character": 55
},
"pos": 44
-}]
\ No newline at end of file
+}]
diff --git a/test/validator/samples/animation-not-in-keyed-each/errors.json b/test/validator/samples/animation-not-in-keyed-each/errors.json
index 1081589e6f..3e0b2d3c0c 100644
--- a/test/validator/samples/animation-not-in-keyed-each/errors.json
+++ b/test/validator/samples/animation-not-in-keyed-each/errors.json
@@ -1,6 +1,6 @@
[{
"code": "invalid-animation",
- "message": "An element that use the animate directive must be the immediate child of a keyed each block",
+ "message": "An element that uses the animate directive must be the immediate child of a keyed each block",
"start": {
"line": 6,
"column": 6,
@@ -12,4 +12,4 @@
"character": 80
},
"pos": 69
-}]
\ No newline at end of file
+}]
diff --git a/test/validator/samples/animation-siblings/errors.json b/test/validator/samples/animation-siblings/errors.json
index af15113b94..3def56f0a5 100644
--- a/test/validator/samples/animation-siblings/errors.json
+++ b/test/validator/samples/animation-siblings/errors.json
@@ -1,6 +1,6 @@
[{
"code": "invalid-animation",
- "message": "An element that use the animate directive must be the sole child of a keyed each block",
+ "message": "An element that uses the animate directive must be the sole child of a keyed each block",
"start": {
"line": 6,
"column": 6,
@@ -12,4 +12,4 @@
"character": 88
},
"pos": 77
-}]
\ No newline at end of file
+}]
diff --git a/test/validator/samples/binding-invalid-foreign-namespace/errors.json b/test/validator/samples/binding-invalid-foreign-namespace/errors.json
new file mode 100644
index 0000000000..c726270266
--- /dev/null
+++ b/test/validator/samples/binding-invalid-foreign-namespace/errors.json
@@ -0,0 +1,15 @@
+[{
+ "code": "invalid-binding",
+ "message": "'value' is not a valid binding. Foreign elements only support bind:this",
+ "pos": 81,
+ "start": {
+ "line": 6,
+ "column": 7,
+ "character": 81
+ },
+ "end": {
+ "line": 6,
+ "column": 28,
+ "character": 102
+ }
+}]
diff --git a/test/validator/samples/binding-invalid-foreign-namespace/input.svelte b/test/validator/samples/binding-invalid-foreign-namespace/input.svelte
new file mode 100644
index 0000000000..e40f44e906
--- /dev/null
+++ b/test/validator/samples/binding-invalid-foreign-namespace/input.svelte
@@ -0,0 +1,6 @@
+
+
+
+
diff --git a/test/validator/samples/css-invalid-global-placement-2/errors.json b/test/validator/samples/css-invalid-global-placement-2/errors.json
new file mode 100644
index 0000000000..4594469cc2
--- /dev/null
+++ b/test/validator/samples/css-invalid-global-placement-2/errors.json
@@ -0,0 +1,15 @@
+[{
+ "code": "css-invalid-global",
+ "message": ":global(...) can be at the start or end of a selector sequence, but not in the middle",
+ "start": {
+ "line": 2,
+ "column": 6,
+ "character": 14
+ },
+ "end": {
+ "line": 2,
+ "column": 19,
+ "character": 27
+ },
+ "pos": 14
+}]
diff --git a/test/validator/samples/css-invalid-global-placement-2/input.svelte b/test/validator/samples/css-invalid-global-placement-2/input.svelte
new file mode 100644
index 0000000000..75bd7b66e1
--- /dev/null
+++ b/test/validator/samples/css-invalid-global-placement-2/input.svelte
@@ -0,0 +1,5 @@
+
diff --git a/test/validator/samples/css-invalid-global-placement-3/errors.json b/test/validator/samples/css-invalid-global-placement-3/errors.json
new file mode 100644
index 0000000000..dc9d605c2c
--- /dev/null
+++ b/test/validator/samples/css-invalid-global-placement-3/errors.json
@@ -0,0 +1,15 @@
+[{
+ "code": "css-invalid-global",
+ "message": ":global(...) can be at the start or end of a selector sequence, but not in the middle",
+ "start": {
+ "line": 5,
+ "column": 6,
+ "character": 60
+ },
+ "end": {
+ "line": 5,
+ "column": 19,
+ "character": 73
+ },
+ "pos": 60
+}]
diff --git a/test/validator/samples/css-invalid-global-placement-3/input.svelte b/test/validator/samples/css-invalid-global-placement-3/input.svelte
new file mode 100644
index 0000000000..2a15c1086a
--- /dev/null
+++ b/test/validator/samples/css-invalid-global-placement-3/input.svelte
@@ -0,0 +1,8 @@
+
diff --git a/test/validator/samples/css-invalid-global-selector-2/errors.json b/test/validator/samples/css-invalid-global-selector-2/errors.json
new file mode 100644
index 0000000000..3317925b00
--- /dev/null
+++ b/test/validator/samples/css-invalid-global-selector-2/errors.json
@@ -0,0 +1,17 @@
+[
+ {
+ "code": "css-invalid-global-selector",
+ "message": ":global(...) must contain a single selector",
+ "start": {
+ "line": 11,
+ "column": 5,
+ "character": 156
+ },
+ "end": {
+ "line": 11,
+ "column": 29,
+ "character": 180
+ },
+ "pos": 156
+ }
+]
diff --git a/test/validator/samples/css-invalid-global-selector-2/input.svelte b/test/validator/samples/css-invalid-global-selector-2/input.svelte
new file mode 100644
index 0000000000..6acbabd7da
--- /dev/null
+++ b/test/validator/samples/css-invalid-global-selector-2/input.svelte
@@ -0,0 +1,18 @@
+
+
+
+
hello world
+
\ No newline at end of file
diff --git a/test/validator/samples/css-invalid-global-selector-3/errors.json b/test/validator/samples/css-invalid-global-selector-3/errors.json
new file mode 100644
index 0000000000..abc516a504
--- /dev/null
+++ b/test/validator/samples/css-invalid-global-selector-3/errors.json
@@ -0,0 +1,17 @@
+[
+ {
+ "code": "css-invalid-global-selector",
+ "message": ":global(...) must contain a single selector",
+ "start": {
+ "line": 5,
+ "column": 5,
+ "character": 77
+ },
+ "end": {
+ "line": 5,
+ "column": 44,
+ "character": 116
+ },
+ "pos": 77
+ }
+]
diff --git a/test/validator/samples/css-invalid-global-selector-3/input.svelte b/test/validator/samples/css-invalid-global-selector-3/input.svelte
new file mode 100644
index 0000000000..dca0094a06
--- /dev/null
+++ b/test/validator/samples/css-invalid-global-selector-3/input.svelte
@@ -0,0 +1,12 @@
+
+
+
+
hello world
+
diff --git a/test/validator/samples/css-invalid-global-selector-4/errors.json b/test/validator/samples/css-invalid-global-selector-4/errors.json
new file mode 100644
index 0000000000..8d76cb63c0
--- /dev/null
+++ b/test/validator/samples/css-invalid-global-selector-4/errors.json
@@ -0,0 +1,17 @@
+[
+ {
+ "code": "css-invalid-global-selector",
+ "message": ":global(...) must contain a single selector",
+ "start": {
+ "line": 2,
+ "column": 5,
+ "character": 13
+ },
+ "end": {
+ "line": 2,
+ "column": 24,
+ "character": 32
+ },
+ "pos": 13
+ }
+]
diff --git a/test/validator/samples/css-invalid-global-selector-4/input.svelte b/test/validator/samples/css-invalid-global-selector-4/input.svelte
new file mode 100644
index 0000000000..ed33b6b385
--- /dev/null
+++ b/test/validator/samples/css-invalid-global-selector-4/input.svelte
@@ -0,0 +1,9 @@
+
+
+
+
hello world
+
diff --git a/test/validator/samples/css-invalid-global-selector-5/errors.json b/test/validator/samples/css-invalid-global-selector-5/errors.json
new file mode 100644
index 0000000000..8129b236e6
--- /dev/null
+++ b/test/validator/samples/css-invalid-global-selector-5/errors.json
@@ -0,0 +1,17 @@
+[
+ {
+ "code": "css-invalid-global-selector",
+ "message": ":global(...) must contain a single selector",
+ "start": {
+ "line": 5,
+ "column": 1,
+ "character": 54
+ },
+ "end": {
+ "line": 5,
+ "column": 20,
+ "character": 73
+ },
+ "pos": 54
+ }
+]
diff --git a/test/validator/samples/css-invalid-global-selector-5/input.svelte b/test/validator/samples/css-invalid-global-selector-5/input.svelte
new file mode 100644
index 0000000000..67d4b9928a
--- /dev/null
+++ b/test/validator/samples/css-invalid-global-selector-5/input.svelte
@@ -0,0 +1,12 @@
+
+
+
+
hello world
+
\ No newline at end of file
diff --git a/test/validator/samples/css-invalid-global-selector-6/errors.json b/test/validator/samples/css-invalid-global-selector-6/errors.json
new file mode 100644
index 0000000000..8129b236e6
--- /dev/null
+++ b/test/validator/samples/css-invalid-global-selector-6/errors.json
@@ -0,0 +1,17 @@
+[
+ {
+ "code": "css-invalid-global-selector",
+ "message": ":global(...) must contain a single selector",
+ "start": {
+ "line": 5,
+ "column": 1,
+ "character": 54
+ },
+ "end": {
+ "line": 5,
+ "column": 20,
+ "character": 73
+ },
+ "pos": 54
+ }
+]
diff --git a/test/validator/samples/css-invalid-global-selector-6/input.svelte b/test/validator/samples/css-invalid-global-selector-6/input.svelte
new file mode 100644
index 0000000000..e0b2ffd597
--- /dev/null
+++ b/test/validator/samples/css-invalid-global-selector-6/input.svelte
@@ -0,0 +1,12 @@
+
+
+
+
hello world
+
\ No newline at end of file
diff --git a/test/validator/samples/css-invalid-global-selector/errors.json b/test/validator/samples/css-invalid-global-selector/errors.json
new file mode 100644
index 0000000000..7b2d5123b0
--- /dev/null
+++ b/test/validator/samples/css-invalid-global-selector/errors.json
@@ -0,0 +1,17 @@
+[
+ {
+ "code": "css-invalid-global-selector",
+ "message": ":global(...) must contain a single selector",
+ "start": {
+ "line": 11,
+ "column": 5,
+ "character": 143
+ },
+ "end": {
+ "line": 11,
+ "column": 24,
+ "character": 162
+ },
+ "pos": 143
+ }
+]
diff --git a/test/validator/samples/css-invalid-global-selector/input.svelte b/test/validator/samples/css-invalid-global-selector/input.svelte
new file mode 100644
index 0000000000..0ec337edfb
--- /dev/null
+++ b/test/validator/samples/css-invalid-global-selector/input.svelte
@@ -0,0 +1,18 @@
+
+
+
+
hello world
+
\ No newline at end of file
diff --git a/test/validator/samples/css-invalid-global/errors.json b/test/validator/samples/css-invalid-global/errors.json
deleted file mode 100644
index 63ed908342..0000000000
--- a/test/validator/samples/css-invalid-global/errors.json
+++ /dev/null
@@ -1,15 +0,0 @@
-[{
- "code": "css-invalid-global",
- "message": ":global(...) must be the first element in a compound selector",
- "start": {
- "line": 2,
- "column": 5,
- "character": 13
- },
- "end": {
- "line": 2,
- "column": 18,
- "character": 26
- },
- "pos": 13
-}]
\ No newline at end of file
diff --git a/test/validator/samples/css-invalid-global/input.svelte b/test/validator/samples/css-invalid-global/input.svelte
deleted file mode 100644
index 518674424a..0000000000
--- a/test/validator/samples/css-invalid-global/input.svelte
+++ /dev/null
@@ -1,5 +0,0 @@
-
\ No newline at end of file
diff --git a/test/validator/samples/default-export-anonymous-class/errors.json b/test/validator/samples/default-export-anonymous-class/errors.json
new file mode 100644
index 0000000000..0a410e5eda
--- /dev/null
+++ b/test/validator/samples/default-export-anonymous-class/errors.json
@@ -0,0 +1,15 @@
+[{
+ "code": "default-export",
+ "message": "A component cannot have a default export",
+ "pos": 10,
+ "start": {
+ "line": 2,
+ "column": 1,
+ "character": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 30,
+ "character": 39
+ }
+}]
diff --git a/test/validator/samples/default-export-anonymous-class/input.svelte b/test/validator/samples/default-export-anonymous-class/input.svelte
new file mode 100644
index 0000000000..d78759e113
--- /dev/null
+++ b/test/validator/samples/default-export-anonymous-class/input.svelte
@@ -0,0 +1,3 @@
+
diff --git a/test/validator/samples/default-export-anonymous-function/errors.json b/test/validator/samples/default-export-anonymous-function/errors.json
new file mode 100644
index 0000000000..1f144e8392
--- /dev/null
+++ b/test/validator/samples/default-export-anonymous-function/errors.json
@@ -0,0 +1,15 @@
+[{
+ "code": "default-export",
+ "message": "A component cannot have a default export",
+ "pos": 10,
+ "start": {
+ "line": 2,
+ "column": 1,
+ "character": 10
+ },
+ "end": {
+ "line": 2,
+ "column": 24,
+ "character": 33
+ }
+}]
diff --git a/test/validator/samples/default-export-anonymous-function/input.svelte b/test/validator/samples/default-export-anonymous-function/input.svelte
new file mode 100644
index 0000000000..5e98ca42ab
--- /dev/null
+++ b/test/validator/samples/default-export-anonymous-function/input.svelte
@@ -0,0 +1,3 @@
+
diff --git a/test/validator/samples/each-block-multiple-children/_config.js b/test/validator/samples/each-block-multiple-children/_config.js
index e26996239d..083edcd210 100644
--- a/test/validator/samples/each-block-multiple-children/_config.js
+++ b/test/validator/samples/each-block-multiple-children/_config.js
@@ -1,3 +1,3 @@
export default {
dev: true
-};
\ No newline at end of file
+};
diff --git a/test/validator/samples/error-mode-warn/input.svelte b/test/validator/samples/error-mode-warn/input.svelte
new file mode 100644
index 0000000000..5304ef4c71
--- /dev/null
+++ b/test/validator/samples/error-mode-warn/input.svelte
@@ -0,0 +1,6 @@
+
+
+
+
diff --git a/test/validator/samples/error-mode-warn/options.json b/test/validator/samples/error-mode-warn/options.json
new file mode 100644
index 0000000000..8d48d2f34e
--- /dev/null
+++ b/test/validator/samples/error-mode-warn/options.json
@@ -0,0 +1,3 @@
+{
+ "errorMode": "warn"
+}
\ No newline at end of file
diff --git a/test/validator/samples/error-mode-warn/warnings.json b/test/validator/samples/error-mode-warn/warnings.json
new file mode 100644
index 0000000000..cce6324df5
--- /dev/null
+++ b/test/validator/samples/error-mode-warn/warnings.json
@@ -0,0 +1,47 @@
+[
+ {
+ "code": "invalid-binding",
+ "message": "Cannot bind to a variable which is not writable",
+ "pos": 61,
+ "start": {
+ "line": 5,
+ "column": 19,
+ "character": 61
+ },
+ "end": {
+ "line": 5,
+ "column": 24,
+ "character": 66
+ }
+ },
+ {
+ "code": "missing-declaration",
+ "message": "'undeclared' is not defined",
+ "pos": 88,
+ "start": {
+ "character": 88,
+ "column": 19,
+ "line": 6
+ },
+ "end": {
+ "character": 98,
+ "column": 29,
+ "line": 6
+ }
+ },
+ {
+ "code": "binding-undeclared",
+ "message": "undeclared is not declared",
+ "pos": 88,
+ "end": {
+ "character": 98,
+ "column": 29,
+ "line": 6
+ },
+ "start": {
+ "character": 88,
+ "column": 19,
+ "line": 6
+ }
+ }
+]
\ No newline at end of file
diff --git a/test/validator/samples/event-modifiers-invalid/errors.json b/test/validator/samples/event-modifiers-invalid/errors.json
index 59a142d632..ea6de4ce34 100644
--- a/test/validator/samples/event-modifiers-invalid/errors.json
+++ b/test/validator/samples/event-modifiers-invalid/errors.json
@@ -1,5 +1,5 @@
[{
- "message": "Valid event modifiers are preventDefault, stopPropagation, capture, once, passive, nonpassive or self",
+ "message": "Valid event modifiers are preventDefault, stopPropagation, capture, once, passive, nonpassive, self or trusted",
"code": "invalid-event-modifier",
"start": {
"line": 1,
diff --git a/test/validator/samples/event-modifiers-legacy/_config.js b/test/validator/samples/event-modifiers-legacy/_config.js
index 0179e05ec4..52f59c8767 100644
--- a/test/validator/samples/event-modifiers-legacy/_config.js
+++ b/test/validator/samples/event-modifiers-legacy/_config.js
@@ -1,3 +1,3 @@
export default {
legacy: true
-};
\ No newline at end of file
+};
diff --git a/test/validator/samples/non-empty-block-dev/_config.js b/test/validator/samples/non-empty-block-dev/_config.js
index e26996239d..083edcd210 100644
--- a/test/validator/samples/non-empty-block-dev/_config.js
+++ b/test/validator/samples/non-empty-block-dev/_config.js
@@ -1,3 +1,3 @@
export default {
dev: true
-};
\ No newline at end of file
+};
diff --git a/test/validator/samples/prop-slot/errors.json b/test/validator/samples/prop-slot/errors.json
deleted file mode 100644
index 4fbfa3935c..0000000000
--- a/test/validator/samples/prop-slot/errors.json
+++ /dev/null
@@ -1,15 +0,0 @@
-[{
- "code": "invalid-prop",
- "message": "'slot' is reserved for future use in named slots",
- "start": {
- "line": 5,
- "column": 8,
- "character": 67
- },
- "end": {
- "line": 5,
- "column": 18,
- "character": 77
- },
- "pos": 67
-}]
diff --git a/test/validator/samples/prop-slot/input.svelte b/test/validator/samples/prop-slot/input.svelte
deleted file mode 100644
index 816c656aa0..0000000000
--- a/test/validator/samples/prop-slot/input.svelte
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
diff --git a/test/validator/samples/reactive-module-const-variable/input.svelte b/test/validator/samples/reactive-module-const-variable/input.svelte
new file mode 100644
index 0000000000..c89cc1c1d0
--- /dev/null
+++ b/test/validator/samples/reactive-module-const-variable/input.svelte
@@ -0,0 +1,9 @@
+
+
+
diff --git a/test/validator/samples/reactive-module-const-variable/warnings.json b/test/validator/samples/reactive-module-const-variable/warnings.json
new file mode 100644
index 0000000000..0d4f101c7a
--- /dev/null
+++ b/test/validator/samples/reactive-module-const-variable/warnings.json
@@ -0,0 +1,2 @@
+[
+]
diff --git a/test/validator/samples/reactive-module-variable-2/input.svelte b/test/validator/samples/reactive-module-variable-2/input.svelte
new file mode 100644
index 0000000000..d36d9cf210
--- /dev/null
+++ b/test/validator/samples/reactive-module-variable-2/input.svelte
@@ -0,0 +1,7 @@
+
+
diff --git a/test/validator/samples/reactive-module-variable-2/warnings.json b/test/validator/samples/reactive-module-variable-2/warnings.json
new file mode 100644
index 0000000000..fe51488c70
--- /dev/null
+++ b/test/validator/samples/reactive-module-variable-2/warnings.json
@@ -0,0 +1 @@
+[]
diff --git a/test/validator/samples/reactive-module-variable/input.svelte b/test/validator/samples/reactive-module-variable/input.svelte
new file mode 100644
index 0000000000..5a540de4f0
--- /dev/null
+++ b/test/validator/samples/reactive-module-variable/input.svelte
@@ -0,0 +1,6 @@
+
+
diff --git a/test/validator/samples/reactive-module-variable/warnings.json b/test/validator/samples/reactive-module-variable/warnings.json
new file mode 100644
index 0000000000..d08fc1309f
--- /dev/null
+++ b/test/validator/samples/reactive-module-variable/warnings.json
@@ -0,0 +1,17 @@
+[
+ {
+ "code": "module-script-reactive-declaration",
+ "message": "\"foo\" is declared in a module script and will not be reactive",
+ "pos": 59,
+ "start": {
+ "character": 59,
+ "column": 4,
+ "line": 5
+ },
+ "end": {
+ "character": 69,
+ "column": 14,
+ "line": 5
+ }
+ }
+]
diff --git a/test/validator/samples/silence-warnings-2/input.svelte b/test/validator/samples/silence-warnings-2/input.svelte
new file mode 100644
index 0000000000..81cb90b7be
--- /dev/null
+++ b/test/validator/samples/silence-warnings-2/input.svelte
@@ -0,0 +1,9 @@
+
+
+
+
diff --git a/test/validator/samples/silence-warnings-2/warnings.json b/test/validator/samples/silence-warnings-2/warnings.json
new file mode 100644
index 0000000000..fe51488c70
--- /dev/null
+++ b/test/validator/samples/silence-warnings-2/warnings.json
@@ -0,0 +1 @@
+[]
diff --git a/test/validator/samples/silence-warnings/input.svelte b/test/validator/samples/silence-warnings/input.svelte
new file mode 100644
index 0000000000..0e473f51db
--- /dev/null
+++ b/test/validator/samples/silence-warnings/input.svelte
@@ -0,0 +1,15 @@
+
+
+
+
+
+
diff --git a/test/validator/samples/silence-warnings/warnings.json b/test/validator/samples/silence-warnings/warnings.json
new file mode 100644
index 0000000000..fe51488c70
--- /dev/null
+++ b/test/validator/samples/silence-warnings/warnings.json
@@ -0,0 +1 @@
+[]
diff --git a/test/validator/samples/svelte-slot-placement-2/errors.json b/test/validator/samples/svelte-slot-placement-2/errors.json
new file mode 100644
index 0000000000..5659b35e7d
--- /dev/null
+++ b/test/validator/samples/svelte-slot-placement-2/errors.json
@@ -0,0 +1,9 @@
+[
+ {
+ "code": "invalid-slotted-content",
+ "message": "
must be a child of a component",
+ "start": { "line": 5, "column": 0, "character": 59 },
+ "end": { "line": 7, "column": 18, "character": 112 },
+ "pos": 59
+ }
+]
diff --git a/test/validator/samples/svelte-slot-placement-2/input.svelte b/test/validator/samples/svelte-slot-placement-2/input.svelte
new file mode 100644
index 0000000000..4fad457bd8
--- /dev/null
+++ b/test/validator/samples/svelte-slot-placement-2/input.svelte
@@ -0,0 +1,7 @@
+
+
+
+ test
+
\ No newline at end of file
diff --git a/test/validator/samples/svelte-slot-placement/errors.json b/test/validator/samples/svelte-slot-placement/errors.json
new file mode 100644
index 0000000000..ce825243f0
--- /dev/null
+++ b/test/validator/samples/svelte-slot-placement/errors.json
@@ -0,0 +1,9 @@
+[
+ {
+ "code": "invalid-slotted-content",
+ "message": " must be a child of a component",
+ "start": { "line": 7, "column": 2, "character": 77 },
+ "end": { "line": 9, "column": 20, "character": 134 },
+ "pos": 77
+ }
+]
diff --git a/test/validator/samples/svelte-slot-placement/input.svelte b/test/validator/samples/svelte-slot-placement/input.svelte
new file mode 100644
index 0000000000..a09639dd71
--- /dev/null
+++ b/test/validator/samples/svelte-slot-placement/input.svelte
@@ -0,0 +1,11 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/test/validator/samples/use-the-platform/input.svelte b/test/validator/samples/use-the-platform/input.svelte
new file mode 100644
index 0000000000..bff03d2ed5
--- /dev/null
+++ b/test/validator/samples/use-the-platform/input.svelte
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/test/validator/samples/use-the-platform/warnings.json b/test/validator/samples/use-the-platform/warnings.json
new file mode 100644
index 0000000000..bbc37c5e91
--- /dev/null
+++ b/test/validator/samples/use-the-platform/warnings.json
@@ -0,0 +1,32 @@
+[
+ {
+ "code": "invalid-html-attribute",
+ "message": "'className' is not a valid HTML attribute. Did you mean 'class'?",
+ "pos": 5,
+ "start": {
+ "character": 5,
+ "column": 5,
+ "line": 1
+ },
+ "end": {
+ "character": 20,
+ "column": 20,
+ "line": 1
+ }
+ },
+ {
+ "code": "invalid-html-attribute",
+ "message": "'htmlFor' is not a valid HTML attribute. Did you mean 'for'?",
+ "pos": 35,
+ "start": {
+ "character": 35,
+ "column": 7,
+ "line": 2
+ },
+ "end": {
+ "character": 46,
+ "column": 18,
+ "line": 2
+ }
+ }
+]
diff --git a/test/vars/samples/$$props-logicless/_config.js b/test/vars/samples/$$props-logicless/_config.js
index 20f9b99466..05bbe7e0b2 100644
--- a/test/vars/samples/$$props-logicless/_config.js
+++ b/test/vars/samples/$$props-logicless/_config.js
@@ -14,4 +14,4 @@ export default {
}
]);
}
-};
\ No newline at end of file
+};
diff --git a/test/vars/samples/$$props/_config.js b/test/vars/samples/$$props/_config.js
index 20f9b99466..05bbe7e0b2 100644
--- a/test/vars/samples/$$props/_config.js
+++ b/test/vars/samples/$$props/_config.js
@@ -14,4 +14,4 @@ export default {
}
]);
}
-};
\ No newline at end of file
+};
diff --git a/test/vars/samples/component-namespaced/_config.js b/test/vars/samples/component-namespaced/_config.js
index a801c52780..8ed4872355 100644
--- a/test/vars/samples/component-namespaced/_config.js
+++ b/test/vars/samples/component-namespaced/_config.js
@@ -14,4 +14,4 @@ export default {
}
]);
}
-};
\ No newline at end of file
+};
diff --git a/test/vars/samples/imports/_config.js b/test/vars/samples/imports/_config.js
index ecf120c7d6..47e8c0c5d9 100644
--- a/test/vars/samples/imports/_config.js
+++ b/test/vars/samples/imports/_config.js
@@ -36,4 +36,4 @@ export default {
}
]);
}
-};
\ No newline at end of file
+};
diff --git a/test/vars/samples/mutated-vs-reassigned-bindings/_config.js b/test/vars/samples/mutated-vs-reassigned-bindings/_config.js
index ba499674d2..65c7d5cc90 100644
--- a/test/vars/samples/mutated-vs-reassigned-bindings/_config.js
+++ b/test/vars/samples/mutated-vs-reassigned-bindings/_config.js
@@ -25,4 +25,4 @@ export default {
}
]);
}
-};
\ No newline at end of file
+};
diff --git a/test/vars/samples/mutated-vs-reassigned/_config.js b/test/vars/samples/mutated-vs-reassigned/_config.js
index ba499674d2..65c7d5cc90 100644
--- a/test/vars/samples/mutated-vs-reassigned/_config.js
+++ b/test/vars/samples/mutated-vs-reassigned/_config.js
@@ -25,4 +25,4 @@ export default {
}
]);
}
-};
\ No newline at end of file
+};
diff --git a/test/vars/samples/props/_config.js b/test/vars/samples/props/_config.js
index a51c93fb03..d5f5d1cc2b 100644
--- a/test/vars/samples/props/_config.js
+++ b/test/vars/samples/props/_config.js
@@ -47,4 +47,4 @@ export default {
}
]);
}
-};
\ No newline at end of file
+};
diff --git a/test/vars/samples/vars-report-false/_config.js b/test/vars/samples/vars-report-false/_config.js
new file mode 100644
index 0000000000..f4709f09c8
--- /dev/null
+++ b/test/vars/samples/vars-report-false/_config.js
@@ -0,0 +1,9 @@
+export default {
+ options: {
+ varsReport: false
+ },
+
+ test(assert, vars) {
+ assert.deepEqual(vars, []);
+ }
+};
diff --git a/test/vars/samples/vars-report-false/input.svelte b/test/vars/samples/vars-report-false/input.svelte
new file mode 100644
index 0000000000..7583c99845
--- /dev/null
+++ b/test/vars/samples/vars-report-false/input.svelte
@@ -0,0 +1,5 @@
+
+
+{foo}
\ No newline at end of file
diff --git a/test/vars/samples/vars-report-full-noscript/_config.js b/test/vars/samples/vars-report-full-noscript/_config.js
new file mode 100644
index 0000000000..9c39324518
--- /dev/null
+++ b/test/vars/samples/vars-report-full-noscript/_config.js
@@ -0,0 +1,19 @@
+export default {
+ options: {
+ varsReport: 'full'
+ },
+
+ test(assert, vars) {
+ assert.deepEqual(vars, [{
+ name: 'foo',
+ export_name: null,
+ injected: false,
+ module: false,
+ mutated: false,
+ reassigned: false,
+ referenced: true,
+ referenced_from_script: false,
+ writable: false
+ }]);
+ }
+};
diff --git a/test/vars/samples/vars-report-full-noscript/input.svelte b/test/vars/samples/vars-report-full-noscript/input.svelte
new file mode 100644
index 0000000000..e076ac55f8
--- /dev/null
+++ b/test/vars/samples/vars-report-full-noscript/input.svelte
@@ -0,0 +1 @@
+{foo}
\ No newline at end of file
diff --git a/test/vars/samples/vars-report-full-script/_config.js b/test/vars/samples/vars-report-full-script/_config.js
new file mode 100644
index 0000000000..2519dc5508
--- /dev/null
+++ b/test/vars/samples/vars-report-full-script/_config.js
@@ -0,0 +1,31 @@
+export default {
+ options: {
+ varsReport: 'full'
+ },
+
+ test(assert, vars) {
+ assert.deepEqual(vars, [
+ {
+ name: 'foo',
+ export_name: 'foo',
+ injected: false,
+ module: false,
+ mutated: false,
+ reassigned: false,
+ referenced: true,
+ referenced_from_script: false,
+ writable: true
+ }, {
+ name: 'bar',
+ export_name: null,
+ injected: false,
+ module: false,
+ mutated: false,
+ reassigned: false,
+ referenced: true,
+ referenced_from_script: false,
+ writable: false
+ }
+ ]);
+ }
+};
diff --git a/test/vars/samples/vars-report-full-script/input.svelte b/test/vars/samples/vars-report-full-script/input.svelte
new file mode 100644
index 0000000000..11870584a6
--- /dev/null
+++ b/test/vars/samples/vars-report-full-script/input.svelte
@@ -0,0 +1,5 @@
+
+
+{foo} {bar}
\ No newline at end of file
diff --git a/test/vars/samples/vars-report-full/_config.js b/test/vars/samples/vars-report-full/_config.js
new file mode 100644
index 0000000000..9c39324518
--- /dev/null
+++ b/test/vars/samples/vars-report-full/_config.js
@@ -0,0 +1,19 @@
+export default {
+ options: {
+ varsReport: 'full'
+ },
+
+ test(assert, vars) {
+ assert.deepEqual(vars, [{
+ name: 'foo',
+ export_name: null,
+ injected: false,
+ module: false,
+ mutated: false,
+ reassigned: false,
+ referenced: true,
+ referenced_from_script: false,
+ writable: false
+ }]);
+ }
+};
diff --git a/test/vars/samples/vars-report-full/input.svelte b/test/vars/samples/vars-report-full/input.svelte
new file mode 100644
index 0000000000..0178466fe3
--- /dev/null
+++ b/test/vars/samples/vars-report-full/input.svelte
@@ -0,0 +1,3 @@
+
+
+{foo}
\ No newline at end of file
diff --git a/tsconfig.json b/tsconfig.json
index 39476f3dd1..f2e055a2a9 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -21,10 +21,14 @@
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
+ // Hides exports flagged with @internal from the d.ts output
+ "stripInternal": true,
+
// TODO: error all the things
//"strict": true,
"noImplicitThis": true,
"noUnusedLocals": true,
- "noUnusedParameters": true
+ "noUnusedParameters": true,
+ "typeRoots": ["./node_modules/@types"]
}
}