Skip to content

Commit

Permalink
feat(core): update package structure and configuration
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The package structure has been updated to use a monorepo setup with individual packages. The configuration files have been updated to reflect this change.
  • Loading branch information
Ryan-Zayne committed Oct 23, 2024
1 parent 2e4807d commit 3707922
Show file tree
Hide file tree
Showing 85 changed files with 323 additions and 720 deletions.
2 changes: 1 addition & 1 deletion dev/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@zayne-labs/tsconfig/bundler/dom/app",

"include": ["src"]
"include": ["**/*", "/*"]
}
14 changes: 7 additions & 7 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import zayne from "@zayne-labs/eslint-config";
import { zayne } from "@zayne-labs/eslint-config";

export default zayne({
type: "lib",
ignores: ["dist/**", "eslint.config.js"],
react: true,
tailwindcss: true,
ignores: ["packages/toolkit/dist/**"],
node: {
overrides: {
"node/no-unsupported-features/node-builtins": "off",
"node/no-unsupported-features/es-syntax": "off",
"node/no-unsupported-features/node-builtins": "off",
},
},
react: true,
tailwindcss: true,
type: "lib",
typescript: {
tsconfigPath: "tsconfig.eslint.json",
tsconfigPath: ["dev/tsconfig.json", "packages/toolkit/tsconfig.json"],
},
});
108 changes: 16 additions & 92 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,84 +1,31 @@
{
"name": "@zayne-labs/toolkit",
"name": "@zayne-labs/toolkit-root",
"type": "module",
"version": "0.5.2",
"version": "0.0.0",
"packageManager": "[email protected]",
"description": "A collection of utility functions, types and composables used by my other projects. Nothing too fancy but can be useful.",
"author": "Ryan Zayne",
"license": "MIT",
"homepage": "https://github.com/zayne-labs/toolkit#readme",
"repository": {
"type": "git",
"url": "https://github.com/zayne-labs/toolkit.git"
},
"bugs": {
"url": "https://github.com/zayne-labs/toolkit/issues"
},
"keywords": [
"utilities",
"types",
"hooks"
],
"sideEffects": false,
"exports": {
".": "./dist/esm-min/core/index.js",
"./react": "./dist/esm-min/react/index.js",
"./type-helpers": "./dist/esm-min/type-helpers/index.js"
},
"main": "./dist/esm-min/core/index.js",
"module": "./dist/esm-min/core/index.js",
"types": "./dist/esm-min/core/index.d.ts",
"files": [
"dist"
],
"engines": {
"node": ">=18.x"
},

"scripts": {
"build": "tsup",
"build:dev": "cross-env NODE_ENV=development tsup",
"build:test": "concurrently --prefix-colors \"yellow.bold,#7da4f8.bold,magenta\" --names PUBLINT,TSUP 'pnpm:lint:publint' 'pnpm:build:dev'",
"build": "pnpm --filter \"./packages/*\" build",
"build:dev": "pnpm --filter \"./packages/*\" build:dev",
"build:test": "pnpm --filter \"./packages/*\" build:test",
"inspect:eslint-config": "pnpx @eslint/config-inspector@latest",
"lint:attw": "attw --pack . --ignore-rules=cjs-resolves-to-esm",
"lint:check-types": "tsc --pretty --incremental -p tsconfig.json",
"lint:eslint": "eslint src/**/*.ts --cache --max-warnings 0 --report-unused-disable-directives",
"lint:attw": "pnpm --filter \"./packages/*\" lint:attw",
"lint:check-types": "pnpm --filter \"./packages/*\" lint:check-types",
"lint:eslint": "eslint . --cache --max-warnings 0 --report-unused-disable-directives",
"lint:format": "prettier --cache --write .",
"lint:publint": "publint --strict .",
"lint:size": "size-limit",
"lint:publint": "pnpm --filter \"./packages/*\" version-package:publint",
"lint:size": "pnpm --filter \"./packages/**\" lint:size",
"prepare": "husky",
"release": "changeset publish",
"test:release": "pkg-pr-new publish",
"test:release": "pnpm --filter \"./packages/*\" test:release",
"version-package": "changeset version"
},
"peerDependencies": {
"@types/react": "^18.0.0",
"react": "^18.0.0",
"sonner": "^1.5.0",
"zustand": "^5.0.0-rc.2"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
},
"react": {
"optional": true
},
"sonner": {
"optional": true
},
"zustand": {
"optional": true
}
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.16.4",
"@changesets/cli": "^2.27.9",
"@size-limit/esbuild-why": "^11.1.6",
"@size-limit/preset-small-lib": "^11.1.6",
"@total-typescript/ts-reset": "^0.6.1",
"@types/node": "^22.7.4",
"@zayne-labs/eslint-config": "^0.1.5",
"@zayne-labs/tsconfig": "^0.1.1",
"@zayne-labs/eslint-config": "^0.2.8",
"@zayne-labs/tsconfig": "catalog:",
"concurrently": "^9.0.1",
"cross-env": "^7.0.3",
"eslint": "^9.11.1",
Expand All @@ -88,29 +35,6 @@
"lint-staged": "^15.2.10",
"pkg-pr-new": "^0.0.29",
"prettier": "^3.3.3",
"publint": "^0.2.11",
"size-limit": "^11.1.6",
"terser": "^5.34.1",
"tsup": "^8.3.0",
"typescript": "5.6.2"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/",
"provenance": true
},
"size-limit": [
{
"path": "./src/core/index.ts",
"limit": "3 kb"
},
{
"path": "./src/react/index.ts",
"limit": "5.1 kb"
},
{
"path": "./src/type-helpers/index.ts",
"limit": "500 b"
}
]
"typescript": "catalog:"
}
}
File renamed without changes.
102 changes: 102 additions & 0 deletions packages/toolkit/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"name": "@zayne-labs/toolkit",
"type": "module",
"version": "0.5.2",
"packageManager": "[email protected]",
"description": "A collection of utility functions, types and composables used by my other projects. Nothing too fancy but can be useful.",
"author": "Ryan Zayne",
"license": "MIT",
"homepage": "https://github.com/zayne-labs/toolkit#readme",
"repository": {
"type": "git",
"url": "https://github.com/zayne-labs/toolkit.git"
},
"bugs": {
"url": "https://github.com/zayne-labs/toolkit/issues"
},
"keywords": [
"utilities",
"types",
"hooks"
],
"sideEffects": false,
"exports": {
".": "./dist/esm-min/core/index.js",
"./react": "./dist/esm-min/react/index.js",
"./type-helpers": "./dist/esm-min/type-helpers/index.js"
},
"main": "./dist/esm-min/core/index.js",
"module": "./dist/esm-min/core/index.js",
"types": "./dist/esm-min/core/index.d.ts",
"files": [
"dist"
],
"engines": {
"node": ">=18.x"
},
"scripts": {
"build": "tsup",
"build:dev": "cross-env NODE_ENV=development tsup",
"build:test": "concurrently --prefix-colors \"yellow.bold,#7da4f8.bold,magenta\" --names PUBLINT,TSUP 'pnpm:lint:publint' 'pnpm:build:dev'",
"lint:attw": "attw --pack . --ignore-rules=cjs-resolves-to-esm",
"lint:check-types": "tsc --pretty --incremental -p tsconfig.json",
"lint:publint": "publint --strict .",
"lint:size": "size-limit",
"test:release": "pkg-pr-new publish"
},
"peerDependencies": {
"@types/react": "^18.0.0",
"react": "^18.0.0",
"sonner": "^1.5.0",
"zustand": "^5.0.0-rc.2"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
},
"react": {
"optional": true
},
"sonner": {
"optional": true
},
"zustand": {
"optional": true
}
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.16.4",
"@changesets/cli": "^2.27.9",
"@size-limit/esbuild-why": "^11.1.6",
"@size-limit/preset-small-lib": "^11.1.6",
"@total-typescript/ts-reset": "^0.6.1",
"@types/node": "^22.7.4",
"@zayne-labs/tsconfig": "catalog:",
"concurrently": "^9.0.1",
"cross-env": "^7.0.3",
"publint": "^0.2.11",
"size-limit": "^11.1.6",
"terser": "^5.34.1",
"tsup": "^8.3.0",
"typescript": "catalog:"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/",
"provenance": true
},
"size-limit": [
{
"path": "./src/core/index.ts",
"limit": "3 kb"
},
{
"path": "./src/react/index.ts",
"limit": "5.1 kb"
},
{
"path": "./src/type-helpers/index.ts",
"limit": "500 b"
}
]
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tsconfig.json → packages/toolkit/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
}
},

"include": ["src/**/*.ts"],
"exclude": ["dist", "node_modules"]
"include": ["src/**/*.ts", "**/*.ts"],
"exclude": ["dist", "node_modules/**"]
}
File renamed without changes.
Loading

0 comments on commit 3707922

Please sign in to comment.