roxiness / stackmix Goto Github PK
View Code? Open in Web Editor NEWA collection of templates for Routify.
A collection of templates for Routify.
Update svite to @sveltejs/vite-plugin-svelte
instead of @svitejs/vite-plugin-svelte
I created a stackmix project with serviceWorker features. After running npm run dev
, I got this:
error when starting dev server:
Error: The following dependencies are imported but could not be resolved:
workbox-window (imported by /home/zen/latihan/mainan/src/components/Serviceworker.svelte)
Are they installed?
at optimizeDeps (/home/zen/latihan/mainan/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-cc49d7be.js:72342:15)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async runOptimize (/home/zen/latihan/mainan/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-cc49d7be.js:73001:48)
at async Server.httpServer.listen (/home/zen/latihan/mainan/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-cc49d7be.js:73015:17)
npm ERR! code 1
npm ERR! path /home/zen/latihan/mainan
npm ERR! command failed
npm ERR! command sh -c vite
npm ERR! A complete log of this run can be found in:
npm ERR! /home/zen/.npm/_logs/2021-07-09T17_56_51_342Z-debug.log
ERROR: "dev:vite" exited with 1.
npm ERR! code 1
npm ERR! path /home/zen/latihan/mainan
npm ERR! command failed
npm ERR! command sh -c run-p dev:*
npm ERR! A complete log of this run can be found in:
npm ERR! /home/zen/.npm/_logs/2021-07-09T17_56_51_824Z-debug.log
I use pnpm i
for installing dependencies.
I decided to give routify-templates a try.
My comments below!
Not sure why it is downloading the whole of Playwright for me. Feels a bit heavy to download 250Mb+ worth of browsers?
I used these options:
✔ Pick a bundler. Combine at your own risk. › **rollup**
✔ Pick a template. Combine at your own risk. › **single-page**
✔ Pick features. › markdown, postcss, vercel
✔ Pick content. › content
✔ Misc › dev
Then when I try to run, spassr is not included, so my first run fails. Here's the package.json
(abbreviated):
{
"name": "routify-app",
"version": "1.0.0",
"@comments scripts": {
"dev": "run all dev:* scripts",
"dev:routify": "generate Routify's routes.js on filechange",
"build": "run all build:* scripts",
"build:routify": "build routify",
"serve": "serve content in 'dist' folder"
},
"scripts": {
"dev": "run-p dev:* serve:*",
"dev:routify": "routify",
"serve": "run-p serve:*",
"serve:spa": "spassr",
"serve:ssr": "spassr --ssr --port 5005",
"build": "cross-env NODE_ENV=production run-s build:*",
"build:routify": "routify -b",
"test": "npm run test:dev && npm run test:build",
"test:dev": "node test/lib/wrapper dev ava test/{common,dev}/**/*.test.js",
"test:build": "node test/lib/wrapper build ava test/{common,build}/**/*.test.js"
},
"devDependencies": {
"@roxi/routify": "^2.14.0",
"@ava/cooperate": "^0.1.0",
"fkill": "^7.1.0",
"npm-run-all": "^4.1.5",
"svelte": "^3.35.0",
"playwright": "^1.8.0",
"cross-env": "^7.0.3",
"mdsvex": "^0.8.9",
"remark-slug": "^6.0.0",
"routify-plugin-frontmatter": "^1.0.1",
"svelte-preprocess": "^4.6.3",
"postcss": "^8.2.4"
},
(...)
}
So I am thinking this need spassr and doesn't need playwright.
If I install spassr:
npm i spassr
I get it to run.
But then it fails to build, and I get a blank page on localhost:5000
[spassr] Serving ssr on localhost:5005
> error: Could not resolve "dist/build/main.js"
1 error
[tossr] Error on url: /
[tossr] Unhandled promise rejection:
[tossr] Error: Build failed with 1 error:
error: Could not resolve "dist/build/main.js"
at failureErrorWithLog (/Users/johanronsse/Sites/routify-templates/output/node_modules/esbuild/lib/main.js:1160:15)
at buildResponseToResult (/Users/johanronsse/Sites/routify-templates/output/node_modules/esbuild/lib/main.js:896:32)
at /Users/johanronsse/Sites/routify-templates/output/node_modules/esbuild/lib/main.js:991:20
at /Users/johanronsse/Sites/routify-templates/output/node_modules/esbuild/lib/main.js:542:9
at handleIncomingPacket (/Users/johanronsse/Sites/routify-templates/output/node_modules/esbuild/lib/main.js:631:9)
at Socket.readFromStdout (/Users/johanronsse/Sites/routify-templates/output/node_modules/esbuild/lib/main.js:509:7)
at Socket.emit (events.js:210:5)
at addChunk (_stream_readable.js:309:12)
at readableAddChunk (_stream_readable.js:290:11)
at Socket.Readable.push (_stream_readable.js:224:10) {
errors: [
{
detail: undefined,
location: null,
notes: [],
text: 'Could not resolve "dist/build/main.js"'
}
],
warnings: []
}
> error: Could not resolve "dist/build/main.js"
1 error
I chose the scroll template. In the default _layout.svelte I found some odd code. What's with the lines only containing ';'? Is this autogenerated from something?
<script>
import { components, beforeUrlChange, layout, page, url } from "@roxi/routify";
;
;
;
;
// we want smooth scrolling when navigating (hash links) within the same page
$beforeUrlChange(
(event, newRoute) => (document.documentElement.style["scrollBehavior"] = newRoute === $page ? "smooth" : "auto")
);
;
</script>
What about add Bootstrap CSS or Bulma CSS in "select features"?
Hi @dominikg and @jakobrosenberg, 👍 first on this. I wanted to ask if there are any plans to include typescript support since routify and vite supports it , and give users the option to choose between TS or JS
I get this error when I try to run npm run generate
in the cloned stackmix repo:
[error] No files matching the pattern were found: "/Users/user/Desktop/dev/contrib/stackmix/.canvasit-temp/output-hwoajQ/**/*.{js,svelte}".
(node:37847) UnhandledPromiseRejectionWarning: Error: Command failed: npx prettier "/Users/user/Desktop/dev/contrib/stackmix/.canvasit-temp/output-hwoajQ/**/*.{js,svelte}" --write --single-quote --no-semi
[error] No files matching the pattern were found: "/Users/user/Desktop/dev/contrib/stackmix/.canvasit-temp/output-hwoajQ/**/*.{js,svelte}".
at checkExecSyncError (child_process.js:616:11)
at execSync (child_process.js:652:15)
at run (/Users/user/Desktop/dev/contrib/stackmix/node_modules/canvasit/canvasit.js:131:9)
at async _run (/Users/user/Desktop/dev/contrib/stackmix/node_modules/canvasit/canvasit.js:46:16)
at async merge (/Users/user/Desktop/dev/contrib/stackmix/node_modules/canvasit/canvasit.js:76:20)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:37847) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:37847) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I've already tried to remove prettier from cli.js
, but that didn't worked either. Do you have any idea what's wrong?
Just posting some output here I got when setting up a new project using Stackmix which is not that clean.
Node 14.15.0
Could this be because I don't have prettier installed globally?
npx stackmix boekentorenroutify
npx: installed 130 in 5.645s
✔ Pick a bundler. Combine at your own risk. › vite
✔ Pick a template. Combine at your own risk. › scroll-navigation
✔ Pick features. › markdown, milligram, postcss, vercel
✔ Pick content. › content
✔ Misc › dev
ConfigError: Couldn't resolve parser "babel-ts"
at resolveParser$1 (/usr/local/lib/node_modules/prettier/bin-prettier.js:6974:13)
at normalize (/usr/local/lib/node_modules/prettier/bin-prettier.js:7065:19)
at textToDoc (/usr/local/lib/node_modules/prettier/bin-prettier.js:9830:21)
at /usr/local/lib/node_modules/prettier/bin-prettier.js:9824:14
at formatBodyContent (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1675:22)
at /Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1622:85
at embedTag (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1697:15)
at embedType (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1622:52)
at embedScript (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1623:41)
at Object.embed (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1632:20)
ConfigError: Couldn't resolve parser "babel-ts"
at resolveParser$1 (/usr/local/lib/node_modules/prettier/bin-prettier.js:6974:13)
at normalize (/usr/local/lib/node_modules/prettier/bin-prettier.js:7065:19)
at textToDoc (/usr/local/lib/node_modules/prettier/bin-prettier.js:9830:21)
at /usr/local/lib/node_modules/prettier/bin-prettier.js:9824:14
at formatBodyContent (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1675:22)
at /Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1622:85
at embedTag (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1697:15)
at embedType (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1622:52)
at embedScript (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1623:41)
at Object.embed (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1632:20)
ConfigError: Couldn't resolve parser "babel-ts"
at resolveParser$1 (/usr/local/lib/node_modules/prettier/bin-prettier.js:6974:13)
at normalize (/usr/local/lib/node_modules/prettier/bin-prettier.js:7065:19)
at textToDoc (/usr/local/lib/node_modules/prettier/bin-prettier.js:9830:21)
at /usr/local/lib/node_modules/prettier/bin-prettier.js:9824:14
at formatBodyContent (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1675:22)
at /Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1622:85
at embedTag (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1697:15)
at embedType (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1622:52)
at embedScript (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1623:41)
at Object.embed (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1632:20)
ConfigError: Couldn't resolve parser "babel-ts"
at resolveParser$1 (/usr/local/lib/node_modules/prettier/bin-prettier.js:6974:13)
at normalize (/usr/local/lib/node_modules/prettier/bin-prettier.js:7065:19)
at textToDoc (/usr/local/lib/node_modules/prettier/bin-prettier.js:9830:21)
at /usr/local/lib/node_modules/prettier/bin-prettier.js:9824:14
at formatBodyContent (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1675:22)
at /Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1622:85
at embedTag (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1697:15)
at embedType (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1622:52)
at embedScript (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1623:41)
at Object.embed (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1632:20)
ConfigError: Couldn't resolve parser "babel-ts"
at resolveParser$1 (/usr/local/lib/node_modules/prettier/bin-prettier.js:6974:13)
at normalize (/usr/local/lib/node_modules/prettier/bin-prettier.js:7065:19)
at textToDoc (/usr/local/lib/node_modules/prettier/bin-prettier.js:9830:21)
at /usr/local/lib/node_modules/prettier/bin-prettier.js:9824:14
at formatBodyContent (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1675:22)
at /Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1622:85
at embedTag (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1697:15)
at embedType (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1622:52)
at embedScript (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1623:41)
at Object.embed (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1632:20)
ConfigError: Couldn't resolve parser "babel-ts"
at resolveParser$1 (/usr/local/lib/node_modules/prettier/bin-prettier.js:6974:13)
at normalize (/usr/local/lib/node_modules/prettier/bin-prettier.js:7065:19)
at textToDoc (/usr/local/lib/node_modules/prettier/bin-prettier.js:9830:21)
at /usr/local/lib/node_modules/prettier/bin-prettier.js:9824:14
at formatBodyContent (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1675:22)
at /Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1622:85
at embedTag (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1697:15)
at embedType (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1622:52)
at embedScript (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1623:41)
at Object.embed (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1632:20)
ConfigError: Couldn't resolve parser "babel-ts"
at resolveParser$1 (/usr/local/lib/node_modules/prettier/bin-prettier.js:6974:13)
at normalize (/usr/local/lib/node_modules/prettier/bin-prettier.js:7065:19)
at textToDoc (/usr/local/lib/node_modules/prettier/bin-prettier.js:9830:21)
at /usr/local/lib/node_modules/prettier/bin-prettier.js:9824:14
at formatBodyContent (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1675:22)
at /Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1622:85
at embedTag (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1697:15)
at embedType (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1622:52)
at embedScript (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1623:41)
at Object.embed (/Users/johanronsse/.npm/_npx/34400/lib/node_modules/stackmix/node_modules/prettier-plugin-svelte/plugin.js:1632:20)```
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.