Repository: pateketrueke/yrv Branch: master Commit: 9b853a2d9ebb Files: 42 Total size: 76.3 KB Directory structure: gitextract_601t9p7l/ ├── .eslintignore ├── .eslintrc ├── .gitattributes ├── .github/ │ └── workflows/ │ ├── release.yml │ └── testing.yml ├── .gitignore ├── CHANGELOG.md ├── Makefile ├── README.md ├── components.js ├── debug.js ├── e2e/ │ ├── app/ │ │ ├── import.esm.js │ │ ├── routers.js │ │ └── testing.js │ ├── cases/ │ │ ├── main.test.js │ │ └── routers.test.js │ ├── components/ │ │ ├── Example.svelte │ │ ├── Import.svelte │ │ ├── Main.svelte │ │ ├── Testing.svelte │ │ └── nested-routers/ │ │ ├── App.svelte │ │ ├── Home.svelte │ │ ├── List.svelte │ │ ├── Login.svelte │ │ ├── NewTeam.svelte │ │ ├── NotFound.svelte │ │ └── Players.svelte │ └── helpers.js ├── package.json ├── src/ │ ├── index.js │ ├── lib/ │ │ ├── Link.svelte │ │ ├── Route.svelte │ │ ├── Router.svelte │ │ ├── router.js │ │ └── utils.js │ ├── test/ │ │ ├── _layout.pug │ │ ├── folder.pug │ │ ├── import.pug │ │ ├── index.pug │ │ └── routers.pug │ └── vendor.js └── types/ └── index.d.ts ================================================ FILE CONTENTS ================================================ ================================================ FILE: .eslintignore ================================================ e2e/public/assets e2e/components/Import.svelte ================================================ FILE: .eslintrc ================================================ { "env": { "es6": true, "browser": true }, "extends": "airbnb-base", "plugins": [ "svelte3" ], "overrides": [ { "files": ["*.svelte"], "processor": "svelte3/svelte3" } ], "parserOptions": { "ecmaVersion": 2019, "sourceType": "module" }, "rules" : { "max-len": ["error", { "code": 150 }], "arrow-parens": ["error", "as-needed"], "indent": 0, "strict": 0, "prefer-const": 0, "no-console": 0, "no-labels": 0, "no-unused-labels": 0, "no-restricted-syntax": 0, "no-multi-assign": 0, "prefer-destructuring": 0, "function-paren-newline": 0, "global-require": 0, "prefer-spread": 0, "prefer-rest-params": 0, "prefer-arrow-callback": 0, "arrow-body-style": 0, "no-restricted-globals": 0, "consistent-return": 0, "no-param-reassign": 0, "no-underscore-dangle": 0, "no-multiple-empty-lines": 0, "import/first": 0, "import/extensions": 0, "import/no-unresolved": 0, "import/no-dynamic-require": 0, "import/no-mutable-exports": 0, "import/no-extraneous-dependencies": 0, "import/prefer-default-export": 0 } } ================================================ FILE: .gitattributes ================================================ package-lock.json -diff dist/* -diff ================================================ FILE: .github/workflows/release.yml ================================================ name: Release on: push: branches: - master jobs: Release: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 with: persist-credentials: false fetch-depth: 0 - uses: actions/setup-node@v3 with: node-version: 14 - run: npm i - run: npm test - run: HASHCHANGE=true npm test - run: | git config --local user.name "Release Bot" git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" - run: npm run release - name: Push Changes uses: ad-m/github-push-action@master with: github_token: ${{ secrets.GITHUB_TOKEN }} branch: ${{ github.ref }} tags: true - name: Publish run: make release && npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} ================================================ FILE: .github/workflows/testing.yml ================================================ name: build on: pull_request: branches: - master jobs: build-test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: fetch-depth: 0 - uses: tacoss/nodejs@v2 with: args: make ci ================================================ FILE: .gitignore ================================================ .DS_Store *.todo dist build cache.json node_modules e2e/public/assets package-lock.json ================================================ FILE: CHANGELOG.md ================================================ # Changelog All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. ### [0.0.57](https://github.com/pateketrueke/yrv/compare/v0.0.56...v0.0.57) (2022-06-26) ### Bug Fixes * use actions/setup-node instead ([7106391](https://github.com/pateketrueke/yrv/commit/7106391a64783c514c9578147e129021c201087b)) ### [0.0.56](https://github.com/pateketrueke/yrv/compare/v0.0.55...v0.0.56) (2022-06-26) ### [0.0.55](https://github.com/pateketrueke/yrv/compare/v0.0.52...v0.0.55) (2022-06-26) ### Bug Fixes * revert alias support ([8e1b907](https://github.com/pateketrueke/yrv/commit/8e1b9072f1b0bc462018c19ddcac3f5b53b896c7)) * run tests before releasing ([77e30d8](https://github.com/pateketrueke/yrv/commit/77e30d840cc73acdf49a084da55b147b33accd18)) ### [0.0.54](https://github.com/pateketrueke/yrv/compare/v0.0.52...v0.0.54) (2022-06-26) ### Bug Fixes * revert alias support ([8e1b907](https://github.com/pateketrueke/yrv/commit/8e1b9072f1b0bc462018c19ddcac3f5b53b896c7)) * run tests before releasing ([77e30d8](https://github.com/pateketrueke/yrv/commit/77e30d840cc73acdf49a084da55b147b33accd18)) ### [0.0.52](https://github.com/pateketrueke/yrv/compare/v0.0.51...v0.0.52) (2022-01-21) ### [0.0.51](https://github.com/pateketrueke/yrv/compare/v0.0.50...v0.0.51) (2022-01-16) ### [0.0.50](https://github.com/pateketrueke/yrv/compare/v0.0.49...v0.0.50) (2021-08-13) ### Bug Fixes * make sure vendor.js is bundled ([b863696](https://github.com/pateketrueke/yrv/commit/b8636962b82bb5488c2ec5286c2c9c3097165104)) ### [0.0.49](https://github.com/pateketrueke/yrv/compare/v0.0.48...v0.0.49) (2021-08-13) ### [0.0.48](https://github.com/pateketrueke/yrv/compare/v0.0.47...v0.0.48) (2021-08-11) ### [0.0.47](https://github.com/pateketrueke/yrv/compare/v0.0.46...v0.0.47) (2021-06-30) ### [0.0.46](https://github.com/pateketrueke/yrv/compare/v0.0.45...v0.0.46) (2021-06-27) ### Bug Fixes * run tests on CI for PRs only, master is for release ([c5ad7a4](https://github.com/pateketrueke/yrv/commit/c5ad7a4c66cab235cd09970f6f9bffe13560701a)) * setup NPM token before releasing ([258dbe2](https://github.com/pateketrueke/yrv/commit/258dbe2211514c4d544470e8b00e6c8011e7fdae)) ### [0.0.45](https://github.com/pateketrueke/yrv/compare/v0.0.44...v0.0.45) (2021-06-27) ### Bug Fixes * move release step outside npm scripts ([40a870c](https://github.com/pateketrueke/yrv/commit/40a870cbe99a7dc05cdb4a633083914011c4fac4)) ### [0.0.44](https://github.com/pateketrueke/yrv/compare/v0.0.43...v0.0.44) (2021-06-27) ### Bug Fixes * debug entry-point ([e500aad](https://github.com/pateketrueke/yrv/commit/e500aad01fb3314f2a84cdf7079b5f194b5015ad)) * enable DEBUG while on dev and CI ([2bddc76](https://github.com/pateketrueke/yrv/commit/2bddc761be5e791005b345d97e43b0b06e10a084)) * rebuild before tests to enable cross-env changes ([6aea3f8](https://github.com/pateketrueke/yrv/commit/6aea3f8d9cc5daac53e97127d56901ae33362ed2)) * use ...activeProps for active Route components ([cf41085](https://github.com/pateketrueke/yrv/commit/cf41085c3aaa20bd4d25d76f9e1b6650a997e808)) ### [0.0.43](https://github.com/pateketrueke/yrv/compare/v0.0.42...v0.0.43) (2021-06-27) ### [0.0.42](https://github.com/pateketrueke/yrv/compare/v0.0.41...v0.0.42) (2021-05-09) ### [0.0.41](https://github.com/pateketrueke/yrv/compare/v0.0.40...v0.0.41) (2021-05-09) ### [0.0.40](https://github.com/pateketrueke/yrv/compare/v0.0.39...v0.0.40) (2021-05-09) ### [0.0.39](https://github.com/pateketrueke/yrv/compare/v0.0.38...v0.0.39) (2021-03-31) ### [0.0.38](https://github.com/pateketrueke/yrv/compare/v0.0.37...v0.0.38) (2021-03-10) ### Bug Fixes * make sure types are included on the package; closes [#72](https://github.com/pateketrueke/yrv/issues/72) ([72c07f2](https://github.com/pateketrueke/yrv/commit/72c07f2fa57aefef23af093fab58430e318231a9)) ### [0.0.37](https://github.com/pateketrueke/yrv/compare/v0.0.35...v0.0.37) (2021-03-10) ### Features * adds in auto release and auto-publishing ([f587f9b](https://github.com/pateketrueke/yrv/commit/f587f9b35c48586b05bcc08f645021ed801c073b)) * Adds in Standard Version ([af0a5e4](https://github.com/pateketrueke/yrv/commit/af0a5e4d6b9f25480a5b3b88ed3151c00516792c)), closes [#28](https://github.com/pateketrueke/yrv/issues/28) * Adds in TypeScript definitions for the repository ([4273f09](https://github.com/pateketrueke/yrv/commit/4273f09a778ff38b7c11eb0ef108209ac5f12749)) ### Bug Fixes * Adds changes to move to ubuntu runner instead of self-hosted ([83f605c](https://github.com/pateketrueke/yrv/commit/83f605ce8f0eedc58de761af1b9ee8901a0dda8c)) * patch top-level pending component on routers, thanks to [@jhechtf](https://github.com/jhechtf) - closes [#34](https://github.com/pateketrueke/yrv/issues/34) ([83f74bc](https://github.com/pateketrueke/yrv/commit/83f74bcae474ba122c5dacc8c4aeb0625b2645ea)) ### [0.0.36](https://github.com/pateketrueke/yrv/compare/v0.0.35...v0.0.36) (2021-03-09) ### Features * adds in auto release and auto-publishing ([f587f9b](https://github.com/pateketrueke/yrv/commit/f587f9b35c48586b05bcc08f645021ed801c073b)) * Adds in Standard Version ([af0a5e4](https://github.com/pateketrueke/yrv/commit/af0a5e4d6b9f25480a5b3b88ed3151c00516792c)), closes [#28](https://github.com/pateketrueke/yrv/issues/28) * Adds in TypeScript definitions for the repository ([4273f09](https://github.com/pateketrueke/yrv/commit/4273f09a778ff38b7c11eb0ef108209ac5f12749)) ### Bug Fixes * Adds changes to move to ubuntu runner instead of self-hosted ([83f605c](https://github.com/pateketrueke/yrv/commit/83f605ce8f0eedc58de761af1b9ee8901a0dda8c)) * patch top-level pending component on routers, thanks to [@jhechtf](https://github.com/jhechtf) - closes [#34](https://github.com/pateketrueke/yrv/issues/34) ([83f74bc](https://github.com/pateketrueke/yrv/commit/83f74bcae474ba122c5dacc8c4aeb0625b2645ea)) ### [0.0.35](https://github.com/pateketrueke/yrv/compare/v0.0.34...v0.0.35) (2020-11-13) ### [0.0.34](https://github.com/pateketrueke/yrv/compare/v0.0.33...v0.0.34) (2020-11-13) ### Bug Fixes * skip :headless ([1e4d0eb](https://github.com/pateketrueke/yrv/commit/1e4d0eb426945635c48c150a8b26dbf970dc2841)) * wait 1sec before check ([a6479cf](https://github.com/pateketrueke/yrv/commit/a6479cfd12d49350e14189d21e58d70bd60e5132)) ### [0.0.33](https://github.com/pateketrueke/yrv/compare/v0.0.32...v0.0.33) (2020-09-24) ### Bug Fixes * clean ./build before test ([60fc680](https://github.com/pateketrueke/yrv/commit/60fc6800e9bd952d14fa6cb98cc8267c106aeb3f)) * dev, test and build ready; lock deps ([1dfe683](https://github.com/pateketrueke/yrv/commit/1dfe683e5e03b8cd0f7b6ed91d86585aee384200)) * disable DEBUG on dist, include src/ files ([eea9b5a](https://github.com/pateketrueke/yrv/commit/eea9b5a15704e660a3d2b070f6f73b4363d783b7)) * enable DEBUG for whole testing ([64a21cf](https://github.com/pateketrueke/yrv/commit/64a21cfd48065bdeb582f38f76af10f52ff9d46d)) * import from ./src during development ([6616e98](https://github.com/pateketrueke/yrv/commit/6616e986483731ba443fb675482583a1b369e918)) * print fallback branch when missing DEBUG ([d34b6ab](https://github.com/pateketrueke/yrv/commit/d34b6abb8d291bc0e749abaf310c844cbf02071f)) * remove cache too ([a438b4e](https://github.com/pateketrueke/yrv/commit/a438b4e2080e0849298d38c1b6b36a2e7088dc1e)) * right setup for DEBUG mode ([7f247fd](https://github.com/pateketrueke/yrv/commit/7f247fd259702149982f20674f3265c7e1ac352d)) * split sub tasks ([7fca020](https://github.com/pateketrueke/yrv/commit/7fca020283f955b8826923323029199bd98ba8b3)) ### [0.0.32](https://github.com/pateketrueke/yrv/compare/v0.0.31...v0.0.32) (2020-09-23) ### Bug Fixes * package built files, not sources ([610f016](https://github.com/pateketrueke/yrv/commit/610f0169d7c1dc38c11ca68efaa15a976c5596f1)) ### [0.0.31](https://github.com/pateketrueke/yrv/compare/v0.0.30...v0.0.31) (2020-09-23) ### [0.0.30](https://github.com/pateketrueke/yrv/compare/v0.0.29...v0.0.30) (2020-04-11) ### [0.0.29](https://github.com/pateketrueke/yrv/compare/v0.0.28...v0.0.29) (2020-04-10) ### [0.0.28](https://github.com/pateketrueke/yrv/compare/v0.0.27...v0.0.28) (2020-04-10) ### [0.0.27](https://github.com/pateketrueke/yrv/compare/v0.0.26...v0.0.27) (2020-03-25) ### [0.0.26](https://github.com/pateketrueke/yrv/compare/v0.0.25...v0.0.26) (2020-03-15) ### [0.0.25](https://github.com/pateketrueke/yrv/compare/v0.0.24...v0.0.25) (2020-03-06) ### [0.0.24](https://github.com/pateketrueke/yrv/compare/v0.0.23...v0.0.24) (2020-02-29) ### [0.0.23](https://github.com/pateketrueke/yrv/compare/v0.0.22...v0.0.23) (2020-02-29) ### [0.0.22](https://github.com/pateketrueke/yrv/compare/v0.0.21...v0.0.22) (2020-02-29) ### [0.0.21](https://github.com/pateketrueke/yrv/compare/v0.0.20...v0.0.21) (2020-02-29) ### [0.0.20](https://github.com/pateketrueke/yrv/compare/v0.0.19...v0.0.20) (2020-02-29) ### [0.0.19](https://github.com/pateketrueke/yrv/compare/v0.0.18...v0.0.19) (2020-02-20) ### [0.0.18](https://github.com/pateketrueke/yrv/compare/v0.0.17...v0.0.18) (2020-01-25) ### [0.0.17](https://github.com/pateketrueke/yrv/compare/v0.0.16...v0.0.17) (2020-01-20) ### [0.0.16](https://github.com/pateketrueke/yrv/compare/v0.0.15...v0.0.16) (2019-12-14) ### [0.0.15](https://github.com/pateketrueke/yrv/compare/v0.0.14...v0.0.15) (2019-12-07) ### [0.0.14](https://github.com/pateketrueke/yrv/compare/v0.0.13...v0.0.14) (2019-11-19) ### [0.0.13](https://github.com/pateketrueke/yrv/compare/v0.0.12...v0.0.13) (2019-11-16) ### [0.0.12](https://github.com/pateketrueke/yrv/compare/v0.0.10...v0.0.12) (2019-11-08) ### [0.0.10](https://github.com/pateketrueke/yrv/compare/v0.0.9...v0.0.10) (2019-11-04) ### [0.0.9](https://github.com/pateketrueke/yrv/compare/v0.0.8...v0.0.9) (2019-11-01) ### [0.0.8](https://github.com/pateketrueke/yrv/compare/v0.0.7...v0.0.8) (2019-10-28) ### [0.0.7](https://github.com/pateketrueke/yrv/compare/v0.0.6...v0.0.7) (2019-10-26) ### [0.0.6](https://github.com/pateketrueke/yrv/compare/v0.0.5...v0.0.6) (2019-10-18) ### [0.0.5](https://github.com/pateketrueke/yrv/compare/v0.0.4...v0.0.5) (2019-10-18) ### [0.0.4](https://github.com/pateketrueke/yrv/compare/v0.0.3...v0.0.4) (2019-10-18) ### [0.0.3](https://github.com/pateketrueke/yrv/compare/v0.0.2...v0.0.3) (2019-10-17) ### [0.0.2](https://github.com/pateketrueke/yrv/compare/v0.0.1...v0.0.2) (2019-10-17) ================================================ FILE: Makefile ================================================ ifneq ($(DEBUG),) E2E_FLAGS=--debug-on-fail endif help: Makefile @awk -F':.*?##' '/^[a-z0-9\\%!:-]+:.*##/{gsub("%","*",$$1);gsub("\\\\",":*",$$1);printf "\033[36m%8s\033[0m %s\n",$$1,$$2}' $< ci: src deps clean ## Run CI scripts @npm test -- --color $(E2E_FLAGS) @HASHCHANGE=true npm test -- --color $(E2E_FLAGS) dev: src deps ## Start dev tasks @npm run dev e2e: src deps ## Run E2E tests locally @npm run test:e2e -- e2e/cases $(E2E_FLAGS) test: src deps clean @npm test deps: package*.json @(((ls node_modules | grep .) > /dev/null 2>&1) || npm i) || true clean: @rm -f cache.json @rm -rf build/* release: clean @NODE_ENV=production npm run build ifneq ($(CI),) @echo '//registry.npmjs.org/:_authToken=$${NODE_AUTH_TOKEN}' > .npmrc endif ================================================ FILE: README.md ================================================
{JSON.stringify($router, null, 2)}
```
**Why does Yrv not work with Parcel or webpack/snowpack?**
If you're getting any of the errors below:
- store.subscribe is not a function
- Class constructor SvelteComponent cannot be invoked without 'new'
- 'on_outro' is not exported by [...]
- 'target' is a required option
Make sure you're using the right settings:
1. Add mainFields into resolve config, e.g. `mainFields: ['svelte', 'browser', 'module', 'main']`
2. Remove `exclude: /node_modules/` from `svelte-loader` config
> If you're using an online tool that is not the official Svelte REPL the behavior is unexpected and no further support will be granted.
**Can I use hash-based routes _à la_ Gmail? e.g. `index.html#/profile`, `index.html#/book/42`?**
Yes, URIs like that are suitable for embedded apps like Electron, where normal URLs would fail.
Also this mode is the default used on the Svelte REPL, because is not an iframe, nor a regular webpage... it's a weird thing!
> If you enable `router.hashchange = true` all your regular links will be automatically rewritten to hash-based URIs instead, see how it works in our test suite.
**Why I'm getting `Components can be lazy-loaded through `() => import('...')` calls.
This content is static, always shown.
Home | Test page | Anchor page | Error pageLinks can open windows, and they can set callbacks too: /* eslint-disable no-alert */ alert('GREAT!')}>Open window
Routes with exactly one segment are considered nested routes, e.g. 1 | 2 | 3 | ?
Link's `href` can be changed as well, e.g. Change me!
This content is always mounted when the current URL starts-with /test.
Undo | Test props | Redirect | Protected
Any Route-less content is always shown!
You can also hook into the router's state with `router.subscribe(...)`, e.g.
Times router-info has been changed: {count}
Value: {router.params.value}
{failure}
{/if} {#if activeRouter} {#if !hasLoaded} {#if pending || pendingComponent} {#if isSvelteComponent(pending)}