Skip to content

Commit

Permalink
chore: init upgrade to turbp
Browse files Browse the repository at this point in the history
  • Loading branch information
segunadebayo committed Apr 13, 2022
1 parent 4fdde27 commit c64a99a
Show file tree
Hide file tree
Showing 25 changed files with 508 additions and 90 deletions.
23 changes: 1 addition & 22 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 10,
"ecmaFeatures": {
"jsx": true
},
"project": "tsconfig.json"
},
"extends": ["plugin:import/recommended", "plugin:import/typescript", "prettier"],
"plugins": ["jest", "@typescript-eslint/eslint-plugin", "testing-library"],
"env": {
"es6": true,
"browser": true,
"node": true
},
"env": { "node": true },
"rules": {
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-use-before-define": "off",
Expand Down Expand Up @@ -77,16 +66,6 @@
"rules": {
"jest/expect-expect": "off"
}
},
{
"files": ["*.test.*", "*.test.*"],
"extends": ["plugin:jest/recommended", "plugin:jest/style"],
"excludedFiles": ["cypress/**/*.test.ts"],
"rules": {
"jsx-a11y/label-has-associated-control": "off",
"global-require": "off",
"no-new": "off"
}
}
]
}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Disable turbo cache
.turbo

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

Expand Down Expand Up @@ -163,4 +166,4 @@ temp/

# System files
.DS_Store
.ultra.cache.json
.ultra.cache.json
2 changes: 1 addition & 1 deletion examples/vue-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@vue/compiler-sfc": "^3.0.5",
"@vue/runtime-dom": "^3.2.21",
"eslint-plugin-vue": "^6.0.1",
"typescript": "4.5.4",
"typescript": "^4.6.3",
"vite-plugin-components": "^0.10.4",
"vite-plugin-optimize-persist": "^0.1.0",
"vite-plugin-package-config": "^0.0.3",
Expand Down
5 changes: 0 additions & 5 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ module.exports = {
testPathIgnorePatterns: ["<rootDir>/cypress/"],
transformIgnorePatterns: ["[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$"],
setupFilesAfterEnv: ["@testing-library/jest-dom/extend-expect"],
globals: {
"ts-jest": {
tsconfig: "tsconfig.json",
},
},
watchPlugins: ["jest-watch-typeahead/filename", "jest-watch-typeahead/testname"],
collectCoverageFrom: ["**/src/**/*.(ts|tsx)"],
modulePathIgnorePatterns: ["dist"],
Expand Down
13 changes: 13 additions & 0 deletions lask.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"entryPoints": ["./src/index.ts"],
"clean": true,
"outDir": "dist",
"external": {
"dependencies": true,
"peerDependencies": true
},
"devConfig": "tsconfig.json",
"buildConfig": "tsconfig.json",
"format": ["cjs", "esm"],
"calculateSize": true
}
33 changes: 13 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
{
"name": "zag",
"private": true,
"description": "UI machines monorepo root package",
"repository": {
"type": "git",
"url": "git+https://github.com/chakra-ui/zag.git"
},
"author": "Segun Adebayo <[email protected]>",
"license": "MIT",
"workspaces": {
"packages": [
"packages/**/*",
"scripts",
"examples/*"
]
},
"scripts": {
"build:module": "esr scripts/build.ts",
"build:prod": "NODE_ENV=production yarn build:module",
"dev": "yarn build:module --dev",
"watch": "yarn build:module --dev --watch",
"prepare": "husky install && yarn dev",
"prepare": "husky install",
"clean": "esr scripts/generate-typings.ts",
"build:types": "ultra -r --silent --concurrency 20 --filter \"@zag-js/*\" \"tsc src/index.ts --declaration --emitDeclarationOnly --target es2018 --outDir dist --skipLibCheck --moduleResolution node --strict false\"",
"prebuild": "yarn build:types",
Expand All @@ -35,7 +41,7 @@
"test": "jest --maxWorkers=50%",
"test:ci": "jest --runInBand"
},
"dependencies": {
"devDependencies": {
"@changesets/changelog-github": "^0.4.0",
"@changesets/cli": "^2.19.0",
"@commitlint/cli": "^16.0.2",
Expand Down Expand Up @@ -84,26 +90,13 @@
"rimraf": "^3.0.2",
"shelljs": "^0.8.5",
"start-server-and-test": "^1.14.0",
"typescript": "4.5.4",
"typescript": "^4.6.3",
"turbo": "^1.2.2",
"lask": "^0.1.0",
"ultra-runner": "^3.10.5"
},
"workspaces": {
"packages": [
"packages/core",
"packages/machines/*",
"packages/frameworks/*",
"packages/types",
"packages/utilities/*",
"examples/*"
]
},
"lint-staged": {
"**/*.{ts,tsx,js,jsx}": [
"prettier --write"
],
"**/*.{md,yml,json,babelrc,eslintrc,prettierrc}": [
"prettier --write"
]
"**/*.{ts,tsx,js,jsx}": "prettier --write"
},
"commitlint": {
"extends": [
Expand Down
19 changes: 12 additions & 7 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,29 @@
"finite state machine"
],
"author": "Segun Adebayo <[email protected]>",
"homepage": "https://github.com/chakra-ui/core#readme",
"homepage": "https://github.com/chakra-ui/zag#readme",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"repository": "https://github.com/chakra-ui/core/tree/main/packages/machine",
"repository": "https://github.com/chakra-ui/zag/tree/main/packages/machine",
"sideEffects": false,
"files": [
"src",
"dist",
"package.json",
"README.md"
"dist/**/*"
],
"scripts": {
"start": "yarn zag build --watch",
"build": "yarn zag build --prod",
"test": "jest --config ../../jest.config.js --rootDir tests",
"lint": "eslint src --ext .ts,.tsx",
"test:ci": "yarn test --ci --runInBand --updateSnapshot",
"test:watch": "yarn test --watchAll"
},
"publishConfig": {
"access": "public"
},
"bugs": {
"url": "https://github.com/chakra-ui/core/issues"
"url": "https://github.com/chakra-ui/zag/issues"
},
"dependencies": {
"@zag-js/utils": "^0.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/utilities/number/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ npm i @zag-js/number

## Contribution

Yes please! See the [contributing guidelines](https://github.com/chakra-ui/core/blob/main/CONTRIBUTING.md) for details.
Yes please! See the [contributing guidelines](https://github.com/chakra-ui/zag/blob/main/CONTRIBUTING.md) for details.

## Licence

This project is licensed under the terms of the [MIT license](https://github.com/chakra-ui/core/blob/main/LICENSE).
This project is licensed under the terms of the [MIT license](https://github.com/chakra-ui/zag/blob/main/LICENSE).
4 changes: 2 additions & 2 deletions packages/utilities/popper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ npm i @zag-js/popper

## Contribution

Yes please! See the [contributing guidelines](https://github.com/chakra-ui/core/blob/main/CONTRIBUTING.md) for details.
Yes please! See the [contributing guidelines](https://github.com/chakra-ui/zag/blob/main/CONTRIBUTING.md) for details.

## Licence

This project is licensed under the terms of the [MIT license](https://github.com/chakra-ui/core/blob/main/LICENSE).
This project is licensed under the terms of the [MIT license](https://github.com/chakra-ui/zag/blob/main/LICENSE).
4 changes: 2 additions & 2 deletions packages/utilities/rect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ npm i @zag-js/geometry

## Contribution

Yes please! See the [contributing guidelines](https://github.com/chakra-ui/core/blob/main/CONTRIBUTING.md) for details.
Yes please! See the [contributing guidelines](https://github.com/chakra-ui/zag/blob/main/CONTRIBUTING.md) for details.

## Licence

This project is licensed under the terms of the [MIT license](https://github.com/chakra-ui/core/blob/main/LICENSE).
This project is licensed under the terms of the [MIT license](https://github.com/chakra-ui/zag/blob/main/LICENSE).
4 changes: 2 additions & 2 deletions plop-templates/util-template/README.md.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ npm i @zag-js/{{packageName}}
## Contribution

Yes please! See the
[contributing guidelines](https://github.com/chakra-ui/core/blob/main/CONTRIBUTING.md)
[contributing guidelines](https://github.com/chakra-ui/zag/blob/main/CONTRIBUTING.md)
for details.

## Licence

This project is licensed under the terms of the
[MIT license](https://github.com/chakra-ui/core/blob/main/LICENSE).
[MIT license](https://github.com/chakra-ui/zag/blob/main/LICENSE).
4 changes: 2 additions & 2 deletions scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ function buildPackage(dir: string, pkg: Record<string, any>, opts: BuildOptions)
const common: esbuild.BuildOptions = {
minify: process.env.NODE_ENV === "production",
bundle: true,
sourcemap: true,
sourcemap: "inline",
absWorkingDir: dir,
entryPoints: ["src/index.ts"],
external: Object.keys(pkg.peerDependencies ?? {}),
external: ["valtio"].concat(Object.keys(pkg.peerDependencies ?? {})),
}

esbuild.buildSync({
Expand Down
3 changes: 3 additions & 0 deletions scripts/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env node
require("@swc-node/register")
require("./src/index.ts")
15 changes: 15 additions & 0 deletions scripts/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "@zag-js/scripts",
"version": "1.0.0",
"private": true,
"bin": {
"zag": "index.js"
},
"dependencies": {
"esbuild-plugin-alias": "^0.2.1",
"@swc-node/register": "1.4.2",
"commander": "8.3.0",
"signale": "^1.4.0",
"@types/signale": "^1.4.4"
}
}
25 changes: 25 additions & 0 deletions scripts/play.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { getWorkspacePkgs } from "./build-utils"
import fs from "fs"

const patch = {
files: ["dist/**/*"],
scripts: {
start: "yarn zag build --watch",
build: "yarn zag build --prod",
test: "jest --config ../../jest.config.js --rootDir tests",
lint: "eslint src --ext .ts,.tsx",
"test:ci": "yarn test --ci --runInBand --updateSnapshot",
"test:watch": "yarn test --watchAll",
},
}

async function main() {
const pkgs = await getWorkspacePkgs()
for (const { pkg } of pkgs) {
if (pkg.name === "@zag-js/scripts") continue
Object.assign(pkg, patch)
fs.writeFileSync(`${pkg.dir}/package.json`, JSON.stringify(pkg, null, 2))
}
}

main()
Loading

0 comments on commit c64a99a

Please sign in to comment.