Skip to content

Commit

Permalink
Add build step for remaining projects
Browse files Browse the repository at this point in the history
  • Loading branch information
augustobmoura committed Jan 16, 2024
1 parent 3c9e61c commit 1493d1c
Show file tree
Hide file tree
Showing 54 changed files with 302 additions and 211 deletions.
8 changes: 6 additions & 2 deletions bin/archive/migration/migrate-sub-packages.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ migrate() (
publishConfig.directory > /dev/null

tsconfig='{
"extends": "../../../tsconfig.base.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "dist"
},
Expand All @@ -43,10 +43,14 @@ migrate_all() {
local pkgs_json=()

for pkg in "$dir"/*/; do
if [ -f "$pkg/tsconfig.json" ]; then
continue
fi

pkgJson+=("$(migrate "$pkg")")
done

npx -y sort-package-json "${pkgs_json[@]}"
}

migrate_all packages/base
migrate_all packages
4 changes: 3 additions & 1 deletion bin/refresh-tsconfig-references.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { globbyStream } from 'globby'
import { $ } from 'zx'
import JSON5 from 'json5'

const ALL_PROJECTS_TSCONFIG = 'tsconfig.pkgsrc.json'

const formatFile = async file => {
await $`yarn -s prettier --write ${file}`
}
Expand Down Expand Up @@ -135,7 +137,7 @@ const main = async () => {

await Promise.all(refreshingPromises)

const allTsconfigLoc = path.join(rootPath, 'tsconfig.all.json')
const allTsconfigLoc = path.join(rootPath, ALL_PROJECTS_TSCONFIG)
const allReferences = allProjects.map(dir => ({
path: path.relative(rootPath, dir),
}))
Expand Down
110 changes: 55 additions & 55 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,74 +1,103 @@
{
"name": "@toptal/picasso-root",
"version": "0.0.1",
"description": "",
"private": true,
"description": "",
"homepage": "https://github.com/toptal/picasso#readme",
"bugs": {
"url": "https://github.com/toptal/picasso/issues"
},
"repository": {
"type": "git",
"url": "[email protected]:toptal/picasso.git"
},
"license": "MIT",
"author": "Toptal",
"workspaces": [
"packages/*",
"packages/base/*"
],
"scripts": {
"build:package": "lerna run build:package",
"build:all": "nx run-many -t build",
"build:package": "lerna run build:package",
"build:storybook": "build-storybook -c .storybook -o build/storybook --quiet",
"circularity": "madge --circular packages/*/src",
"check:icon-sizes": "node ./bin/check-icon-sizes",
"circularity": "madge --circular packages/*/src",
"clean": "yarn cache clean && nx reset && find . -type d -name \"node_modules\" -exec rm -rf '{}' +",
"generate:component": "davinci-code new component",
"generate:example": "davinci-code new example",
"generate:svg-components": "yarn generate:icons && yarn generate:pictograms",
"generate:icons": "./bin/generate-components-from-svg icon",
"generate:pictograms": "./bin/generate-components-from-svg pictogram",
"generate:svg-components": "yarn generate:icons && yarn generate:pictograms",
"happo": "cross-env SCREENSHOT_BREAKPOINTS=true TEST_ENV=visual HAPPO_PROJECT=Picasso/Storybook happo",
"happo:storybook": "cross-env SCREENSHOT_BREAKPOINTS=true TEST_ENV=visual HAPPO_IS_ASYNC=false happo-ci-github-actions",
"lint": "davinci-syntax lint code --check .",
"lint:fix": "davinci-syntax lint code packages/base",
"release": "yarn build:package && changeset publish",
"prepare": "husky install",
"prepublish": "if [ -f 'yarn.lock' ]; then yarn-deduplicate yarn.lock; fi",
"refresh:tsconfig-references": "./bin/refresh-tsconfig-references.mjs",
"release": "yarn build:package && changeset publish",
"start": "start-storybook -p 9001 -c .storybook",
"syncpack": "yarn syncpack:list & yarn syncpack:fix",
"syncpack:list": "syncpack list-mismatches",
"syncpack:fix": "syncpack fix-mismatches",
"symlink": "cross-env ./bin/symlink --link",
"symlink:off": "cross-env ./bin/symlink --unlink",
"syncpack": "yarn syncpack:list & yarn syncpack:fix",
"syncpack:fix": "syncpack fix-mismatches",
"syncpack:list": "syncpack list-mismatches",
"test": "yarn test:unit && yarn test:integration",
"test:combine": "yarn istanbul-merge --out coverage/combined/report.json coverage/cypress/coverage-final.json coverage/jest/coverage-final.json && nyc report --temp-dir coverage/combined --report-dir coverage/combined --reporter html",
"test:coverage": "yarn test:unit:coverage && yarn test:integration && yarn test:combine",
"test:integration": "yarn test:setup cypress run --component",
"test:integration:ci": "yarn happo-e2e -- -- yarn test:setup cypress run --component",
"test:integration:open": "yarn test:setup cypress open --browser=electron --component",
"test:setup": "cross-env TZ=UTC NODE_ENV=development",
"test:unit": "davinci-qa unit --config=./jest.spec.mjs",
"test:unit:debug": "cross-env NODE_OPTIONS=--inspect-brk yarn test:unit",
"test:unit:ci": "yarn test:unit --maxWorkers=4 --ci",
"test:unit:coverage": "yarn test:unit:ci --collect-coverage --coverage true --collectCoverageFrom packages/**/*.{ts,tsx} --coverageDirectory coverage/jest",
"test:combine": "yarn istanbul-merge --out coverage/combined/report.json coverage/cypress/coverage-final.json coverage/jest/coverage-final.json && nyc report --temp-dir coverage/combined --report-dir coverage/combined --reporter html",
"test:unit:debug": "cross-env NODE_OPTIONS=--inspect-brk yarn test:unit",
"test:unit:watch": "yarn test:unit --watch",
"typecheck": "tsc --noEmit && tsc -p ./cypress/tsconfig.json",
"prepublish": "if [ -f 'yarn.lock' ]; then yarn-deduplicate yarn.lock; fi",
"prepare": "husky install"
"typecheck": "tsc --noEmit && tsc -p ./cypress/tsconfig.json"
},
"lint-staged": {
"{**/*.{js,jsx,ts,tsx},.changeset/*.md}": [
"davinci-syntax lint code",
"prettier --write"
]
},
"nyc": {
"report-dir": "coverage/cypress",
"reporter": [
"json"
],
"include": [
"packages/**/src/**/*.ts",
"packages/**/src/**/*.tsx",
"packages/base/src/**/*.ts",
"packages/base/src/**/*.tsx"
],
"report-dir": "coverage/cypress",
"reporter": [
"json"
]
},
"repository": {
"type": "git",
"url": "[email protected]:toptal/picasso.git"
},
"author": "Toptal",
"license": "MIT",
"bugs": {
"url": "https://github.com/toptal/picasso/issues"
"resolutions": {
"**/@types/unist": "3.0.0",
"**/default-browser-id/meow/trim-newlines": "^3",
"**/find-babel-config/json5": "1",
"**/marksy/marked": "^0.7.0",
"@storybook/react": "^6.5.15",
"ansi-regex": "^5.0.1",
"glob-parent": "^6.0.2",
"lodash": "^4.17.21",
"minimist": "^1.2.6",
"node-fetch": "^2.6.7",
"postcss": "^8.4.32",
"prettier": "^2.5.1",
"prismjs": "^1.25.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-test-renderer": "^18.2.0",
"semver-regex": "^3.1.3",
"trim": "^0.0.3",
"unset-value": "^2.0.1",
"webpack": "^5.0.0",
"yaml": "2"
},
"homepage": "https://github.com/toptal/picasso#readme",
"devDependencies": {
"@actions/core": "^1.10.0",
"@actions/github": "^6.0.0",
Expand Down Expand Up @@ -155,35 +184,6 @@
"yarn-deduplicate": "^6.0.2",
"zx": "^7.2.3"
},
"lint-staged": {
"{**/*.{js,jsx,ts,tsx},.changeset/*.md}": [
"davinci-syntax lint code",
"prettier --write"
]
},
"resolutions": {
"lodash": "^4.17.21",
"**/marksy/marked": "^0.7.0",
"**/find-babel-config/json5": "1",
"postcss": "^8.4.32",
"**/default-browser-id/meow/trim-newlines": "^3",
"**/@types/unist": "3.0.0",
"@storybook/react": "^6.5.15",
"webpack": "^5.0.0",
"glob-parent": "^6.0.2",
"prettier": "^2.5.1",
"trim": "^0.0.3",
"ansi-regex": "^5.0.1",
"minimist": "^1.2.6",
"prismjs": "^1.25.0",
"unset-value": "^2.0.1",
"semver-regex": "^3.1.3",
"node-fetch": "^2.6.7",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-test-renderer": "^18.2.0",
"yaml": "2"
},
"engines": {
"node": ">=18"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import React, { forwardRef } from 'react'
import type {
BaseProps,
TextLabelProps,
OverridableComponent,
} from '@toptal/picasso-shared'
import { useTitleCase } from '@toptal/picasso-shared'
import type { Theme } from '@material-ui/core/styles'
Expand Down Expand Up @@ -32,7 +31,7 @@ const Active = (props: { children: ReactNode }) => {
return <Typography weight='semibold' color='black' {...props} />
}

export const BreadcrumbsItem: OverridableComponent<Props> = forwardRef<
export const BreadcrumbsItem = forwardRef<
HTMLElement,
Props
>(function BreadcrumbsItem(props, ref) {
Expand Down
2 changes: 1 addition & 1 deletion packages/base/Button/src/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export interface Props
/** Disables button */
disabled?: boolean
/** Content of Button component */
children: ReactNode
children?: ReactNode
focused?: boolean
/** Take the full width of a container */
fullWidth?: boolean
Expand Down
3 changes: 2 additions & 1 deletion packages/base/Notification/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './Notification'
export * from './NotificationActions'
export * from './NotificationCompound'
export * from './NotificationCompound'
export * from './use-notification'
2 changes: 1 addition & 1 deletion packages/base/Table/src/TableBody/TableBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const stripeRows = (children: React.ReactNode) => {

stripeIndex++
if (stripeIndex % 2 !== 0) {
return React.cloneElement(child, { stripeEven: true })
return React.cloneElement(child, { stripeEven: true } as {})
}

return child
Expand Down
2 changes: 1 addition & 1 deletion packages/base/Utils/src/utils/forward-ref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export type Component<T, P> = T & {
*
* @param component exotic component returned by `forwardRef`
*/
export const documentable = <T, P>(component: T): Component<T, P> => component
export const documentable = <T, P>(component: T): Component<T, P> => component as Component<T, P>

/**
* Wrapper around React.forwardRef that preserves genericity of the passed `Component`.
Expand Down
7 changes: 7 additions & 0 deletions packages/base/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "dist"
},
"include": ["src"]
}
15 changes: 9 additions & 6 deletions packages/picasso-charts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@
"description": "Charts components of Picasso",
"author": "Toptal",
"license": "MIT",
"main": "index.js",
"module": "index.js",
"main": "./dist/src/index.js",
"module": "./dist/src/index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/toptal/picasso.git"
},
"publishConfig": {
"access": "public",
"directory": "dist-package"
"access": "public"
},
"scripts": {
"build:package": "cross-env NODE_ENV=production node ../../bin/build.js --tsConfig=./tsconfig.build.json",
"prepublishOnly": "if [ -d dist-package ]; then cp ./package.json ./dist-package/package.json; fi"
"build": "tsc -b tsconfig.json",
"prepare": "yarn build"
},
"bugs": {
"url": "https://github.com/toptal/picasso/issues"
Expand All @@ -40,5 +39,9 @@
"d3-array": "^3.2.2",
"debounce": "^1.2.1",
"recharts": "^2.9.0"
},
"type": "module",
"exports": {
".": "./dist/src/index.js"
}
}
7 changes: 0 additions & 7 deletions packages/picasso-charts/tsconfig.build.json

This file was deleted.

10 changes: 10 additions & 0 deletions packages/picasso-charts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": { "outDir": "dist" },
"include": ["src"],
"references": [
{ "path": "../base/Utils" },
{ "path": "../picasso" },
{ "path": "../shared" }
]
}
19 changes: 11 additions & 8 deletions packages/picasso-codemod/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,25 @@
"author": "Toptal",
"homepage": "https://github.com/toptal/picasso/tree/master/packages/picasso-codemod#readme",
"license": "MIT",
"main": "index.js",
"module": "index.js",
"main": "./dist/src/index.js",
"module": "./dist/src/index.js",
"publishConfig": {
"access": "public",
"directory": "dist-package"
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/toptal/picasso.git"
},
"scripts": {
"build:package": "./bin/build.sh",
"prepublishOnly": "if [ -d dist-package ]; then cp ./package.json ./dist-package/package.json; fi"
"build": "tsc -b tsconfig.json",
"prepare": "yarn build"
},
"bugs": {
"url": "https://github.com/toptal/picasso/issues"
},
"peerDependencies": {
"typescript": "~4.7.0",
"react": ">=16.12.0 < 19.0.0"
"react": ">=16.12.0 < 19.0.0",
"typescript": "~4.7.0"
},
"devDependencies": {
"@types/jscodeshift": "^0.11.6"
Expand All @@ -37,5 +36,9 @@
"globby": "^14.0.0",
"jscodeshift": "^0.13.1",
"meow": "^10.1.3"
},
"type": "module",
"exports": {
".": "./dist/src/index.js"
}
}
8 changes: 0 additions & 8 deletions packages/picasso-codemod/tsconfig.build.json

This file was deleted.

7 changes: 7 additions & 0 deletions packages/picasso-codemod/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "dist"
},
"include": ["src"]
}
Loading

0 comments on commit 1493d1c

Please sign in to comment.