Skip to content

Commit c84d512

Browse files
authored
Merge pull request #309 from modernweb-dev/next
feat: introduce @rocket/engine and use it
2 parents 8c76c2d + 5226ab0 commit c84d512

File tree

1,562 files changed

+45411
-16736
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,562 files changed

+45411
-16736
lines changed

.changeset/new-forks-report.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@mdjs/core': patch
3+
---
4+
5+
Update `es-module-lexer` version.

.changeset/new-forks-report2.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@mdjs/mdjs-preview': patch
3+
'@mdjs/mdjs-story': patch
4+
---
5+
6+
Update lit version & add a server template for `@rocket/[email protected]+`.

.changeset/old-falcons-sin.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@rocket/launch': minor
3+
'@rocket/search': minor
4+
---
5+
6+
BREAKING CHANGE: New version built for @rocket/engine and @rocket/cli 0.20+
7+
8+
For more information see the [migration guide](https://github.com/modernweb-dev/rocket/blob/next/packages/cli/MIGRATION.md).

.changeset/sharp-dingos-arrive.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@rocket/components': minor
3+
---
4+
5+
Initial public beta version with multiple server renderable components based on [lit](https://lit.dev).

.changeset/three-eagles-notice.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@rocket/cli': minor
3+
---
4+
5+
BREAKING CHANGE: Complete rewrite introducing `@rocket/engine`
6+
Introduces class based templates, server side rendering of web components and a file based routing.
7+
8+
For more information see the [migration guide](https://github.com/modernweb-dev/rocket/blob/next/packages/cli/MIGRATION.md).
9+
10+
The [legacy documentation](https://legacy.rocket.modern-web.dev/) is still available.

.changeset/three-eagles-notice2.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@rocket/engine': minor
3+
'@rocket/create': minor
4+
---
5+
6+
Initial public beta version.

.changeset/tiny-actors-flow.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@rocket/spark': minor
3+
---
4+
5+
Initial public beta version for `@rocket/cli` 0.20+

.eleventyignore

-4
This file was deleted.

.eslintignore

+11
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,14 @@ __output
1212
__output-dev
1313

1414
docs/_merged*
15+
*-mdjs-generated.js
16+
17+
# sanity example has a separate backend that is unrelated to Rocket
18+
# therefore it does not need to follow it code rules
19+
/examples/04-sanity-minimal-starter/backend/
20+
21+
/packages/engine/test-node/fixtures/06-error-handling/01-page-error/docs/index.rocket.js
22+
/packages/engine/test-node/fixtures/03b-format-markdown/c01-md-in-js-to-md-html/md-in-js.js
23+
/packages/engine/test-node/fixtures/03b-format-markdown/04-keep-converted-files/index-converted-md.js
24+
/packages/engine/test-node/fixtures/03c-format-html/02-client-js/docs/index-converted-html.js
25+
/packages/engine/test-node/fixtures/03b-format-markdown/04-keep-converted-files/index-converted-md-source.js

.github/workflows/verify.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
strategy:
1010
matrix:
11-
node-version: [14.x]
11+
node-version: [16.x]
1212
steps:
1313
- uses: actions/checkout@v2
1414

@@ -32,7 +32,11 @@ jobs:
3232
- name: Install dependencies
3333
run: yarn --frozen-lockfile
3434

35-
- uses: microsoft/playwright-github-action@v1
35+
- name: Install Playwright dependencies
36+
run: npx playwright install-deps
37+
38+
- name: Install Playwright
39+
run: npx playwright install
3640

3741
- name: Build Packages
3842
run: yarn build:packages

.gitignore

+12-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,14 @@ dist-types
2828
stats.html
2929
*.tsbuildinfo
3030

31-
## Rocket ignore files (need to be the full relative path to the folders)
32-
docs/_merged_data/
33-
docs/_merged_assets/
34-
docs/_merged_includes/
31+
# Rocket Search
32+
rocket-search-index.json
33+
34+
## Rocket ignore files
35+
*-mdjs-generated.js
36+
*-converted-md-source.js
37+
*-converted-md.js
38+
*-converted-html.js
3539
_site
3640
_site-dev
3741

@@ -41,3 +45,7 @@ _merged_assets
4145
_merged_includes
4246
__output
4347
__output-dev
48+
docs_backup
49+
50+
## Local playground
51+
examples/testing

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v14
1+
v16

.vscode/extensions.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
// See http://go.microsoft.com/fwlink/?LinkId=827846
3+
// for the documentation about the extensions.json format
4+
"recommendations": [
5+
"dbaeumer.vscode-eslint"
6+
]
7+
}

.vscode/launch.json

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// A launch configuration that compiles the extension and then opens it inside a new window
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
{
6+
"version": "0.2.0",
7+
"configurations": [
8+
{
9+
"name": "Run Web Dev Server Extension",
10+
"type": "extensionHost",
11+
"request": "launch",
12+
"args": [
13+
"--extensionDevelopmentPath=${workspaceFolder}/packages/vscode-rocket"
14+
],
15+
"outFiles": [
16+
"${workspaceFolder}/packages/vscode-rocket/out/**/*.js"
17+
],
18+
"preLaunchTask": "Compile vscode-rocket"
19+
},
20+
{
21+
"name": "Extension Tests",
22+
"type": "extensionHost",
23+
"request": "launch",
24+
"args": [
25+
"--extensionDevelopmentPath=${workspaceFolder}",
26+
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
27+
],
28+
"outFiles": [
29+
"${workspaceFolder}/out/test/**/*.js"
30+
],
31+
"preLaunchTask": "${defaultBuildTask}"
32+
}
33+
]
34+
}

.vscode/settings.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"gitdoc.enabled": false,
3+
"typescript.tsdk": "node_modules/typescript/lib",
4+
"files.exclude": {
5+
"**/*-mdjs-generated.js": false,
6+
},
7+
"search.exclude": {
8+
"**/*-mdjs-generated.js": true,
9+
"**/dist-types": true,
10+
}
11+
}

.vscode/tasks.json

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// See https://go.microsoft.com/fwlink/?LinkId=733558
2+
// for the documentation about the tasks.json format
3+
{
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"type": "npm",
8+
"script": "watch",
9+
"problemMatcher": "$tsc-watch",
10+
"isBackground": true,
11+
"presentation": {
12+
"reveal": "never"
13+
},
14+
"group": {
15+
"kind": "build",
16+
"isDefault": true
17+
}
18+
},
19+
{
20+
"label": "Compile vscode-rocket",
21+
"type": "npm",
22+
"script": "compile",
23+
"path": "packages/vscode-rocket/",
24+
"group": "build",
25+
"problemMatcher": [],
26+
"detail": "tsc -p ./"
27+
}
28+
]
29+
}

README.md

+21-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
> This project is in its BETA phase
22
33
<p align="center">
4-
<img
5-
width="60%"
6-
src="./assets/logo.png"
7-
alt="Rocket"
8-
/>
4+
<picture width="60%">
5+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/modernweb-dev/rocket/next/site/src/assets/rocket-logo-dark-with-text.svg">
6+
<img alt="Rocket Logo" src="https://raw.githubusercontent.com/modernweb-dev/rocket/next/site/src/assets/rocket-logo-light-with-text.svg">
7+
</picture>
98
</p>
109

1110
<p align="center">
1211
<a href="https://github.com/modernweb-dev/rocket/actions"
1312
><img
14-
src="https://img.shields.io/github/workflow/status/modernweb-dev/rocket/Release/main?label=workflow&style=flat-square"
13+
src="https://img.shields.io/github/workflow/status/modernweb-dev/rocket/Release/next?label=workflow&style=flat-square"
1514
alt="GitHub Actions workflow status"
1615
/></a>
1716
<a href="https://twitter.com/modern_web_dev"
@@ -21,29 +20,29 @@
2120
/></a>
2221
<a href="https://open.vscode.dev/modernweb-dev/rocket"
2322
><img
24-
src="https://open.vscode.dev/badges/open-in-vscode.svg"
23+
src="https://img.shields.io/static/v1?logo=visualstudiocode&label=&message=Open%20in%20Visual%20Studio%20Code&labelColor=2c2c32&color=007acc&logoColor=007acc"
2524
alt="Open in VS Code"
2625
/></a>
2726
</p>
2827

2928
<p align="center">
3029
<a href="https://rocket.modern-web.dev">Website</a>
3130
·
32-
<a href="https://rocket.modern-web.dev/guides/">Guides</a>
31+
<a href="https://rocket.modern-web.dev/doc/">Documentation</a>
3332
·
34-
<a href="https://rocket.modern-web.dev/docs/">Documentation</a>
33+
<a href="https://rocket.modern-web.dev/chat">Discord Community</a>
3534
</p>
3635

3736
<h1></h1>
3837

3938
**The modern web setup for static sites with a sprinkle of JavaScript!**
4039

41-
- **Meta Framework:** Build on top of giants like <a href="https://www.11ty.dev/">Eleventy</a>, <a href="https://rollupjs.org/">Rollup</a>, and <a href="https://www.modern-web.dev/">Modern Web</a>.
40+
- **Meta Framework:** Build on top of giants like <a href="https://lit.dev/">Lit</a>, <a href="https://rollupjs.org/">Rollup</a> and <a href="https://www.modern-web.dev/">Modern Web</a>.
4241
- **Powerful Default Template:** Provide content and you are ready to go.
4342
- **Small:** No overblown tools or frontend frameworks, add JavaScript and/or Web Components only on pages where needed..
4443

4544
<p align="center">
46-
<a href="https://rocket.modern-web.dev/guides/"><strong>Explore the Rocket Guides&nbsp;&nbsp;▶</strong></a>
45+
<a href="https://rocket.modern-web.dev/docs/setup/getting-started/"><strong>Getting Started With Rocket&nbsp;&nbsp;▶</strong></a>
4746
</p>
4847

4948
## The Goal for Rocket
@@ -55,11 +54,21 @@ You can still tweak every detail of every underlying tool that gets used.
5554

5655
Rocket is part of the [Modern Web Family](https://twitter.com/modern_web_dev).
5756

57+
<p align="center">
58+
<a href="https://rocket.modern-web.dev/chat"><strong>Join our Discord Community&nbsp;&nbsp;▶</strong></a>
59+
</p>
60+
61+
## Quick Start
62+
63+
```
64+
npx @rocket/create@latest
65+
```
66+
5867
## 🤝 Contributing
5968

6069
We are always looking for contributors of all skill levels! If you're looking to ease your way into the project, try out a [good first issue](https://github.com/modernweb-dev/rocket/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22).
6170

62-
If you are interested in helping contribute to Modern Web, please take a look at our [Contributing Guide](https://github.com/modernweb-dev/rocket/blob/main/CONTRIBUTING.md). Also, feel free to drop into [slack](https://rocket.modern-web.dev/about/slack/) and say hi. 👋
71+
If you are interested in helping contribute to Modern Web, please take a look at our [Contributing Guide](https://github.com/modernweb-dev/rocket/blob/next/CONTRIBUTING.md). Also, feel free to drop into [discord](https://rocket.modern-web.dev/chat) and say hi. 👋
6372

6473
### Financial Contributors
6574

TODO.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
## TODO
2+
3+
- 404 page background images are not being loaded
4+
- sitemap.xml not deployed on netlify
5+
6+
## Features
7+
8+
- recursive rendering of lit / html / and markdown
9+
- "import" markdown with frontmatter
10+
- mdjs update to unified v10 AND go esm only (only cjs pkg we have now)
11+
12+
## Nice to have
13+
14+
- Add "menuExclude" => to actually exclude the menu item
15+
16+
## Bugs
17+
18+
- write to `_site-dev` instead of `_site` while using `rocket start`
19+
- nested `recursive.data.js` do not overwrite the parent data
20+
- support <!-- asdf --> in markdown
21+
22+
## Error Handling
23+
24+
- make error nice for parent page not found in index => auto generate page? 🤔
25+
26+
## Examples
27+
28+
- docs site, blog (simple), blog (complex), minimal
29+
- add stackblitz/codesandbox examples => does not work because of `@parcel/watcher` https://github.com/parcel-bundler/watcher/issues/99
30+
31+
- Example: export variable and use it in rendering
32+
- Example: fetch data from an api and display it
33+
- Example: usage of image
34+
35+
## later
36+
37+
- support `@change` in markdown
38+
- support "hey ${foo.map(f => `${f} + 1`)}"
39+
- ENGINE: Rename "options.docsDir" to "options.inputDir"
40+
41+
## consider
42+
43+
- Replace magic "resolve:pkg/foo.css" with a directive `${resolve()}`?

assets/logo.png

-10.1 KB
Binary file not shown.

config/rocket.config.js

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import { rocketLaunch } from '@rocket/launch';
2+
import { rocketSpark } from '@rocket/spark';
3+
import { presetRocketSearch } from '@rocket/search';
4+
5+
/**
6+
* Extracts the current applicable absoluteBaseUrl from Netlify system variables
7+
*
8+
* @param {string} fallback
9+
*/
10+
export function absoluteBaseUrlNetlify(fallback) {
11+
let absoluteBaseUrl = fallback;
12+
13+
switch (process.env.CONTEXT) {
14+
case 'production':
15+
absoluteBaseUrl = process.env.URL ?? '';
16+
break;
17+
case 'deploy-preview':
18+
absoluteBaseUrl = process.env.DEPLOY_URL ?? '';
19+
break;
20+
case 'branch-deploy':
21+
absoluteBaseUrl = process.env.DEPLOY_PRIME_URL ?? '';
22+
break;
23+
/* no default */
24+
}
25+
return absoluteBaseUrl;
26+
}
27+
28+
export default /** @type {import('@rocket/cli/types/main').RocketCliOptions} */ ({
29+
absoluteBaseUrl: absoluteBaseUrlNetlify('http://localhost:8080'),
30+
longFileHeaderWidth: 100,
31+
longFileHeaderComment: '// prettier-ignore',
32+
// adjustDevServerOptions: (options) => ({
33+
// ...options,
34+
// nodeResolve: {
35+
// ...options.nodeResolve,
36+
// exportConditions: ['development'],
37+
// },
38+
// }),
39+
40+
// buildOpenGraphImages: false,
41+
42+
presets: [rocketLaunch(), rocketSpark(), presetRocketSearch()],
43+
// serviceWorkerName: 'sw.js',
44+
// pathPrefix: '/_site/',
45+
46+
// clearOutputDir: false,
47+
});

docs/.eleventyignore

-1
This file was deleted.

docs/404.md

-4
This file was deleted.

docs/_assets/_static/logos/npm.svg

-1
This file was deleted.

docs/_assets/_static/logos/pnpm.svg

-3
This file was deleted.

docs/_assets/_static/logos/yarn.svg

-1
This file was deleted.

0 commit comments

Comments
 (0)