Skip to content

Commit

Permalink
feat: rough initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
cmgriffing committed Oct 12, 2024
0 parents commit 5406129
Show file tree
Hide file tree
Showing 84 changed files with 18,519 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/config@2.0.0/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
29 changes: 29 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Format

on:
push:
branches: [main]

jobs:
format:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2.2.4

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

- name: Install dependencies
run: pnpm install --ignore-scripts

- name: Format
run: pnpm run format

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

on:
push:
branches: [main]

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

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2.2.4

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

- name: Install Dependencies
run: pnpm install --ignore-scripts

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

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2.2.4

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

- name: Install dependencies
run: pnpm install --ignore-scripts

- name: Build all packages
run: pnpm build

- name: Run Build and Tests
run: pnpm run build-test
env:
CI: true
30 changes: 30 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
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

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

.DS_Store
Thumbs.db
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
auto-install-peers=true
strict-peer-dependencies=false
10 changes: 10 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"trailingComma": "all",
"tabWidth": 2,
"printWidth": 100,
"semi": false,
"singleQuote": true,
"useTabs": false,
"arrowParens": "avoid",
"bracketSpacing": true
}
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
# pnpm up -Lri
```
9 changes: 9 additions & 0 deletions configs/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineConfig } from 'vite'
import solidPlugin from 'vite-plugin-solid'

export default defineConfig({
plugins: [solidPlugin()],
build: {
target: 'esnext',
},
})
43 changes: 43 additions & 0 deletions configs/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { defineConfig } from 'vitest/config'
import solidPlugin from 'vite-plugin-solid'

export default defineConfig(({ mode }) => {
// to test in server environment, run with "--mode ssr" or "--mode test:ssr" flag
// loads only server.test.ts file
const testSSR = mode === 'test:ssr' || mode === 'ssr'

return {
plugins: [
solidPlugin({
// https://github.com/solidjs/solid-refresh/issues/29
hot: false,
// For testing SSR we need to do a SSR JSX transform
solid: { generate: testSSR ? 'ssr' : 'dom' },
}),
],
test: {
watch: false,
isolate: !testSSR,
env: {
NODE_ENV: testSSR ? 'production' : 'development',
DEV: testSSR ? '' : '1',
SSR: testSSR ? '1' : '',
PROD: testSSR ? '1' : '',
},
passWithNoTests: true,
environment: testSSR ? 'node' : 'jsdom',
transformMode: { web: [/\.[jt]sx$/] },
...(testSSR
? {
include: ['test/server.test.{ts,tsx}'],
}
: {
include: ['test/*.test.{ts,tsx}'],
exclude: ['test/server.test.{ts,tsx}'],
}),
},
resolve: {
conditions: testSSR ? ['node'] : ['browser', 'development'],
},
}
})
42 changes: 42 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "lithium-monorepo",
"description": "A monorepo for Lithium, the social sharable diff tool",
"version": "0.0.1",
"license": "MIT",
"author": "Chris Griffing",
"contributors": [],
"private": true,
"scripts": {
"postinstall": "pnpm build",
"dev": "pnpm run --parallel --filter ./packages/* dev",
"build": "turbo run build --filter=./packages/*",
"test": "turbo run test --filter=./packages/*",
"typecheck": "turbo run typecheck --filter=./packages/*",
"build-test": "turbo run build test typecheck --filter=./packages/*",
"format": "prettier --ignore-path .gitignore -w \"packages/**/*.{js,ts,json,css,tsx,jsx,md}\" \"playgrounds/**/*.{js,ts,json,css,tsx,jsx,md}\"",
"changeset": "changeset",
"version-packages": "changeset version && pnpm i",
"ci:version": "changeset version && pnpm i --no-frozen-lockfile && git add .",
"release": "pnpm build && changeset publish",
"update-deps": "pnpm up -Lri"
},
"devDependencies": {
"@changesets/cli": "^2.26.0",
"@types/node": "^18.11.18",
"concurrently": "^7.6.0",
"jsdom": "^21.0.0",
"prettier": "2.8.3",
"solid-js": "^1.6.9",
"tsup": "^6.5.0",
"tsup-preset-solid": "^0.1.3",
"turbo": "^1.7.0",
"typescript": "^4.9.4",
"vite": "^4.0.4",
"vite-plugin-solid": "^2.5.0",
"vitest": "^0.27.2"
},
"packageManager": "pnpm@7.22.0",
"engines": {
"node": ">=18.0.0"
}
}
11 changes: 11 additions & 0 deletions packages/shiki-magic-move/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.cache
.DS_Store
.idea
*.log
*.tgz
coverage
dist
lib-cov
logs
node_modules
temp
2 changes: 2 additions & 0 deletions packages/shiki-magic-move/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ignore-workspace-root-check=true
shell-emulator=true
6 changes: 6 additions & 0 deletions packages/shiki-magic-move/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "all",
"tabWidth": 2,
"semi": false,
"singleQuote": true
}
1 change: 1 addition & 0 deletions packages/shiki-magic-move/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Please refer to https://github.com/antfu/contribute
21 changes: 21 additions & 0 deletions packages/shiki-magic-move/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Anthony Fu <https://github.com/antfu>

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.
Loading

0 comments on commit 5406129

Please sign in to comment.