Skip to content

Commit

Permalink
Merge pull request #309 from modernweb-dev/next
Browse files Browse the repository at this point in the history
feat: introduce @rocket/engine and use it
  • Loading branch information
daKmoR committed Aug 11, 2022
2 parents 8c76c2d + 5226ab0 commit c84d512
Show file tree
Hide file tree
Showing 1,562 changed files with 45,411 additions and 16,736 deletions.
5 changes: 5 additions & 0 deletions .changeset/new-forks-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@mdjs/core': patch
---

Update `es-module-lexer` version.
6 changes: 6 additions & 0 deletions .changeset/new-forks-report2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@mdjs/mdjs-preview': patch
'@mdjs/mdjs-story': patch
---

Update lit version & add a server template for `@rocket/[email protected]+`.
8 changes: 8 additions & 0 deletions .changeset/old-falcons-sin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@rocket/launch': minor
'@rocket/search': minor
---

BREAKING CHANGE: New version built for @rocket/engine and @rocket/cli 0.20+

For more information see the [migration guide](https://github.com/modernweb-dev/rocket/blob/next/packages/cli/MIGRATION.md).
5 changes: 5 additions & 0 deletions .changeset/sharp-dingos-arrive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket/components': minor
---

Initial public beta version with multiple server renderable components based on [lit](https://lit.dev).
10 changes: 10 additions & 0 deletions .changeset/three-eagles-notice.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@rocket/cli': minor
---

BREAKING CHANGE: Complete rewrite introducing `@rocket/engine`
Introduces class based templates, server side rendering of web components and a file based routing.

For more information see the [migration guide](https://github.com/modernweb-dev/rocket/blob/next/packages/cli/MIGRATION.md).

The [legacy documentation](https://legacy.rocket.modern-web.dev/) is still available.
6 changes: 6 additions & 0 deletions .changeset/three-eagles-notice2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@rocket/engine': minor
'@rocket/create': minor
---

Initial public beta version.
5 changes: 5 additions & 0 deletions .changeset/tiny-actors-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket/spark': minor
---

Initial public beta version for `@rocket/cli` 0.20+
4 changes: 0 additions & 4 deletions .eleventyignore

This file was deleted.

11 changes: 11 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,14 @@ __output
__output-dev

docs/_merged*
*-mdjs-generated.js

# sanity example has a separate backend that is unrelated to Rocket
# therefore it does not need to follow it code rules
/examples/04-sanity-minimal-starter/backend/

/packages/engine/test-node/fixtures/06-error-handling/01-page-error/docs/index.rocket.js
/packages/engine/test-node/fixtures/03b-format-markdown/c01-md-in-js-to-md-html/md-in-js.js
/packages/engine/test-node/fixtures/03b-format-markdown/04-keep-converted-files/index-converted-md.js
/packages/engine/test-node/fixtures/03c-format-html/02-client-js/docs/index-converted-html.js
/packages/engine/test-node/fixtures/03b-format-markdown/04-keep-converted-files/index-converted-md-source.js
8 changes: 6 additions & 2 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
node-version: [16.x]
steps:
- uses: actions/checkout@v2

Expand All @@ -32,7 +32,11 @@ jobs:
- name: Install dependencies
run: yarn --frozen-lockfile

- uses: microsoft/playwright-github-action@v1
- name: Install Playwright dependencies
run: npx playwright install-deps

- name: Install Playwright
run: npx playwright install

- name: Build Packages
run: yarn build:packages
Expand Down
16 changes: 12 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ dist-types
stats.html
*.tsbuildinfo

## Rocket ignore files (need to be the full relative path to the folders)
docs/_merged_data/
docs/_merged_assets/
docs/_merged_includes/
# Rocket Search
rocket-search-index.json

## Rocket ignore files
*-mdjs-generated.js
*-converted-md-source.js
*-converted-md.js
*-converted-html.js
_site
_site-dev

Expand All @@ -41,3 +45,7 @@ _merged_assets
_merged_includes
__output
__output-dev
docs_backup

## Local playground
examples/testing
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v14
v16
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"dbaeumer.vscode-eslint"
]
}
34 changes: 34 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// A launch configuration that compiles the extension and then opens it inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Web Dev Server Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}/packages/vscode-rocket"
],
"outFiles": [
"${workspaceFolder}/packages/vscode-rocket/out/**/*.js"
],
"preLaunchTask": "Compile vscode-rocket"
},
{
"name": "Extension Tests",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
],
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
}
]
}
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"gitdoc.enabled": false,
"typescript.tsdk": "node_modules/typescript/lib",
"files.exclude": {
"**/*-mdjs-generated.js": false,
},
"search.exclude": {
"**/*-mdjs-generated.js": true,
"**/dist-types": true,
}
}
29 changes: 29 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Compile vscode-rocket",
"type": "npm",
"script": "compile",
"path": "packages/vscode-rocket/",
"group": "build",
"problemMatcher": [],
"detail": "tsc -p ./"
}
]
}
33 changes: 21 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
> This project is in its BETA phase
<p align="center">
<img
width="60%"
src="./assets/logo.png"
alt="Rocket"
/>
<picture width="60%">
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/modernweb-dev/rocket/next/site/src/assets/rocket-logo-dark-with-text.svg">
<img alt="Rocket Logo" src="https://raw.githubusercontent.com/modernweb-dev/rocket/next/site/src/assets/rocket-logo-light-with-text.svg">
</picture>
</p>

<p align="center">
<a href="https://github.com/modernweb-dev/rocket/actions"
><img
src="https://img.shields.io/github/workflow/status/modernweb-dev/rocket/Release/main?label=workflow&style=flat-square"
src="https://img.shields.io/github/workflow/status/modernweb-dev/rocket/Release/next?label=workflow&style=flat-square"
alt="GitHub Actions workflow status"
/></a>
<a href="https://twitter.com/modern_web_dev"
Expand All @@ -21,29 +20,29 @@
/></a>
<a href="https://open.vscode.dev/modernweb-dev/rocket"
><img
src="https://open.vscode.dev/badges/open-in-vscode.svg"
src="https://img.shields.io/static/v1?logo=visualstudiocode&label=&message=Open%20in%20Visual%20Studio%20Code&labelColor=2c2c32&color=007acc&logoColor=007acc"
alt="Open in VS Code"
/></a>
</p>

<p align="center">
<a href="https://rocket.modern-web.dev">Website</a>
·
<a href="https://rocket.modern-web.dev/guides/">Guides</a>
<a href="https://rocket.modern-web.dev/doc/">Documentation</a>
·
<a href="https://rocket.modern-web.dev/docs/">Documentation</a>
<a href="https://rocket.modern-web.dev/chat">Discord Community</a>
</p>

<h1></h1>

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

- **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>.
- **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>.
- **Powerful Default Template:** Provide content and you are ready to go.
- **Small:** No overblown tools or frontend frameworks, add JavaScript and/or Web Components only on pages where needed..

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

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

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

<p align="center">
<a href="https://rocket.modern-web.dev/chat"><strong>Join our Discord Community&nbsp;&nbsp;▶</strong></a>
</p>

## Quick Start

```
npx @rocket/create@latest
```

## 🤝 Contributing

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).

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. 👋
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. 👋

### Financial Contributors

Expand Down
43 changes: 43 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## TODO

- 404 page background images are not being loaded
- sitemap.xml not deployed on netlify

## Features

- recursive rendering of lit / html / and markdown
- "import" markdown with frontmatter
- mdjs update to unified v10 AND go esm only (only cjs pkg we have now)

## Nice to have

- Add "menuExclude" => to actually exclude the menu item

## Bugs

- write to `_site-dev` instead of `_site` while using `rocket start`
- nested `recursive.data.js` do not overwrite the parent data
- support <!-- asdf --> in markdown

## Error Handling

- make error nice for parent page not found in index => auto generate page? 🤔

## Examples

- docs site, blog (simple), blog (complex), minimal
- add stackblitz/codesandbox examples => does not work because of `@parcel/watcher` https://github.com/parcel-bundler/watcher/issues/99

- Example: export variable and use it in rendering
- Example: fetch data from an api and display it
- Example: usage of image

## later

- support `@change` in markdown
- support "hey ${foo.map(f => `${f} + 1`)}"
- ENGINE: Rename "options.docsDir" to "options.inputDir"

## consider

- Replace magic "resolve:pkg/foo.css" with a directive `${resolve()}`?
Binary file removed assets/logo.png
Binary file not shown.
47 changes: 47 additions & 0 deletions config/rocket.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { rocketLaunch } from '@rocket/launch';
import { rocketSpark } from '@rocket/spark';
import { presetRocketSearch } from '@rocket/search';

/**
* Extracts the current applicable absoluteBaseUrl from Netlify system variables
*
* @param {string} fallback
*/
export function absoluteBaseUrlNetlify(fallback) {
let absoluteBaseUrl = fallback;

switch (process.env.CONTEXT) {
case 'production':
absoluteBaseUrl = process.env.URL ?? '';
break;
case 'deploy-preview':
absoluteBaseUrl = process.env.DEPLOY_URL ?? '';
break;
case 'branch-deploy':
absoluteBaseUrl = process.env.DEPLOY_PRIME_URL ?? '';
break;
/* no default */
}
return absoluteBaseUrl;
}

export default /** @type {import('@rocket/cli/types/main').RocketCliOptions} */ ({
absoluteBaseUrl: absoluteBaseUrlNetlify('http://localhost:8080'),
longFileHeaderWidth: 100,
longFileHeaderComment: '// prettier-ignore',
// adjustDevServerOptions: (options) => ({
// ...options,
// nodeResolve: {
// ...options.nodeResolve,
// exportConditions: ['development'],
// },
// }),

// buildOpenGraphImages: false,

presets: [rocketLaunch(), rocketSpark(), presetRocketSearch()],
// serviceWorkerName: 'sw.js',
// pathPrefix: '/_site/',

// clearOutputDir: false,
});
1 change: 0 additions & 1 deletion docs/.eleventyignore

This file was deleted.

4 changes: 0 additions & 4 deletions docs/404.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/_assets/_static/logos/npm.svg

This file was deleted.

3 changes: 0 additions & 3 deletions docs/_assets/_static/logos/pnpm.svg

This file was deleted.

1 change: 0 additions & 1 deletion docs/_assets/_static/logos/yarn.svg

This file was deleted.

Loading

0 comments on commit c84d512

Please sign in to comment.