mirror of
https://github.com/modernweb-dev/rocket.git
synced 2026-03-10 08:51:24 +00:00
feat: setup wireit and use it for the types generation
This commit is contained in:
8
.github/workflows/release.yml
vendored
8
.github/workflows/release.yml
vendored
@@ -12,6 +12,8 @@ jobs:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: google/wireit@setup-github-actions-caching/v1
|
||||
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@master
|
||||
with:
|
||||
@@ -27,12 +29,6 @@ jobs:
|
||||
- name: Install Dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build Packages
|
||||
run: npm run build:packages
|
||||
|
||||
- name: Build Types
|
||||
run: npm run types
|
||||
|
||||
- name: Create Release Pull Request or Publish to npm
|
||||
id: changesets
|
||||
uses: changesets/action@master
|
||||
|
||||
4
.github/workflows/verify.yml
vendored
4
.github/workflows/verify.yml
vendored
@@ -10,6 +10,7 @@ jobs:
|
||||
matrix:
|
||||
node-version: [18.x]
|
||||
steps:
|
||||
- uses: google/wireit@setup-github-actions-caching/v1
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Node ${{ matrix.node-version }}
|
||||
@@ -26,9 +27,6 @@ jobs:
|
||||
- name: Install Playwright
|
||||
run: npx playwright install
|
||||
|
||||
- name: Build Packages
|
||||
run: npm run build:packages
|
||||
|
||||
- name: Lint
|
||||
run: npm run lint
|
||||
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -21,6 +21,7 @@ dist
|
||||
dist-types
|
||||
stats.html
|
||||
*.tsbuildinfo
|
||||
.wireit
|
||||
|
||||
# Rocket Search
|
||||
rocket-search-index.json
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "package.json",
|
||||
"author": "Jaydan Urwin <jaydan@jaydanurwin.com>",
|
||||
"license": "UNLICENSED",
|
||||
"scripts": {
|
||||
|
||||
348
package-lock.json
generated
348
package-lock.json
generated
@@ -56,7 +56,8 @@
|
||||
"rollup-plugin-terser": "^7.0.2",
|
||||
"sinon": "^9.2.3",
|
||||
"ts-node": "^9.1.1",
|
||||
"typescript": "^4.8.4"
|
||||
"typescript": "^4.8.4",
|
||||
"wireit": "^0.7.2"
|
||||
}
|
||||
},
|
||||
"examples/01-hydration-starter": {
|
||||
@@ -2972,28 +2973,6 @@
|
||||
"resolved": "presets/spark",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@rollup/plugin-babel": {
|
||||
"version": "5.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz",
|
||||
"integrity": "sha512-WFfdLWU/xVWKeRQnKmIAQULUI7Il0gZnBIH/ZFO069wYIfPu+8zrfp/KMW0atmELoRDq8FbiP3VCss9MhCut7Q==",
|
||||
"dependencies": {
|
||||
"@babel/helper-module-imports": "^7.10.4",
|
||||
"@rollup/pluginutils": "^3.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 10.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0",
|
||||
"@types/babel__core": "^7.1.9",
|
||||
"rollup": "^1.20.0||^2.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@types/babel__core": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@rollup/plugin-commonjs": {
|
||||
"version": "17.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-17.1.0.tgz",
|
||||
@@ -3047,15 +3026,60 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rollup/plugin-replace": {
|
||||
"version": "2.4.2",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-2.4.2.tgz",
|
||||
"integrity": "sha512-IGcu+cydlUMZ5En85jxHH4qj2hta/11BHq95iHEyb2sbgiN0eCdzvUcHw5gt9pBL5lTi4JDYJ1acCoMGpTvEZg==",
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-5.0.1.tgz",
|
||||
"integrity": "sha512-Z3MfsJ4CK17BfGrZgvrcp/l6WXoKb0kokULO+zt/7bmcyayokDaQ2K3eDJcRLCTAlp5FPI4/gz9MHAsosz4Rag==",
|
||||
"dependencies": {
|
||||
"@rollup/pluginutils": "^3.1.0",
|
||||
"magic-string": "^0.25.7"
|
||||
"@rollup/pluginutils": "^5.0.1",
|
||||
"magic-string": "^0.26.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"rollup": "^1.20.0 || ^2.0.0"
|
||||
"rollup": "^1.20.0||^2.0.0||^3.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"rollup": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@rollup/plugin-replace/node_modules/@rollup/pluginutils": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.2.tgz",
|
||||
"integrity": "sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==",
|
||||
"dependencies": {
|
||||
"@types/estree": "^1.0.0",
|
||||
"estree-walker": "^2.0.2",
|
||||
"picomatch": "^2.3.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"rollup": "^1.20.0||^2.0.0||^3.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"rollup": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@rollup/plugin-replace/node_modules/@types/estree": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.0.tgz",
|
||||
"integrity": "sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ=="
|
||||
},
|
||||
"node_modules/@rollup/plugin-replace/node_modules/magic-string": {
|
||||
"version": "0.26.7",
|
||||
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.26.7.tgz",
|
||||
"integrity": "sha512-hX9XH3ziStPoPhJxLq1syWuZMxbDvGNbVchfrdCtanC7D13888bMFow61x8axrx+GfHLtVeAx2kxL7tTGRl+Ow==",
|
||||
"dependencies": {
|
||||
"sourcemap-codec": "^1.4.8"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@rollup/plugin-typescript": {
|
||||
@@ -8594,6 +8618,12 @@
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/jsonc-parser": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz",
|
||||
"integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/jsonfile": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
|
||||
@@ -11580,6 +11610,17 @@
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/proper-lockfile": {
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/proper-lockfile/-/proper-lockfile-4.1.2.tgz",
|
||||
"integrity": "sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"graceful-fs": "^4.2.4",
|
||||
"retry": "^0.12.0",
|
||||
"signal-exit": "^3.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/property-information": {
|
||||
"version": "6.1.1",
|
||||
"resolved": "https://registry.npmjs.org/property-information/-/property-information-6.1.1.tgz",
|
||||
@@ -12611,6 +12652,15 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/retry": {
|
||||
"version": "0.12.0",
|
||||
"resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz",
|
||||
"integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">= 4"
|
||||
}
|
||||
},
|
||||
"node_modules/reusify": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz",
|
||||
@@ -14644,6 +14694,25 @@
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/wireit": {
|
||||
"version": "0.7.2",
|
||||
"resolved": "https://registry.npmjs.org/wireit/-/wireit-0.7.2.tgz",
|
||||
"integrity": "sha512-Zjq50QH5hguk64hXfJmJJpLGgi8TUy7780w0u2VXK325qWxJtw1fP6HhOYcdjTWeoYLWQDDkTytQ119y/UMseg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"braces": "^3.0.2",
|
||||
"chokidar": "^3.5.3",
|
||||
"fast-glob": "^3.2.11",
|
||||
"jsonc-parser": "^3.0.0",
|
||||
"proper-lockfile": "^4.1.2"
|
||||
},
|
||||
"bin": {
|
||||
"wireit": "bin/wireit.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.14.0"
|
||||
}
|
||||
},
|
||||
"node_modules/word-wrap": {
|
||||
"version": "1.2.3",
|
||||
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
|
||||
@@ -15084,12 +15153,13 @@
|
||||
"@babel/core": "^7.12.10",
|
||||
"@babel/preset-env": "^7.12.11",
|
||||
"@rollup/plugin-babel": "^5.2.2",
|
||||
"@rollup/plugin-node-resolve": "^11.0.1",
|
||||
"@rollup/plugin-replace": "^2.4.2",
|
||||
"@rollup/plugin-node-resolve": "^15.0.1",
|
||||
"@rollup/plugin-replace": "^5.0.1",
|
||||
"@web/rollup-plugin-html": "^1.8.0",
|
||||
"@web/rollup-plugin-import-meta-assets": "^1.0.4",
|
||||
"@web/rollup-plugin-polyfills-loader": "^1.1.0",
|
||||
"browserslist": "^4.16.1",
|
||||
"plugins-manager": "^0.3.1",
|
||||
"rollup-plugin-terser": "^7.0.2",
|
||||
"workbox-broadcast-update": "^6.1.5",
|
||||
"workbox-cacheable-response": "^6.1.5",
|
||||
@@ -15101,25 +15171,83 @@
|
||||
"rollup": "^2.35.0"
|
||||
}
|
||||
},
|
||||
"packages/building-rollup/node_modules/@rollup/plugin-node-resolve": {
|
||||
"version": "11.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.1.tgz",
|
||||
"integrity": "sha512-yc2n43jcqVyGE2sqV5/YCmocy9ArjVAP/BeXyTtADTBBX6V0e5UMqwO8CdQ0kzjb6zu5P1qMzsScCMRvE9OlVg==",
|
||||
"packages/building-rollup/node_modules/@rollup/plugin-babel": {
|
||||
"version": "5.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz",
|
||||
"integrity": "sha512-WFfdLWU/xVWKeRQnKmIAQULUI7Il0gZnBIH/ZFO069wYIfPu+8zrfp/KMW0atmELoRDq8FbiP3VCss9MhCut7Q==",
|
||||
"dependencies": {
|
||||
"@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.19.0"
|
||||
"@babel/helper-module-imports": "^7.10.4",
|
||||
"@rollup/pluginutils": "^3.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 10.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0",
|
||||
"@types/babel__core": "^7.1.9",
|
||||
"rollup": "^1.20.0||^2.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@types/babel__core": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"packages/building-rollup/node_modules/@rollup/plugin-node-resolve": {
|
||||
"version": "15.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.0.1.tgz",
|
||||
"integrity": "sha512-ReY88T7JhJjeRVbfCyNj+NXAG3IIsVMsX9b5/9jC98dRP8/yxlZdz7mHZbHk5zHr24wZZICS5AcXsFZAXYUQEg==",
|
||||
"dependencies": {
|
||||
"@rollup/pluginutils": "^5.0.1",
|
||||
"@types/resolve": "1.20.2",
|
||||
"deepmerge": "^4.2.2",
|
||||
"is-builtin-module": "^3.2.0",
|
||||
"is-module": "^1.0.0",
|
||||
"resolve": "^1.22.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"rollup": "^2.78.0||^3.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"rollup": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"packages/building-rollup/node_modules/@rollup/plugin-node-resolve/node_modules/@rollup/pluginutils": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.2.tgz",
|
||||
"integrity": "sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==",
|
||||
"dependencies": {
|
||||
"@types/estree": "^1.0.0",
|
||||
"estree-walker": "^2.0.2",
|
||||
"picomatch": "^2.3.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"rollup": "^1.20.0||^2.0.0||^3.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"rollup": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"packages/building-rollup/node_modules/@types/estree": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.0.tgz",
|
||||
"integrity": "sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ=="
|
||||
},
|
||||
"packages/building-rollup/node_modules/@types/resolve": {
|
||||
"version": "1.20.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz",
|
||||
"integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q=="
|
||||
},
|
||||
"packages/check-html-links": {
|
||||
"version": "0.2.4",
|
||||
"license": "MIT",
|
||||
@@ -15317,6 +15445,7 @@
|
||||
"@rocket/engine": "^0.2.7",
|
||||
"@webcomponents/template-shadowroot": "^0.1.0",
|
||||
"lit": "^2.3.0",
|
||||
"plugins-manager": "^0.3.1",
|
||||
"workbox-window": "^6.1.5"
|
||||
}
|
||||
},
|
||||
@@ -17567,12 +17696,13 @@
|
||||
"@babel/core": "^7.12.10",
|
||||
"@babel/preset-env": "^7.12.11",
|
||||
"@rollup/plugin-babel": "^5.2.2",
|
||||
"@rollup/plugin-node-resolve": "^11.0.1",
|
||||
"@rollup/plugin-replace": "^2.4.2",
|
||||
"@rollup/plugin-node-resolve": "^15.0.1",
|
||||
"@rollup/plugin-replace": "^5.0.1",
|
||||
"@web/rollup-plugin-html": "^1.8.0",
|
||||
"@web/rollup-plugin-import-meta-assets": "^1.0.4",
|
||||
"@web/rollup-plugin-polyfills-loader": "^1.1.0",
|
||||
"browserslist": "^4.16.1",
|
||||
"plugins-manager": "^0.3.1",
|
||||
"rollup-plugin-terser": "^7.0.2",
|
||||
"workbox-broadcast-update": "^6.1.5",
|
||||
"workbox-cacheable-response": "^6.1.5",
|
||||
@@ -17581,18 +17711,49 @@
|
||||
"workbox-strategies": "^6.1.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"@rollup/plugin-node-resolve": {
|
||||
"version": "11.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.1.tgz",
|
||||
"integrity": "sha512-yc2n43jcqVyGE2sqV5/YCmocy9ArjVAP/BeXyTtADTBBX6V0e5UMqwO8CdQ0kzjb6zu5P1qMzsScCMRvE9OlVg==",
|
||||
"@rollup/plugin-babel": {
|
||||
"version": "5.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz",
|
||||
"integrity": "sha512-WFfdLWU/xVWKeRQnKmIAQULUI7Il0gZnBIH/ZFO069wYIfPu+8zrfp/KMW0atmELoRDq8FbiP3VCss9MhCut7Q==",
|
||||
"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.19.0"
|
||||
"@babel/helper-module-imports": "^7.10.4",
|
||||
"@rollup/pluginutils": "^3.1.0"
|
||||
}
|
||||
},
|
||||
"@rollup/plugin-node-resolve": {
|
||||
"version": "15.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.0.1.tgz",
|
||||
"integrity": "sha512-ReY88T7JhJjeRVbfCyNj+NXAG3IIsVMsX9b5/9jC98dRP8/yxlZdz7mHZbHk5zHr24wZZICS5AcXsFZAXYUQEg==",
|
||||
"requires": {
|
||||
"@rollup/pluginutils": "^5.0.1",
|
||||
"@types/resolve": "1.20.2",
|
||||
"deepmerge": "^4.2.2",
|
||||
"is-builtin-module": "^3.2.0",
|
||||
"is-module": "^1.0.0",
|
||||
"resolve": "^1.22.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@rollup/pluginutils": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.2.tgz",
|
||||
"integrity": "sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==",
|
||||
"requires": {
|
||||
"@types/estree": "^1.0.0",
|
||||
"estree-walker": "^2.0.2",
|
||||
"picomatch": "^2.3.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@types/estree": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.0.tgz",
|
||||
"integrity": "sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ=="
|
||||
},
|
||||
"@types/resolve": {
|
||||
"version": "1.20.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz",
|
||||
"integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q=="
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -17687,6 +17848,7 @@
|
||||
"@rocket/engine": "^0.2.7",
|
||||
"@webcomponents/template-shadowroot": "^0.1.0",
|
||||
"lit": "^2.3.0",
|
||||
"plugins-manager": "^0.3.1",
|
||||
"workbox-window": "^6.1.5"
|
||||
}
|
||||
},
|
||||
@@ -17708,15 +17870,6 @@
|
||||
"lit": "^2.3.0"
|
||||
}
|
||||
},
|
||||
"@rollup/plugin-babel": {
|
||||
"version": "5.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz",
|
||||
"integrity": "sha512-WFfdLWU/xVWKeRQnKmIAQULUI7Il0gZnBIH/ZFO069wYIfPu+8zrfp/KMW0atmELoRDq8FbiP3VCss9MhCut7Q==",
|
||||
"requires": {
|
||||
"@babel/helper-module-imports": "^7.10.4",
|
||||
"@rollup/pluginutils": "^3.1.0"
|
||||
}
|
||||
},
|
||||
"@rollup/plugin-commonjs": {
|
||||
"version": "17.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-17.1.0.tgz",
|
||||
@@ -17755,12 +17908,37 @@
|
||||
}
|
||||
},
|
||||
"@rollup/plugin-replace": {
|
||||
"version": "2.4.2",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-2.4.2.tgz",
|
||||
"integrity": "sha512-IGcu+cydlUMZ5En85jxHH4qj2hta/11BHq95iHEyb2sbgiN0eCdzvUcHw5gt9pBL5lTi4JDYJ1acCoMGpTvEZg==",
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-5.0.1.tgz",
|
||||
"integrity": "sha512-Z3MfsJ4CK17BfGrZgvrcp/l6WXoKb0kokULO+zt/7bmcyayokDaQ2K3eDJcRLCTAlp5FPI4/gz9MHAsosz4Rag==",
|
||||
"requires": {
|
||||
"@rollup/pluginutils": "^3.1.0",
|
||||
"magic-string": "^0.25.7"
|
||||
"@rollup/pluginutils": "^5.0.1",
|
||||
"magic-string": "^0.26.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"@rollup/pluginutils": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.2.tgz",
|
||||
"integrity": "sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==",
|
||||
"requires": {
|
||||
"@types/estree": "^1.0.0",
|
||||
"estree-walker": "^2.0.2",
|
||||
"picomatch": "^2.3.1"
|
||||
}
|
||||
},
|
||||
"@types/estree": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.0.tgz",
|
||||
"integrity": "sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ=="
|
||||
},
|
||||
"magic-string": {
|
||||
"version": "0.26.7",
|
||||
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.26.7.tgz",
|
||||
"integrity": "sha512-hX9XH3ziStPoPhJxLq1syWuZMxbDvGNbVchfrdCtanC7D13888bMFow61x8axrx+GfHLtVeAx2kxL7tTGRl+Ow==",
|
||||
"requires": {
|
||||
"sourcemap-codec": "^1.4.8"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@rollup/plugin-typescript": {
|
||||
@@ -21989,6 +22167,12 @@
|
||||
"resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz",
|
||||
"integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA=="
|
||||
},
|
||||
"jsonc-parser": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz",
|
||||
"integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==",
|
||||
"dev": true
|
||||
},
|
||||
"jsonfile": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
|
||||
@@ -24128,6 +24312,17 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"proper-lockfile": {
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/proper-lockfile/-/proper-lockfile-4.1.2.tgz",
|
||||
"integrity": "sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"graceful-fs": "^4.2.4",
|
||||
"retry": "^0.12.0",
|
||||
"signal-exit": "^3.0.2"
|
||||
}
|
||||
},
|
||||
"property-information": {
|
||||
"version": "6.1.1",
|
||||
"resolved": "https://registry.npmjs.org/property-information/-/property-information-6.1.1.tgz",
|
||||
@@ -24912,6 +25107,12 @@
|
||||
"signal-exit": "^3.0.2"
|
||||
}
|
||||
},
|
||||
"retry": {
|
||||
"version": "0.12.0",
|
||||
"resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz",
|
||||
"integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==",
|
||||
"dev": true
|
||||
},
|
||||
"reusify": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz",
|
||||
@@ -26502,6 +26703,19 @@
|
||||
"integrity": "sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA==",
|
||||
"dev": true
|
||||
},
|
||||
"wireit": {
|
||||
"version": "0.7.2",
|
||||
"resolved": "https://registry.npmjs.org/wireit/-/wireit-0.7.2.tgz",
|
||||
"integrity": "sha512-Zjq50QH5hguk64hXfJmJJpLGgi8TUy7780w0u2VXK325qWxJtw1fP6HhOYcdjTWeoYLWQDDkTytQ119y/UMseg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"braces": "^3.0.2",
|
||||
"chokidar": "^3.5.3",
|
||||
"fast-glob": "^3.2.11",
|
||||
"jsonc-parser": "^3.0.0",
|
||||
"proper-lockfile": "^4.1.2"
|
||||
}
|
||||
},
|
||||
"word-wrap": {
|
||||
"version": "1.2.3",
|
||||
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
|
||||
|
||||
26
package.json
26
package.json
@@ -10,8 +10,7 @@
|
||||
"scripts": {
|
||||
"analyze": "run-s analyze:* format:*",
|
||||
"analyze:analyze": "node scripts/workspaces-scripts-bin.mjs analyze",
|
||||
"build": "npm run build:packages && npm run rocket:build",
|
||||
"build:packages": "node scripts/workspaces-scripts-bin.mjs build:package",
|
||||
"build": "npm run rocket:build",
|
||||
"build:site": "run-s analyze:* rocket:build",
|
||||
"changeset": "changeset",
|
||||
"debug": "web-test-runner --watch --config web-test-runner-chrome.config.mjs",
|
||||
@@ -25,37 +24,30 @@
|
||||
"lint:prettier": "node node_modules/prettier/bin-prettier.js \"**/*.{ts,js,mjs,cjs,md}\" --check --ignore-path .eslintignore",
|
||||
"lint:types": "npm run types",
|
||||
"lint:versions": "node scripts/lint-versions.js",
|
||||
"postinstall": "npm run setup",
|
||||
"postinstall": "npx patch-package",
|
||||
"preview": "node packages/cli/src/cli.js preview --open",
|
||||
"release": "changeset publish && npm run format",
|
||||
"rocket:build": "NODE_DEBUG=engine:rendering node --trace-warnings packages/cli/src/cli.js build",
|
||||
"rocket:upgrade": "node packages/cli/src/cli.js upgrade",
|
||||
"search": "node packages/cli/src/cli.js search",
|
||||
"setup": "npm run setup:ts-configs",
|
||||
"setup:patches": "npx patch-package",
|
||||
"setup:ts-configs": "node scripts/generate-ts-configs.mjs",
|
||||
"start:experimental": "NODE_DEBUG=engine:rendering node --no-warnings --experimental-loader ./packages/engine/src/litCssLoader.js packages/cli/src/cli.js start --open",
|
||||
"start": "NODE_DEBUG=engine:rendering node --trace-warnings packages/cli/src/cli.js start --open",
|
||||
"preview": "node packages/cli/src/cli.js preview --open",
|
||||
"start:experimental": "NODE_DEBUG=engine:rendering node --no-warnings --experimental-loader ./packages/engine/src/litCssLoader.js packages/cli/src/cli.js start --open",
|
||||
"test": "npm run test:node && npm run test:web",
|
||||
"test:integration": "playwright test packages/*/test-node/*.spec.js --retries=3",
|
||||
"test:node": "npm run test:unit && npm run test:integration",
|
||||
"test:unit": "node --trace-warnings ./node_modules/.bin/mocha --require ./scripts/testMochaGlobalHooks.js \"packages/*/test-node/**/*.test.{ts,js,mjs,cjs}\" -- --timeout 8000 --reporter dot --exit",
|
||||
"test:web": "web-test-runner",
|
||||
"types": "run-s types:clear types:copy types:build",
|
||||
"types:build": "tsc --build",
|
||||
"types:clear": "rimraf packages/*/dist-types/",
|
||||
"types:copy": "node scripts/workspaces-scripts-bin.mjs types:copy",
|
||||
"types": "npm run types --workspaces --if-present",
|
||||
"update-dependency": "node scripts/update-dependency.js",
|
||||
"update-esm-entrypoints": "node scripts/update-esm-entrypoints.mjs && npm run format",
|
||||
"update-package-configs": "node scripts/update-package-configs.mjs && npm run format",
|
||||
"xprestart": "npm run analyze"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"@changesets/cli": "^2.20.0",
|
||||
"@custom-elements-manifest/analyzer": "^0.4.12",
|
||||
"@playwright/test": "^1.18.1",
|
||||
"@open-wc/testing": "^3.1.2",
|
||||
"@playwright/test": "^1.18.1",
|
||||
"@rollup/plugin-commonjs": "^17.0.0",
|
||||
"@rollup/plugin-json": "^4.1.0",
|
||||
"@rollup/plugin-typescript": "^8.1.0",
|
||||
@@ -94,7 +86,8 @@
|
||||
"rollup-plugin-terser": "^7.0.2",
|
||||
"sinon": "^9.2.3",
|
||||
"ts-node": "^9.1.1",
|
||||
"typescript": "^4.8.4"
|
||||
"typescript": "^4.8.4",
|
||||
"wireit": "^0.7.2"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"parser": "@typescript-eslint/parser",
|
||||
@@ -118,7 +111,8 @@
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/no-empty-interface": "off",
|
||||
"@typescript-eslint/no-unused-vars": "error",
|
||||
"@typescript-eslint/no-var-requires": "off"
|
||||
"@typescript-eslint/no-var-requires": "off",
|
||||
"@typescript-eslint/ban-ts-comment": "off"
|
||||
}
|
||||
},
|
||||
"husky": {
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
// /**
|
||||
// * @typedef {import('./src/types').BasicOptions} BasicOptions
|
||||
// * @typedef {import('./src/types').SpaOptions} SpaOptions
|
||||
// */
|
||||
|
||||
export { createBasicConfig, createBasicMetaConfig } from './src/createBasicConfig.js';
|
||||
export { createSpaConfig, createSpaMetaConfig } from './src/createSpaConfig.js';
|
||||
export { createMpaConfig, createMpaMetaConfig } from './src/createMpaConfig.js';
|
||||
export {
|
||||
createServiceWorkerConfig,
|
||||
createServiceWorkerMetaConfig,
|
||||
} from './src/createServiceWorkerConfig.js';
|
||||
@@ -13,10 +13,12 @@
|
||||
},
|
||||
"author": "Modern Web <hello@modern-web.dev> (https://modern-web.dev/)",
|
||||
"homepage": "https://rocket.modern-web.dev/docs/tools/building-rollup/",
|
||||
"main": "./index.js",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": "./index.js"
|
||||
".": {
|
||||
"types": "./dist-types/src/index.d.ts",
|
||||
"default": "./src/index.js"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"build:babelrc": "rimraf dist && rollup -c demo/babelrc/rollup.config.js",
|
||||
@@ -27,6 +29,7 @@
|
||||
"build:spa-js-input": "rimraf dist && rollup -c demo/js/rollup.spa-js-input.config.js",
|
||||
"build:spa-nomodule": "rimraf dist && rollup -c demo/js/rollup.spa-nomodule.config.js",
|
||||
"build:ts": "rimraf dist && rollup -c demo/ts/rollup.spa.config.js",
|
||||
"prepublishOnly": "npm run types",
|
||||
"start:babelrc": "npm run build:babelrc && npm run start:build",
|
||||
"start:build": "web-dev-server --root-dir dist --compatibility none --open",
|
||||
"start:cjs": "npm run build:cjs && npm run start:build",
|
||||
@@ -38,10 +41,11 @@
|
||||
"start:ts": "npm run build:ts && npm run start:build",
|
||||
"start:watch": "npm run build:spa-nomodule -- --watch & npm run start:build",
|
||||
"test": "npm run test:node",
|
||||
"test:node": "mocha test-node/**/*.test.js --timeout 5000"
|
||||
"test:node": "mocha test-node/**/*.test.js --timeout 5000",
|
||||
"types": "wireit"
|
||||
},
|
||||
"files": [
|
||||
"*.js",
|
||||
"dist-types",
|
||||
"src"
|
||||
],
|
||||
"keywords": [
|
||||
@@ -54,17 +58,35 @@
|
||||
"@babel/core": "^7.12.10",
|
||||
"@babel/preset-env": "^7.12.11",
|
||||
"@rollup/plugin-babel": "^5.2.2",
|
||||
"@rollup/plugin-node-resolve": "^11.0.1",
|
||||
"@rollup/plugin-replace": "^2.4.2",
|
||||
"@rollup/plugin-node-resolve": "^15.0.1",
|
||||
"@rollup/plugin-replace": "^5.0.1",
|
||||
"@web/rollup-plugin-html": "^1.8.0",
|
||||
"@web/rollup-plugin-import-meta-assets": "^1.0.4",
|
||||
"@web/rollup-plugin-polyfills-loader": "^1.1.0",
|
||||
"browserslist": "^4.16.1",
|
||||
"plugins-manager": "^0.3.1",
|
||||
"rollup-plugin-terser": "^7.0.2",
|
||||
"workbox-broadcast-update": "^6.1.5",
|
||||
"workbox-cacheable-response": "^6.1.5",
|
||||
"workbox-expiration": "^6.1.5",
|
||||
"workbox-routing": "^6.1.5",
|
||||
"workbox-strategies": "^6.1.5"
|
||||
},
|
||||
"wireit": {
|
||||
"types": {
|
||||
"command": "copyfiles \"./types/**/*.d.ts\" dist-types/ && tsc --build --pretty",
|
||||
"dependencies": [
|
||||
"../plugins-manager:types"
|
||||
],
|
||||
"clean": "if-file-deleted",
|
||||
"files": [
|
||||
"src/**/*.js",
|
||||
"tsconfig.json"
|
||||
],
|
||||
"output": [
|
||||
"dist-types/**",
|
||||
".tsbuildinfo"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import resolve from '@rollup/plugin-node-resolve';
|
||||
// @ts-ignore
|
||||
import { terser } from 'rollup-plugin-terser';
|
||||
import babelPkg from '@rollup/plugin-babel';
|
||||
|
||||
@@ -6,11 +7,19 @@ import { applyPlugins } from 'plugins-manager';
|
||||
|
||||
const { babel } = babelPkg;
|
||||
|
||||
/** @typedef {import('../types/main.js').BuildingRollupOptions} BuildingRollupOptions */
|
||||
|
||||
/**
|
||||
* @param {BuildingRollupOptions} [userConfig]
|
||||
*/
|
||||
export function createBasicConfig(userConfig) {
|
||||
const { config, metaPlugins } = createBasicMetaConfig(userConfig);
|
||||
return applyPlugins(config, metaPlugins);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {BuildingRollupOptions} [userConfig]
|
||||
*/
|
||||
export function createBasicMetaConfig(userConfig = { output: {} }) {
|
||||
const developmentMode =
|
||||
typeof userConfig.developmentMode !== 'undefined'
|
||||
@@ -37,8 +46,12 @@ export function createBasicMetaConfig(userConfig = { output: {} }) {
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @type {import('plugins-manager').MetaPlugin<any>[]}
|
||||
*/
|
||||
let metaPlugins = [
|
||||
{
|
||||
// @ts-ignore
|
||||
plugin: resolve,
|
||||
options: {
|
||||
moduleDirectories: ['node_modules', 'web_modules'],
|
||||
@@ -72,6 +85,7 @@ export function createBasicMetaConfig(userConfig = { output: {} }) {
|
||||
},
|
||||
{
|
||||
plugin: terser,
|
||||
options: {},
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
import { createSpaMetaConfig } from './createSpaConfig.js';
|
||||
import { adjustPluginOptions, applyPlugins } from 'plugins-manager';
|
||||
// @ts-ignore
|
||||
import { rollupPluginHTML } from '@web/rollup-plugin-html';
|
||||
|
||||
/** @typedef {import('../types/main.js').BuildingRollupOptions} BuildingRollupOptions */
|
||||
|
||||
/**
|
||||
* @param {BuildingRollupOptions} [userConfig]
|
||||
*/
|
||||
export function createMpaConfig(userConfig) {
|
||||
const { config, metaPlugins } = createMpaMetaConfig(userConfig);
|
||||
|
||||
@@ -9,6 +15,9 @@ export function createMpaConfig(userConfig) {
|
||||
return final;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {BuildingRollupOptions} userConfig
|
||||
*/
|
||||
export function createMpaMetaConfig(userConfig = { output: {}, setupPlugins: [] }) {
|
||||
const { config, metaPlugins } = createSpaMetaConfig(userConfig);
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import resolve from '@rollup/plugin-node-resolve';
|
||||
// @ts-ignore
|
||||
import { terser } from 'rollup-plugin-terser';
|
||||
import babelPkg from '@rollup/plugin-babel';
|
||||
import replace from '@rollup/plugin-replace';
|
||||
@@ -7,11 +8,19 @@ import { applyPlugins } from 'plugins-manager';
|
||||
|
||||
const { babel } = babelPkg;
|
||||
|
||||
/** @typedef {import('../types/main.js').BuildingRollupOptions} BuildingRollupOptions */
|
||||
|
||||
/**
|
||||
* @param {BuildingRollupOptions} userConfig
|
||||
*/
|
||||
export function createServiceWorkerConfig(userConfig) {
|
||||
const { config, metaPlugins } = createServiceWorkerMetaConfig(userConfig);
|
||||
return applyPlugins(config, metaPlugins);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {BuildingRollupOptions} userConfig
|
||||
*/
|
||||
export function createServiceWorkerMetaConfig(userConfig = { output: {} }) {
|
||||
const developmentMode =
|
||||
typeof userConfig.developmentMode !== 'undefined'
|
||||
@@ -31,14 +40,19 @@ export function createServiceWorkerMetaConfig(userConfig = { output: {} }) {
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @type {import('plugins-manager').MetaPlugin<any>[]}
|
||||
*/
|
||||
let metaPlugins = [
|
||||
{
|
||||
// @ts-ignore
|
||||
plugin: resolve,
|
||||
options: {
|
||||
moduleDirectories: ['node_modules', 'web_modules'],
|
||||
},
|
||||
},
|
||||
{
|
||||
// @ts-ignore
|
||||
plugin: replace,
|
||||
options: {
|
||||
'process.env.NODE_ENV': JSON.stringify(developmentMode ? 'development' : 'production'),
|
||||
|
||||
@@ -1,15 +1,26 @@
|
||||
// @ts-ignore
|
||||
import { rollupPluginHTML } from '@web/rollup-plugin-html';
|
||||
// @ts-ignore
|
||||
import { importMetaAssets } from '@web/rollup-plugin-import-meta-assets';
|
||||
// @ts-ignore
|
||||
import { polyfillsLoader } from '@web/rollup-plugin-polyfills-loader';
|
||||
import { applyPlugins } from 'plugins-manager';
|
||||
|
||||
import { createBasicMetaConfig } from './createBasicConfig.js';
|
||||
|
||||
/** @typedef {import('../types/main.js').BuildingRollupOptions} BuildingRollupOptions */
|
||||
|
||||
/**
|
||||
* @param {BuildingRollupOptions} [userConfig]
|
||||
*/
|
||||
export function createSpaConfig(userConfig) {
|
||||
const { config, metaPlugins } = createSpaMetaConfig(userConfig);
|
||||
return applyPlugins(config, metaPlugins);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {BuildingRollupOptions} userConfig
|
||||
*/
|
||||
export function createSpaMetaConfig(userConfig = { output: {} }) {
|
||||
const { config, metaPlugins, developmentMode } = createBasicMetaConfig(userConfig);
|
||||
|
||||
@@ -27,8 +38,13 @@ export function createSpaMetaConfig(userConfig = { output: {} }) {
|
||||
}
|
||||
delete config.absoluteBaseUrl;
|
||||
|
||||
/**
|
||||
* @type {import('plugins-manager').MetaPlugin<any>[]}
|
||||
*/
|
||||
const spaMetaPlugins = [
|
||||
// @ts-ignore
|
||||
...metaPlugins,
|
||||
// @ts-ignore
|
||||
{
|
||||
plugin: rollupPluginHTML,
|
||||
options: {
|
||||
@@ -36,9 +52,11 @@ export function createSpaMetaConfig(userConfig = { output: {} }) {
|
||||
absoluteBaseUrl,
|
||||
},
|
||||
},
|
||||
// @ts-ignore
|
||||
{
|
||||
plugin: importMetaAssets,
|
||||
},
|
||||
// @ts-ignore
|
||||
{
|
||||
plugin: polyfillsLoader,
|
||||
options: {
|
||||
|
||||
11
packages/building-rollup/src/index.js
Normal file
11
packages/building-rollup/src/index.js
Normal file
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* @typedef {import('../types/main.js').BuildingRollupOptions} BuildingRollupOptions
|
||||
*/
|
||||
|
||||
export { createBasicConfig, createBasicMetaConfig } from './createBasicConfig.js';
|
||||
export { createSpaConfig, createSpaMetaConfig } from './createSpaConfig.js';
|
||||
export { createMpaConfig, createMpaMetaConfig } from './createMpaConfig.js';
|
||||
export {
|
||||
createServiceWorkerConfig,
|
||||
createServiceWorkerMetaConfig,
|
||||
} from './createServiceWorkerConfig.js';
|
||||
@@ -1,6 +1,6 @@
|
||||
import chai from 'chai';
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
import { readFile } from 'fs/promises';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { rollup } from 'rollup';
|
||||
|
||||
@@ -8,7 +8,7 @@ const { expect } = chai;
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
/**
|
||||
* @param {object} config
|
||||
* @param {import('@rocket/building-rollup').BuildingRollupOptions} config
|
||||
*/
|
||||
async function buildAndWrite(config) {
|
||||
const bundle = await rollup(config);
|
||||
@@ -16,21 +16,27 @@ async function buildAndWrite(config) {
|
||||
if (Array.isArray(config.output)) {
|
||||
await bundle.write(config.output[0]);
|
||||
await bundle.write(config.output[1]);
|
||||
} else {
|
||||
} else if (config.output) {
|
||||
await bundle.write(config.output);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} configString
|
||||
* @returns
|
||||
*/
|
||||
async function execute(configString) {
|
||||
const configPath = path.join(__dirname, 'fixtures', configString.split('/').join(path.sep));
|
||||
const config = (await import(configPath)).default;
|
||||
await buildAndWrite(config);
|
||||
|
||||
/**
|
||||
* @param {string} fileName
|
||||
*/
|
||||
return async (fileName, { stripToBody = false, stripStartEndWhitespace = true } = {}) => {
|
||||
let text = await fs.promises.readFile(
|
||||
path.join(config.output.dir, fileName.split('/').join(path.sep)),
|
||||
);
|
||||
text = text.toString();
|
||||
let text = (
|
||||
await readFile(path.join(config.output.dir, fileName.split('/').join(path.sep)))
|
||||
).toString();
|
||||
if (stripToBody) {
|
||||
const bodyOpenTagEnd = text.indexOf('>', text.indexOf('<body') + 1) + 1;
|
||||
const bodyCloseTagStart = text.indexOf('</body>');
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
import puppeteer from 'puppeteer';
|
||||
import chai from 'chai';
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
// @ts-ignore
|
||||
import rimraf from 'rimraf';
|
||||
import { rollup } from 'rollup';
|
||||
// @ts-ignore
|
||||
import { startDevServer } from '@web/dev-server';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
@@ -14,6 +15,7 @@ const rootDir = path.resolve(__dirname, '..', 'dist');
|
||||
const { expect } = chai;
|
||||
|
||||
describe('spa integration tests', () => {
|
||||
// @ts-ignore
|
||||
let server;
|
||||
/** @type {import('puppeteer').Browser} */
|
||||
let browser;
|
||||
@@ -27,6 +29,7 @@ describe('spa integration tests', () => {
|
||||
readCliArgs: false,
|
||||
readFileConfig: false,
|
||||
logStartMessage: false,
|
||||
// @ts-ignore
|
||||
clearTerminalOnReload: false,
|
||||
});
|
||||
browser = await puppeteer.launch();
|
||||
@@ -35,6 +38,7 @@ describe('spa integration tests', () => {
|
||||
|
||||
after(async () => {
|
||||
await browser.close();
|
||||
// @ts-ignore
|
||||
await server.stop();
|
||||
});
|
||||
|
||||
@@ -45,6 +49,7 @@ describe('spa integration tests', () => {
|
||||
].forEach(testCase => {
|
||||
describe(`testcase ${testCase}`, function describe() {
|
||||
this.timeout(30000);
|
||||
// @ts-ignore
|
||||
let page;
|
||||
|
||||
before(async () => {
|
||||
|
||||
15
packages/building-rollup/tsconfig.json
Normal file
15
packages/building-rollup/tsconfig.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"extends": "../../tsconfig.node-base.json",
|
||||
"compilerOptions": {
|
||||
"module": "ESNext",
|
||||
"outDir": "./dist-types",
|
||||
"rootDir": ".",
|
||||
"composite": true,
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"emitDeclarationOnly": true,
|
||||
"moduleResolution": "NodeNext"
|
||||
},
|
||||
"include": ["src", "types", "test-node"],
|
||||
"exclude": ["dist-types"]
|
||||
}
|
||||
8
packages/building-rollup/types/main.d.ts
vendored
Normal file
8
packages/building-rollup/types/main.d.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { RollupOptions } from 'rollup';
|
||||
|
||||
interface BuildingRollupOptions extends RollupOptions {
|
||||
developmentMode?: boolean;
|
||||
rootDir?: string;
|
||||
absoluteBaseUrl?: string;
|
||||
setupPlugins?: function[];
|
||||
}
|
||||
@@ -1,5 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
|
||||
/** @typedef {import('../types/main').CheckHtmlLinksCliOptions} CheckHtmlLinksCliOptions */
|
||||
|
||||
import path from 'path';
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
import fs from 'fs';
|
||||
import saxWasm from 'sax-wasm';
|
||||
import minimatch from 'minimatch';
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
},
|
||||
"author": "Modern Web <hello@modern-web.dev> (https://modern-web.dev/)",
|
||||
"homepage": "https://rocket.modern-web.dev/",
|
||||
"main": "./src/index.js",
|
||||
"bin": {
|
||||
"rocket": "src/cli.js"
|
||||
},
|
||||
@@ -30,12 +29,13 @@
|
||||
},
|
||||
"scripts": {
|
||||
"build": "npm run rocket:build",
|
||||
"prepublishOnly": "npm run types",
|
||||
"rocket:build": "node src/cli.js build -c demo",
|
||||
"rocket:start": "node src/cli.js start -c demo",
|
||||
"start": "npm run rocket:start",
|
||||
"test": "mocha --require ../../scripts/testMochaGlobalHooks.js test-node/**/*.test.{js,cjs} test-node/*.test.{js,cjs} --timeout 8000",
|
||||
"test:watch": "onchange 'src/**/*.{js,cjs}' 'test-node/**/*.{js,cjs}' -- npm test",
|
||||
"types:copy": "copyfiles \"./types/**/*.d.ts\" dist-types/",
|
||||
"types": "wireit",
|
||||
"xtest:watch": "mocha test/**/*.test.js --parallel --watch"
|
||||
},
|
||||
"files": [
|
||||
@@ -67,14 +67,22 @@
|
||||
"@types/ip": "^1.1.0",
|
||||
"koa-proxy": "^1.0.0-alpha.3"
|
||||
},
|
||||
"types": "./dist-types/src/index.d.ts",
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
"*": [
|
||||
"./dist-types/src/index.d.ts"
|
||||
"wireit": {
|
||||
"types": {
|
||||
"command": "copyfiles \"./types/**/*.d.ts\" dist-types/ && tsc --build --pretty",
|
||||
"dependencies": [
|
||||
"../plugins-manager:types",
|
||||
"../engine:types",
|
||||
"../building-rollup:types"
|
||||
],
|
||||
"test-helpers": [
|
||||
"./dist-types/test-helpers/index.d.ts"
|
||||
"clean": "if-file-deleted",
|
||||
"files": [
|
||||
"src/**/*.js",
|
||||
"tsconfig.json"
|
||||
],
|
||||
"output": [
|
||||
"dist-types/**",
|
||||
".tsbuildinfo"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
import path from 'path';
|
||||
|
||||
import { existsSync } from 'fs';
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
import { Command } from 'commander';
|
||||
import { RocketStart } from './RocketStart.js';
|
||||
import { RocketBuild } from './RocketBuild.js';
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
|
||||
// @ts-ignore
|
||||
import { CheckHtmlLinksCli } from 'check-html-links';
|
||||
import { bold, gray } from 'colorette';
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
import path from 'path';
|
||||
import { existsSync } from 'fs';
|
||||
import { rollup } from 'rollup';
|
||||
|
||||
// @ts-ignore
|
||||
import { createMpaConfig, createServiceWorkerConfig } from '@rocket/building-rollup';
|
||||
|
||||
// import { rollupPluginHTML } from '@web/rollup-plugin-html';
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
// @ts-nocheck
|
||||
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const EleventyImage = require('@11ty/eleventy-img');
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
// @ts-nocheck
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// Don't edit this file directly. It is generated by /scripts/update-package-configs.ts
|
||||
|
||||
{
|
||||
"extends": "../../tsconfig.node-base.json",
|
||||
"compilerOptions": {
|
||||
@@ -9,27 +7,9 @@
|
||||
"composite": true,
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"emitDeclarationOnly": true
|
||||
"emitDeclarationOnly": true,
|
||||
"moduleResolution": "NodeNext"
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"path": "../plugins-manager/tsconfig.json"
|
||||
},
|
||||
{
|
||||
"path": "../mdjs-core/tsconfig.json"
|
||||
},
|
||||
{
|
||||
"path": "../engine/tsconfig.json"
|
||||
}
|
||||
],
|
||||
"include": [
|
||||
"src",
|
||||
"*.js",
|
||||
"types"
|
||||
],
|
||||
"exclude": [
|
||||
"dist",
|
||||
"dist-types",
|
||||
"src/init-files/"
|
||||
]
|
||||
}
|
||||
"include": ["src", "types"],
|
||||
"exclude": ["dist-types", "**/__output/**", "**/__output-dev/**"]
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
},
|
||||
"author": "Modern Web <hello@modern-web.dev> (https://modern-web.dev/)",
|
||||
"homepage": "https://rocket.modern-web.dev/",
|
||||
"main": "./exports/index.js",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": {
|
||||
@@ -26,9 +25,10 @@
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"prepublishOnly": "npm run types",
|
||||
"test": "mocha --require ../../scripts/testMochaGlobalHooks.js test-node/**/*.test.{js,cjs} test-node/*.test.{js,cjs}",
|
||||
"test:watch": "onchange 'src/**/*.{js,cjs}' 'test-node/**/*.{js,cjs}' -- npm test",
|
||||
"types:copy": "copyfiles \"./types/**/*.d.ts\" dist-types/",
|
||||
"types": "wireit",
|
||||
"xtest:watch": "mocha test/**/*.test.js --parallel --watch"
|
||||
},
|
||||
"files": [
|
||||
@@ -47,10 +47,17 @@
|
||||
},
|
||||
"devDependencies": {},
|
||||
"types": "./dist-types/exports/index.d.ts",
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
"*": [
|
||||
"./dist-types/exports/index.d.ts"
|
||||
"wireit": {
|
||||
"types": {
|
||||
"command": "copyfiles \"./types/**/*.d.ts\" dist-types/ && tsc --build --pretty",
|
||||
"clean": "if-file-deleted",
|
||||
"files": [
|
||||
"src/**/*.js",
|
||||
"tsconfig.json"
|
||||
],
|
||||
"output": [
|
||||
"dist-types/**",
|
||||
".tsbuildinfo"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,10 +8,14 @@ export class RocketOpenGraphOverview extends LitElement {
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
/** @type {{ url: string, sourceRelativeFilePath: string }} */
|
||||
this.inputDir = '';
|
||||
/** @type {{ url: string, sourceRelativeFilePath: string }[]} */
|
||||
this.pages = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {{ url: string, sourceRelativeFilePath: string }} options
|
||||
*/
|
||||
renderPage({ url, sourceRelativeFilePath }) {
|
||||
const iframeUrl = url.endsWith('/')
|
||||
? `${url}index.opengraph.html`
|
||||
|
||||
@@ -12,6 +12,8 @@ export class RocketRotatingText extends LitElement {
|
||||
this.initIndex = 0;
|
||||
this.inIndex = 0;
|
||||
this.outIndex = -1;
|
||||
/** @type {string[]} */
|
||||
this.items = [];
|
||||
}
|
||||
|
||||
next() {
|
||||
|
||||
@@ -5,6 +5,11 @@ export class RocketTestimonialSmall extends LitElement {
|
||||
cite: { type: String },
|
||||
};
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.cite = '';
|
||||
}
|
||||
|
||||
static styles = css`
|
||||
:host {
|
||||
display: block;
|
||||
|
||||
@@ -1,8 +1,15 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import { LitElement, html, css } from 'lit';
|
||||
|
||||
// wait for all dialog animations to complete their promises
|
||||
const animationsComplete = element =>
|
||||
Promise.allSettled(element.getAnimations().map(animation => animation.finished));
|
||||
/**
|
||||
* Wait for all dialog animations to complete their promises
|
||||
*
|
||||
* @param {HTMLElement} element
|
||||
*/
|
||||
function animationsComplete(element) {
|
||||
return Promise.allSettled(element.getAnimations().map(animation => animation.finished));
|
||||
}
|
||||
|
||||
export class RocketDialog extends LitElement {
|
||||
static properties = {
|
||||
@@ -31,6 +38,10 @@ export class RocketDialog extends LitElement {
|
||||
`;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {Event} ev
|
||||
*/
|
||||
async _submit(ev) {
|
||||
ev.preventDefault();
|
||||
if (ev.target?.value) {
|
||||
@@ -40,8 +51,10 @@ export class RocketDialog extends LitElement {
|
||||
}
|
||||
|
||||
firstUpdated() {
|
||||
this._dialog = this.shadowRoot.querySelector('dialog');
|
||||
this._invoker = this.shadowRoot.querySelector('slot[name="invoker"]')?.assignedElements()[0];
|
||||
this._dialog = this.shadowRoot?.querySelector('dialog');
|
||||
this._invoker = /** @type {HTMLSlotElement} */ (
|
||||
this.shadowRoot?.querySelector('slot[name="invoker"]')
|
||||
)?.assignedElements()[0];
|
||||
}
|
||||
|
||||
async close() {
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
import { LitElement, html, css } from 'lit';
|
||||
|
||||
// wait for all dialog animations to complete their promises
|
||||
const animationsComplete = element =>
|
||||
Promise.allSettled(element.getAnimations().map(animation => animation.finished));
|
||||
/**
|
||||
* Wait for all dialog animations to complete their promises
|
||||
*
|
||||
* @param {HTMLElement} element
|
||||
*/
|
||||
function animationsComplete(element) {
|
||||
return Promise.allSettled(element.getAnimations().map(animation => animation.finished));
|
||||
}
|
||||
|
||||
export class RocketDrawer extends LitElement {
|
||||
static properties = {
|
||||
@@ -54,6 +59,9 @@ export class RocketDrawer extends LitElement {
|
||||
this.open = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import('lit').PropertyValues} changedProperties
|
||||
*/
|
||||
updated(changedProperties) {
|
||||
super.updated(changedProperties);
|
||||
if (changedProperties.has('open')) {
|
||||
@@ -65,16 +73,24 @@ export class RocketDrawer extends LitElement {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Event} ev
|
||||
*/
|
||||
closeOnOutsideClick(ev) {
|
||||
if (ev.target === this._dialog) {
|
||||
this.close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import('lit').PropertyValues} changedProperties
|
||||
*/
|
||||
firstUpdated(changedProperties) {
|
||||
super.firstUpdated(changedProperties);
|
||||
this._dialog = this.shadowRoot.querySelector('dialog');
|
||||
this._invoker = this.shadowRoot.querySelector('slot[name="invoker"]')?.assignedElements()[0];
|
||||
this._dialog = this.shadowRoot?.querySelector('dialog');
|
||||
this._invoker = /** @type {HTMLSlotElement} */ (
|
||||
this.shadowRoot?.querySelector('slot[name="invoker"]')
|
||||
)?.assignedElements()[0];
|
||||
}
|
||||
|
||||
async _close() {
|
||||
@@ -95,8 +111,10 @@ export class RocketDrawer extends LitElement {
|
||||
this._dialog.dispatchEvent(new Event('opened'));
|
||||
this._dialog.removeAttribute('inert');
|
||||
|
||||
const focusTarget = this.querySelector('[autofocus]');
|
||||
focusTarget ? focusTarget.focus() : this.shadowRoot.querySelector('button.close').focus();
|
||||
const focusTarget = /** @type {HTMLElement} */ (this.querySelector('[autofocus]'));
|
||||
focusTarget
|
||||
? focusTarget.focus()
|
||||
: /** @type {HTMLElement} */ (this.shadowRoot?.querySelector('button.close'))?.focus();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
// @ts-nocheck
|
||||
|
||||
import { LitElement, html } from 'lit-element';
|
||||
import { OverlayMixin, withModalDialogConfig } from '@lion/overlays';
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
import { html } from 'lit';
|
||||
|
||||
/**
|
||||
* @param {{ pageTree: import('@rocket/engine').PageTree, titleWrapperFn: (input: string) => string, description: string, siteName: string }} options
|
||||
*/
|
||||
export function pageDefaults({ pageTree, titleWrapperFn, description, siteName }) {
|
||||
return {
|
||||
...defaultHead({ pageTree, titleWrapperFn, description, siteName }),
|
||||
@@ -8,14 +10,17 @@ export function pageDefaults({ pageTree, titleWrapperFn, description, siteName }
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {{ pageTree: import('@rocket/engine').PageTree, titleWrapperFn: (input: string) => string, description: string, siteName: string }} options
|
||||
*/
|
||||
export function defaultHead({ pageTree, titleWrapperFn, description, siteName }) {
|
||||
return {
|
||||
/**
|
||||
* @param {any} data
|
||||
*/
|
||||
head__10: data => {
|
||||
const useDescription = data.description ? data.description : description;
|
||||
const title = titleWrapperFn(
|
||||
// @ts-ignore
|
||||
pageTree.getPage(data.sourceRelativeFilePath)?.model?.name,
|
||||
);
|
||||
const title = titleWrapperFn(pageTree.getPage(data.sourceRelativeFilePath)?.model?.name);
|
||||
return html`
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
|
||||
@@ -19,6 +19,13 @@ export class RocketSocialLink extends LitElement {
|
||||
siteName: { type: String },
|
||||
};
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.url = '';
|
||||
this.name = '';
|
||||
this.siteName = '';
|
||||
}
|
||||
|
||||
render() {
|
||||
return html`
|
||||
<a
|
||||
|
||||
15
packages/components/tsconfig.json
Normal file
15
packages/components/tsconfig.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"extends": "../../tsconfig.node-base.json",
|
||||
"compilerOptions": {
|
||||
"module": "ESNext",
|
||||
"outDir": "./dist-types",
|
||||
"rootDir": ".",
|
||||
"composite": true,
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"emitDeclarationOnly": true,
|
||||
"moduleResolution": "NodeNext"
|
||||
},
|
||||
"include": ["exports", "src", "types"],
|
||||
"exclude": ["dist-types"]
|
||||
}
|
||||
@@ -13,7 +13,6 @@
|
||||
},
|
||||
"author": "Modern Web <hello@modern-web.dev> (https://modern-web.dev/)",
|
||||
"homepage": "https://rocket.modern-web.dev/",
|
||||
"main": "./src/index.js",
|
||||
"bin": {
|
||||
"create-rocket": "src/cli.js"
|
||||
},
|
||||
@@ -28,8 +27,7 @@
|
||||
"prepublishOnly": "node ./scripts/prepublish.js",
|
||||
"start": "node ./src/cli.js",
|
||||
"test": "mocha test-node/**/*.test.{js,cjs} test-node/*.test.{js,cjs}",
|
||||
"test:watch": "onchange 'src/**/*.{js,cjs}' 'test-node/**/*.{js,cjs}' -- npm test",
|
||||
"types:copy": "copyfiles \"./types/**/*.d.ts\" dist-types/"
|
||||
"test:watch": "onchange 'src/**/*.{js,cjs}' 'test-node/**/*.{js,cjs}' -- npm test"
|
||||
},
|
||||
"files": [
|
||||
"deployments",
|
||||
@@ -49,13 +47,5 @@
|
||||
"commander": "^9.0.0",
|
||||
"degit": "^2.0.0",
|
||||
"prompts": "^2.2.0"
|
||||
},
|
||||
"types": "./dist-types/src/index.d.ts",
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
"*": [
|
||||
"./dist-types/src/index.d.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
import { Command } from 'commander';
|
||||
import prompts from 'prompts';
|
||||
import { underline, bold, gray, green, blue, yellow, red } from 'colorette';
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
},
|
||||
"author": "Modern Web <hello@modern-web.dev> (https://modern-web.dev/)",
|
||||
"homepage": "https://rocket.modern-web.dev/docs/tools/engine/",
|
||||
"main": "./src/index.js",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": {
|
||||
@@ -35,10 +34,11 @@
|
||||
"scripts": {
|
||||
"debug": "DEBUG=engine:rendering npm run test",
|
||||
"debug:integration": "PWDEBUG=1 npm run test:integration",
|
||||
"prepublishOnly": "npm run types",
|
||||
"test": "mocha --require ../../scripts/testMochaGlobalHooks.js --timeout 8000 test-node/**/*.test.js test-node/*.test.js",
|
||||
"test:integration": "playwright test test-node/*.spec.js --retries=3",
|
||||
"test:watch": "onchange 'src/**/*.js' 'test-node/**/*.js' -- npm test",
|
||||
"types:copy": "copyfiles \"./types/**/*.d.ts\" dist-types/"
|
||||
"types": "wireit"
|
||||
},
|
||||
"files": [
|
||||
"assets",
|
||||
@@ -57,17 +57,21 @@
|
||||
"sax-wasm": "^2.1.3",
|
||||
"unist-util-visit": "^4.1.0"
|
||||
},
|
||||
"types": "./dist-types/src/index.d.ts",
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
"*": [
|
||||
"./dist-types/src/index.d.ts"
|
||||
"wireit": {
|
||||
"types": {
|
||||
"command": "copyfiles \"./types/**/*.d.ts\" dist-types/ && tsc --build --pretty",
|
||||
"dependencies": [
|
||||
"../plugins-manager:types",
|
||||
"../mdjs-core:types"
|
||||
],
|
||||
"server": [
|
||||
"./dist-types/src/index.server.d.ts"
|
||||
"clean": "if-file-deleted",
|
||||
"files": [
|
||||
"src/**/*.js",
|
||||
"tsconfig.json"
|
||||
],
|
||||
"hydration": [
|
||||
"./dist-types/src/index.hydration.d.ts"
|
||||
"output": [
|
||||
"dist-types/**",
|
||||
".tsbuildinfo"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
|
||||
/** @typedef {import('../types/main.js').EngineOptions} EngineOptions */
|
||||
/** @typedef {import('../types/main.js').DevServerPlugin} DevServerPlugin */
|
||||
/** @typedef {import('../types/main.js').DevServerMiddleware} DevServerMiddleware */
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
import { existsSync } from 'fs';
|
||||
import path from 'path';
|
||||
import { debuglog } from 'util';
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
import { existsSync } from 'fs';
|
||||
import { readFile, writeFile } from 'fs/promises';
|
||||
import path from 'path';
|
||||
@@ -191,11 +190,14 @@ export class RocketHeader {
|
||||
const [, exports] = parse(readDataFile.toString());
|
||||
|
||||
for (const dataExportName of exports) {
|
||||
// TODO: update to latest es-module-lexer version
|
||||
// @ts-ignore - ts somehow grabs the wrong version of es-module-lexer types... 0.x => strings[], 1.x => {...}[]
|
||||
const foundIndex = possibleImports.findIndex(el => el.importName === dataExportName);
|
||||
if (foundIndex >= 0) {
|
||||
possibleImports[foundIndex].importModuleName = exportModuleName;
|
||||
} else {
|
||||
possibleImports.push({
|
||||
// @ts-ignore
|
||||
importName: dataExportName,
|
||||
importModuleName: exportModuleName,
|
||||
});
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
// @ts-ignore
|
||||
import { mdjsProcess } from '@mdjs/core';
|
||||
import { existsSync } from 'fs';
|
||||
|
||||
@@ -1,21 +1,20 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
/* eslint-disable no-prototype-builtins */
|
||||
import { evaluate } from './evaluate.js';
|
||||
import { extractStrategies } from './extractStrategies.js';
|
||||
|
||||
export class HydrationLoader {
|
||||
/** @type {import('../../types/main').Components} */
|
||||
/** @type {import('../../types/main.js').Components} */
|
||||
components = {};
|
||||
isSetup = false;
|
||||
|
||||
/** @type {import('../../types/main').ElementWithStrategy[]} */
|
||||
/** @type {import('../../types/main.js').ElementWithStrategy[]} */
|
||||
elements = [];
|
||||
|
||||
/** @type {{ [key: string]: MediaQueryList }} */
|
||||
mediaQueries = {};
|
||||
|
||||
/**
|
||||
* @param {import('../../types/main').Components} components
|
||||
* @param {import('../../types/main.js').Components} components
|
||||
*/
|
||||
constructor(components) {
|
||||
this.components = components;
|
||||
@@ -81,11 +80,11 @@ export class HydrationLoader {
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {import('../../types/main').ElementWithStrategy[]}
|
||||
* @returns {import('../../types/main.js').ElementWithStrategy[]}
|
||||
*/
|
||||
gatherElements() {
|
||||
const els = document.querySelectorAll('[loading]');
|
||||
/** @type {import('../../types/main').ElementWithStrategy[]} */
|
||||
/** @type {import('../../types/main.js').ElementWithStrategy[]} */
|
||||
const elements = [];
|
||||
for (const el of els) {
|
||||
const strategyAttribute = el.getAttribute('loading');
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
|
||||
/**
|
||||
* @param {object} options
|
||||
* @param {string} options.strategyTemplate
|
||||
* @param {import("../../types/main").Strategy[]} options.strategies
|
||||
* @param {import("../../types/main.js").Strategy[]} options.strategies
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export function evaluate({ strategyTemplate, strategies }) {
|
||||
|
||||
@@ -49,12 +49,12 @@ function getStrategy(part, type) {
|
||||
|
||||
/**
|
||||
* @param {string} input
|
||||
* @returns {import("../../types/main").LoadingStrategy}
|
||||
* @returns {import("../../types/main.js").LoadingStrategy}
|
||||
*/
|
||||
export function extractStrategies(input) {
|
||||
const parts = getParts(input);
|
||||
|
||||
/** @type {import("../../types/main").LoadingStrategy} */
|
||||
/** @type {import("../../types/main.js").LoadingStrategy} */
|
||||
const result = {
|
||||
strategyAttribute: input,
|
||||
strategies: [],
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
import { renderJoiningGroup } from '../helpers/renderJoiningGroup.js';
|
||||
import { html } from 'lit';
|
||||
import { classMap } from 'lit/directives/class-map.js';
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
/** @typedef {import('lit').TemplateResult} TemplateResult */
|
||||
|
||||
export class LayoutRaw {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
// @ts-nocheck
|
||||
import path from 'path';
|
||||
import { TreeModel } from '@d4kmor/tree-model';
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
import { Menu } from './Menu.js';
|
||||
|
||||
/** @typedef {import('lit').TemplateResult} TemplateResult */
|
||||
|
||||
@@ -86,7 +86,7 @@ async function renderFile({
|
||||
openGraphUrl: url.replace(/\.html$/, '.opengraph.html'),
|
||||
};
|
||||
}
|
||||
/** @type {import('../../types/layout').renderData} */
|
||||
/** @type {import('../../types/layout.js').renderData} */
|
||||
const layoutData = {
|
||||
sourceFilePath,
|
||||
outputFilePath,
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// Don't edit this file directly. It is generated by /scripts/update-package-configs.ts
|
||||
|
||||
{
|
||||
"extends": "../../tsconfig.node-base.json",
|
||||
"compilerOptions": {
|
||||
@@ -9,24 +7,10 @@
|
||||
"composite": true,
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"emitDeclarationOnly": true
|
||||
"emitDeclarationOnly": true,
|
||||
"moduleResolution": "NodeNext"
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"path": "../plugins-manager/tsconfig.json"
|
||||
},
|
||||
{
|
||||
"path": "../mdjs-core/tsconfig.json"
|
||||
}
|
||||
],
|
||||
"include": [
|
||||
"src",
|
||||
"*.js",
|
||||
"types",
|
||||
"preset"
|
||||
],
|
||||
"exclude": [
|
||||
"dist",
|
||||
"dist-types"
|
||||
]
|
||||
}
|
||||
"references": [],
|
||||
"include": ["src", "types"],
|
||||
"exclude": ["dist-types"]
|
||||
}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"include": ["src", "*.js", "types", "preset"]
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
export { LaunchContent } from '../src/content/LaunchContent.js';
|
||||
@@ -13,7 +13,6 @@
|
||||
},
|
||||
"author": "Modern Web <hello@modern-web.dev> (https://modern-web.dev/)",
|
||||
"homepage": "https://rocket.modern-web.dev/docs/presets/launch/",
|
||||
"main": "./src/index.js",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": {
|
||||
@@ -23,13 +22,17 @@
|
||||
"./assets/*": "./assets/*",
|
||||
"./css/*": "./css/*",
|
||||
"./js/*": "./src/public/*",
|
||||
"./*": "./exports/*"
|
||||
"./*": {
|
||||
"types": "./dist-types/exports/*",
|
||||
"default": "./exports/*"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"analyze": "cem analyze --litelement",
|
||||
"prepublishOnly": "npm run types",
|
||||
"test": "mocha --timeout 5000 test-node/**/*.test.{js,cjs} test-node/*.test.{js,cjs}",
|
||||
"test:watch": "onchange 'src/**/*.{js,cjs}' 'test-node/**/*.{js,cjs}' -- npm test",
|
||||
"types:copy": "copyfiles \"./types/**/*.d.ts\" dist-types/"
|
||||
"types": "wireit"
|
||||
},
|
||||
"files": [
|
||||
"__public",
|
||||
@@ -51,17 +54,27 @@
|
||||
"@rocket/engine": "^0.2.7",
|
||||
"@webcomponents/template-shadowroot": "^0.1.0",
|
||||
"lit": "^2.3.0",
|
||||
"plugins-manager": "^0.3.1",
|
||||
"workbox-window": "^6.1.5"
|
||||
},
|
||||
"types": "./dist-types/src/index.d.ts",
|
||||
"customElements": "custom-elements.json",
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
"*": [
|
||||
"./dist-types/src/index.d.ts"
|
||||
"wireit": {
|
||||
"types": {
|
||||
"command": "copyfiles \"./types/**/*.d.ts\" dist-types/ && tsc --build --pretty",
|
||||
"dependencies": [
|
||||
"../cli:types",
|
||||
"../components:types",
|
||||
"../engine:types",
|
||||
"../plugins-manager:types"
|
||||
],
|
||||
"inline-notification": [
|
||||
"./dist-types/src/inline-notification/index.d.ts"
|
||||
"clean": "if-file-deleted",
|
||||
"files": [
|
||||
"src/**/*.js",
|
||||
"tsconfig.json"
|
||||
],
|
||||
"output": [
|
||||
"dist-types/**",
|
||||
".tsbuildinfo"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
import { renderJoiningGroup, TableOfContentsMenu } from '@rocket/engine';
|
||||
import { html } from 'lit';
|
||||
import { LayoutMain } from './LayoutMain.js';
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
import { renderJoiningGroup } from '@rocket/engine';
|
||||
import { html, nothing } from 'lit';
|
||||
import { LayoutMain } from './LayoutMain.js';
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
import {
|
||||
Layout,
|
||||
renderJoiningGroup,
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
import { renderJoiningGroup, TableOfContentsMenu } from '@rocket/engine';
|
||||
import { html } from 'lit';
|
||||
import { LayoutMain } from './LayoutMain.js';
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
import { LitElement, html, nothing } from 'lit';
|
||||
import { LaunchBlogPreview } from './LaunchBlogPreview.js';
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
(async () => {
|
||||
if ('serviceWorker' in navigator) {
|
||||
const { Workbox } = await import('workbox-window');
|
||||
|
||||
@@ -5,7 +5,6 @@ import { BroadcastUpdatePlugin } from 'workbox-broadcast-update';
|
||||
import { ExpirationPlugin } from 'workbox-expiration';
|
||||
|
||||
addEventListener('install', () => {
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
// @ts-ignore
|
||||
skipWaiting();
|
||||
/* eslint-enable @typescript-eslint/ban-ts-comment */
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
import { addPlugin } from 'plugins-manager';
|
||||
|
||||
class EnginePluginLaunch {
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// Don't edit this file directly. It is generated by /scripts/update-package-configs.ts
|
||||
|
||||
{
|
||||
"extends": "../../tsconfig.node-base.json",
|
||||
"compilerOptions": {
|
||||
@@ -9,29 +7,9 @@
|
||||
"composite": true,
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"emitDeclarationOnly": true
|
||||
"emitDeclarationOnly": true,
|
||||
"moduleResolution": "NodeNext"
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"path": "../plugins-manager/tsconfig.json"
|
||||
},
|
||||
{
|
||||
"path": "../mdjs-core/tsconfig.json"
|
||||
},
|
||||
{
|
||||
"path": "../engine/tsconfig.json"
|
||||
},
|
||||
{
|
||||
"path": "../cli/tsconfig.json"
|
||||
}
|
||||
],
|
||||
"include": [
|
||||
"src",
|
||||
"*.js",
|
||||
"types"
|
||||
],
|
||||
"exclude": [
|
||||
"dist",
|
||||
"dist-types"
|
||||
]
|
||||
}
|
||||
"include": ["exports", "src", "types"],
|
||||
"exclude": ["dist-types", "**/__output/**", "**/__output-dev/**"]
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
},
|
||||
"author": "Modern Web <hello@modern-web.dev> (https://modern-web.dev/)",
|
||||
"homepage": "https://rocket.modern-web.dev/docs/markdown-javascript/overview/",
|
||||
"main": "./index.js",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": {
|
||||
@@ -22,25 +21,20 @@
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"prepublishOnly": "publish-docs --github-url https://github.com/modernweb-dev/rocket/ --git-root-dir ../../",
|
||||
"prepublishOnly": "npm run types && publish-docs --github-url https://github.com/modernweb-dev/rocket/ --git-root-dir ../../",
|
||||
"start": "npm run start:stories",
|
||||
"start:script": "web-dev-server -c demo/script/server.js --root-dir ../../",
|
||||
"start:stories": "web-dev-server -c demo/stories/server.js --root-dir ../../",
|
||||
"test": "npm run test:node",
|
||||
"test:node": "mocha test-node",
|
||||
"test:watch": "mocha test-node --watch",
|
||||
"types:copy": "copyfiles -f \"./types/**/*.d.ts\" dist-types/types"
|
||||
"types": "wireit"
|
||||
},
|
||||
"files": [
|
||||
"*.d.ts",
|
||||
"*.js",
|
||||
"*.mjs",
|
||||
"dist-types",
|
||||
"src",
|
||||
"types"
|
||||
"src"
|
||||
],
|
||||
"keywords": [
|
||||
"open-wc",
|
||||
"markdown",
|
||||
"unified",
|
||||
"remark"
|
||||
@@ -73,5 +67,22 @@
|
||||
"remark-slug": "^7.0.1",
|
||||
"remark-stringify": "^10.0.2"
|
||||
},
|
||||
"types": "dist-types/index.d.ts"
|
||||
"types": "dist-types/index.d.ts",
|
||||
"wireit": {
|
||||
"types": {
|
||||
"command": "copyfiles \"./types/**/*.d.ts\" dist-types/ && tsc --build --pretty",
|
||||
"dependencies": [
|
||||
"../plugins-manager:types"
|
||||
],
|
||||
"clean": "if-file-deleted",
|
||||
"files": [
|
||||
"src/**/*.js",
|
||||
"tsconfig.json"
|
||||
],
|
||||
"output": [
|
||||
"dist-types/**",
|
||||
".tsbuildinfo"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
/** @typedef {import('../types/code').Story} Story */
|
||||
/** @typedef {import('../types/code').ParseResult} ParseResult */
|
||||
/** @typedef {import('../types/code').ProcessResult} ProcessResult */
|
||||
/** @typedef {import('../types/code').MdjsProcessPlugin} MdjsProcessPlugin */
|
||||
/** @typedef {import('../types/code.js').Story} Story */
|
||||
/** @typedef {import('../types/code.js').ParseResult} ParseResult */
|
||||
/** @typedef {import('../types/code.js').ProcessResult} ProcessResult */
|
||||
/** @typedef {import('../types/code.js').MdjsProcessPlugin} MdjsProcessPlugin */
|
||||
|
||||
import { unified } from 'unified';
|
||||
import markdown from 'remark-parse';
|
||||
@@ -15,6 +14,7 @@ import raw from 'rehype-raw';
|
||||
import htmlSlug from 'rehype-slug';
|
||||
// @ts-ignore
|
||||
import htmlHeading from 'rehype-autolink-headings';
|
||||
// @ts-ignore
|
||||
import rehypePrism from 'rehype-prism-plus';
|
||||
// @ts-ignore
|
||||
import htmlStringify from 'rehype-stringify';
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
/** @typedef {import('../types/code.js').Story} Story */
|
||||
/** @typedef {import('../types/code.js').StoryTypes} StoryTypes */
|
||||
/** @typedef {(name: string) => string} TagFunction */
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// Don't edit this file directly. It is generated by /scripts/update-package-configs.ts
|
||||
|
||||
{
|
||||
"extends": "../../tsconfig.node-base.json",
|
||||
"compilerOptions": {
|
||||
@@ -9,20 +7,9 @@
|
||||
"composite": true,
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"emitDeclarationOnly": true
|
||||
"emitDeclarationOnly": true,
|
||||
"moduleResolution": "Node16"
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"path": "../plugins-manager/tsconfig.json"
|
||||
}
|
||||
],
|
||||
"include": [
|
||||
"src",
|
||||
"*.js",
|
||||
"types"
|
||||
],
|
||||
"exclude": [
|
||||
"dist",
|
||||
"dist-types"
|
||||
]
|
||||
}
|
||||
"include": ["src", "types"],
|
||||
"exclude": ["dist-types"]
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
/**
|
||||
* @template T
|
||||
* @typedef {import('./types/main.js').MetaPlugin<T>} MetaPlugin
|
||||
**/
|
||||
/** @typedef {import('./types/main.js').Plugin} Plugin */
|
||||
|
||||
export { addPlugin } from './src/addPlugin.js';
|
||||
export { removePlugin } from './src/removePlugin.js';
|
||||
export { adjustPluginOptions } from './src/adjustPluginOptions.js';
|
||||
export { applyPlugins } from './src/applyPlugins.js';
|
||||
export { executeSetupFunctions } from './src/executeSetupFunctions.js';
|
||||
@@ -16,23 +16,35 @@
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist-types/index.d.ts",
|
||||
"types": "./dist-types/src/index.d.ts",
|
||||
"require": "./dist/index.cjs",
|
||||
"default": "./index.js"
|
||||
"default": "./src/index.js"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"build:package": "rimraf dist && esbuild --platform=node --format=cjs --bundle --outfile=dist/index.cjs ./index.js",
|
||||
"prepublishOnly": "publish-docs --github-url https://github.com/modernweb-dev/rocket/ --git-root-dir ../../",
|
||||
"prepublishOnly": "npm run types && rimraf dist && esbuild --platform=node --format=cjs --bundle --outfile=dist/index.cjs ./index.js && publish-docs --github-url https://github.com/modernweb-dev/rocket/ --git-root-dir ../../",
|
||||
"test": "mocha --timeout 5000 test-node/**/*.test.{js,cjs} test-node/*.test.{js,cjs}",
|
||||
"test:watch": "onchange 'src/**/*.{js,cjs}' 'test-node/**/*.{js,cjs}' -- npm test",
|
||||
"types:copy": "copyfiles \"./types/**/*.d.ts\" dist-types/"
|
||||
"types": "wireit"
|
||||
},
|
||||
"files": [
|
||||
"*.js",
|
||||
"dist",
|
||||
"dist-types",
|
||||
"src"
|
||||
],
|
||||
"types": "./dist-types/index.d.ts"
|
||||
"types": "./dist-types/src/index.d.ts",
|
||||
"wireit": {
|
||||
"types": {
|
||||
"command": "copyfiles \"./types/**/*.d.ts\" dist-types/ && tsc --build --pretty",
|
||||
"clean": "if-file-deleted",
|
||||
"files": [
|
||||
"src/**/*.js",
|
||||
"tsconfig.json"
|
||||
],
|
||||
"output": [
|
||||
"dist-types/**",
|
||||
".tsbuildinfo"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
/**
|
||||
* @template {import('../types/main.js').Plugin} T
|
||||
* @param {T} plugin
|
||||
* @param {import('../types/main.js').GetPluginOptions<T>} [options]
|
||||
* @param {import('../types/main.js').ManagerOptions} [managerOptions]
|
||||
* @param {import('../types/main.js').ManagerOptions} managerOptions
|
||||
*/
|
||||
// @ts-ignore
|
||||
export function addPlugin(plugin, options = {}, { how = 'after', location = 'bottom' } = {}) {
|
||||
export function addPlugin(plugin, options, { how = 'after', location = 'bottom' } = {}) {
|
||||
/**
|
||||
* @param {import('../types/main.js').MetaPlugin<T>[]} plugins
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
/** @typedef {import('../types/main.js').Plugin} Plugin */
|
||||
|
||||
/**
|
||||
|
||||
12
packages/plugins-manager/src/index.js
Normal file
12
packages/plugins-manager/src/index.js
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* @template T
|
||||
* @typedef {import('../types/main.js').MetaPlugin<T>} MetaPlugin
|
||||
**/
|
||||
/** @typedef {import('../types/main.js').Plugin} Plugin */
|
||||
/** @typedef {import('../types/main.js').AnyFn} AnyFn */
|
||||
|
||||
export { addPlugin } from './addPlugin.js';
|
||||
export { removePlugin } from './removePlugin.js';
|
||||
export { adjustPluginOptions } from './adjustPluginOptions.js';
|
||||
export { applyPlugins } from './applyPlugins.js';
|
||||
export { executeSetupFunctions } from './executeSetupFunctions.js';
|
||||
@@ -1,8 +1,6 @@
|
||||
import chai from 'chai';
|
||||
import { expect } from 'chai';
|
||||
|
||||
import { addPlugin, applyPlugins } from '../index.js';
|
||||
|
||||
const { expect } = chai;
|
||||
import { addPlugin, applyPlugins } from 'plugins-manager';
|
||||
|
||||
describe('addPlugin', () => {
|
||||
const insertPlugin = ({ firstName = 'first', lastName = 'last' } = {}) =>
|
||||
@@ -11,15 +9,7 @@ describe('addPlugin', () => {
|
||||
const secondPlugin = () => 'secondPlugin';
|
||||
const thirdPlugin = () => 'thirdPlugin';
|
||||
|
||||
/**
|
||||
* @template T
|
||||
* @type {import('../types/main.js.js').MetaPlugin<T>[]}
|
||||
*/
|
||||
const oneExistingPlugin = [{ plugin: firstPlugin, options: {} }];
|
||||
/**
|
||||
* @template T
|
||||
* @type {import('../types/main.js.js').MetaPlugin<T>[]}
|
||||
*/
|
||||
const threeExistingPlugins = [
|
||||
{ plugin: firstPlugin, options: {} },
|
||||
{ plugin: secondPlugin, options: {} },
|
||||
@@ -111,12 +101,16 @@ describe('addPlugin', () => {
|
||||
});
|
||||
|
||||
it('[advanced] can add a `wrapPlugin` property to the function itself which will call it on the plugin on init', async () => {
|
||||
/**
|
||||
* @param {import('plugins-manager').AnyFn} plugin
|
||||
*/
|
||||
function myWrapper(plugin) {
|
||||
return () => 'wrapped' + plugin();
|
||||
}
|
||||
|
||||
const config = applyPlugins({
|
||||
setupPlugins: [addPlugin(insertPlugin)].map(mod => {
|
||||
// @ts-ignore
|
||||
mod.wrapPlugin = myWrapper;
|
||||
return mod;
|
||||
}),
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
// @ts-check
|
||||
|
||||
import chai from 'chai';
|
||||
|
||||
import { adjustPluginOptions, applyPlugins } from '../index.js';
|
||||
import { adjustPluginOptions, applyPlugins } from 'plugins-manager';
|
||||
|
||||
const { expect } = chai;
|
||||
|
||||
|
||||
@@ -1,20 +1,10 @@
|
||||
import chai from 'chai';
|
||||
import { expect } from 'chai';
|
||||
|
||||
import { applyPlugins, addPlugin } from '../index.js';
|
||||
|
||||
const { expect } = chai;
|
||||
import { applyPlugins, addPlugin } from 'plugins-manager';
|
||||
|
||||
describe('applyPlugins', () => {
|
||||
const insertPlugin = () => `-- insertPlugin --`;
|
||||
/**
|
||||
* @template T
|
||||
* @type {import('../types/main.js.js').MetaPlugin<T>[]}
|
||||
*/
|
||||
const oneExistingPlugin = [{ plugin: () => 'firstPlugin', options: {} }];
|
||||
/**
|
||||
* @template T
|
||||
* @type {import('../types/main.js.js').MetaPlugin<T>[]}
|
||||
*/
|
||||
const threeExistingPlugin = [
|
||||
{ plugin: () => 'firstPlugin', options: {} },
|
||||
{ plugin: () => 'secondPlugin', options: {} },
|
||||
|
||||
@@ -1,18 +1,12 @@
|
||||
import chai from 'chai';
|
||||
import { expect } from 'chai';
|
||||
|
||||
import { executeSetupFunctions, addPlugin } from '../index.js';
|
||||
|
||||
const { expect } = chai;
|
||||
import { executeSetupFunctions, addPlugin } from 'plugins-manager';
|
||||
|
||||
describe('executeSetupFunctions', () => {
|
||||
const firstPlugin = () => 'firstPlugin';
|
||||
const secondPlugin = () => 'secondPlugin';
|
||||
const thirdPlugin = () => 'thirdPlugin';
|
||||
|
||||
/**
|
||||
* @template T
|
||||
* @type {import('../types/main.js.js').MetaPlugin<T>[]}
|
||||
*/
|
||||
const threeExistingPlugin = [
|
||||
{ plugin: firstPlugin, options: {} },
|
||||
{ plugin: secondPlugin, options: {} },
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import chai from 'chai';
|
||||
import { expect } from 'chai';
|
||||
|
||||
import { removePlugin, applyPlugins } from '../index.js';
|
||||
|
||||
const { expect } = chai;
|
||||
import { removePlugin, applyPlugins } from 'plugins-manager';
|
||||
|
||||
describe('removePlugin', () => {
|
||||
const firstPlugin = () => 'firstPlugin';
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// Don't edit this file directly. It is generated by /scripts/update-package-configs.ts
|
||||
|
||||
{
|
||||
"extends": "../../tsconfig.node-base.json",
|
||||
"compilerOptions": {
|
||||
@@ -9,16 +7,17 @@
|
||||
"composite": true,
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"emitDeclarationOnly": true
|
||||
"emitDeclarationOnly": true,
|
||||
"moduleResolution": "Node16"
|
||||
},
|
||||
"references": [],
|
||||
"include": [
|
||||
"src",
|
||||
"*.js",
|
||||
"types"
|
||||
"types",
|
||||
"test-node"
|
||||
],
|
||||
"exclude": [
|
||||
"dist",
|
||||
"dist-types"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
2
packages/plugins-manager/types/main.d.ts
vendored
2
packages/plugins-manager/types/main.d.ts
vendored
@@ -12,7 +12,7 @@ export type GetPluginOptions<T> = T extends Constructor
|
||||
|
||||
export interface MetaPlugin<T> {
|
||||
plugin: Plugin;
|
||||
options: GetPluginOptions<T>;
|
||||
options: GetPluginOptions<T> | undefined;
|
||||
}
|
||||
|
||||
export interface ManagerOptions {
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
},
|
||||
"author": "Modern Web <hello@modern-web.dev> (https://modern-web.dev/)",
|
||||
"homepage": "https://rocket.modern-web.dev/docs/presets/search/",
|
||||
"main": "./node.js",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": "./exports/index.js",
|
||||
@@ -26,10 +25,12 @@
|
||||
"scripts": {
|
||||
"analyze": "cem analyze --litelement",
|
||||
"debug": "cd ../../ && npm run debug -- --group search",
|
||||
"prepublishOnly": "npm run types",
|
||||
"test": "npm run test:node && npm run test:web",
|
||||
"test:node": "mocha --require ../../scripts/testMochaGlobalHooks.js test-node/**/*.test.js test-node/*.test.js",
|
||||
"test:watch": "onchange 'src/**/*.{js,cjs}' 'test-node/**/*.js' -- npm run test:node",
|
||||
"test:web": "cd ../../ && npm run test:web -- --group search"
|
||||
"test:web": "cd ../../ && npm run test:web -- --group search",
|
||||
"types": "wireit"
|
||||
},
|
||||
"files": [
|
||||
"*.js",
|
||||
@@ -52,5 +53,23 @@
|
||||
"devDependencies": {
|
||||
"@rocket/cli": "^0.20.0"
|
||||
},
|
||||
"customElements": "custom-elements.json"
|
||||
"customElements": "custom-elements.json",
|
||||
"wireit": {
|
||||
"types": {
|
||||
"command": "copyfiles \"./types/**/*.d.ts\" dist-types/ && tsc --build --pretty",
|
||||
"dependencies": [
|
||||
"../engine:types",
|
||||
"../plugins-manager:types"
|
||||
],
|
||||
"clean": "if-file-deleted",
|
||||
"files": [
|
||||
"src/**/*.js",
|
||||
"tsconfig.json"
|
||||
],
|
||||
"output": [
|
||||
"dist-types/**",
|
||||
".tsbuildinfo"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
|
||||
// @ts-ignore https://github.com/lucaong/minisearch/issues/152
|
||||
import MiniSearch from 'minisearch';
|
||||
import { getIdBlocksOfHtml } from './getIdBlocksOfHtml.js';
|
||||
@@ -69,6 +67,7 @@ export class RocketCliSearch {
|
||||
if (!this.outputDir || !this.inputDir) {
|
||||
return;
|
||||
}
|
||||
// @ts-ignore
|
||||
const miniSearch = new MiniSearch({
|
||||
fields: ['title', 'headline', 'body', 'section'], // fields to index for full-text search
|
||||
storeFields: ['title', 'headline', 'body', 'section'], // fields to return with search results
|
||||
|
||||
@@ -1,21 +1,19 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
import { LitElement, html, css } from 'lit';
|
||||
import { unsafeHTML } from 'lit/directives/unsafe-html.js';
|
||||
import { repeat } from 'lit/directives/repeat.js';
|
||||
import MiniSearch from 'minisearch';
|
||||
import { highlightSearchTerms, joinTitleHeadline } from './utils-shared.js';
|
||||
|
||||
/** @typedef {import('./types').RocketSearchResult} RocketSearchResult */
|
||||
/** @typedef {import('../types/main.js').RocketSearchResult} RocketSearchResult */
|
||||
|
||||
// wait for all dialog animations to complete their promises
|
||||
/**
|
||||
* Wait for all dialog animations to complete their promises
|
||||
*
|
||||
* @param {HTMLElement} element
|
||||
* @returns
|
||||
*/
|
||||
const animationsComplete = element =>
|
||||
// @ts-ignore
|
||||
Promise.allSettled(element.getAnimations().map(animation => animation.finished));
|
||||
function animationsComplete(element) {
|
||||
return Promise.allSettled(element.getAnimations().map(animation => animation.finished));
|
||||
}
|
||||
|
||||
export class RocketSearch extends LitElement {
|
||||
static properties = {
|
||||
@@ -72,6 +70,7 @@ export class RocketSearch extends LitElement {
|
||||
throw new Error(`The given json-url "${this.jsonUrl}" could not be fetched.`);
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
this.miniSearch = MiniSearch.loadJSON(responseText, {
|
||||
fields: ['title', 'headline', 'body'],
|
||||
searchOptions: {
|
||||
@@ -202,6 +201,7 @@ export class RocketSearch extends LitElement {
|
||||
if (this.miniSearch && changedProperties.has('search')) {
|
||||
if (this.search.length > 1) {
|
||||
this.results = /** @type {RocketSearchResult[]} */ (
|
||||
// @ts-ignore
|
||||
this.miniSearch.search(this.search)
|
||||
).slice(0, this.maxResults);
|
||||
if (this.results.length > 0) {
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
// @ts-nocheck
|
||||
|
||||
import chalk from 'chalk';
|
||||
import { highlightSearchTerms, joinTitleHeadline } from './utils-shared.js';
|
||||
|
||||
/** @typedef {import('./types').RocketSearchResult} RocketSearchResult */
|
||||
/** @typedef {import('../types/main').RocketSearchResult} RocketSearchResult */
|
||||
|
||||
const CLEAR_COMMAND = process.platform === 'win32' ? '\x1B[2J\x1B[0f' : '\x1B[2J\x1B[3J\x1B[H';
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// Don't edit this file directly. It is generated by /scripts/update-package-configs.ts
|
||||
|
||||
{
|
||||
"extends": "../../tsconfig.node-base.json",
|
||||
"compilerOptions": {
|
||||
@@ -9,29 +7,9 @@
|
||||
"composite": true,
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"emitDeclarationOnly": true
|
||||
"emitDeclarationOnly": true,
|
||||
"moduleResolution": "NodeNext"
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"path": "../plugins-manager/tsconfig.json"
|
||||
},
|
||||
{
|
||||
"path": "../mdjs-core/tsconfig.json"
|
||||
},
|
||||
{
|
||||
"path": "../engine/tsconfig.json"
|
||||
},
|
||||
{
|
||||
"path": "../cli/tsconfig.json"
|
||||
}
|
||||
],
|
||||
"include": [
|
||||
"src",
|
||||
"*.js",
|
||||
"types"
|
||||
],
|
||||
"exclude": [
|
||||
"dist",
|
||||
"dist-types"
|
||||
]
|
||||
}
|
||||
"include": ["exports", "src", "types"],
|
||||
"exclude": ["dist-types", "**/__output/**", "**/__output-dev/**"]
|
||||
}
|
||||
|
||||
12
patches/@web+dev-server-core+0.3.19.patch
Normal file
12
patches/@web+dev-server-core+0.3.19.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff --git a/node_modules/@web/dev-server-core/package.json b/node_modules/@web/dev-server-core/package.json
|
||||
index c65693c..0e0bdc9 100644
|
||||
--- a/node_modules/@web/dev-server-core/package.json
|
||||
+++ b/node_modules/@web/dev-server-core/package.json
|
||||
@@ -16,6 +16,7 @@
|
||||
"main": "dist/index.js",
|
||||
"exports": {
|
||||
".": {
|
||||
+ "types": "./index.d.ts",
|
||||
"import": "./index.mjs",
|
||||
"require": "./dist/index.js"
|
||||
},
|
||||
12
patches/@web+dev-server-rollup+0.3.19.patch
Normal file
12
patches/@web+dev-server-rollup+0.3.19.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff --git a/node_modules/@web/dev-server-rollup/package.json b/node_modules/@web/dev-server-rollup/package.json
|
||||
index 56795a5..6f3285a 100644
|
||||
--- a/node_modules/@web/dev-server-rollup/package.json
|
||||
+++ b/node_modules/@web/dev-server-rollup/package.json
|
||||
@@ -16,6 +16,7 @@
|
||||
"main": "dist/index.js",
|
||||
"exports": {
|
||||
".": {
|
||||
+ "types": "./index.d.ts",
|
||||
"import": "./index.mjs",
|
||||
"require": "./dist/index.js"
|
||||
}
|
||||
@@ -13,7 +13,6 @@
|
||||
},
|
||||
"author": "Modern Web <hello@modern-web.dev> (https://modern-web.dev/)",
|
||||
"homepage": "https://rocket.modern-web.dev/",
|
||||
"main": "./src/index.js",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": {
|
||||
@@ -27,8 +26,9 @@
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"prepublishOnly": "npm run types",
|
||||
"test": "mocha --require ../../scripts/testMochaGlobalHooks.js test-node/**/*.test.{js,cjs} test-node/*.test.{js,cjs}",
|
||||
"types:copy": "copyfiles \"./types/**/*.d.ts\" dist-types/"
|
||||
"types": "wireit"
|
||||
},
|
||||
"files": [
|
||||
"dist-types",
|
||||
@@ -42,14 +42,25 @@
|
||||
"dependencies": {
|
||||
"@rocket/components": "^0.2.0",
|
||||
"@rocket/engine": "^0.2.6",
|
||||
"lit": "^2.3.0"
|
||||
"lit": "^2.3.0",
|
||||
"plugins-manager": "^0.3.1"
|
||||
},
|
||||
"devDependencies": {},
|
||||
"types": "./dist-types/src/index.d.ts",
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
"*": [
|
||||
"./dist-types/src/index.d.ts"
|
||||
"wireit": {
|
||||
"types": {
|
||||
"command": "copyfiles \"./types/**/*.d.ts\" dist-types/ && tsc --build --pretty",
|
||||
"dependencies": [
|
||||
"../../packages/components:types",
|
||||
"../../packages/engine:types",
|
||||
"../../packages/plugins-manager:types"
|
||||
],
|
||||
"clean": "if-file-deleted",
|
||||
"files": [
|
||||
"src/**/*.js",
|
||||
"tsconfig.json"
|
||||
],
|
||||
"output": [
|
||||
"dist-types/**",
|
||||
".tsbuildinfo"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { css } from 'lit';
|
||||
import { RocketColumns } from '@rocket/components/rocket-columns.js';
|
||||
import { RocketColumns } from '@rocket/components/columns.js';
|
||||
|
||||
export class BlockFeatures extends RocketColumns {
|
||||
static styles = [
|
||||
...this.styles,
|
||||
...super.styles,
|
||||
css`
|
||||
slot[name='title']::slotted(*) {
|
||||
margin-bottom: 100px;
|
||||
|
||||
@@ -1,8 +1,18 @@
|
||||
import { Layout, renderJoiningGroup } from '@rocket/engine';
|
||||
import { pageDefaults } from '@rocket/components';
|
||||
import { html, nothing } from 'lit';
|
||||
import { html } from 'lit';
|
||||
|
||||
export class LayoutHome extends Layout {
|
||||
/**
|
||||
* @type {import('../types/main.js').LayoutHomeOptions}
|
||||
*/
|
||||
options = {
|
||||
...this.options,
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {import('../types/main.js').LayoutHomeOptions} options
|
||||
*/
|
||||
constructor(options) {
|
||||
super(options);
|
||||
this.options = {
|
||||
@@ -28,18 +38,19 @@ export class LayoutHome extends Layout {
|
||||
|
||||
header__50: data => {
|
||||
if (!this.options.pageTree) {
|
||||
return nothing;
|
||||
return html``;
|
||||
}
|
||||
const page = this.options.pageTree.getPage(data.sourceRelativeFilePath);
|
||||
if (page?.model?.headlinesWithId) {
|
||||
return html`
|
||||
${page.model.headlinesWithId.map(
|
||||
headline => html`
|
||||
(/** @type {{ id: string; text: string; }} */ headline) => html`
|
||||
<a class="headline-link" href="/#${headline.id}">${headline.text}</a>
|
||||
`,
|
||||
)}
|
||||
`;
|
||||
}
|
||||
return html``;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,8 +1,18 @@
|
||||
import { Layout, renderJoiningGroup } from '@rocket/engine';
|
||||
import { pageDefaults } from '@rocket/components';
|
||||
import { html, nothing } from 'lit';
|
||||
import { html } from 'lit';
|
||||
|
||||
export class LayoutMain extends Layout {
|
||||
/**
|
||||
* @type {import('../types/main.js').LayoutMainOptions}
|
||||
*/
|
||||
options = {
|
||||
...this.options,
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {import('../types/main.js').LayoutMainOptions} options
|
||||
*/
|
||||
constructor(options) {
|
||||
super(options);
|
||||
this.options = {
|
||||
@@ -28,18 +38,19 @@ export class LayoutMain extends Layout {
|
||||
|
||||
header__50: () => {
|
||||
if (!this.options.pageTree) {
|
||||
return nothing;
|
||||
return html``;
|
||||
}
|
||||
const page = this.options.pageTree.getPage('index.rocket.html');
|
||||
if (page.model.headlinesWithId) {
|
||||
if (page && page.model.headlinesWithId) {
|
||||
return html`
|
||||
${page.model.headlinesWithId.map(
|
||||
headline => html`
|
||||
(/** @type {{ id: string; text: string; }} */ headline) => html`
|
||||
<a class="headline-link" href="/#${headline.id}">${headline.text}</a>
|
||||
`,
|
||||
)}
|
||||
`;
|
||||
}
|
||||
return html``;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ class EnginePluginSpark {
|
||||
}
|
||||
|
||||
export function rocketSpark() {
|
||||
// @ts-ignore
|
||||
return /** @type {import('@rocket/cli').RocketPreset} */ ({
|
||||
setupEnginePlugins: [addPlugin(EnginePluginSpark)],
|
||||
});
|
||||
|
||||
15
presets/spark/tsconfig.json
Normal file
15
presets/spark/tsconfig.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"extends": "../../tsconfig.node-base.json",
|
||||
"compilerOptions": {
|
||||
"module": "ESNext",
|
||||
"outDir": "./dist-types",
|
||||
"rootDir": ".",
|
||||
"composite": true,
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"emitDeclarationOnly": true,
|
||||
"moduleResolution": "NodeNext"
|
||||
},
|
||||
"include": ["exports", "src", "types"],
|
||||
"exclude": ["dist-types", "**/__output/**", "**/__output-dev/**"]
|
||||
}
|
||||
33
presets/spark/types/main.d.ts
vendored
Normal file
33
presets/spark/types/main.d.ts
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
import { LayoutOptions, PageTree, TemplateValue } from '@rocket/engine';
|
||||
|
||||
export interface LayoutMainOptions extends LayoutOptions {
|
||||
pageTree: PageTree;
|
||||
titleWrapperFn: (title: string) => string;
|
||||
description: string;
|
||||
siteName: string;
|
||||
|
||||
/**
|
||||
* defines stylesheets (+ font loading)
|
||||
*/
|
||||
head__100: TemplateValue;
|
||||
|
||||
footer__10: TemplateValue;
|
||||
|
||||
header__50: TemplateValue;
|
||||
}
|
||||
|
||||
export interface LayoutHomeOptions extends LayoutOptions {
|
||||
pageTree: PageTree;
|
||||
titleWrapperFn: (title: string) => string;
|
||||
description: string;
|
||||
siteName: string;
|
||||
|
||||
/**
|
||||
* defines stylesheets (+ font loading)
|
||||
*/
|
||||
head__100: TemplateValue;
|
||||
|
||||
footer__10: TemplateValue;
|
||||
|
||||
header__50: TemplateValue;
|
||||
}
|
||||
@@ -66,7 +66,7 @@
|
||||
"DOM",
|
||||
"DOM.Iterable",
|
||||
"ES6",
|
||||
"ES2017",
|
||||
"ES2020",
|
||||
// Allows array.flatMap. import `array-flat-polyfill` to cover node10
|
||||
"ES2019.array",
|
||||
"ScriptHost"
|
||||
|
||||
Reference in New Issue
Block a user