Skip to content

Commit

Permalink
feat: switch to monorepo and add vue package
Browse files Browse the repository at this point in the history
  • Loading branch information
DevilTea committed Jan 22, 2025
1 parent d6dc8f0 commit 646306f
Show file tree
Hide file tree
Showing 27 changed files with 5,730 additions and 1,440 deletions.
8 changes: 0 additions & 8 deletions .editorconfig

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ jobs:
run: nr build

- name: Test
run: nr test
run: nr test:unit
206 changes: 199 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,203 @@
.cache
# General
.DS_Store
.idea
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

# Logs
logs
*.log
*.tgz
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist
lib-cov
logs
node_modules
temp

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# vitepress build output
**/.vitepress/dist

# vitepress cache directory
**/.vitepress/cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

15 changes: 0 additions & 15 deletions eslint.config.js

This file was deleted.

3 changes: 3 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import deviltea from '@deviltea/eslint-config'

export default deviltea()
8 changes: 8 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "0.0.1",
"packages": [
"packages/*"
],
"npmClient": "pnpm"
}
88 changes: 28 additions & 60 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "@deviltea/tiny-state-machine",
"name": "@deviltea/tiny-state-machine-mono",
"type": "module",
"version": "0.0.1",
"private": true,
"packageManager": "[email protected]",
"description": "A simple state machine with tiny size and type safe.",
"author": "DevilTea <[email protected]>",
Expand All @@ -13,74 +14,41 @@
},
"bugs": "https://github.com/DevilTea/tiny-state-machine/issues",
"keywords": [],
"sideEffects": false,
"exports": {
".": {
"types": {
"import": "./dist/index.d.mts",
"require": "./dist/index.d.cts",
"default": "./dist/index.d.ts"
},
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
}
},
"main": "./dist/index.mjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"typesVersions": {
"*": {
"*": [
"./dist/*",
"./dist/index.d.ts"
]
}
},
"files": [
"dist"
],
"scripts": {
"build": "unbuild && pnpm calcsize",
"dev": "unbuild --stub",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"prepublishOnly": "nr build",
"release": "bumpp && npm publish",
"start": "tsx src/index.ts",
"test": "vitest",
"calcsize": "tsx ./scripts/calcsize.ts",
"typecheck": "tsc --noEmit --project tsconfig.test.json",
"build": "lerna run build",
"release": "pnpm exec bumpp -r && pnpm run build && pnpm -r --filter=./packages/* publish",
"lint": "eslint --fix .",
"typecheck": "tsc -b --noEmit",
"publint": "pnpm -r --filter=./packages/* exec publint",
"test:unit": "vitest",
"test:coverage": "vitest run --coverage",
"prepare": "simple-git-hooks"
},
"devDependencies": {
"@antfu/ni": "0.23.0",
"@deviltea/eslint-config": "3.4.1",
"@deviltea/tsconfig": "0.0.6",
"@types/node": "^20.10.1",
"@vitest/coverage-v8": "2.1.3",
"brotli-size": "4.0.0",
"bumpp": "9.7.1",
"eslint": "9.13.0",
"fast-glob": "3.3.2",
"gzip-size": "7.0.0",
"lint-staged": "15.2.0",
"pnpm": "9.12.2",
"rimraf": "6.0.1",
"simple-git-hooks": "2.11.1",
"terser": "5.36.0",
"tsx": "4.16.2",
"typescript": "5.6.3",
"unbuild": "^2.0.0",
"vite": "5.4.10",
"vitest": "2.1.3"
"@deviltea/eslint-config": "catalog:",
"@deviltea/tsconfig": "catalog:",
"@types/node": "catalog:",
"@vitest/coverage-v8": "catalog:",
"bumpp": "catalog:",
"eslint": "catalog:",
"happy-dom": "catalog:",
"lerna": "catalog:",
"lint-staged": "catalog:",
"pkg-size": "catalog:",
"publint": "catalog:",
"rimraf": "catalog:",
"simple-git-hooks": "catalog:",
"terser": "catalog:",
"tsx": "catalog:",
"typescript": "catalog:",
"unbuild": "catalog:",
"vitest": "catalog:",
"zx": "catalog:"
},
"simple-git-hooks": {
"pre-commit": "pnpm lint-staged"
},
"lint-staged": {
"*": "eslint --fix"
},
"publishConfig": {
"access": "public"
}
}
5 changes: 1 addition & 4 deletions build.config.ts → packages/core/build.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import { defineBuildConfig } from 'unbuild'

export default defineBuildConfig({
entries: [
'src/index',
],
entries: ['src/index.ts'],
declaration: true,
clean: true,
rollup: {
emitCJS: true,
},
Expand Down
Loading

0 comments on commit 646306f

Please sign in to comment.