Skip to content

Commit

Permalink
chore: misc toolchain upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey committed Nov 26, 2024
1 parent 1aa87fb commit 6f9f90d
Show file tree
Hide file tree
Showing 79 changed files with 5,412 additions and 16,373 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
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)
16 changes: 16 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": [
"@changesets/changelog-github",
{
"repo": "marko-js/writable-dom"
}
],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
7 changes: 7 additions & 0 deletions .changeset/red-ghosts-complain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"writable-dom": patch
---

Fixes an issue where an inline host node
would remain empty if it was the last node in
the tree and a blocking node was encountered.
3 changes: 0 additions & 3 deletions .commitlintrc.json

This file was deleted.

6 changes: 0 additions & 6 deletions .eslintignore

This file was deleted.

32 changes: 0 additions & 32 deletions .eslintrc.json

This file was deleted.

3 changes: 0 additions & 3 deletions .fixpackrc

This file was deleted.

74 changes: 61 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,80 @@ name: CI

on:
pull_request:
paths-ignore: ["**.md"]
types: [opened, synchronize]
push:
branches: ["main"]
paths-ignore: ["**.md"]
branches: [main]

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
with:
ref: ${{ github.head_ref }}
- name: Use node
uses: actions/setup-node@v4
with:
node-version: 20
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:
node: [14.x, 16.x]
node: [18, 20]
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Use node@${{ matrix.node }}
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: "npm"
cache: npm
- name: Install dependencies
run: npm ci
- name: Lint code
run: npm run lint
- name: Install Playwright
run: npx playwright install-deps chromium
- name: Install Playwright Browsers
run: npx playwright install --with-deps chromium
- name: Run tests
run: npm run ci:test
run: npm run @ci:test
- name: Report code coverage
run: npm run ci:report
uses: codecov/codecov-action@v4
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: 20
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 }}
27 changes: 0 additions & 27 deletions .github/workflows/release.yml

This file was deleted.

1 change: 0 additions & 1 deletion .husky/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions .husky/commit-msg

This file was deleted.

5 changes: 1 addition & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install lint-staged
npm test
2 changes: 1 addition & 1 deletion .mocharc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"extension": ["js", "ts"],
"enable-source-maps": true,
"watchFiles": ["src/**/*.ts"],
"require": ["esbuild-register", "mocha-snap"]
"require": ["tsx", "mocha-snap"]
}
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.vscode
.nyc_output
package.json
package-lock.json
node_modules
coverage
Expand Down
10 changes: 2 additions & 8 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
{
"overrides": [
{
"files": "*rc",
"options": {
"parser": "json"
}
}
]
"$schema": "https://json.schemastore.org/prettierrc",
"plugins": ["prettier-plugin-packagejson"]
}
3 changes: 0 additions & 3 deletions .releaserc.json

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 eBay Inc. and contributors
Copyright (c) 2024 eBay Inc. and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
40 changes: 40 additions & 0 deletions build.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { build, BuildOptions } from "esbuild";
import glob from "fast-glob";
import fs from "fs";
import path from "path";
const entryPoints: string[] = [];
const srcdir = path.resolve("src");
const outdir = path.resolve("dist");
const files = glob.stream(["**", "!*.d.ts", "!**/__tests__"], {
cwd: srcdir,
}) as AsyncIterable<string>;

for await (const file of files) {
if (path.extname(file) === ".ts") {
entryPoints.push(path.resolve(srcdir, file));
} else {
const outfile = path.join(outdir, file);
await fs.promises.mkdir(path.dirname(outfile), { recursive: true });
await fs.promises.copyFile(path.join(srcdir, file), outfile);
}
}

const opts: BuildOptions = {
outdir,
entryPoints,
outbase: srcdir,
platform: "node",
target: ["node14"],
};

await Promise.all([
build({
...opts,
format: "cjs",
}),
build({
...opts,
format: "esm",
outExtension: { ".js": ".mjs" },
}),
]);
46 changes: 0 additions & 46 deletions build.ts

This file was deleted.

45 changes: 45 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
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: [
".nyc_output",
".vscode*",
"**/__snapshots__",
"**/*dist/",
"coverage",
"node_modules",
],
},
eslint.configs.recommended,
...tseslint.configs.recommended,
{
languageOptions: {
globals: {
...globals.browser,
...globals.mocha,
...globals.node,
},
},
plugins: {
"simple-import-sort": sortImportPlugin,
},
rules: {
"@typescript-eslint/no-duplicate-enum-values": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-empty-object-type": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-import-type-side-effects": "error",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-require-imports": "off",
"@typescript-eslint/no-unused-expressions": "off",
"@typescript-eslint/no-unused-vars": "off",
"simple-import-sort/exports": "error",
"simple-import-sort/imports": "error",
},
},
);
Loading

0 comments on commit 6f9f90d

Please sign in to comment.