Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add server plugin, support linked compiler mode
BREAKING CHANGE: drop support for Marko 4 compiler BREAKING CHANGE: new api to support server plugin
- Loading branch information
1 parent
adaa679
commit 258ba92
Showing
76 changed files
with
3,103 additions
and
2,200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.vscode | ||
node_modules | ||
coverage | ||
dist | ||
__snapshots__ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"root": true, | ||
"extends": ["eslint:recommended", "prettier"], | ||
"parserOptions": { | ||
"ecmaVersion": 2020, | ||
"sourceType": "module", | ||
"ecmaFeatures": { | ||
"jsx": false | ||
} | ||
}, | ||
"env": { | ||
"browser": true, | ||
"node": true, | ||
"jest": true | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": ["**/*.ts"], | ||
"parser": "@typescript-eslint/parser", | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"prettier" | ||
], | ||
"rules": { | ||
"no-prototype-builtins": "off", | ||
"no-constant-condition": "off", | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/explicit-module-boundary-types": "off", | ||
"@typescript-eslint/no-non-null-assertion": "off", | ||
"@typescript-eslint/no-empty-function": "off", | ||
"@typescript-eslint/no-var-requires": "off" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"quiet": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
paths-ignore: ["**.md"] | ||
push: | ||
branches: ["main"] | ||
paths-ignore: ["**.md"] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node: [12.x, 14.x, 15.x] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Use node@${{ matrix.node }} | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Lint code | ||
run: npm run lint | ||
- name: Run tests | ||
run: npm run ci:test | ||
- name: Report code coverage | ||
run: npm run ci:report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,10 +11,7 @@ npm-debug.log | |
|
||
# Build | ||
dist | ||
*.tsbuildinfo | ||
|
||
# Coverage | ||
coverage | ||
.nyc_output | ||
|
||
# Test | ||
*.actual.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"*.ts": ["eslint -f codeframe --fix", "prettier --write"], | ||
"*.{js,json,md}": ["prettier --write"] | ||
"*{.js,.json,.md,.yml,rc}": ["prettier --write"], | ||
"./{,packages/*/}package.json": ["fixpack"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"overrides": [ | ||
{ | ||
"files": "*rc", | ||
"options": { | ||
"parser": "json" | ||
} | ||
} | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import fs from "fs"; | ||
static let watcher; | ||
static let pendingManifest; | ||
static function getLatestManifest($global) { | ||
if (!watcher) { | ||
watcher = fs.watch($global.__rollupManifest).on("change", () => { | ||
pendingManifest = undefined | ||
getLatestManifest($global); | ||
}); | ||
} | ||
return pendingManifest || (pendingManifest = fs.promises | ||
.readFile($global.__rollupManifest, "utf-8") | ||
.then(JSON.parse) | ||
.catch(() => | ||
new Promise(resolve => watcher.once("change", resolve)) | ||
.then(() => getLatestManifest($global)) | ||
)); | ||
} | ||
|
||
$ const $global = out.global; | ||
<await(getLatestManifest($global))> | ||
<@then|manifest|> | ||
$ const entries = $global.__rollupEntries || ($global.__rollupEntries = []); | ||
$ let writtenEntries = 0; | ||
<__flush_here_and_after__> | ||
$ const lastWrittenEntry = writtenEntries; | ||
$ writtenEntries = entries.length; | ||
<for|i| from=lastWrittenEntry to=(writtenEntries - 1)> | ||
<${input.renderBody}(entries[i], ...manifest)/> | ||
</> | ||
</> | ||
</> | ||
</> |
Oops, something went wrong.