Skip to content

Commit feb41d9

Browse files
authored
Merge pull request #38 from sveltejs/monorepo-and-tests
Monorepo and tests
2 parents 64a86c6 + 6ca33f5 commit feb41d9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+8012
-204
lines changed

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@1.6.0/schema.json",
3+
"changelog": ["@svitejs/changesets-changelog-github-compact", { "repo": "sveltejs/svelte-hmr" }],
4+
"commit": false,
5+
"linked": [],
6+
"access": "public",
7+
"baseBranch": "master",
8+
"updateInternalDependencies": "patch"
9+
}

.changeset/great-chefs-build.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte-hmr': patch
3+
---
4+
5+
added changesets

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
indent_style = space
7+
indent_size = 2
8+
charset = utf-8
9+
trim_trailing_whitespace = true

.eslintrc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ settings:
99
- svelte/internal
1010

1111
overrides:
12-
- files: ["index.js", "index.cjs", "index.mjs", "./lib/**/*"]
12+
- files:
13+
- "packages/svelte-hmr/index.js"
14+
- "packages/svelte-hmr/lib/**/*"
15+
- "**/rollup.config.js"
1316
env:
1417
node: true

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
open_collective: svelte

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: Svelte Discord
4+
url: https://svelte.dev/chat
5+
about: If you want to chat, join our discord.

.github/workflows/ci.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# build and test
2+
name: CI
3+
4+
on:
5+
push:
6+
branches:
7+
- master
8+
pull_request:
9+
branches:
10+
- master
11+
12+
jobs:
13+
# "checks" job runs on linux + 16 only and checks that install, build, lint and audit work
14+
# it also primes the pnpm store cache for linux, important for downstream tests
15+
checks:
16+
timeout-minutes: 5
17+
runs-on: ${{ matrix.os }}
18+
strategy:
19+
matrix:
20+
# pseudo-matrix for convenience, NEVER use more than a single combination
21+
node: [16]
22+
os: [ubuntu-latest]
23+
outputs:
24+
build_successful: ${{ steps.build.outcome == 'success' }}
25+
steps:
26+
- uses: actions/checkout@v3
27+
- uses: actions/setup-node@v3
28+
with:
29+
node-version: ${{ matrix.node }}
30+
- run: npm i -g pnpm@6
31+
- uses: actions/setup-node@v3
32+
with:
33+
node-version: ${{ matrix.node }}
34+
cache: 'pnpm'
35+
cache-dependency-path: '**/pnpm-lock.yaml'
36+
- name: install
37+
run: pnpm install --frozen-lockfile --prefer-offline
38+
# reactivate this when there is a build step
39+
# - name: build
40+
# id: build
41+
# run: pnpm run build
42+
- name: lint
43+
if: (${{ success() }} || ${{ failure() }})
44+
run: pnpm run lint
45+
- name: audit
46+
if: (${{ success() }} || ${{ failure() }})
47+
run: pnpm audit
48+
49+
# this is the test matrix
50+
# it is skipped if the build step of the checks job wasn't successful (still runs if lint or audit fail)
51+
test:
52+
needs: checks
53+
if: (${{ success() }} || ${{ failure() }}) && (${{ needs.checks.output.build_successful }})
54+
timeout-minutes: 10
55+
runs-on: ${{ matrix.os }}
56+
strategy:
57+
fail-fast: false
58+
matrix:
59+
os: [ ubuntu-latest, macos-latest ]
60+
node: [ 14, 16 ]
61+
steps:
62+
- uses: actions/checkout@v2
63+
- uses: actions/setup-node@v3
64+
with:
65+
node-version: ${{ matrix.node }}
66+
- run: npm i -g pnpm@6
67+
- uses: actions/setup-node@v3
68+
with:
69+
node-version: ${{ matrix.node }}
70+
cache: 'pnpm'
71+
cache-dependency-path: '**/pnpm-lock.yaml'
72+
- name: install
73+
run: pnpm install --frozen-lockfile --prefer-offline
74+
- name: run tests
75+
run: pnpm test

.github/workflows/release.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
release:
10+
# prevents this action from running on forks
11+
if: github.repository == 'sveltejs/svelte-hmr'
12+
name: Release
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
# pseudo-matrix for convenience, NEVER use more than a single combination
17+
node: [16]
18+
os: [ubuntu-latest]
19+
steps:
20+
- name: checkout
21+
uses: actions/checkout@v2
22+
with:
23+
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
24+
fetch-depth: 0
25+
- uses: actions/setup-node@v3
26+
with:
27+
node-version: ${{ matrix.node }}
28+
- run: npm i -g pnpm@6
29+
- uses: actions/setup-node@v3
30+
with:
31+
node-version: ${{ matrix.node }}
32+
cache: 'pnpm'
33+
cache-dependency-path: '**/pnpm-lock.yaml'
34+
- name: install
35+
run: pnpm install --frozen-lockfile --prefer-offline
36+
37+
- name: Creating .npmrc
38+
run: |
39+
cat << EOF > "$HOME/.npmrc"
40+
//registry.npmjs.org/:_authToken=$NPM_TOKEN
41+
EOF
42+
env:
43+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
44+
- name: Create Release Pull Request or Publish to npm
45+
id: changesets
46+
uses: changesets/action@v1
47+
with:
48+
# This expects you to have a script called release which does a build for your packages and calls changeset publish
49+
publish: pnpm release
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
53+
54+
# TODO alert discord
55+
# - name: Send a Slack notification if a publish happens
56+
# if: steps.changesets.outputs.published == 'true'
57+
# # You can do something when a publish happens.
58+
# run: my-slack-bot send-notification --message "A new version of ${GITHUB_REPOSITORY} was published!"

.gitignore

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,47 @@
1-
/node_modules/
1+
# logs and temp
2+
*.log
3+
**/*.log
4+
*.cpuprofile
5+
**/*.cpuprofile
6+
temp
7+
**/temp
8+
*.tmp
9+
**/*.tmp
10+
11+
# build and dist
12+
build
13+
**/build
14+
dist
15+
**/dist
16+
17+
# env and local
18+
*.local
19+
**/*.local
20+
.env
21+
**/.env
22+
23+
#node_modules and pnpm
24+
node_modules
25+
**/node_modules
26+
# only workspace root has a lock
27+
pnpm-lock.yaml
28+
!/pnpm-lock.yaml
29+
.pnpm-store
30+
**/.pnpm-store
31+
32+
#ide
33+
.idea
34+
**/.idea
35+
.vscode
36+
**/.vscode
37+
38+
# macos
39+
.DS_Store
40+
._.DS_Store
41+
**/.DS_Store
42+
**/._.DS_Store
43+
44+
# misc
245
*.bak.*
346
*.bak
447
*.orig

0 commit comments

Comments
 (0)