Skip to content

Commit

Permalink
chore: first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardoperra committed Jan 9, 2023
0 parents commit d6258f1
Show file tree
Hide file tree
Showing 40 changed files with 9,940 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .changeset/config.json
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",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# editorconfig.org
root = true

[*]
indent_style = tab
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
30 changes: 30 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Format

on:
push:
branches:
- main

jobs:
format:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: pnpm/[email protected]

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 16

- name: Install dependencies
run: pnpm install

- name: Format
run: pnpm run format

- name: Add, Commit and Push
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Format"
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Release

on: [workflow_dispatch]

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
with:
fetch-depth: 0

- uses: pnpm/[email protected]

- name: Setup Node.js 17.x
uses: actions/setup-node@v2
with:
node-version: 17.x
cache: pnpm

- name: Install Dependencies
run: pnpm install

- name: Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: pnpm run release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35 changes: 35 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build and Test

on: [push]

jobs:
build:
runs-on: ${{ matrix.operating-system }}

strategy:
matrix:
node-version: [16.x, 17.x]
operating-system: [ubuntu-latest]

steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 2

- uses: pnpm/[email protected]

- name: Setup Node.js environment ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: pnpm

- name: Install dependencies
run: pnpm install

- name: Run Build and Tests
run: pnpm run build-test

env:
CI: true
38 changes: 38 additions & 0 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Version

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
version:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
with:
fetch-depth: 0

- uses: pnpm/[email protected]

- name: Setup Node.js 17.x
uses: actions/setup-node@v2
with:
node-version: 17.x
cache: pnpm

- name: Install Dependencies
run: pnpm install

- name: Create Update Version Pull Request
id: changesets
uses: changesets/action@v1
with:
commit: "chore: update versions"
title: "chore: update versions"
version: pnpm run ci:version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
node_modules
dist
gitignore

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# turbo
.turbo

# solid
.solid

# VSC Settings
.vscode/settings.json

/.idea
.project
.classpath
*.launch
.settings/

.DS_Store
Thumbs.db
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
auto-install-peers=true
18 changes: 18 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"trailingComma": "all",
"tabWidth": 2,
"printWidth": 100,
"semi": false,
"singleQuote": false,
"useTabs": true,
"arrowParens": "avoid",
"bracketSpacing": true,
"overrides": [
{
"files": "*.md",
"options": {
"useTabs": false
}
}
]
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 your-author-name

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
69 changes: 69 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<p>
<img width="100%" src="https://assets.solidjs.com/banner?type=your-repository-name&background=tiles&project=Monorepo" alt="your-repository-name Monorepo">
</p>

# your-repository-name

[![pnpm](https://img.shields.io/badge/maintained%20with-pnpm-cc00ff.svg?style=for-the-badge&logo=pnpm)](https://pnpm.io/)
[![turborepo](https://img.shields.io/badge/built%20with-turborepo-cc00ff.svg?style=for-the-badge&logo=turborepo)](https://turborepo.org/)

your-repository-desc

> **Note** After using this template, you have to search and replace all `your-repository-name` and similar strings
> with appropriate texts.
>
> `your-repository-name` should be a **kebab-case** string representing the name of you monorepo.
>
> `your-repository-desc` should be a **Normal case** string with the description of the repository.
>
> `your-nickname` should be a **kebab-case** string from your profile URL.
>
> `your-author-name` should be a **Normal case** string with your first and last name.
## Project Commands

List of cli commands available from a project root.

To use the commands, first install [pnpm](https://pnpm.io) and install dependencies with `pnpm i`.

```bash
pnpm run dev
# Builds all packages in watch mode, and starts all playgrounds
# turbo run dev --parallel

pnpm run build
# Builds all the packages in the monorepo
# turbo run build --filter=!./playgrounds/*

pnpm run test
# Runs tests for all the packages in the monorepo
# turbo run test --filter=!./playgrounds/*

pnpm run typecheck
# Runs TS typecheck for all the packages in the monorepo
# turbo run typecheck --filter=!./playgrounds/*

pnpm run build-test
# Runs build, typecheck and test commands for all the packages in the monorepo
# "turbo run build test typecheck --filter=!./playgrounds/*

pnpm run format
# Formats the reposotory with prettier
# prettier -w \"packages/**/*.{js,ts,json,css,tsx,jsx,md}\" \"playgrounds/**/*.{js,ts,json,css,tsx,jsx,md}\"

pnpm run changeset
# Creates a changeset
# changeset

pnpm run version-packages
# Applies changesets to bump package versions and update CHANGELOGs
# "changeset version && pnpm i

pnpm run release
# Builds and publishes changed packages to npm
# pnpm run build-test && changeset publish

pnpm run update-deps
# Updates all dependencies in the repository
# taze -w -r && pnpm i
```
35 changes: 35 additions & 0 deletions configs/jest.config.ssr.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import type { Config } from "@jest/types"

const projectRootPath = "<rootDir>/../.."
const solidjsPath = `${projectRootPath}/node_modules/solid-js`

const config: Config.InitialOptions = {
preset: "ts-jest",

globals: {
"ts-jest": {
tsconfig: `<rootDir>/tsconfig.json`,
babelConfig: {
presets: [
"@babel/preset-env",
["babel-preset-solid", { generate: "ssr", hydratable: true }],
],
},
},
},

testEnvironment: "node",

setupFilesAfterEnv: [`${projectRootPath}/configs/jest.setup.ssr.ts`],

moduleNameMapper: {
"solid-js/web": `${solidjsPath}/web/dist/server.cjs`,
"solid-js/store": `${solidjsPath}/store/dist/server.cjs`,
"solid-js": `${solidjsPath}/dist/server.cjs`,
},

testMatch: ["<rootDir>/test/**.ssr.test.(js|ts)?(x)"],

verbose: true,
}
export default config
32 changes: 32 additions & 0 deletions configs/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import type { Config } from "@jest/types"

const projectRootPath = "<rootDir>/../.."
const solidjsPath = `${projectRootPath}/node_modules/solid-js`

const config: Config.InitialOptions = {
preset: "ts-jest",

globals: {
"ts-jest": {
tsconfig: `<rootDir>/tsconfig.json`,
babelConfig: {
presets: ["@babel/preset-env", "babel-preset-solid"],
},
},
},

testEnvironment: "jsdom",

setupFilesAfterEnv: ["@testing-library/jest-dom", "regenerator-runtime"],

moduleNameMapper: {
"solid-js/web": `${solidjsPath}/web/dist/web.cjs`,
"solid-js/store": `${solidjsPath}/store/dist/store.cjs`,
"solid-js": `${solidjsPath}/dist/solid.cjs`,
},

testPathIgnorePatterns: ["/node_modules/", "ssr"],

verbose: true,
}
export default config
6 changes: 6 additions & 0 deletions configs/jest.setup.ssr.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
jest.mock("solid-js/web", () => ({
...jest.requireActual("solid-js/web"),
template: jest.fn()
}));

export {};
6 changes: 6 additions & 0 deletions configs/rollup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import withSolid from "rollup-preset-solid";

export default withSolid({
input: "src/index.tsx",
targets: ["esm", "cjs"]
});
Loading

0 comments on commit d6258f1

Please sign in to comment.