Skip to content

Commit

Permalink
v0.2 (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
rixo authored Sep 11, 2024
1 parent 6d8bb85 commit 7a9dd75
Show file tree
Hide file tree
Showing 147 changed files with 5,555 additions and 22,946 deletions.
5 changes: 5 additions & 0 deletions .changeset/big-pugs-bake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte-hmr': minor
---

Rewrite tests to get rid of old vulnerable (dev) dependencies, and update CI setup
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.ts
17 changes: 0 additions & 17 deletions .eslintrc

This file was deleted.

15 changes: 15 additions & 0 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
parserOptions:
sourceType: module
ecmaVersion: latest

# overrides:
# - files:
# - "packages/svelte-hmr/index.js"
# - "packages/svelte-hmr/lib/**/*"
# - "**/rollup.config.js"
# env:
# node: true

env:
node: true
# es2022: true
28 changes: 21 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
branches:
- master

env:
# we call `pnpm playwright install` instead
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'

jobs:
# "checks" job runs on linux + 16 only and checks that install, build, lint and audit work
# it also primes the pnpm store cache for linux, important for downstream tests
Expand All @@ -23,9 +27,9 @@ jobs:
outputs:
build_successful: ${{ steps.build.outcome == 'success' }}
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2.2.4
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'pnpm'
Expand Down Expand Up @@ -53,15 +57,25 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ]
node: [ 14, 16 ]
node: [ 16, 18, 20, 22 ]
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2.2.4
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'pnpm'
- name: use svelte 3
if: matrix.svelte == 3
run: |
tmppkg="$(jq '.devDependencies.svelte = "^3.59.2"' package.json)" && echo -E "${tmppkg}" > package.json && tmppkg=""
- name: install
if: matrix.node != 14 && matrix.svelte != 3
run: pnpm install --frozen-lockfile --prefer-offline
- name: install for node14 or svelte3
if: matrix.node == 14 || matrix.svelte == 3
run: pnpm install --no-frozen-lockfile --prefer-offline
- name: install playwright chromium
run: cd playground && pnpm playwright install chromium
- name: run tests
run: pnpm test
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ jobs:
strategy:
matrix:
# pseudo-matrix for convenience, NEVER use more than a single combination
node: [16]
node: [20]
os: [ubuntu-latest]
steps:
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: install pnpm
Expand All @@ -31,7 +31,7 @@ jobs:
PNPM_VER=$(jq -r '.packageManager | if .[0:5] == "pnpm@" then .[5:] else "packageManager in package.json does not start with pnpm@\n" | halt_error(1) end' package.json)
echo installing pnpm version $PNPM_VER
npm i -g pnpm@$PNPM_VER
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'pnpm'
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ pnpm-lock.yaml
*.bak.*
*.bak
*.orig

# temporary playground files
/playground-*/
3 changes: 0 additions & 3 deletions .prettierrc

This file was deleted.

3 changes: 3 additions & 0 deletions packages/svelte-hmr-spec/.prettierrc → .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
plugins:
- prettier-plugin-jsdoc

semi: false
singleQuote: true
trailingComma: es5
14 changes: 14 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "@tsconfig/svelte/tsconfig.json",
"include": ["packages/**/*", "playground/**/*"],
"exclude": ["node_modules", "**/*.bak"],
"compilerOptions": {
"checkJs": true,
"moduleResolution": "node16",
"module": "es2022",
"resolveJsonModule": true,
"skipLibCheck": true,
//"noUnusedLocals": true,
//"types": []
}
}
22 changes: 22 additions & 0 deletions mount-tmp-playground.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# Mount a tmpfs on playground-tmp directory.
#
# This is entirely optional. The point is to save write cycles on your disk.
#
# Usage:
#
# export TMP_PLAYGROUND_DIR=playground-tmp
# ./mount-tmp-playground.sh
# cd playground
# pnpm test
#

TMP_PLAYGROUND_DIR=${TMP_PLAYGROUND_DIR:-"playground-tmp"}

if [ "$1" == "-u" ] || [ "$1" == "--unmount" ]; then
umount "$TMP_PLAYGROUND_DIR"
else
mkdir -p "$TMP_PLAYGROUND_DIR"
mount -o size=16G -t tmpfs none playground-tmp
fi
20 changes: 11 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,26 @@
"type": "git",
"url": "https://github.com/sveltejs/svelte-hmr"
},
"packageManager": "pnpm@7.33.5",
"packageManager": "pnpm@8.14.0",
"engines": {
"pnpm": ">=7.0.0"
},
"pnpm": {
"overrides": {
"minimatch@^3.0.4": "^3.1.2",
"svelte-hmr": "workspace:*"
},
"peerDependencyRules": {
"ignoreMissing": ["nollup","webpack","webpack-dev-server"]
"svelte-hmr": "workspace:*",
"svelte": "$svelte"
}
},
"devDependencies": {
"@changesets/cli": "^2.26.2",
"@rixo/eslint-config": "^0.8.1",
"@changesets/cli": "^2.27.8",
"@svitejs/changesets-changelog-github-compact": "^0.1.1",
"prettier": "^1.19.1"
"@tsconfig/svelte": "^4.0.1",
"eslint": "^8.44.0",
"prettier": "^2.8.8",
"prettier-plugin-jsdoc": "^0.4.2",
"svelte": "^4.0.0",
"svelte-check": "^3.4.4",
"typescript": "^5.0.4"
},
"scripts": {
"release": "pnpm changeset publish",
Expand Down
1 change: 0 additions & 1 deletion packages/svelte-hmr-spec/.eslintignore

This file was deleted.

22 changes: 0 additions & 22 deletions packages/svelte-hmr-spec/.eslintrc

This file was deleted.

4 changes: 0 additions & 4 deletions packages/svelte-hmr-spec/.gitignore

This file was deleted.

7 changes: 0 additions & 7 deletions packages/svelte-hmr-spec/.mocharc.yml

This file was deleted.

51 changes: 0 additions & 51 deletions packages/svelte-hmr-spec/README.md

This file was deleted.

9 changes: 0 additions & 9 deletions packages/svelte-hmr-spec/cli.js

This file was deleted.

30 changes: 0 additions & 30 deletions packages/svelte-hmr-spec/package.json

This file was deleted.

1 change: 0 additions & 1 deletion packages/svelte-hmr-spec/src.fixtures/App.svelte

This file was deleted.

9 changes: 0 additions & 9 deletions packages/svelte-hmr-spec/src.fixtures/main.js

This file was deleted.

Loading

0 comments on commit 7a9dd75

Please sign in to comment.