-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: ensure dev and preview servers close correctly * fix: prevent vite warning about dynamic imports * chore: add changesets and other tooling * chore: add pre-commit linting * fix: enable running tests without building
- Loading branch information
Showing
139 changed files
with
22,256 additions
and
2,328 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,12 @@ | ||
{ | ||
"all": true, | ||
"excludeAfterRemap": true, | ||
"parserPlugins": ["objectRestSpread", "typescript"], | ||
"reporter": ["text-summary", "lcov"], | ||
"include": [ | ||
"packages/*/src/**/*.js", | ||
"packages/*/src/**/*.ts", | ||
"packages/*/src/**/*.marko" | ||
], | ||
"exclude": ["**/__tests__", "**/*.d.ts"] | ||
} |
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,8 @@ | ||
# Changesets | ||
|
||
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works | ||
with multi-package repos, or single-package repos to help you version and publish your code. You can | ||
find the full documentation for it [in our repository](https://github.com/changesets/changesets) | ||
|
||
We have a quick list of common questions to get you started engaging with this project in | ||
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) |
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,11 @@ | ||
{ | ||
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json", | ||
"changelog": "@changesets/cli/changelog", | ||
"updateInternalDependencies": "patch", | ||
"baseBranch": "main", | ||
"access": "public", | ||
"commit": false, | ||
"linked": [], | ||
"ignore": ["*-example"], | ||
"fixed": [] | ||
} |
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 @@ | ||
--- | ||
"@marko/run": patch | ||
--- | ||
|
||
Test release workflow |
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,80 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize] | ||
push: | ||
branches: [main, v3, v4] | ||
|
||
concurrency: | ||
group: "${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }}" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Use node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 22 | ||
cache: npm | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Build | ||
run: npm run @ci:build | ||
- name: Lint Code | ||
run: npm run @ci:lint | ||
test: | ||
runs-on: ubuntu-latest | ||
name: "test: node@${{ matrix.node }}" | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest] | ||
node: [18, 20] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Use node@${{ matrix.node }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
cache: npm | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Install Playwright Browsers | ||
run: npx playwright install --with-deps chromium | ||
- name: Run tests | ||
run: npm run @ci:test | ||
- name: Report code coverage | ||
uses: codecov/codecov-action@v5 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
release: | ||
runs-on: ubuntu-latest | ||
needs: [build, test] | ||
if: ${{ github.repository_owner == 'marko-js' && github.event_name == 'push' }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 22 | ||
cache: npm | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Release | ||
id: changesets | ||
uses: changesets/action@v1 | ||
with: | ||
version: npm run @ci:version | ||
publish: npm run @ci:release | ||
commit: "[ci] release" | ||
title: "[ci] release" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
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 |
---|---|---|
|
@@ -8,4 +8,6 @@ dist | |
*.ignore | ||
.cache | ||
*.actual.* | ||
.app | ||
.app | ||
coverage | ||
*.lcov |
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 @@ | ||
npm exec -- lint-staged && npm run build |
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 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/lintstagedrc.schema.json", | ||
"*.{ts,js}": ["eslint --fix", "prettier --write --with-node-modules"], | ||
"*.{json,md,css}": ["prettier --write --with-node-modules"] | ||
} |
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,19 @@ | ||
__snapshots__ | ||
.cache | ||
.nvm | ||
.vscode | ||
.marko-run | ||
.cache | ||
*actual* | ||
*expected* | ||
~* | ||
CHANGELOG.md | ||
coverage | ||
dist | ||
fixtures | ||
input.* | ||
node_modules | ||
package-lock.json | ||
snapshots | ||
netlify/*-functions | ||
netlify/assets |
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,4 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/prettierrc", | ||
"plugins": ["prettier-plugin-packagejson"] | ||
} |
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,58 @@ | ||
import eslint from "@eslint/js"; | ||
import sortImportPlugin from "eslint-plugin-simple-import-sort"; | ||
import globals from "globals"; | ||
import tseslint from "typescript-eslint"; | ||
|
||
export default tseslint.config( | ||
{ | ||
ignores: [ | ||
"!packages/runtime-class/src/node_modules", | ||
".cache", | ||
".sizes", | ||
".vscode", | ||
"**/.app", | ||
"**/.cache", | ||
"**/.marko-run", | ||
"**/__snapshots__", | ||
"**/*.marko.js", | ||
"**/*actual*", | ||
"**/*dist/", | ||
"**/*expected*", | ||
"**/snapshots", | ||
"**/test/**/input.js", | ||
"coverage", | ||
"node_modules", | ||
"**/netlify/*-functions", | ||
"**/netlify/assets", | ||
], | ||
}, | ||
eslint.configs.recommended, | ||
...tseslint.configs.recommended, | ||
{ | ||
languageOptions: { | ||
globals: { | ||
...globals.mocha, | ||
...globals.browser, | ||
...globals.node, | ||
}, | ||
}, | ||
plugins: { | ||
"simple-import-sort": sortImportPlugin, | ||
}, | ||
rules: { | ||
"simple-import-sort/imports": "error", | ||
"simple-import-sort/exports": "error", | ||
"no-control-regex": "off", | ||
"@typescript-eslint/no-empty-function": "off", | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/no-import-type-side-effects": "error", | ||
"@typescript-eslint/no-non-null-assertion": "off", | ||
"@typescript-eslint/no-unused-expressions": "off", | ||
"@typescript-eslint/no-require-imports": "off", | ||
"@typescript-eslint/no-duplicate-enum-values": "off", | ||
"@typescript-eslint/no-unused-vars": "off", | ||
"@typescript-eslint/no-empty-object-type": "off", | ||
"@typescript-eslint/no-namespace": "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
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,15 +1,15 @@ | ||
export const POST: MarkoRun.Handler = () => { | ||
return new Response('POST-ed', { status: 200 }); | ||
} | ||
return new Response("POST-ed", { status: 200 }); | ||
}; | ||
|
||
export const PUT: MarkoRun.Handler = () => { | ||
return new Response('PUT-ed', { status: 200 }); | ||
} | ||
return new Response("PUT-ed", { status: 200 }); | ||
}; | ||
|
||
export const GET: MarkoRun.Handler = () => { | ||
console.log('Home route handler') | ||
} | ||
console.log("Home route handler"); | ||
}; | ||
|
||
export const DELETE: MarkoRun.Handler = () => { | ||
return new Response('DELETE-ed', { status: 200 }); | ||
} | ||
return new Response("DELETE-ed", { status: 200 }); | ||
}; |
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,3 +1,3 @@ | ||
{ | ||
"name": "foo" | ||
} | ||
} |
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 |
---|---|---|
|
@@ -4,4 +4,4 @@ | |
"compilerOptions": { | ||
"rootDir": "./" | ||
} | ||
} | ||
} |
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
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,8 +1,8 @@ | ||
export function POST() { | ||
return new Response('posted', { status: 200 }); | ||
return new Response("posted", { status: 200 }); | ||
} | ||
|
||
export function GET(_, next) { | ||
console.log(`'/' route GET handler`) | ||
console.log(`'/' route GET handler`); | ||
return next(); | ||
} | ||
} |
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,3 +1,3 @@ | ||
{ | ||
"name": "foo" | ||
} | ||
} |
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 |
---|---|---|
|
@@ -6,4 +6,4 @@ | |
"outDir": "./dist", | ||
"noImplicitOverride": false | ||
} | ||
} | ||
} |
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
Oops, something went wrong.