Absorb Snowpack config inside Astro (#32)
* Absorb Snowpack config inside Astro * Add basic README * Format tests * Update esbuild * Format tests
This commit is contained in:
parent
11637df579
commit
3ddd3594f0
20 changed files with 737 additions and 4541 deletions
50
README.md
Normal file
50
README.md
Normal file
|
@ -0,0 +1,50 @@
|
|||
# 👩🚀 Astro
|
||||
|
||||
A next-generation static-site generator with partial hydration. Use your favorite JS framework and ship bare-minimum JS (or none at all!).
|
||||
|
||||
## 🔧 Setup
|
||||
|
||||
```
|
||||
npm install astro
|
||||
```
|
||||
|
||||
TODO: astro boilerplate
|
||||
|
||||
## 🧞 Development
|
||||
|
||||
Add a `dev` npm script to your `/package.json` file:
|
||||
|
||||
```json
|
||||
{
|
||||
"scripts": {
|
||||
"dev": "astro dev ."
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Then run:
|
||||
|
||||
```
|
||||
npm run dev
|
||||
```
|
||||
|
||||
## 🚀 Build & Deployment
|
||||
|
||||
Add a `build` npm script to your `/package.json` file:
|
||||
|
||||
```json
|
||||
{
|
||||
"scripts": {
|
||||
"dev": "astro dev .",
|
||||
"build": "astro build ."
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Then run:
|
||||
|
||||
```
|
||||
npm run build
|
||||
```
|
||||
|
||||
Now upload the contents of `/_site_` to your favorite static site host.
|
|
@ -1,9 +1,15 @@
|
|||
|
||||
export default {
|
||||
projectRoot: '.',
|
||||
astroRoot: './astro',
|
||||
dist: './_site',
|
||||
extensions: {
|
||||
'.jsx': 'preact'
|
||||
}
|
||||
}
|
||||
'.jsx': 'preact',
|
||||
},
|
||||
snowpack: {
|
||||
optimize: {
|
||||
bundle: false,
|
||||
minify: true,
|
||||
target: 'es2018',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
4826
examples/snowpack/package-lock.json
generated
4826
examples/snowpack/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -10,18 +10,12 @@
|
|||
"lint": "prettier --check \"src/**/*.js\""
|
||||
},
|
||||
"dependencies": {
|
||||
"@material-ui/core": "^4.11.3",
|
||||
"date-fns": "^2.19.0",
|
||||
"deepmerge": "^4.2.2",
|
||||
"docsearch.js": "^2.6.3",
|
||||
"htm": "^3.0.4",
|
||||
"mdast-util-from-markdown": "^0.8.5",
|
||||
"mdast-util-toc": "^5.1.0",
|
||||
"preact": "^10.5.12",
|
||||
"preact-render-to-string": "^5.1.12",
|
||||
"react": "^17.0.1",
|
||||
"react-dom": "^17.0.1",
|
||||
"vue": "^3.0.7"
|
||||
"mdast-util-toc": "^5.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@11ty/eleventy": "^0.11.0",
|
||||
|
@ -29,26 +23,15 @@
|
|||
"@11ty/eleventy-plugin-syntaxhighlight": "^3.0.4",
|
||||
"@contentful/rich-text-html-renderer": "^14.1.2",
|
||||
"@contentful/rich-text-types": "^14.1.2",
|
||||
"@snowpack/plugin-postcss": "^1.0.7",
|
||||
"@snowpack/plugin-run-script": "^2.3.0",
|
||||
"@snowpack/plugin-sass": "^1.4.0",
|
||||
"@snowpack/plugin-svelte": "^3.5.2",
|
||||
"@snowpack/plugin-vue": "^2.3.0",
|
||||
"astro": "file:../../",
|
||||
"eleventy-plugin-nesting-toc": "^1.2.0",
|
||||
"luxon": "^1.25.0",
|
||||
"markdown-it": "^12.0.2",
|
||||
"markdown-it-anchor": "^6.0.0",
|
||||
"nodemon": "^2.0.7",
|
||||
"postcss-cli": "^8.3.0",
|
||||
"postcss-preset-env": "^6.7.0",
|
||||
"prettier": "^2.0.5",
|
||||
"snowpack": "^3.1.0-pre.14",
|
||||
"sass": "^1.32.8",
|
||||
"stylelint": "^13.8.0",
|
||||
"stylelint-config-prettier": "^8.0.2",
|
||||
"stylelint-config-rational-order": "^0.1.2",
|
||||
"stylelint-config-standard": "^20.0.0",
|
||||
"svelte": "^3.35.0"
|
||||
"stylelint-config-standard": "^20.0.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
/** @type {import("snowpack").SnowpackUserConfig } */
|
||||
module.exports = {
|
||||
|
||||
mount: {
|
||||
public: '/',
|
||||
//src: '/_dist_',
|
||||
},
|
||||
plugins: [
|
||||
['@snowpack/plugin-sass', { compilerOptions: { style: 'compressed' } }],
|
||||
'@snowpack/plugin-svelte',
|
||||
'@snowpack/plugin-vue',
|
||||
],
|
||||
packageOptions: {},
|
||||
buildOptions: {
|
||||
out: '_site',
|
||||
},
|
||||
optimize: {
|
||||
bundle: false,
|
||||
minify: true,
|
||||
target: 'es2018',
|
||||
},
|
||||
};
|
260
package-lock.json
generated
260
package-lock.json
generated
|
@ -223,6 +223,36 @@
|
|||
"integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==",
|
||||
"dev": true
|
||||
},
|
||||
"@snowpack/plugin-sass": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@snowpack/plugin-sass/-/plugin-sass-1.4.0.tgz",
|
||||
"integrity": "sha512-Hzz/TYt4IKcjrInv+FyujLohtJHadZCUdz5nnfh1N7MwplHFmxgLuKiT8tsiafHFAGsuR+4ZpFTqLeSyQTHAhQ==",
|
||||
"requires": {
|
||||
"execa": "^5.0.0",
|
||||
"find-up": "^5.0.0",
|
||||
"npm-run-path": "^4.0.1",
|
||||
"sass": "^1.3.0"
|
||||
}
|
||||
},
|
||||
"@snowpack/plugin-svelte": {
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@snowpack/plugin-svelte/-/plugin-svelte-3.6.0.tgz",
|
||||
"integrity": "sha512-YHzbkFOX8ahisc/SUk13Wd004KDPZRhIgalfCXCJIyRvgstPuOZ3ejcirYcPlyf1+G4mW69HLN7/y98JPTvAJA==",
|
||||
"requires": {
|
||||
"rollup-plugin-svelte": "^7.0.0",
|
||||
"svelte-hmr": "^0.12.1",
|
||||
"svelte-preprocess": "^4.6.0"
|
||||
}
|
||||
},
|
||||
"@snowpack/plugin-vue": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@snowpack/plugin-vue/-/plugin-vue-2.3.0.tgz",
|
||||
"integrity": "sha512-W53I7nZrHaV85yNqo9PaD1M0FS0Ftw9+eiGf8mez7lyvSd//MGAhdIjXO7Xn2RhnBauM/BnbnUxu/L/2/P5FiA==",
|
||||
"requires": {
|
||||
"@vue/compiler-sfc": "^3.0.0",
|
||||
"hash-sum": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"@szmarczak/http-timer": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz",
|
||||
|
@ -281,6 +311,11 @@
|
|||
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.3.tgz",
|
||||
"integrity": "sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw=="
|
||||
},
|
||||
"@types/pug": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/pug/-/pug-2.0.4.tgz",
|
||||
"integrity": "sha1-h3L80EGOPNLMFxVV1zAHQVBR9LI="
|
||||
},
|
||||
"@types/react": {
|
||||
"version": "17.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.3.tgz",
|
||||
|
@ -310,7 +345,6 @@
|
|||
"version": "1.16.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/sass/-/sass-1.16.0.tgz",
|
||||
"integrity": "sha512-2XZovu4NwcqmtZtsBR5XYLw18T8cBCnU2USFHTnYLLHz9fkhnoEMoDsqShJIOFsFhn5aJHjweiUUdTrDGujegA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/node": "*"
|
||||
}
|
||||
|
@ -459,6 +493,49 @@
|
|||
"@vue/shared": "3.0.7"
|
||||
}
|
||||
},
|
||||
"@vue/compiler-sfc": {
|
||||
"version": "3.0.7",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.0.7.tgz",
|
||||
"integrity": "sha512-37/QILpGE+J3V+bP9Slg9e6xGqfk+MmS2Yj8ChR4fS0/qWUU/YoYHE0GPIzjmBdH0JVOOmJqunxowIXmqNiHng==",
|
||||
"requires": {
|
||||
"@babel/parser": "^7.12.0",
|
||||
"@babel/types": "^7.12.0",
|
||||
"@vue/compiler-core": "3.0.7",
|
||||
"@vue/compiler-dom": "3.0.7",
|
||||
"@vue/compiler-ssr": "3.0.7",
|
||||
"@vue/shared": "3.0.7",
|
||||
"consolidate": "^0.16.0",
|
||||
"estree-walker": "^2.0.1",
|
||||
"hash-sum": "^2.0.0",
|
||||
"lru-cache": "^5.1.1",
|
||||
"magic-string": "^0.25.7",
|
||||
"merge-source-map": "^1.1.0",
|
||||
"postcss": "^8.1.10",
|
||||
"postcss-modules": "^4.0.0",
|
||||
"postcss-selector-parser": "^6.0.4",
|
||||
"source-map": "^0.6.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"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=="
|
||||
},
|
||||
"lru-cache": {
|
||||
"version": "5.1.1",
|
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
|
||||
"integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
|
||||
"requires": {
|
||||
"yallist": "^3.0.2"
|
||||
}
|
||||
},
|
||||
"yallist": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
|
||||
"integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"@vue/compiler-ssr": {
|
||||
"version": "3.0.7",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.0.7.tgz",
|
||||
|
@ -660,6 +737,11 @@
|
|||
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz",
|
||||
"integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA=="
|
||||
},
|
||||
"bluebird": {
|
||||
"version": "3.7.2",
|
||||
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
|
||||
"integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg=="
|
||||
},
|
||||
"boolbase": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz",
|
||||
|
@ -1003,6 +1085,14 @@
|
|||
"xdg-basedir": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"consolidate": {
|
||||
"version": "0.16.0",
|
||||
"resolved": "https://registry.npmjs.org/consolidate/-/consolidate-0.16.0.tgz",
|
||||
"integrity": "sha512-Nhl1wzCslqXYTJVDyJCu3ODohy9OfBMB5uD2BiBTzd7w+QY0lBzafkR8y8755yMYHAaMD4NuzbAw03/xzfw+eQ==",
|
||||
"requires": {
|
||||
"bluebird": "^3.7.2"
|
||||
}
|
||||
},
|
||||
"copyfiles": {
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/copyfiles/-/copyfiles-2.4.1.tgz",
|
||||
|
@ -1028,7 +1118,6 @@
|
|||
"version": "7.0.3",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
||||
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"path-key": "^3.1.0",
|
||||
"shebang-command": "^2.0.0",
|
||||
|
@ -1151,6 +1240,11 @@
|
|||
"integrity": "sha512-q9K8BlJVxK7hQYqa6XISGmBZbtQQWVXSrRrWreHC94rMt1QL/Impruc+7p2CYSYuVIUr+YCt6hjrs1kkdJRTug==",
|
||||
"dev": true
|
||||
},
|
||||
"detect-indent": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.0.0.tgz",
|
||||
"integrity": "sha512-oSyFlqaTHCItVRGK5RmrmjB+CmaMOW7IaNA/kdxqhoa6d17j/5ce9O9eWXmV/KEdRwqpQA+Vqe8a8Bsybu4YnA=="
|
||||
},
|
||||
"diff": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz",
|
||||
|
@ -1288,9 +1382,9 @@
|
|||
"integrity": "sha512-ooYciCUtfw6/d2w56UVeqHPcoCFAiJdz5XOkYpv/Txl1HMUozpXjz/2RIQgqwKdXNDPSF1W7mJCFse3G+HDyAA=="
|
||||
},
|
||||
"esbuild": {
|
||||
"version": "0.9.6",
|
||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.9.6.tgz",
|
||||
"integrity": "sha512-F6vASxU0wT/Davt9aj2qtDwDNSkQxh9VbyO56M7PDWD+D/Vgq/rmUDGDQo7te76W5auauVojjnQr/wTu3vpaUA=="
|
||||
"version": "0.10.1",
|
||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.10.1.tgz",
|
||||
"integrity": "sha512-JSZpNt0sCb5KtUwHR3ddTY7T85xwasbqrVbxJ57iFOR00dCeD/HwAqIsUSXR1O9Nnt4z/7oWLasUCgBnhBFcdg=="
|
||||
},
|
||||
"escalade": {
|
||||
"version": "3.1.1",
|
||||
|
@ -1549,6 +1643,29 @@
|
|||
"integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
|
||||
"dev": true
|
||||
},
|
||||
"execa": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/execa/-/execa-5.0.0.tgz",
|
||||
"integrity": "sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ==",
|
||||
"requires": {
|
||||
"cross-spawn": "^7.0.3",
|
||||
"get-stream": "^6.0.0",
|
||||
"human-signals": "^2.1.0",
|
||||
"is-stream": "^2.0.0",
|
||||
"merge-stream": "^2.0.0",
|
||||
"npm-run-path": "^4.0.1",
|
||||
"onetime": "^5.1.2",
|
||||
"signal-exit": "^3.0.3",
|
||||
"strip-final-newline": "^2.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"get-stream": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.0.tgz",
|
||||
"integrity": "sha512-A1B3Bh1UmL0bidM/YX2NsCOTnGJePL9rO/M+Mw3m9f2gUpfokS0hi5Eah0WSUEWZdZhIZtMjkIYS7mDfOqNHbg=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"extend-shallow": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
|
||||
|
@ -1834,6 +1951,11 @@
|
|||
"integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==",
|
||||
"dev": true
|
||||
},
|
||||
"hash-sum": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-2.0.0.tgz",
|
||||
"integrity": "sha512-WdZTbAByD+pHfl/g9QSsBIIwy8IT+EsPiKDs0KNX+zSHhdDLFKdZu0BQHljvO+0QI/BasbMSUa8wYNCZTvhslg=="
|
||||
},
|
||||
"hosted-git-info": {
|
||||
"version": "2.8.8",
|
||||
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz",
|
||||
|
@ -1889,6 +2011,11 @@
|
|||
"integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==",
|
||||
"dev": true
|
||||
},
|
||||
"human-signals": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz",
|
||||
"integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw=="
|
||||
},
|
||||
"icss-replace-symbols": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz",
|
||||
|
@ -2077,6 +2204,11 @@
|
|||
"integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==",
|
||||
"dev": true
|
||||
},
|
||||
"is-stream": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz",
|
||||
"integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw=="
|
||||
},
|
||||
"is-typedarray": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
|
||||
|
@ -2106,8 +2238,7 @@
|
|||
"isexe": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
||||
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
|
||||
"dev": true
|
||||
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA="
|
||||
},
|
||||
"js-tokens": {
|
||||
"version": "4.0.0",
|
||||
|
@ -2290,6 +2421,19 @@
|
|||
"resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz",
|
||||
"integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow=="
|
||||
},
|
||||
"merge-source-map": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.1.0.tgz",
|
||||
"integrity": "sha512-Qkcp7P2ygktpMPh2mCQZaf3jhN6D3Z/qVZHSdWvQ+2Ef5HgRAPBO57A77+ENm0CPx2+1Ce/MYKi3ymqdfuqibw==",
|
||||
"requires": {
|
||||
"source-map": "^0.6.1"
|
||||
}
|
||||
},
|
||||
"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=="
|
||||
},
|
||||
"merge2": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
|
||||
|
@ -2365,12 +2509,22 @@
|
|||
"picomatch": "^2.0.5"
|
||||
}
|
||||
},
|
||||
"mimic-fn": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
|
||||
"integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg=="
|
||||
},
|
||||
"mimic-response": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz",
|
||||
"integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==",
|
||||
"dev": true
|
||||
},
|
||||
"min-indent": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz",
|
||||
"integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg=="
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||
|
@ -2499,6 +2653,14 @@
|
|||
"integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==",
|
||||
"dev": true
|
||||
},
|
||||
"npm-run-path": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz",
|
||||
"integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==",
|
||||
"requires": {
|
||||
"path-key": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"nth-check": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.0.0.tgz",
|
||||
|
@ -2522,6 +2684,14 @@
|
|||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"onetime": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz",
|
||||
"integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==",
|
||||
"requires": {
|
||||
"mimic-fn": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"open": {
|
||||
"version": "7.4.2",
|
||||
"resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz",
|
||||
|
@ -2655,8 +2825,7 @@
|
|||
"path-key": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
|
||||
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
|
||||
"dev": true
|
||||
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="
|
||||
},
|
||||
"path-parse": {
|
||||
"version": "1.0.6",
|
||||
|
@ -2955,6 +3124,11 @@
|
|||
"integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==",
|
||||
"dev": true
|
||||
},
|
||||
"require-relative": {
|
||||
"version": "0.8.7",
|
||||
"resolved": "https://registry.npmjs.org/require-relative/-/require-relative-0.8.7.tgz",
|
||||
"integrity": "sha1-eZlTn8ngR6N5KPoZb44VY9q9Nt4="
|
||||
},
|
||||
"resolve": {
|
||||
"version": "1.20.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz",
|
||||
|
@ -3002,6 +3176,30 @@
|
|||
"fsevents": "~2.3.1"
|
||||
}
|
||||
},
|
||||
"rollup-plugin-svelte": {
|
||||
"version": "7.1.0",
|
||||
"resolved": "https://registry.npmjs.org/rollup-plugin-svelte/-/rollup-plugin-svelte-7.1.0.tgz",
|
||||
"integrity": "sha512-vopCUq3G+25sKjwF5VilIbiY6KCuMNHP1PFvx2Vr3REBNMDllKHFZN2B9jwwC+MqNc3UPKkjXnceLPEjTjXGXg==",
|
||||
"requires": {
|
||||
"require-relative": "^0.8.7",
|
||||
"rollup-pluginutils": "^2.8.2"
|
||||
}
|
||||
},
|
||||
"rollup-pluginutils": {
|
||||
"version": "2.8.2",
|
||||
"resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz",
|
||||
"integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==",
|
||||
"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=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"run-parallel": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
|
||||
|
@ -3082,7 +3280,6 @@
|
|||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
|
||||
"integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"shebang-regex": "^3.0.0"
|
||||
}
|
||||
|
@ -3090,14 +3287,12 @@
|
|||
"shebang-regex": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
|
||||
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
|
||||
"dev": true
|
||||
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="
|
||||
},
|
||||
"signal-exit": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz",
|
||||
"integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==",
|
||||
"dev": true
|
||||
"integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA=="
|
||||
},
|
||||
"slash": {
|
||||
"version": "3.0.0",
|
||||
|
@ -3130,6 +3325,13 @@
|
|||
"picomatch": "^2.2.2",
|
||||
"resolve": "^1.20.0",
|
||||
"rollup": "^2.34.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"esbuild": {
|
||||
"version": "0.9.7",
|
||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.9.7.tgz",
|
||||
"integrity": "sha512-VtUf6aQ89VTmMLKrWHYG50uByMF4JQlVysb8dmg6cOgW8JnFCipmz7p+HNBl+RR3LLCuBxFGVauAe2wfnF9bLg=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"source-map": {
|
||||
|
@ -3238,6 +3440,19 @@
|
|||
"resolved": "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz",
|
||||
"integrity": "sha1-5SEekiQ2n7uB1jOi8ABE3IztrZI="
|
||||
},
|
||||
"strip-final-newline": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz",
|
||||
"integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA=="
|
||||
},
|
||||
"strip-indent": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz",
|
||||
"integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==",
|
||||
"requires": {
|
||||
"min-indent": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"strip-json-comments": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
|
||||
|
@ -3257,6 +3472,22 @@
|
|||
"resolved": "https://registry.npmjs.org/svelte/-/svelte-3.35.0.tgz",
|
||||
"integrity": "sha512-gknlZkR2sXheu/X+B7dDImwANVvK1R0QGQLd8CNIfxxGPeXBmePnxfzb6fWwTQRsYQG7lYkZXvpXJvxvpsoB7g=="
|
||||
},
|
||||
"svelte-hmr": {
|
||||
"version": "0.12.9",
|
||||
"resolved": "https://registry.npmjs.org/svelte-hmr/-/svelte-hmr-0.12.9.tgz",
|
||||
"integrity": "sha512-SGE7Odznj4dqZtUVIWcoPCvZ9gHImxVIIjrz+O3DDSi0j4OaSLim6MRF4UdhlBKeW3glSRc+tXNSKYvM5x+Dyw=="
|
||||
},
|
||||
"svelte-preprocess": {
|
||||
"version": "4.7.0",
|
||||
"resolved": "https://registry.npmjs.org/svelte-preprocess/-/svelte-preprocess-4.7.0.tgz",
|
||||
"integrity": "sha512-iNrY4YGqi0LD2e6oT9YbdSzOKntxk8gmzfqso1z/lUJOZh4o6fyIqkirmiZ8/dDJFqtIE1spVgDFWgkfhLEYlw==",
|
||||
"requires": {
|
||||
"@types/pug": "^2.0.4",
|
||||
"@types/sass": "^1.16.0",
|
||||
"detect-indent": "^6.0.0",
|
||||
"strip-indent": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"table": {
|
||||
"version": "6.0.7",
|
||||
"resolved": "https://registry.npmjs.org/table/-/table-6.0.7.tgz",
|
||||
|
@ -3567,7 +3798,6 @@
|
|||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"isexe": "^2.0.0"
|
||||
}
|
||||
|
|
|
@ -26,6 +26,9 @@
|
|||
"dependencies": {
|
||||
"@babel/generator": "^7.13.9",
|
||||
"@babel/traverse": "^7.13.0",
|
||||
"@snowpack/plugin-sass": "^1.4.0",
|
||||
"@snowpack/plugin-svelte": "^3.6.0",
|
||||
"@snowpack/plugin-vue": "^2.3.0",
|
||||
"@types/babel__generator": "^7.6.2",
|
||||
"@types/babel__traverse": "^7.11.1",
|
||||
"@types/estree": "0.0.46",
|
||||
|
@ -41,7 +44,7 @@
|
|||
"deepmerge": "^4.2.2",
|
||||
"domhandler": "^4.0.0",
|
||||
"es-module-lexer": "^0.4.1",
|
||||
"esbuild": "^0.9.6",
|
||||
"esbuild": "^0.10.1",
|
||||
"find-up": "^5.0.0",
|
||||
"github-slugger": "^1.3.0",
|
||||
"gray-matter": "^4.0.2",
|
||||
|
|
|
@ -5,14 +5,14 @@ import { promises as fsPromises } from 'fs';
|
|||
import yargs from 'yargs-parser';
|
||||
|
||||
import { loadConfig } from './config.js';
|
||||
import {build} from './build.js';
|
||||
import { build } from './build.js';
|
||||
import devServer from './dev.js';
|
||||
|
||||
const { readFile } = fsPromises;
|
||||
const buildAndExit = async (...args: Parameters<typeof build>) => {
|
||||
const ret = await build(...args);
|
||||
process.exit(ret);
|
||||
}
|
||||
};
|
||||
|
||||
type Arguments = yargs.Arguments;
|
||||
type cliState = 'help' | 'version' | 'dev' | 'build';
|
||||
|
|
|
@ -138,13 +138,17 @@ export async function createRuntime(astroConfig: AstroConfig, { env, logging }:
|
|||
mount: {
|
||||
[astroRoot.pathname]: '/_astro',
|
||||
[internalPath.pathname]: '/_astro_internal',
|
||||
public: '/',
|
||||
},
|
||||
plugins: [[new URL('../snowpack-plugin.cjs', import.meta.url).pathname, astroPlugOptions]],
|
||||
plugins: [[new URL('../snowpack-plugin.cjs', import.meta.url).pathname, astroPlugOptions], '@snowpack/plugin-sass', '@snowpack/plugin-svelte', '@snowpack/plugin-vue'],
|
||||
devOptions: {
|
||||
open: 'none',
|
||||
output: 'stream',
|
||||
port: 0,
|
||||
},
|
||||
buildOptions: {
|
||||
out: astroConfig.dist,
|
||||
},
|
||||
packageOptions: {
|
||||
knownEntrypoints: ['preact-render-to-string'],
|
||||
external: ['@vue/server-renderer', 'node-fetch'],
|
||||
|
|
|
@ -11,19 +11,19 @@ Basics.before(async () => {
|
|||
const astroConfig = {
|
||||
projectRoot: new URL('./fixtures/astro-basic/', import.meta.url),
|
||||
hmxRoot: new URL('./fixtures/astro-basic/astro/', import.meta.url),
|
||||
dist: './_site'
|
||||
dist: './_site',
|
||||
};
|
||||
|
||||
const logging = {
|
||||
level: 'error',
|
||||
dest: process.stderr
|
||||
dest: process.stderr,
|
||||
};
|
||||
|
||||
runtime = await createRuntime(astroConfig, logging);
|
||||
});
|
||||
|
||||
Basics.after(async () => {
|
||||
await runtime && runtime.shutdown();
|
||||
(await runtime) && runtime.shutdown();
|
||||
});
|
||||
|
||||
Basics('Can load page', async () => {
|
||||
|
|
|
@ -13,19 +13,19 @@ Markdown.before(async () => {
|
|||
|
||||
const logging = {
|
||||
level: 'error',
|
||||
dest: process.stderr
|
||||
dest: process.stderr,
|
||||
};
|
||||
|
||||
try {
|
||||
runtime = await createRuntime(astroConfig, logging);
|
||||
} catch(err) {
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
setupError = err;
|
||||
}
|
||||
});
|
||||
|
||||
Markdown.after(async () => {
|
||||
runtime && runtime.shutdown();
|
||||
(await runtime) && runtime.shutdown();
|
||||
});
|
||||
|
||||
Markdown('No errors creating a runtime', () => {
|
||||
|
|
5
test/fixtures/astro-basic/astro.config.mjs
vendored
5
test/fixtures/astro-basic/astro.config.mjs
vendored
|
@ -1,6 +1,5 @@
|
|||
|
||||
export default {
|
||||
projectRoot: '.',
|
||||
astroRoot: './astro',
|
||||
dist: './_site'
|
||||
}
|
||||
dist: './_site',
|
||||
};
|
||||
|
|
5
test/fixtures/astro-basic/snowpack.config.js
vendored
5
test/fixtures/astro-basic/snowpack.config.js
vendored
|
@ -1,5 +0,0 @@
|
|||
export default {
|
||||
mount: {
|
||||
|
||||
}
|
||||
};
|
|
@ -1,9 +1,8 @@
|
|||
|
||||
export default {
|
||||
projectRoot: '.',
|
||||
astroRoot: './astro',
|
||||
dist: './_site',
|
||||
extensions: {
|
||||
'.jsx': 'preact'
|
||||
}
|
||||
}
|
||||
'.jsx': 'preact',
|
||||
},
|
||||
};
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
export default {
|
||||
mount: {
|
||||
|
||||
}
|
||||
};
|
|
@ -1,7 +1,6 @@
|
|||
|
||||
export default {
|
||||
projectRoot: '.',
|
||||
astroRoot: './astro',
|
||||
dist: './_site'
|
||||
dist: './_site',
|
||||
// No extensions needed, React is the default.
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
export default {
|
||||
mount: {
|
||||
|
||||
}
|
||||
};
|
|
@ -13,19 +13,19 @@ React.before(async () => {
|
|||
|
||||
const logging = {
|
||||
level: 'error',
|
||||
dest: process.stderr
|
||||
dest: process.stderr,
|
||||
};
|
||||
|
||||
try {
|
||||
runtime = await createRuntime(astroConfig, logging);
|
||||
} catch(err) {
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
setupError = err;
|
||||
}
|
||||
});
|
||||
|
||||
React.after(async () => {
|
||||
await runtime.shutdown();
|
||||
(await runtime) && runtime.shutdown();
|
||||
});
|
||||
|
||||
React('No error creating the runtime', () => {
|
||||
|
|
|
@ -13,7 +13,7 @@ const SnowpackDev = suite('snowpack.dev');
|
|||
let runtime, cwd, setupError;
|
||||
|
||||
SnowpackDev.before(async () => {
|
||||
// Bug: Snowpack config is still loaded relative to the current working directory.
|
||||
// Bug: Snowpack config is still loaded relative to the current working directory.
|
||||
cwd = process.cwd();
|
||||
process.chdir(new URL('../examples/snowpack/', import.meta.url).pathname);
|
||||
|
||||
|
@ -26,7 +26,7 @@ SnowpackDev.before(async () => {
|
|||
|
||||
try {
|
||||
runtime = await createRuntime(astroConfig, logging);
|
||||
} catch(err) {
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
setupError = err;
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ SnowpackDev.before(async () => {
|
|||
|
||||
SnowpackDev.after(async () => {
|
||||
process.chdir(cwd);
|
||||
await runtime && runtime.shutdown();
|
||||
(await runtime) && runtime.shutdown();
|
||||
});
|
||||
|
||||
async function* allPageFiles(root) {
|
||||
|
@ -72,7 +72,7 @@ SnowpackDev('Can load every page', async () => {
|
|||
}
|
||||
const result = await runtime.load(pathname);
|
||||
if (result.statusCode === 500) {
|
||||
failed.push({...result, pathname});
|
||||
failed.push({ ...result, pathname });
|
||||
continue;
|
||||
}
|
||||
assert.equal(result.statusCode, 200, `Loading ${pathname}`);
|
||||
|
|
Loading…
Reference in a new issue