Skip to content

Commit

Permalink
Merge branch 'main' into renovate/rollup
Browse files Browse the repository at this point in the history
  • Loading branch information
HeartSquared authored May 27, 2024
2 parents fa88779 + 12bf8bc commit 0c70f44
Show file tree
Hide file tree
Showing 23 changed files with 142 additions and 80 deletions.
5 changes: 5 additions & 0 deletions .changeset/rich-chairs-mix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kaizen/package-bundler": patch
---

Add `noEmit` to package bundler `tsconfig.base.json` and include types in dist.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- run: pnpm compile
- run: pnpm lint:ts

eslint:
if: github.head_ref != 'changeset-release/main'
Expand All @@ -34,7 +34,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- run: pnpm lint:ts && pnpm lint:md
- run: pnpm lint:js && pnpm lint:md

prettier:
if: github.head_ref != 'changeset-release/main'
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"clean": "pnpm turbo clean && pnpm storybook:clean && rimraf node_modules",
"test": "pnpm turbo test",
"test:ci": "pnpm turbo test:ci",
"compile": "tsc && pnpm pkg:aio compile",
"storybook": "storybook dev -p 6006 -c storybook",
"storybook:preview": "NODE_ENV=production pnpm storybook --docs",
"storybook:clean": "rm -rf storybook/public",
Expand All @@ -22,13 +21,14 @@
"storybook:build:prod": "pnpm storybook:build --docs",
"test:storybook": "test-storybook --config-dir storybook",
"jest:debug": "node --inspect-brk node_modules/.bin/jest --runInBand --no-cache",
"lint": "pnpm lint:ts && pnpm lint:md && pnpm lint:format && pnpm lint:styles",
"lint:ts": "tsc --noEmit && pnpm turbo lint:ts",
"eslint-config": "pnpm eslint -c .eslintrc.js --max-warnings=0",
"lint:ts": "pnpm eslint-config '**/*.{ts,tsx,mjs,js}'",
"lint": "pnpm lint:js && pnpm lint:md && pnpm lint:format && pnpm lint:styles",
"lint:js": "pnpm eslint-config '**/*.{ts,tsx,mjs,js}'",
"lint:md": "pnpm eslint-config '**/*.{md,mdx}'",
"lint:format": "pnpm prettier --check '**/*'",
"lint:styles": "pnpm stylelint '**/*.scss'",
"lint:fix": "pnpm lint:styles --fix && pnpm lint:ts --fix && pnpm lint:md --fix && pnpm lint:format --write",
"lint:fix": "pnpm lint:styles --fix && pnpm lint:js --fix && pnpm lint:md --fix && pnpm lint:format --write",
"reset": "pnpm clean && pnpm install --force",
"chromatic": "chromatic",
"changeset": "changeset",
Expand Down
1 change: 1 addition & 0 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"build": "pnpm package-bundler build-shared-ui && pnpm build:global-styles",
"build:global-styles": "postcss ./styles/global.css --output dist/styles.css",
"clean": "rm -rf dist",
"lint:ts": "tsc --noEmit",
"test": "FORCE_COLOR=1 jest",
"test:ci": "pnpm test -- --ci",
"update-icons": "./src/Icon/bin/update-icons.sh",
Expand Down
8 changes: 0 additions & 8 deletions packages/components/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,3 @@ declare module "*.scss" {
const classes: Record<string, string>
export default classes
}

declare module "*.icon.svg" {
const content: {
id: string
viewBox: string
}
export default content
}
1 change: 1 addition & 0 deletions packages/design-tokens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"license": "MIT",
"sideEffects": false,
"scripts": {
"lint:ts": "tsc --noEmit",
"test": "FORCE_COLOR=1 jest",
"test:ci": "pnpm test -- --ci",
"build": "pnpm clean && pnpm build:json && pnpm build:less && pnpm build:sass && pnpm build:ts",
Expand Down
11 changes: 5 additions & 6 deletions packages/design-tokens/tsconfig.dist.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{
"extends": "../../tsconfig.dist.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"noEmit": false,
"noImplicitAny": true,
"target": "es5",
"rootDir": "src",
"outDir": "dist",
"declarationMap": true,
"noEmit": false,
"declaration": true,
"target": "es5",
"module": "CommonJS",
"declarationMap": true,
"sourceMap": true,
"noUncheckedIndexedAccess": true
},
"include": ["src/**/*.ts", "src/**/*.tsx"],
Expand Down
22 changes: 22 additions & 0 deletions packages/design-tokens/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"compilerOptions": {
"baseUrl": ".",
"module": "commonjs",
"jsx": "react",
"esModuleInterop": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"strict": true,
"allowJs": false,
"noEmit": true,
"paths": {
"~storybook/*": ["../../storybook/*"],
"~types/*": ["../components/src/types/*"],
"~components/*": ["../components/src/*"]
}
},
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["node_modules", "**/*.spec.ts"]
}
41 changes: 41 additions & 0 deletions packages/design-tokens/types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
declare module "*.css" {
const classes: { [key: string]: string }
export default classes
}

declare module "*.scss" {
const classes: { [key: string]: string }
export default classes
}

declare module "*.icon.svg" {
const content: {
id: string
viewBox: string
}
export default content
}
declare module "!!raw-loader!*" {
const content: string
export default content
}

declare module "react-map-interaction" {
type InteractionState = {
scale: number
translation: { x: number; y: number }
}
type Props = {
showControls?: boolean
minScale?: number
maxScale?: number
value?: InteractionState
onChange?: (state: InteractionState) => void
}
export const MapInteractionCSS: import("react").ComponentType<Props>
export const MapInteraction: import("react").ComponentType<
Props & {
children: (params: InteractionState) => React.ReactNode
}
>
}
3 changes: 2 additions & 1 deletion packages/hosted-assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
],
"scripts": {
"build": "pnpm clean && tsc --project tsconfig.dist.json",
"clean": "rm -rf dist && rimraf '*.d.ts' '*.js'"
"clean": "rm -rf dist && rimraf '*.d.ts' '*.js'",
"lint:ts": "tsc --noEmit"
}
}
3 changes: 1 addition & 2 deletions packages/hosted-assets/tsconfig.dist.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"extends": "../../tsconfig.dist.json",
"extends": "./tsconfig.json",
"include": ["./index.ts"],
"compilerOptions": {
"outDir": "dist",
"noEmit": false,
"allowJs": false,
"sourceMap": true,
"declaration": true
}
Expand Down
17 changes: 17 additions & 0 deletions packages/hosted-assets/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"compilerOptions": {
"baseUrl": ".",
"module": "commonjs",
"jsx": "react",
"esModuleInterop": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"strict": true,
"allowJs": false,
"noEmit": true
},
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}
6 changes: 3 additions & 3 deletions packages/package-bundler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pnpm add -D postcss postcss-preset-env rollup tslib
### Required files

- `postcss.config.js`
- `rollup.config.(mjs|ts)`
- `rollup.config.mjs`
- `tsconfig.json`
- `tsconfig.dist.json`
- `tsconfig.types.json`
Expand Down Expand Up @@ -84,7 +84,7 @@ module.exports = {

### Rollup

In `rollup.config.(mjs|ts)`:
In `rollup.config.mjs`:
```ts
import { pluginsSharedUi, rollupConfig } from "@kaizen/package-bundler";

Expand Down Expand Up @@ -182,7 +182,7 @@ Example:
```

```ts
// rollup.config.(mjs|ts)
// rollup.config.mjs
export default rollupConfig({
alias: {
entries: [
Expand Down
3 changes: 2 additions & 1 deletion packages/package-bundler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
},
"scripts": {
"build": "rm -rf dist && tsc --build",
"prepare": "ts-patch install -s"
"prepare": "ts-patch install -s",
"lint:ts": "tsc --noEmit"
},
"files": [
"dist",
Expand Down
3 changes: 2 additions & 1 deletion packages/package-bundler/tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"jsx": "react",
"noImplicitAny": true,
"noImplicitReturns": true,
"strict": true
"strict": true,
"noEmit": true
}
}
1 change: 1 addition & 0 deletions packages/package-bundler/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"strict": true,
"allowJs": false,
"outDir": "dist",
"declaration": true,
"target": "ESNext"
},
"include": ["src/**/*"],
Expand Down
3 changes: 2 additions & 1 deletion packages/tailwind/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "Kaizen Tailwind presets",
"scripts": {
"build": "pnpm clean && tsc --project tsconfig.dist.json",
"clean": "rimraf -g '**/*.d.ts' '**/*.js' '**/*.map'"
"clean": "rimraf -g '**/*.d.ts' '**/*.js' '**/*.map'",
"lint:ts": "tsc --noEmit"
},
"repository": {
"type": "git",
Expand Down
15 changes: 8 additions & 7 deletions packages/tailwind/tsconfig.dist.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"extends": "../../tsconfig.dist.json",
"include": ["src/**/*.ts"],
"exclude": ["**/*.spec.ts"],
"extends": "./tsconfig.json",
"compilerOptions": {
"noImplicitAny": true,
"target": "es5",
"rootDir": "src",
"outDir": "dist",
"noEmit": false,
"declaration": true,
"declarationMap": true,
"target": "es5",
"module": "CommonJS",
"sourceMap": true,
"noUncheckedIndexedAccess": false
}
},
"include": ["src/**/*.ts"],
"exclude": ["**/*.spec.ts"]
}
17 changes: 17 additions & 0 deletions packages/tailwind/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"compilerOptions": {
"baseUrl": ".",
"module": "commonjs",
"jsx": "react",
"esModuleInterop": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"strict": true,
"allowJs": false,
"noEmit": true
},
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["node_modules", "**/*.spec.ts"]
}
9 changes: 0 additions & 9 deletions tsconfig.dist.json

This file was deleted.

6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"compilerOptions": {
"baseUrl": ".",
"lib": ["es2019", "dom"],
"module": "commonjs",
"module": "ESNext",
"moduleResolution": "Bundler",
"jsx": "react",
"esModuleInterop": true,
"resolveJsonModule": true,
Expand All @@ -22,6 +22,6 @@
"types": ["@testing-library/jest-dom"]
},
"files": ["./types.d.ts"],
"include": ["packages/**/*", "storybook/**/*", "docs/**/*.tsx"],
"include": ["storybook/**/*", "docs/**/*.tsx"],
"exclude": ["**/node_modules"]
}
3 changes: 3 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
"inputs": ["packages/**"],
"outputs": ["dist/**"]
},
"lint:ts": {
"cache": false
},
"test": {},
"test:ci": {},
"clean": {
Expand Down
32 changes: 0 additions & 32 deletions types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,3 @@ declare module "*.scss" {
const classes: { [key: string]: string }
export default classes
}

declare module "*.icon.svg" {
const content: {
id: string
viewBox: string
}
export default content
}
declare module "!!raw-loader!*" {
const content: string
export default content
}

declare module "react-map-interaction" {
type InteractionState = {
scale: number
translation: { x: number; y: number }
}
type Props = {
showControls?: boolean
minScale?: number
maxScale?: number
value?: InteractionState
onChange?: (state: InteractionState) => void
}
export const MapInteractionCSS: import("react").ComponentType<Props>
export const MapInteraction: import("react").ComponentType<
Props & {
children: (params: InteractionState) => React.ReactNode
}
>
}

0 comments on commit 0c70f44

Please sign in to comment.