Skip to content

Commit d6258f1

Browse files
committed
chore: first commit
0 parents  commit d6258f1

40 files changed

+9940
-0
lines changed

.changeset/config.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.editorconfig

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = tab
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true

.github/workflows/format.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Format
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
format:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: pnpm/[email protected]
15+
16+
- name: Setup Node.js environment
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: 16
20+
21+
- name: Install dependencies
22+
run: pnpm install
23+
24+
- name: Format
25+
run: pnpm run format
26+
27+
- name: Add, Commit and Push
28+
uses: stefanzweifel/git-auto-commit-action@v4
29+
with:
30+
commit_message: "Format"

.github/workflows/release.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Release
2+
3+
on: [workflow_dispatch]
4+
5+
concurrency: ${{ github.workflow }}-${{ github.ref }}
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout Repo
12+
uses: actions/checkout@v2
13+
with:
14+
fetch-depth: 0
15+
16+
- uses: pnpm/[email protected]
17+
18+
- name: Setup Node.js 17.x
19+
uses: actions/setup-node@v2
20+
with:
21+
node-version: 17.x
22+
cache: pnpm
23+
24+
- name: Install Dependencies
25+
run: pnpm install
26+
27+
- name: Publish to npm
28+
id: changesets
29+
uses: changesets/action@v1
30+
with:
31+
publish: pnpm run release
32+
env:
33+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/tests.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build and Test
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ${{ matrix.operating-system }}
8+
9+
strategy:
10+
matrix:
11+
node-version: [16.x, 17.x]
12+
operating-system: [ubuntu-latest]
13+
14+
steps:
15+
- name: Checkout repo
16+
uses: actions/checkout@v2
17+
with:
18+
fetch-depth: 2
19+
20+
- uses: pnpm/[email protected]
21+
22+
- name: Setup Node.js environment ${{ matrix.node-version }}
23+
uses: actions/setup-node@v3
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
cache: pnpm
27+
28+
- name: Install dependencies
29+
run: pnpm install
30+
31+
- name: Run Build and Tests
32+
run: pnpm run build-test
33+
34+
env:
35+
CI: true

.github/workflows/version.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Version
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
concurrency: ${{ github.workflow }}-${{ github.ref }}
9+
10+
jobs:
11+
version:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout Repo
15+
uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0
18+
19+
- uses: pnpm/[email protected]
20+
21+
- name: Setup Node.js 17.x
22+
uses: actions/setup-node@v2
23+
with:
24+
node-version: 17.x
25+
cache: pnpm
26+
27+
- name: Install Dependencies
28+
run: pnpm install
29+
30+
- name: Create Update Version Pull Request
31+
id: changesets
32+
uses: changesets/action@v1
33+
with:
34+
commit: "chore: update versions"
35+
title: "chore: update versions"
36+
version: pnpm run ci:version
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
node_modules
2+
dist
3+
gitignore
4+
5+
# debug
6+
npm-debug.log*
7+
yarn-debug.log*
8+
yarn-error.log*
9+
lerna-debug.log
10+
11+
# local env files
12+
.env.local
13+
.env.development.local
14+
.env.test.local
15+
.env.production.local
16+
17+
# turbo
18+
.turbo
19+
20+
# solid
21+
.solid
22+
23+
# VSC Settings
24+
.vscode/settings.json
25+
26+
/.idea
27+
.project
28+
.classpath
29+
*.launch
30+
.settings/
31+
32+
.DS_Store
33+
Thumbs.db

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
auto-install-peers=true

.prettierrc

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"trailingComma": "all",
3+
"tabWidth": 2,
4+
"printWidth": 100,
5+
"semi": false,
6+
"singleQuote": false,
7+
"useTabs": true,
8+
"arrowParens": "avoid",
9+
"bracketSpacing": true,
10+
"overrides": [
11+
{
12+
"files": "*.md",
13+
"options": {
14+
"useTabs": false
15+
}
16+
}
17+
]
18+
}

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 your-author-name
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<p>
2+
<img width="100%" src="https://assets.solidjs.com/banner?type=your-repository-name&background=tiles&project=Monorepo" alt="your-repository-name Monorepo">
3+
</p>
4+
5+
# your-repository-name
6+
7+
[![pnpm](https://img.shields.io/badge/maintained%20with-pnpm-cc00ff.svg?style=for-the-badge&logo=pnpm)](https://pnpm.io/)
8+
[![turborepo](https://img.shields.io/badge/built%20with-turborepo-cc00ff.svg?style=for-the-badge&logo=turborepo)](https://turborepo.org/)
9+
10+
your-repository-desc
11+
12+
> **Note** After using this template, you have to search and replace all `your-repository-name` and similar strings
13+
> with appropriate texts.
14+
>
15+
> `your-repository-name` should be a **kebab-case** string representing the name of you monorepo.
16+
>
17+
> `your-repository-desc` should be a **Normal case** string with the description of the repository.
18+
>
19+
> `your-nickname` should be a **kebab-case** string from your profile URL.
20+
>
21+
> `your-author-name` should be a **Normal case** string with your first and last name.
22+
23+
## Project Commands
24+
25+
List of cli commands available from a project root.
26+
27+
To use the commands, first install [pnpm](https://pnpm.io) and install dependencies with `pnpm i`.
28+
29+
```bash
30+
pnpm run dev
31+
# Builds all packages in watch mode, and starts all playgrounds
32+
# turbo run dev --parallel
33+
34+
pnpm run build
35+
# Builds all the packages in the monorepo
36+
# turbo run build --filter=!./playgrounds/*
37+
38+
pnpm run test
39+
# Runs tests for all the packages in the monorepo
40+
# turbo run test --filter=!./playgrounds/*
41+
42+
pnpm run typecheck
43+
# Runs TS typecheck for all the packages in the monorepo
44+
# turbo run typecheck --filter=!./playgrounds/*
45+
46+
pnpm run build-test
47+
# Runs build, typecheck and test commands for all the packages in the monorepo
48+
# "turbo run build test typecheck --filter=!./playgrounds/*
49+
50+
pnpm run format
51+
# Formats the reposotory with prettier
52+
# prettier -w \"packages/**/*.{js,ts,json,css,tsx,jsx,md}\" \"playgrounds/**/*.{js,ts,json,css,tsx,jsx,md}\"
53+
54+
pnpm run changeset
55+
# Creates a changeset
56+
# changeset
57+
58+
pnpm run version-packages
59+
# Applies changesets to bump package versions and update CHANGELOGs
60+
# "changeset version && pnpm i
61+
62+
pnpm run release
63+
# Builds and publishes changed packages to npm
64+
# pnpm run build-test && changeset publish
65+
66+
pnpm run update-deps
67+
# Updates all dependencies in the repository
68+
# taze -w -r && pnpm i
69+
```

configs/jest.config.ssr.ts

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import type { Config } from "@jest/types"
2+
3+
const projectRootPath = "<rootDir>/../.."
4+
const solidjsPath = `${projectRootPath}/node_modules/solid-js`
5+
6+
const config: Config.InitialOptions = {
7+
preset: "ts-jest",
8+
9+
globals: {
10+
"ts-jest": {
11+
tsconfig: `<rootDir>/tsconfig.json`,
12+
babelConfig: {
13+
presets: [
14+
"@babel/preset-env",
15+
["babel-preset-solid", { generate: "ssr", hydratable: true }],
16+
],
17+
},
18+
},
19+
},
20+
21+
testEnvironment: "node",
22+
23+
setupFilesAfterEnv: [`${projectRootPath}/configs/jest.setup.ssr.ts`],
24+
25+
moduleNameMapper: {
26+
"solid-js/web": `${solidjsPath}/web/dist/server.cjs`,
27+
"solid-js/store": `${solidjsPath}/store/dist/server.cjs`,
28+
"solid-js": `${solidjsPath}/dist/server.cjs`,
29+
},
30+
31+
testMatch: ["<rootDir>/test/**.ssr.test.(js|ts)?(x)"],
32+
33+
verbose: true,
34+
}
35+
export default config

configs/jest.config.ts

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import type { Config } from "@jest/types"
2+
3+
const projectRootPath = "<rootDir>/../.."
4+
const solidjsPath = `${projectRootPath}/node_modules/solid-js`
5+
6+
const config: Config.InitialOptions = {
7+
preset: "ts-jest",
8+
9+
globals: {
10+
"ts-jest": {
11+
tsconfig: `<rootDir>/tsconfig.json`,
12+
babelConfig: {
13+
presets: ["@babel/preset-env", "babel-preset-solid"],
14+
},
15+
},
16+
},
17+
18+
testEnvironment: "jsdom",
19+
20+
setupFilesAfterEnv: ["@testing-library/jest-dom", "regenerator-runtime"],
21+
22+
moduleNameMapper: {
23+
"solid-js/web": `${solidjsPath}/web/dist/web.cjs`,
24+
"solid-js/store": `${solidjsPath}/store/dist/store.cjs`,
25+
"solid-js": `${solidjsPath}/dist/solid.cjs`,
26+
},
27+
28+
testPathIgnorePatterns: ["/node_modules/", "ssr"],
29+
30+
verbose: true,
31+
}
32+
export default config

configs/jest.setup.ssr.ts

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
jest.mock("solid-js/web", () => ({
2+
...jest.requireActual("solid-js/web"),
3+
template: jest.fn()
4+
}));
5+
6+
export {};

configs/rollup.config.ts

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import withSolid from "rollup-preset-solid";
2+
3+
export default withSolid({
4+
input: "src/index.tsx",
5+
targets: ["esm", "cjs"]
6+
});

0 commit comments

Comments
 (0)