Skip to content

Commit

Permalink
feat: setup turbo & changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
elcoosp committed Nov 27, 2024
1 parent d34893a commit 6493022
Show file tree
Hide file tree
Showing 19 changed files with 866 additions and 1,250 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
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@3.0.4/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
6 changes: 6 additions & 0 deletions .changeset/fair-toys-smash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@elcoosp-templates/mm-vite-react": patch
"@elcoosp-templates/mm-rslib": patch
---

Templates to create rslib & vite app monorepo members
21 changes: 20 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
node_modules
# Local
.DS_Store
*.local
*.log*

# Dist
node_modules
dist

# IDE
.idea

# CI
.turbo
.npmrc
codecov
codecov.*

# Test
coverage
5 changes: 5 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.0/schema.json",
"extends": ["node_modules/@elcoosp-configs/biome/src/fmt-base.json"]
}

10 changes: 10 additions & 0 deletions cspell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ignorePaths:
- node_modules
- pnpm-lock.yaml
words:
# User
- elcoosp
- rslib
- vite
- lefthook
- oxlint
8 changes: 8 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
remotes:
- git_url: git@github.com:elcoosp/elcoosp-configs
ref: main
configs:
- packages/lefthook/src/biome.yml
- packages/lefthook/src/cspell.yml
extends:
- biome
23 changes: 21 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,28 @@
"keywords": [],
"author": "",
"license": "ISC",
"packageManager": "pnpm@9.14.2",
"scripts": {
"build": "turbo run build",
"check": "turbo run check",
"test": "turbo run test",
"lint": "turbo run lint",
"fmt": "turbo run fmt",
"test:watch": "turbo run test:watch",
"test:cov": "turbo run test:cov",
"publish-packages": "pnpm build && changeset publish",
"version-packages": "changeset version && pnpm fmt",
"changeset": "changeset"
},
"devDependencies": {
"@elcoosp-configs/rslib": "^2.0.2",
"turbo": "^2.3.2",
"@elcoosp-configs/rslib": "2",
"@elcoosp-configs/biome": "0",
"@rslib/core": "^0.1.0",
"vitest": "^2.1.6"
"vitest": "^2.1.6",
"@biomejs/biome": "^1.9.3",
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.10",
"lefthook": "^1.8.4"
}
}
5 changes: 4 additions & 1 deletion packages/mm-rslib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@
"description": "Monorepo member with `rslib`",
"keywords": [],
"author": "",
"license": "MIT"
"license": "MIT",
"scripts": {
"fmt": "biome format --write"
}
}
11 changes: 5 additions & 6 deletions packages/mm-rslib/template/cargo-generate.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ cargo_generate_version = ">=0.22.0"
[placeholders]
description = { type = "text", prompt = "Description of the monorepo member" }
scope = { type = "text", prompt = "Scope of the npm package" }
files-only = { type = "bool", prompt = "Is the package files only ?", default = false }

# ask_for_string = { type = "bool", prompt = "Make a choice too?", default = true }

# [conditional.'ask_for_string'.placeholders.choice]
# type = "string"
# prompt = "Please select one..."
# choices = ["One", "Two", "Three", "Four"]
[conditional.'ask_for_string'.placeholders.choice]
type = "string"
prompt = "Please select one file type which src folder should contain (and error in index import - with test)"
choices = ["yml", "json"]
3 changes: 3 additions & 0 deletions packages/mm-rslib/template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,8 @@
"fmt": "biome format --write",
"test": "vitest run",
"test:watch": "vitest run --watch"
},
"devDependencies": {
"@elcoosp-configs/rslib": "2"
}
}
6 changes: 3 additions & 3 deletions packages/mm-rslib/template/rslib.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineConfig } from '@rslib/core';
import { createRsLibConfig } from '@elcoosp-configs/rslib';
import { defineConfig } from '@rslib/core'
import { createRsLibConfig } from '@elcoosp-configs/rslib'

export default defineConfig(async () => createRsLibConfig({ preset: 'dual' }));
export default defineConfig(async () => createRsLibConfig({ preset: 'dual' }))
4 changes: 2 additions & 2 deletions packages/mm-rslib/template/tests/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect, test } from 'vitest';
import { expect, test } from 'vitest'

test('index', async () => {
expect(true).toBe(true)
});
})
4 changes: 2 additions & 2 deletions packages/mm-rslib/template/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineConfig } from 'vitest/config';
import { defineConfig } from 'vitest/config'

export default defineConfig({
// Configure Vitest (https://vitest.dev/config/)
test: {},
});
})
5 changes: 4 additions & 1 deletion packages/mm-vite-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@
"description": "Monorepo member with `vite` `react` `oxlint`",
"keywords": [],
"author": "",
"license": "MIT"
"license": "MIT",
"scripts": {
"fmt": "biome format --write"
}
}
28 changes: 3 additions & 25 deletions packages/mm-vite-react/template/biome.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,6 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.0/schema.json",
"organizeImports": {
"enabled": true
},
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"formatter": {
"indentStyle": "space"
},
"javascript": {
"formatter": {
"quoteStyle": "single",
"semicolons": "asNeeded"
}
},
"css": {
"parser": {
"cssModules": true
}
},
"linter": {
"enabled": false
}
"extends": [
"https://github.com/elcoosp/elcoosp-configs/blob/main/packages/biome/src/fmt-base.json"
]
}
Loading

0 comments on commit 6493022

Please sign in to comment.