From 1522454a16aa2cbfbc81524e5f170805e5722a46 Mon Sep 17 00:00:00 2001 From: Stephen Lee Date: Tue, 7 Jan 2025 15:22:57 -0800 Subject: [PATCH] WIP --- .github/pull_request_template.md | 2 +- .github/workflows/clean.yml | 7 +- .github/workflows/pr.yml | 117 +- .github/workflows/react17.yml | 23 +- .github/workflows/release.yml | 94 +- .github/workflows/sizeDiff.yml | 11 +- .gitignore | 7 - .npmrc | 11 + charts/core/package.json | 19 +- chat/avatar/package.json | 14 +- chat/chat-disclaimer/package.json | 15 +- chat/chat-window/package.json | 25 +- chat/fixed-chat-window/package.json | 30 +- chat/input-bar/package.json | 30 +- .../src/utils/setReactTextAreaValue.ts | 1 - chat/lg-markdown/package.json | 12 +- .../src/LGMarkdown/componentsMap.tsx | 1 - chat/message-feed/package.json | 22 +- chat/message-feed/src/MessageFeed.stories.tsx | 20 +- chat/message-feedback/package.json | 23 +- .../PopoverMessageFeedback.stories.tsx | 5 +- chat/message-prompts/package.json | 14 +- chat/message-rating/package.json | 18 +- chat/message/package.json | 23 +- chat/rich-links/package.json | 21 +- chat/title-bar/package.json | 22 +- package.json | 70 +- packages/a11y/package.json | 9 +- packages/a11y/src/A11y.spec.tsx | 2 +- packages/avatar/package.json | 16 +- packages/badge/package.json | 12 +- packages/banner/package.json | 18 +- packages/box/package.json | 4 +- packages/box/src/Box.spec.tsx | 14 - packages/button/package.json | 17 +- packages/button/src/Button.stories.tsx | 2 +- packages/button/src/Button/Button.spec.tsx | 2 +- packages/callout/package.json | 14 +- packages/card/package.json | 14 +- packages/card/src/Card/Card.spec.tsx | 2 +- packages/checkbox/package.json | 18 +- packages/chip/package.json | 16 +- packages/code/package.json | 27 +- .../renderingPlugin/renderingPlugin.spec.tsx | 2 - packages/combobox/package.json | 30 +- packages/combobox/src/Combobox/Combobox.tsx | 2 +- .../src/ComboboxChip/ComboboxChip.stories.tsx | 1 - .../ComboboxGroup/ComboboxGroup.stories.tsx | 1 - .../src/ComboboxMenu/ComboboxMenu.stories.tsx | 2 +- .../ComboboxOption/ComboboxOption.stories.tsx | 1 - packages/confirmation-modal/package.json | 22 +- packages/copyable/package.json | 23 +- packages/date-picker/package.json | 34 +- .../useControlledValue.spec.tsx | 2 +- packages/date-utils/package.json | 6 +- .../src/testing/mockTimeZone/index.ts | 10 +- packages/descendants/package.json | 12 +- packages/empty-state/package.json | 18 +- packages/expandable-card/package.json | 22 +- packages/form-field/package.json | 19 +- packages/form-footer/package.json | 16 +- .../form-footer/src/FormFooter.stories.tsx | 1 - packages/guide-cue/package.json | 26 +- packages/guide-cue/src/GuideCue.stories.tsx | 1 - packages/hooks/package.json | 5 +- .../useControlledValue.spec.tsx | 2 +- packages/hooks/src/useDynamicRefs/index.ts | 1 - packages/hooks/src/useIdAllocator.ts | 1 - packages/icon-button/package.json | 18 +- packages/icon-button/src/IconButton.spec.tsx | 2 +- packages/icon-button/tsconfig.json | 1 + packages/icon/package.json | 7 +- packages/icon/src/Icon.spec.tsx | 1 - packages/info-sprinkle/package.json | 16 +- packages/inline-definition/package.json | 13 +- .../src/InlineDefinition.spec.tsx | 2 +- packages/input-option/package.json | 17 +- .../src/InputOption/InputOption.spec.tsx | 2 - .../src/InputOption/InputOption.stories.tsx | 1 - packages/leafygreen-provider/package.json | 7 +- packages/lib/package.json | 2 - .../lib/src/createUniqueClassName/index.ts | 2 +- packages/loading-indicator/package.json | 14 +- packages/logo/package.json | 10 +- packages/marketing-modal/package.json | 18 +- packages/menu/package.json | 31 +- .../FocusableMenuItem.stories.tsx | 1 - packages/menu/src/Menu.stories.tsx | 2 +- .../menu/src/MenuItem/MenuItem.stories.tsx | 2 +- packages/menu/src/SubMenu/SubMenu.spec.tsx | 4 +- packages/menu/src/SubMenu/SubMenu.stories.tsx | 2 +- .../withMenuContextDecorator.testutils.tsx | 2 +- packages/modal/package.json | 27 +- packages/number-input/package.json | 28 +- packages/ordered-list/package.json | 14 +- packages/pagination/package.json | 20 +- .../pagination/src/Pagination.stories.tsx | 2 +- packages/palette/package.json | 11 +- packages/password-input/package.json | 24 +- packages/pipeline/package.json | 18 +- packages/polymorphic/package.json | 4 +- .../polymorphic/src/Example/types.spec.tsx | 1 - .../src/Polymorphic/Polymorphic.ts | 1 + packages/popover/package.json | 15 +- packages/popover/src/Popover.stories.tsx | 2 +- packages/popover/src/Popover/Popover.tsx | 2 +- packages/portal/package.json | 11 +- packages/portal/src/Portal/Portal.spec.tsx | 1 - packages/portal/src/Portal/Portal.tsx | 1 + packages/radio-box-group/package.json | 13 +- packages/radio-group/package.json | 16 +- packages/ripple/package.json | 2 +- packages/search-input/package.json | 28 +- .../src/SearchInput/SearchInput.spec.tsx | 4 +- .../src/SearchInput/SearchInput.tsx | 2 +- .../src/SearchResult/SearchResult.stories.tsx | 1 - .../SearchResultsMenu.stories.tsx | 2 +- packages/segmented-control/package.json | 19 +- .../src/SegmentedControl.stories.tsx | 8 +- .../SegmentedControlOption.stories.tsx | 2 +- packages/select/package.json | 27 +- .../select/src/ListMenu/ListMenu.stories.tsx | 2 +- packages/select/src/Option/Option.stories.tsx | 2 - packages/select/src/Select/Select.spec.tsx | 2 - packages/side-nav/package.json | 25 +- packages/side-nav/src/SideNav.stories.tsx | 1 - .../src/SideNavItem/SideNavItem.stories.tsx | 1 - .../side-nav/src/SideNavItem/SideNavItem.tsx | 1 + packages/skeleton-loader/package.json | 18 +- packages/skeleton-loader/tsconfig.json | 4 + packages/split-button/package.json | 24 +- .../split-button/src/SplitButton.stories.tsx | 2 +- packages/stepper/package.json | 18 +- packages/stepper/src/Stepper.stories.tsx | 1 - packages/table/package.json | 29 +- packages/tabs/package.json | 27 +- packages/tabs/src/Tabs.spec.tsx | 1 - packages/testing-lib/package.json | 4 +- packages/testing-lib/src/context.spec.ts | 4 +- .../waitForTransition.spec.tsx | 1 - packages/text-area/package.json | 18 +- .../text-area/src/TextArea/TextArea.spec.tsx | 4 +- packages/text-area/src/TextArea/TextArea.tsx | 1 + packages/text-input/package.json | 16 +- .../src/TextInput/TextInput.spec.tsx | 4 +- packages/toast/package.json | 21 +- .../ControlledToast/ControlledToast.spec.tsx | 1 - .../ControlledToast.stories.tsx | 1 - .../InternalToast/InternalToast.stories.tsx | 2 +- .../toast/src/InternalToast/VariantIcon.tsx | 1 - packages/toggle/package.json | 16 +- packages/tokens/package.json | 9 +- packages/tokens/src/Tokens.stories.tsx | 1 - packages/tooltip/package.json | 19 +- packages/tooltip/src/Tooltip.stories.tsx | 1 - packages/typography/package.json | 16 +- pnpm-lock.yaml | 21501 ++++++++++++++++ pnpm-workspace.yaml | 6 + scripts/tsconfig.json | 2 +- stories/PropCombinationsDecorator.stories.tsx | 1 - tools/build/config/package.tsconfig.json | 3 +- tools/build/config/root.tsconfig.json | 2 +- tools/build/src/index.ts | 5 +- tools/build/src/tsdoc/test-package/index.tsx | 2 +- tools/build/src/tsdoc/tsdoc.spec.ts | 2 +- tools/build/tsconfig.json | 3 +- tools/cli/package.json | 20 +- tools/cli/src/index.ts | 6 +- tools/cli/tsconfig.json | 7 + tools/codemods/CONTRIBUTING.md | 2 +- tools/codemods/package.json | 4 +- .../src/utils/jsx/getJSXAttributes.ts | 4 +- .../replaceJSXAttributes.ts | 4 +- tools/create/package.json | 4 +- tools/create/src/index.ts | 1 - tools/create/src/legacy-create.ts | 10 +- .../src/templates/component/package.json.ts | 4 +- .../src/templates/component/readme.md.ts | 6 + tools/install/package.json | 7 +- tools/install/src/index.ts | 2 +- tools/link/bin/link.sh | 12 +- tools/link/bin/unlink.sh | 8 +- tools/link/package.json | 7 +- tools/link/src/unlink.ts | 8 +- tools/link/src/utils/createLinkFrom.ts | 4 +- tools/link/src/utils/install.spec.ts | 4 +- tools/link/src/utils/linkPackageTo.ts | 4 +- tools/link/tsconfig.json | 4 + .../config/npmpackagejsonlintrc.config.js | 1 - tools/lint/package.json | 2 +- tools/lint/src/eslint.ts | 69 +- tools/lint/src/index.ts | 10 +- tools/lint/src/lint.types.ts | 10 +- tools/lint/src/npmPkgJsonLint.ts | 12 +- tools/lint/tsconfig.json | 2 +- tools/meta/package.json | 2 +- tools/meta/src/getAllPackages.ts | 2 +- tools/meta/src/getPackageManager.spec.ts | 4 +- tools/meta/src/getPackageManager.ts | 2 +- tools/meta/tsconfig.json | 4 + tools/slackbot/package.json | 7 +- tools/slackbot/tsconfig.json | 1 + tools/storybook-addon/package.json | 44 +- tools/storybook-addon/src/index.ts | 1 - tools/storybook-addon/src/main/index.ts | 41 +- tools/storybook-addon/tsconfig.json | 3 +- tools/storybook-decorators/package.json | 14 +- .../src/decorators/ReactStrictMode.tsx | 1 - tools/storybook-decorators/tsconfig.json | 1 + tools/storybook-utils/package.json | 2 + tools/test-harnesses/tsconfig.json | 3 +- tools/test/.npmrc | 1 + tools/test/package.json | 8 +- tools/test/scripts/install-react17.ts | 2 +- tools/test/scripts/tsconfig.json | 2 +- tools/test/src/index.ts | 4 +- tools/update/package.json | 4 +- tools/update/src/index.ts | 1 - tools/update/src/update.spec.ts | 9 +- tools/update/tsconfig.json | 4 +- tools/validate/package.json | 7 +- .../src/dependencies/fixDependencyIssues.ts | 7 +- .../src/dependencies/logDependencyIssues.ts | 2 +- yarn.lock | 17332 ------------- 224 files changed, 22677 insertions(+), 18488 deletions(-) create mode 100644 .npmrc create mode 100644 pnpm-lock.yaml create mode 100644 pnpm-workspace.yaml create mode 100644 tools/test/.npmrc delete mode 100644 yarn.lock diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 09f866b1ce..a901ae3461 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -10,7 +10,7 @@ - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have added necessary documentation (if appropriate) -- [ ] I have run `yarn changeset` and documented my changes +- [ ] I have run `pnpm changeset` and documented my changes ### For new components diff --git a/.github/workflows/clean.yml b/.github/workflows/clean.yml index 5fb264b269..676c00db91 100644 --- a/.github/workflows/clean.yml +++ b/.github/workflows/clean.yml @@ -11,7 +11,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 + + - name: pnpm + uses: pnpm/action-setup@v4 + with: + version: 9.15.0 - name: Cleanup run: | diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index b85b2b3c9d..dffe7fd737 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -14,62 +14,74 @@ jobs: name: Build packages runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: actions/cache@v3 + - name: pnpm + uses: pnpm/action-setup@v4 + with: + version: 9.15.0 + + - uses: actions/cache@v4 name: Check for build cache id: build-cache with: path: | **/dist - !**/node_modules - key: ${{ runner.os }}-build-cache-${{ hashFiles('package.json', 'yarn.lock', '**/src/', '!**/node_modules', '!**/dist') }} + .pnpm-store + key: ${{ runner.os }}-build-cache-${{ hashFiles('pnpm-lock.yaml', '**/src/**/*', 'package.json') }} + restore-keys: | + ${{ runner.os }}-build-cache- # Only setup & build if there was no build cache hit - name: Use Node 18 - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 if: ${{ steps.build-cache.outputs.cache-hit != 'true' }} with: - node-version: '18' - cache: yarn - cache-dependency-path: 'yarn.lock' + node-version: 18.12.0 + cache: 'pnpm' + cache-dependency-path: 'pnpm-lock.yaml' - name: Install if: ${{ steps.build-cache.outputs.cache-hit != 'true' }} - run: yarn install --frozen-lockfile --prefer-offline + run: pnpm install --frozen-lockfile --prefer-offline - name: Build if: ${{ steps.build-cache.outputs.cache-hit != 'true' }} - run: yarn build + run: pnpm build lint: name: Check lints runs-on: ubuntu-latest needs: [build] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + + - name: pnpm + uses: pnpm/action-setup@v4 + with: + version: 9.15.0 - name: Use Node 18 - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: '18' - cache: yarn - cache-dependency-path: 'yarn.lock' + node-version: 18.12.0 + cache: 'pnpm' + cache-dependency-path: 'pnpm-lock.yaml' - - uses: actions/cache/restore@v3 + - uses: actions/cache/restore@v4 name: Restore build cache id: build-cache with: path: | **/dist !**/node_modules - key: ${{ runner.os }}-build-cache-${{ hashFiles('package.json', 'yarn.lock', '**/src/', '!**/node_modules', '!**/dist') }} + key: ${{ runner.os }}-build-cache-${{ hashFiles('package.json', 'pnpm-lock.yaml', '**/src/', '!**/node_modules', '!**/dist') }} - name: Install Dependencies - run: yarn install --frozen-lockfile --prefer-offline + run: pnpm install --frozen-lockfile --prefer-offline - name: lint - run: yarn lint + run: pnpm lint chromatic: name: Chromatic @@ -77,28 +89,33 @@ jobs: needs: [build] steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 + - name: pnpm + uses: pnpm/action-setup@v4 + with: + version: 9.15.0 + - name: Use Node 18 - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: '18' - cache: yarn - cache-dependency-path: 'yarn.lock' + node-version: 18.12.0 + cache: 'pnpm' + cache-dependency-path: 'pnpm-lock.yaml' - name: Install Dependencies - run: yarn install --frozen-lockfile --prefer-offline + run: pnpm install --frozen-lockfile --prefer-offline - - uses: actions/cache/restore@v3 + - uses: actions/cache/restore@v4 name: Restore build cache id: build-cache with: path: | **/dist !**/node_modules - key: ${{ runner.os }}-build-cache-${{ hashFiles('package.json', 'yarn.lock', '**/src/', '!**/node_modules', '!**/dist') }} + key: ${{ runner.os }}-build-cache-${{ hashFiles('package.json', 'pnpm-lock.yaml', '**/src/', '!**/node_modules', '!**/dist') }} - name: Publish to Chromatic env: @@ -116,29 +133,34 @@ jobs: runs-on: ubuntu-latest needs: [build] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + + - name: pnpm + uses: pnpm/action-setup@v4 + with: + version: 9.15.0 - name: Use Node 18 - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: '18' - cache: yarn - cache-dependency-path: 'yarn.lock' + node-version: 18.12.0 + cache: 'pnpm' + cache-dependency-path: 'pnpm-lock.yaml' - name: Install Dependencies - run: yarn install --frozen-lockfile --prefer-offline + run: pnpm install --frozen-lockfile --prefer-offline - - uses: actions/cache/restore@v3 + - uses: actions/cache/restore@v4 name: Restore build cache id: build-cache with: path: | **/dist !**/node_modules - key: ${{ runner.os }}-build-cache-${{ hashFiles('package.json', 'yarn.lock', '**/src/', '!**/node_modules', '!**/dist') }} + key: ${{ runner.os }}-build-cache-${{ hashFiles('package.json', 'pnpm-lock.yaml', '**/src/', '!**/node_modules', '!**/dist') }} - name: tests - run: yarn test --ci + run: pnpm run test --ci env: JEST_JUNIT_OUTPUT: 'reports/junit/js-test-results.xml' @@ -147,26 +169,31 @@ jobs: runs-on: ubuntu-latest needs: [build] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + + - name: pnpm + uses: pnpm/action-setup@v4 + with: + version: 9.15.0 - name: Use Node 18 - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: '18' - cache: yarn - cache-dependency-path: 'yarn.lock' + node-version: 18.12.0 + cache: 'pnpm' + cache-dependency-path: 'pnpm-lock.yaml' - name: Install Dependencies - run: yarn install --frozen-lockfile --prefer-offline + run: pnpm install --frozen-lockfile --prefer-offline - - uses: actions/cache/restore@v3 + - uses: actions/cache/restore@v4 name: Restore build cache id: build-cache with: path: | **/dist !**/node_modules - key: ${{ runner.os }}-build-cache-${{ hashFiles('package.json', 'yarn.lock', '**/src/', '!**/node_modules', '!**/dist') }} + key: ${{ runner.os }}-build-cache-${{ hashFiles('package.json', 'pnpm-lock.yaml', '**/src/', '!**/node_modules', '!**/dist') }} - name: validate - run: yarn validate + run: pnpm validate diff --git a/.github/workflows/react17.yml b/.github/workflows/react17.yml index 02d23cc8a7..671825d708 100644 --- a/.github/workflows/react17.yml +++ b/.github/workflows/react17.yml @@ -14,29 +14,34 @@ jobs: name: Test in React 17 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + + - name: pnpm + uses: pnpm/action-setup@v4 + with: + version: 9.15.0 - name: Setup Node 18 - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: '18' - cache: 'yarn' + node-version: 18.12.0 + cache: 'pnpm' - name: Install node-gyp - run: yarn global add node-gyp + run: pnpm add --global node-gyp - name: Install package.json - run: yarn install --prefer-offline + run: pnpm install --prefer-offline - name: Build CLI - run: yarn build:cli + run: pnpm build:cli # TODO: Will nohoist help here? - name: Install testing tools for React 17 run: npx ts-node tools/test/scripts/install-react17.ts - name: Build packages - run: yarn build + run: pnpm build - name: Run tests in React 17 - run: yarn lg test --react17 + run: pnpm run test --react17 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1232d5956d..259ac510fa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,13 +10,13 @@ jobs: name: Build packages runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # Needed following Github's transition from Node 16 to 20 - name: Install node-gyp - run: yarn global add node-gyp + run: pnpm add --global node-gyp - - uses: actions/cache@v3 + - uses: actions/cache@v4 name: Check for build cache id: build-cache with: @@ -25,49 +25,56 @@ jobs: !**/node_modules **/tsdoc.json **/stories.js - key: ${{ runner.os }}-build-cache-${{ hashFiles('package.json', 'yarn.lock', '**/src/', '!**/node_modules', '!**/dist') }} + key: ${{ runner.os }}-build-cache-${{ hashFiles('package.json', 'pnpm-lock.yaml', '**/src/', '!**/node_modules', '!**/dist') }} + restore-keys: | + ${{ runner.os }}-build-cache- # Only setup & build if there was no build cache hit - name: Use Node 18 - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 if: ${{ steps.build-cache.outputs.cache-hit != 'true' }} with: - node-version: '18' - cache: yarn - cache-dependency-path: 'yarn.lock' + node-version: 18.12.0 + cache: 'pnpm' + cache-dependency-path: 'pnpm-lock.yaml' - name: Install if: ${{ steps.build-cache.outputs.cache-hit != 'true' }} - run: yarn install --frozen-lockfile --prefer-offline + run: pnpm install --frozen-lockfile --prefer-offline - name: Build if: ${{ steps.build-cache.outputs.cache-hit != 'true' }} - run: yarn build + run: pnpm build - name: Generate docs if: ${{ steps.build-cache.outputs.cache-hit != 'true' }} - run: yarn turbo run docs + run: pnpm run turbo run docs chromatic: name: Establish Chromatic baseline runs-on: ubuntu-latest needs: [build] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 + - name: pnpm + uses: pnpm/action-setup@v4 + with: + version: 9.15.0 + - name: Use Node 18 - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: '18' - cache: yarn - cache-dependency-path: 'yarn.lock' + node-version: 18.12.0 + cache: 'pnpm' + cache-dependency-path: 'pnpm-lock.yaml' - name: Install Dependencies - run: yarn install --frozen-lockfile --prefer-offline + run: pnpm install --frozen-lockfile --prefer-offline - - uses: actions/cache/restore@v3 + - uses: actions/cache/restore@v4 name: Restore build cache id: build-cache with: @@ -76,7 +83,7 @@ jobs: !**/node_modules **/tsdoc.json **/stories.js - key: ${{ runner.os }}-build-cache-${{ hashFiles('package.json', 'yarn.lock', '**/src/', '!**/node_modules', '!**/dist') }} + key: ${{ runner.os }}-build-cache-${{ hashFiles('package.json', 'pnpm-lock.yaml', '**/src/', '!**/node_modules', '!**/dist') }} - name: Publish to Chromatic uses: chromaui/action@v1 @@ -95,19 +102,24 @@ jobs: published: ${{ steps.changesets.outputs.published }} publishedPackages: ${{ steps.changesets.outputs.publishedPackages }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + + - name: pnpm + uses: pnpm/action-setup@v4 + with: + version: 9.15.0 - name: Use Node 18 - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: '18' - cache: yarn - cache-dependency-path: 'yarn.lock' + node-version: 18.12.0 + cache: 'pnpm' + cache-dependency-path: 'pnpm-lock.yaml' - name: Install Dependencies - run: yarn install --frozen-lockfile --prefer-offline + run: pnpm install --frozen-lockfile --prefer-offline - - uses: actions/cache/restore@v3 + - uses: actions/cache/restore@v4 name: Restore build cache id: build-cache with: @@ -116,14 +128,14 @@ jobs: !**/node_modules **/tsdoc.json **/stories.js - key: ${{ runner.os }}-build-cache-${{ hashFiles('package.json', 'yarn.lock', '**/src/', '!**/node_modules', '!**/dist') }} + key: ${{ runner.os }}-build-cache-${{ hashFiles('package.json', 'pnpm-lock.yaml', '**/src/', '!**/node_modules', '!**/dist') }} - name: Version packages id: changesets uses: changesets/action@v1 with: - version: yarn changeset version - publish: yarn run publish + version: pnpm changeset version + publish: pnpm run publish env: GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' NPM_TOKEN: '${{ secrets.NPM_TOKEN }}' @@ -134,16 +146,21 @@ jobs: needs: [release] if: ${{ needs.release.outputs.published == 'true' }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + + - name: pnpm + uses: pnpm/action-setup@v4 + with: + version: 9.15.0 # Needed following Github's transition from Node 16 to 20 - name: Install node-gyp - run: yarn global add node-gyp + run: pnpm global add node-gyp - name: Install - run: yarn install --frozen-lockfile --prefer-offline + run: pnpm install --frozen-lockfile --prefer-offline - - uses: actions/cache/restore@v3 + - uses: actions/cache/restore@v4 name: Restore build cache id: build-cache with: @@ -152,11 +169,11 @@ jobs: !**/node_modules **/tsdoc.json **/stories.js - key: ${{ runner.os }}-build-cache-${{ hashFiles('package.json', 'yarn.lock', '**/src/', '!**/node_modules', '!**/dist') }} + key: ${{ runner.os }}-build-cache-${{ hashFiles('package.json', 'pnpm-lock.yaml', '**/src/', '!**/node_modules', '!**/dist') }} - name: Notify Slack channel of new releases id: slackbot - run: yarn slackbot '${{ needs.release.outputs.publishedPackages }}' + run: pnpm slackbot '${{ needs.release.outputs.publishedPackages }}' env: SLACK_BOT_TOKEN: '${{ secrets.SLACK_BOT_TOKEN }}' dispatch-to-website: @@ -165,7 +182,12 @@ jobs: needs: [release] if: ${{ needs.release.outputs.published == 'true' }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + + - name: pnpm + uses: pnpm/action-setup@v4 + with: + version: 9.15.0 - name: Dispatch to Website repo uses: peter-evans/repository-dispatch@v2 diff --git a/.github/workflows/sizeDiff.yml b/.github/workflows/sizeDiff.yml index 73e9bff29e..a4ecdb57db 100644 --- a/.github/workflows/sizeDiff.yml +++ b/.github/workflows/sizeDiff.yml @@ -9,12 +9,17 @@ jobs: name: Check file size runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + + - name: pnpm + uses: pnpm/action-setup@v4 + with: + version: 9.15.0 - name: Use Node.js 18 - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: '18' + node-version: 18.12.0 - uses: preactjs/compressed-size-action@v2 with: diff --git a/.gitignore b/.gitignore index b076c1d5d6..b6db7272eb 100644 --- a/.gitignore +++ b/.gitignore @@ -23,9 +23,6 @@ reports ehthumbs.db Thumbs.db -# Yarn Error Log -yarn-error.log - # TypeScript type-checking artifact tsconfig.tsbuildinfo ts-trace/ @@ -43,9 +40,6 @@ parsed-docs.json # Compiled story files **/stories.js* -# Local yarn releases -.yarn - # Storybook/Chromatic logs build-storybook.log doctor-storybook.log @@ -54,7 +48,6 @@ doctor-storybook.log scripts/tmp.* # -.npmrc .changeset/pre.json TODO.md diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000000..5ef394cf8d --- /dev/null +++ b/.npmrc @@ -0,0 +1,11 @@ +enable-pre-post-scripts=true +public-hoist-pattern[]=@types/* +public-hoist-pattern[]=@testing-library/* +public-hoist-pattern[]=*jest* +public-hoist-pattern[]=react +public-hoist-pattern[]=react-dom +public-hoist-pattern[]=@storybook/react +public-hoist-pattern[]=@lg-tools/build +public-hoist-pattern[]=@lg-tools/storybook-addon +public-hoist-pattern[]=@lg-tools/storybook-utils +public-hoist-pattern[]=@leafygreen-ui/testing-lib \ No newline at end of file diff --git a/charts/core/package.json b/charts/core/package.json index a4f3e0260c..392aece63c 100644 --- a/charts/core/package.json +++ b/charts/core/package.json @@ -15,15 +15,14 @@ "access": "public" }, "dependencies": { - "@leafygreen-ui/emotion": "^4.0.7", - "@leafygreen-ui/hooks": "^8.3.0", - "@leafygreen-ui/icon": "^12.8.0", - "@leafygreen-ui/icon-button": "^15.0.23", - "@leafygreen-ui/lib": "13.8.2", - "@leafygreen-ui/palette": "^4.1.1", - "@leafygreen-ui/tokens": "^2.11.0", - "@leafygreen-ui/typography": "^19.3.0", - "@lg-tools/storybook-utils": "^0.1.1", + "@leafygreen-ui/emotion": "workspace:^", + "@leafygreen-ui/hooks": "workspace:^", + "@leafygreen-ui/icon": "workspace:^12.8.0", + "@leafygreen-ui/icon-button": "workspace:^15.0.23", + "@leafygreen-ui/lib": "workspace:^", + "@leafygreen-ui/palette": "workspace:^", + "@leafygreen-ui/tokens": "workspace:^", + "@leafygreen-ui/typography": "workspace:^19.3.0", "echarts": "^5.5.1", "lodash.debounce": "^4.0.8" }, @@ -32,7 +31,7 @@ }, "devDependencies": { "@faker-js/faker": "8.0.2", - "@leafygreen-ui/combobox": "^10.0.0", + "@leafygreen-ui/combobox": "workspace:^10.0.0", "@types/lodash.debounce": "^4.0.9" }, "repository": { diff --git a/chat/avatar/package.json b/chat/avatar/package.json index 80d02cb339..5597ff0f68 100644 --- a/chat/avatar/package.json +++ b/chat/avatar/package.json @@ -21,17 +21,15 @@ "access": "public" }, "dependencies": { - "@leafygreen-ui/avatar": "^1.0.0", - "@leafygreen-ui/emotion": "^4.0.8", - "@leafygreen-ui/lib": "^13.3.0", - "@leafygreen-ui/palette": "^4.0.9", - "@leafygreen-ui/tokens": "^2.7.0" + "@leafygreen-ui/avatar": "workspace:^1.0.0", + "@leafygreen-ui/emotion": "workspace:^", + "@leafygreen-ui/lib": "workspace:^", + "@leafygreen-ui/palette": "workspace:^", + "@leafygreen-ui/tokens": "workspace:^" }, "peerDependencies": { "@leafygreen-ui/leafygreen-provider": "^3.1.12", "@lg-chat/leafygreen-chat-provider": "^2.0.0" }, - "devDependencies": { - "@lg-tools/storybook-utils": "^0.1.0" - } + "devDependencies": {} } diff --git a/chat/chat-disclaimer/package.json b/chat/chat-disclaimer/package.json index 1325c501df..ede1737088 100644 --- a/chat/chat-disclaimer/package.json +++ b/chat/chat-disclaimer/package.json @@ -15,16 +15,15 @@ "access": "public" }, "dependencies": { - "@leafygreen-ui/emotion": "^4.0.8", - "@leafygreen-ui/lib": "^13.3.0", - "@leafygreen-ui/marketing-modal": "^4.2.3", - "@leafygreen-ui/tokens": "^2.5.2", - "@leafygreen-ui/typography": "^19.0.0" + "@leafygreen-ui/emotion": "workspace:^", + "@leafygreen-ui/lib": "workspace:^", + "@leafygreen-ui/marketing-modal": "workspace:^4.2.3", + "@leafygreen-ui/tokens": "workspace:^", + "@leafygreen-ui/typography": "workspace:^19.0.0" }, "devDependencies": { - "@leafygreen-ui/button": "^21.2.0", - "@leafygreen-ui/modal": "^16.0.7", - "@lg-tools/storybook-utils": "^0.1.1" + "@leafygreen-ui/button": "workspace:^21.2.0", + "@leafygreen-ui/modal": "workspace:^16.0.7" }, "homepage": "https://github.com/mongodb/leafygreen-ui/tree/main/packages/chat-disclaimer", "repository": { diff --git a/chat/chat-window/package.json b/chat/chat-window/package.json index 81ef498aa5..d3d8d3a472 100644 --- a/chat/chat-window/package.json +++ b/chat/chat-window/package.json @@ -21,22 +21,21 @@ "access": "public" }, "dependencies": { - "@leafygreen-ui/emotion": "^4.0.8", - "@leafygreen-ui/lib": "^13.6.1", - "@leafygreen-ui/palette": "^4.0.9", - "@leafygreen-ui/tokens": "^2.5.2", - "@lg-chat/avatar": "^3.0.1", - "@lg-chat/leafygreen-chat-provider": "^2.0.0", - "@lg-chat/title-bar": "^2.0.1", + "@leafygreen-ui/emotion": "workspace:^", + "@leafygreen-ui/lib": "workspace:^", + "@leafygreen-ui/palette": "workspace:^", + "@leafygreen-ui/tokens": "workspace:^", + "@lg-chat/avatar": "workspace:^3.0.1", + "@lg-chat/leafygreen-chat-provider": "workspace:^2.0.0", + "@lg-chat/title-bar": "workspace:^2.0.1", "react-keyed-flatten-children": "^2.2.1" }, "devDependencies": { - "@lg-chat/input-bar": "^5.0.0", - "@lg-chat/message": "^4.0.1", - "@lg-chat/message-feed": "^3.0.1", - "@lg-chat/message-prompts": "^2.0.1", - "@lg-chat/message-feedback": "^2.0.1", - "@lg-tools/storybook-utils": "^0.1.0" + "@lg-chat/input-bar": "workspace:^6.0.0", + "@lg-chat/message": "workspace:^4.0.1", + "@lg-chat/message-feed": "workspace:^3.0.1", + "@lg-chat/message-prompts": "workspace:^2.0.1", + "@lg-chat/message-feedback": "workspace:^2.0.1" }, "peerDependencies": { "@leafygreen-ui/leafygreen-provider": "^3.1.12" diff --git a/chat/fixed-chat-window/package.json b/chat/fixed-chat-window/package.json index c44beec335..d04881eca8 100644 --- a/chat/fixed-chat-window/package.json +++ b/chat/fixed-chat-window/package.json @@ -15,26 +15,24 @@ "access": "public" }, "dependencies": { - "@leafygreen-ui/emotion": "^4.0.8", - "@leafygreen-ui/icon": "^12.6.0", - "@leafygreen-ui/leafygreen-provider": "^3.1.12", - "@leafygreen-ui/lib": "^13.6.1", - "@leafygreen-ui/palette": "^4.0.9", + "@leafygreen-ui/emotion": "workspace:^", + "@leafygreen-ui/icon": "workspace:^12.6.0", + "@leafygreen-ui/lib": "workspace:^", + "@leafygreen-ui/palette": "workspace:^", "@leafygreen-ui/popover": "^11.3.1", - "@leafygreen-ui/tokens": "^2.5.2", - "@leafygreen-ui/typography": "^19.3.0", - "@lg-chat/chat-window": "^2.0.1", - "@lg-chat/title-bar": "^2.0.2", + "@leafygreen-ui/tokens": "workspace:^", + "@leafygreen-ui/typography": "workspace:^", + "@lg-chat/chat-window": "workspace:^2.0.1", + "@lg-chat/title-bar": "workspace:^2.0.2", "react-transition-group": "^4.4.5" }, "devDependencies": { - "@lg-chat/avatar": "^3.0.1", - "@lg-chat/input-bar": "^5.0.0", - "@lg-chat/message": "^4.1.1", - "@lg-chat/message-feed": "^3.0.1", - "@lg-chat/message-prompts": "^2.0.2", - "@lg-chat/message-feedback": "^2.1.0", - "@lg-tools/storybook-utils": "^0.1.1" + "@lg-chat/avatar": "workspace:^3.0.1", + "@lg-chat/input-bar": "workspace:^6.0.0", + "@lg-chat/message": "workspace:^4.1.1", + "@lg-chat/message-feed": "workspace:^3.0.1", + "@lg-chat/message-prompts": "workspace:^2.0.2", + "@lg-chat/message-feedback": "workspace:^2.1.0" }, "peerDependencies": { "@leafygreen-ui/leafygreen-provider": "^3.1.12" diff --git a/chat/input-bar/package.json b/chat/input-bar/package.json index 163087da27..d72d14f20c 100644 --- a/chat/input-bar/package.json +++ b/chat/input-bar/package.json @@ -21,19 +21,19 @@ "access": "public" }, "dependencies": { - "@leafygreen-ui/badge": "^8.1.2", - "@leafygreen-ui/button": "^21.2.0", - "@leafygreen-ui/emotion": "^4.0.8", - "@leafygreen-ui/hooks": "^8.3.0", - "@leafygreen-ui/icon": "^12.5.4", - "@leafygreen-ui/input-option": "^2.0.0", - "@leafygreen-ui/lib": "^13.8.1", - "@leafygreen-ui/palette": "^4.0.10", - "@leafygreen-ui/polymorphic": "^2.0.0", - "@leafygreen-ui/popover": "^12.0.0", - "@leafygreen-ui/search-input": "^4.0.0", - "@leafygreen-ui/tokens": "^2.9.0", - "@leafygreen-ui/typography": "^19.2.1", + "@leafygreen-ui/badge": "workspace:^8.1.2", + "@leafygreen-ui/button": "workspace:^21.2.0", + "@leafygreen-ui/emotion": "workspace:^", + "@leafygreen-ui/hooks": "workspace:^", + "@leafygreen-ui/icon": "workspace:^12.5.4", + "@leafygreen-ui/input-option": "workspace:^2.0.0", + "@leafygreen-ui/lib": "workspace:^", + "@leafygreen-ui/palette": "workspace:^", + "@leafygreen-ui/polymorphic": "workspace:^2.0.0", + "@leafygreen-ui/popover": "workspace:^12.0.0", + "@leafygreen-ui/search-input": "workspace:^4.0.0", + "@leafygreen-ui/tokens": "workspace:^", + "@leafygreen-ui/typography": "workspace:^", "lodash": "^4.17.21", "react-keyed-flatten-children": "^1.3.0", "react-textarea-autosize": "^8.3.2" @@ -42,7 +42,5 @@ "@leafygreen-ui/leafygreen-provider": "^3.2.0", "@lg-chat/leafygreen-chat-provider": "^2.0.0" }, - "devDependencies": { - "@lg-tools/storybook-utils": "^0.1.1" - } + "devDependencies": {} } diff --git a/chat/input-bar/src/utils/setReactTextAreaValue.ts b/chat/input-bar/src/utils/setReactTextAreaValue.ts index 1471f16802..b56488ab6a 100644 --- a/chat/input-bar/src/utils/setReactTextAreaValue.ts +++ b/chat/input-bar/src/utils/setReactTextAreaValue.ts @@ -13,7 +13,6 @@ export function setReactTextAreaValue( ) { const previousValue = input.value; - // eslint-disable-next-line no-param-reassign input.value = value; // @ts-ignore custom field diff --git a/chat/lg-markdown/package.json b/chat/lg-markdown/package.json index 84a7b9b008..e1316ccdb1 100644 --- a/chat/lg-markdown/package.json +++ b/chat/lg-markdown/package.json @@ -22,16 +22,14 @@ }, "dependencies": { "@leafygreen-ui/code": "^14.3.2", - "@leafygreen-ui/emotion": "^4.0.8", - "@leafygreen-ui/lib": "^13.3.0", - "@leafygreen-ui/tokens": "^2.5.2", - "@leafygreen-ui/typography": "^19.0.0", + "@leafygreen-ui/emotion": "workspace:^", + "@leafygreen-ui/lib": "workspace:^", + "@leafygreen-ui/tokens": "workspace:^", + "@leafygreen-ui/typography": "workspace:^19.0.0", "react-markdown": "^8.0.7" }, "peerDependencies": { "@leafygreen-ui/leafygreen-provider": "^3.1.12" }, - "devDependencies": { - "@lg-tools/storybook-utils": "^0.1.1" - } + "devDependencies": {} } diff --git a/chat/lg-markdown/src/LGMarkdown/componentsMap.tsx b/chat/lg-markdown/src/LGMarkdown/componentsMap.tsx index faab649e2d..c91022130d 100644 --- a/chat/lg-markdown/src/LGMarkdown/componentsMap.tsx +++ b/chat/lg-markdown/src/LGMarkdown/componentsMap.tsx @@ -1,4 +1,3 @@ -/* eslint-disable react/display-name */ import React from 'react'; import Code, { Language } from '@leafygreen-ui/code'; diff --git a/chat/message-feed/package.json b/chat/message-feed/package.json index 239568bcfe..a3225fb21c 100644 --- a/chat/message-feed/package.json +++ b/chat/message-feed/package.json @@ -21,19 +21,19 @@ "access": "public" }, "dependencies": { - "@leafygreen-ui/emotion": "^4.0.8", - "@leafygreen-ui/lib": "^13.3.0", - "@leafygreen-ui/palette": "^4.0.9", - "@leafygreen-ui/tokens": "^2.5.2", - "@lg-chat/avatar": "^3.0.1", - "@lg-chat/message": "^4.1.1", - "@lg-chat/message-rating": "^2.0.2" + "@leafygreen-ui/emotion": "workspace:^", + "@leafygreen-ui/lib": "workspace:^", + "@leafygreen-ui/palette": "workspace:^", + "@leafygreen-ui/tokens": "workspace:^", + "@lg-chat/avatar": "workspace:^3.0.1", + "@lg-chat/message": "workspace:^4.1.1", + "@lg-chat/message-rating": "workspace:^2.0.2", + "react-keyed-flatten-children": "^2.2.1" }, "devDependencies": { - "@leafygreen-ui/typography": "^19.0.0", - "@lg-chat/chat-disclaimer": "^3.0.2", - "@lg-chat/message-prompts": "^2.0.2", - "@lg-tools/storybook-utils": "^0.1.1" + "@leafygreen-ui/typography": "workspace:^19.0.0", + "@lg-chat/chat-disclaimer": "workspace:^3.0.2", + "@lg-chat/message-prompts": "workspace:^2.0.2" }, "peerDependencies": { "@leafygreen-ui/leafygreen-provider": "^3.1.12", diff --git a/chat/message-feed/src/MessageFeed.stories.tsx b/chat/message-feed/src/MessageFeed.stories.tsx index 5c77df277c..a103a52396 100644 --- a/chat/message-feed/src/MessageFeed.stories.tsx +++ b/chat/message-feed/src/MessageFeed.stories.tsx @@ -3,10 +3,14 @@ import { Avatar } from '@lg-chat/avatar'; import { DisclaimerText } from '@lg-chat/chat-disclaimer'; import { LeafyGreenChatProvider } from '@lg-chat/leafygreen-chat-provider'; import { Message } from '@lg-chat/message'; -import { WithMessageRating as MessageFeedbackStory } from '@lg-chat/message-feedback/src/InlineMessageFeedback/InlineMessageFeedback.stories'; +// TODO: fix this story after PNPM migration +// import { WithMessageRating as MessageFeedbackStory } from '@lg-chat/message-feedback/src/InlineMessageFeedback/InlineMessageFeedback.stories'; import { MessagePrompt, MessagePrompts } from '@lg-chat/message-prompts'; -import { storybookArgTypes, StoryMetaType } from '@lg-tools/storybook-utils'; -import { StoryFn } from '@storybook/react'; +import { + storybookArgTypes, + StoryMetaType, + StoryType, +} from '@lg-tools/storybook-utils'; import { Link } from '@leafygreen-ui/typography'; @@ -52,12 +56,12 @@ const MyMessage = ({ )} {/* @ts-ignore onChange is passed in the story itself */} - {hasMessageRating && } + {/* {hasMessageRating && } */} ); }; -const Template: StoryFn = ({ +const Template: StoryType = ({ children, darkMode, ...rest @@ -79,9 +83,9 @@ const Template: StoryFn = ({ ); -export const Basic: StoryFn = Template.bind({}); +export const Basic: StoryType = Template.bind({}); -export const OneMessage: StoryFn = ({ +export const OneMessage: StoryType = ({ darkMode, ...rest }) => { @@ -99,7 +103,7 @@ export const OneMessage: StoryFn = ({ ); }; -export const ChangingMessages: StoryFn = ({ +export const ChangingMessages: StoryType = ({ darkMode, ...rest }) => { diff --git a/chat/message-feedback/package.json b/chat/message-feedback/package.json index 98c4033383..7fdfac7e30 100644 --- a/chat/message-feedback/package.json +++ b/chat/message-feedback/package.json @@ -22,21 +22,20 @@ "access": "public" }, "dependencies": { - "@leafygreen-ui/button": "^21.2.0", - "@leafygreen-ui/emotion": "^4.0.8", - "@leafygreen-ui/hooks": "^8.1.3", - "@leafygreen-ui/icon": "^12.0.1", - "@leafygreen-ui/icon-button": "^15.0.21", - "@leafygreen-ui/lib": "^13.3.0", - "@leafygreen-ui/palette": "^4.0.9", + "@leafygreen-ui/button": "workspace:^21.2.0", + "@leafygreen-ui/emotion": "workspace:^", + "@leafygreen-ui/hooks": "workspace:^", + "@leafygreen-ui/icon": "workspace:^12.0.1", + "@leafygreen-ui/icon-button": "workspace:^15.0.21", + "@leafygreen-ui/lib": "workspace:^", + "@leafygreen-ui/palette": "workspace:^", "@leafygreen-ui/popover": "^11.3.1", - "@leafygreen-ui/text-area": "^9.0.0", - "@leafygreen-ui/tokens": "^2.5.2", - "@leafygreen-ui/typography": "^19.0.0" + "@leafygreen-ui/text-area": "workspace:^9.0.0", + "@leafygreen-ui/tokens": "workspace:^", + "@leafygreen-ui/typography": "workspace:^" }, "devDependencies": { - "@lg-chat/message-rating": "^2.0.2", - "@lg-tools/storybook-utils": "^0.1.1" + "@lg-chat/message-rating": "workspace:^2.0.2" }, "peerDependencies": { "@leafygreen-ui/leafygreen-provider": "^3.1.12" diff --git a/chat/message-feedback/src/PopoverMessageFeedback/PopoverMessageFeedback.stories.tsx b/chat/message-feedback/src/PopoverMessageFeedback/PopoverMessageFeedback.stories.tsx index d939f67aec..70a9db52f9 100644 --- a/chat/message-feedback/src/PopoverMessageFeedback/PopoverMessageFeedback.stories.tsx +++ b/chat/message-feedback/src/PopoverMessageFeedback/PopoverMessageFeedback.stories.tsx @@ -1,7 +1,6 @@ import React, { ChangeEventHandler, useRef, useState } from 'react'; import { MessageRating, MessageRatingValue } from '@lg-chat/message-rating'; -import { storybookArgTypes } from '@lg-tools/storybook-utils'; -import { StoryFn } from '@storybook/react'; +import { storybookArgTypes, StoryType } from '@lg-tools/storybook-utils'; import { PopoverMessageFeedback } from '.'; @@ -19,7 +18,7 @@ export default { }, }; -const Template: StoryFn = args => { +const Template: StoryType = args => { const triggerRef = useRef(null); const [isActive, setIsActive] = useState(false); const closePopover = () => setIsActive(false); diff --git a/chat/message-prompts/package.json b/chat/message-prompts/package.json index b4d3ce963f..544f23433f 100644 --- a/chat/message-prompts/package.json +++ b/chat/message-prompts/package.json @@ -15,11 +15,11 @@ "access": "public" }, "dependencies": { - "@leafygreen-ui/emotion": "^4.0.8", - "@leafygreen-ui/lib": "^13.3.0", - "@leafygreen-ui/palette": "^4.0.9", - "@leafygreen-ui/tokens": "^2.5.2", - "@leafygreen-ui/typography": "^19.0.0" + "@leafygreen-ui/emotion": "workspace:^", + "@leafygreen-ui/lib": "workspace:^", + "@leafygreen-ui/palette": "workspace:^", + "@leafygreen-ui/tokens": "workspace:^", + "@leafygreen-ui/typography": "workspace:^19.0.0" }, "peerDependencies": { "@leafygreen-ui/leafygreen-provider": "^3.1.12" @@ -32,7 +32,5 @@ "bugs": { "url": "https://jira.mongodb.org/projects/PD/summary" }, - "devDependencies": { - "@lg-tools/storybook-utils": "^0.1.1" - } + "devDependencies": {} } diff --git a/chat/message-rating/package.json b/chat/message-rating/package.json index 5835f46ea8..7acfcd706f 100644 --- a/chat/message-rating/package.json +++ b/chat/message-rating/package.json @@ -21,18 +21,16 @@ "access": "public" }, "dependencies": { - "@leafygreen-ui/emotion": "^4.0.8", - "@leafygreen-ui/hooks": "^8.1.3", - "@leafygreen-ui/icon": "^12.0.1", - "@leafygreen-ui/lib": "^13.3.0", - "@leafygreen-ui/palette": "^4.0.9", - "@leafygreen-ui/tokens": "^2.5.2", - "@leafygreen-ui/typography": "^19.0.0" + "@leafygreen-ui/emotion": "workspace:^", + "@leafygreen-ui/hooks": "workspace:^", + "@leafygreen-ui/icon": "workspace:^12.0.1", + "@leafygreen-ui/lib": "workspace:^", + "@leafygreen-ui/palette": "workspace:^", + "@leafygreen-ui/tokens": "workspace:^", + "@leafygreen-ui/typography": "workspace:^19.0.0" }, "peerDependencies": { "@leafygreen-ui/leafygreen-provider": "^3.1.12" }, - "devDependencies": { - "@lg-tools/storybook-utils": "^0.1.1" - } + "devDependencies": {} } diff --git a/chat/message/package.json b/chat/message/package.json index 20c647f911..ea50a6ab98 100644 --- a/chat/message/package.json +++ b/chat/message/package.json @@ -21,20 +21,19 @@ "access": "public" }, "dependencies": { - "@leafygreen-ui/banner": "^8.0.1", - "@leafygreen-ui/emotion": "^4.0.8", - "@leafygreen-ui/lib": "^13.6.0", - "@leafygreen-ui/palette": "^4.0.9", - "@leafygreen-ui/polymorphic": "^2.0.0", - "@leafygreen-ui/tokens": "^2.11.0", - "@leafygreen-ui/typography": "^19.2.0", - "@lg-chat/lg-markdown": "^2.0.2", - "@lg-chat/rich-links": "^1.2.0" + "@leafygreen-ui/banner": "workspace:^8.0.1", + "@leafygreen-ui/emotion": "workspace:^", + "@leafygreen-ui/lib": "workspace:^", + "@leafygreen-ui/palette": "workspace:^", + "@leafygreen-ui/polymorphic": "workspace:^2.0.0", + "@leafygreen-ui/tokens": "workspace:^", + "@leafygreen-ui/typography": "workspace:^19.2.0", + "@lg-chat/lg-markdown": "workspace:^2.0.2", + "@lg-chat/rich-links": "workspace:^1.2.0" }, "devDependencies": { - "@lg-chat/avatar": "^3.1.0", - "@lg-chat/message-feedback": "^2.1.0", - "@lg-tools/storybook-utils": "^0.1.1" + "@lg-chat/avatar": "workspace:^3.1.0", + "@lg-chat/message-feedback": "workspace:^2.1.0" }, "peerDependencies": { "@leafygreen-ui/leafygreen-provider": "^3.1.12", diff --git a/chat/rich-links/package.json b/chat/rich-links/package.json index 3c8c5ed727..265b6fd9ce 100644 --- a/chat/rich-links/package.json +++ b/chat/rich-links/package.json @@ -15,15 +15,15 @@ "access": "public" }, "dependencies": { - "@leafygreen-ui/card": "^11.0.0", - "@leafygreen-ui/emotion": "^4.0.7", - "@leafygreen-ui/icon": "^12.6.0", - "@leafygreen-ui/leafygreen-provider": "^3.1.12", - "@leafygreen-ui/lib": "^12.0.0", - "@leafygreen-ui/palette": "^4.1.0", - "@leafygreen-ui/polymorphic": "^2.0.2", - "@leafygreen-ui/tokens": "^2.11.0", - "@leafygreen-ui/typography": "^19.3.0" + "@leafygreen-ui/card": "workspace:^11.0.0", + "@leafygreen-ui/emotion": "workspace:^", + "@leafygreen-ui/icon": "workspace:^12.6.0", + "@leafygreen-ui/leafygreen-provider": "workspace:^3.1.12", + "@leafygreen-ui/lib": "workspace:^", + "@leafygreen-ui/palette": "workspace:^", + "@leafygreen-ui/polymorphic": "workspace:^2.0.2", + "@leafygreen-ui/tokens": "workspace:^", + "@leafygreen-ui/typography": "workspace:^19.3.0" }, "peerDependencies": { "@leafygreen-ui/leafygreen-provider": "^3.1.12" @@ -35,5 +35,6 @@ }, "bugs": { "url": "https://jira.mongodb.org/projects/PD/summary" - } + }, + "devDependencies": {} } diff --git a/chat/title-bar/package.json b/chat/title-bar/package.json index c23fe6cc28..706c20ec9b 100644 --- a/chat/title-bar/package.json +++ b/chat/title-bar/package.json @@ -21,20 +21,18 @@ "access": "public" }, "dependencies": { - "@leafygreen-ui/badge": "^8.1.2", - "@leafygreen-ui/emotion": "^4.0.8", - "@leafygreen-ui/icon": "^12.4.0", - "@leafygreen-ui/icon-button": "^15.0.21", - "@leafygreen-ui/lib": "^13.3.0", - "@leafygreen-ui/palette": "^4.0.9", - "@leafygreen-ui/tokens": "^2.5.2", - "@leafygreen-ui/typography": "^19.0.0", - "@lg-chat/avatar": "^3.1.0" + "@leafygreen-ui/badge": "workspace:^8.1.2", + "@leafygreen-ui/emotion": "workspace:^", + "@leafygreen-ui/icon": "workspace:^12.4.0", + "@leafygreen-ui/icon-button": "workspace:^15.0.21", + "@leafygreen-ui/lib": "workspace:^", + "@leafygreen-ui/palette": "workspace:^", + "@leafygreen-ui/tokens": "workspace:^", + "@leafygreen-ui/typography": "workspace:^19.0.0", + "@lg-chat/avatar": "workspace:^3.1.0" }, "peerDependencies": { "@leafygreen-ui/leafygreen-provider": "^3.1.12" }, - "devDependencies": { - "@lg-tools/storybook-utils": "^0.1.1" - } + "devDependencies": {} } diff --git a/package.json b/package.json index ba71d5e240..caf38bff05 100644 --- a/package.json +++ b/package.json @@ -5,66 +5,86 @@ "license": "Apache-2.0", "private": true, "engines": { - "node": ">= 18.0.0", - "npm": ">= 8.19.4" + "node": ">= 18.12.0", + "pnpm": ">= 9.15.0" }, "scripts": { - "init": "yarn && yarn build", - "init17": "yarn && yarn build:cli && npx ts-node tools/test/scripts/install-react17.ts && yarn build", + "init": "pnpm install && pnpm build", + "init17": "pnpm install && pnpm build:cli && npx ts-node tools/test/scripts/install-react17.ts && pnpm build", "create-package": "lg create", - "prebuild": "yarn build:cli", + "prebuild": "pnpm build:cli", "build": "turbo run build tsc", "build:cli": "turbo run build tsc --filter=@lg-tools/cli", "build-storybook": "npx storybook build", "build:tsc": "turbo run tsc", "chromatic": "npx chromatic", "clean": "npm-run-all --parallel clean:*", - "clean:builds": "rm -rf {packages,tools,chat,charts}/*/{dist,tsconfig.tsbuildinfo,stories.js,.turbo}", - "clean:cache": "rm -rf .turbo {cache}", - "clean:modules": "rm -rf node_modules {packages,tools,chat,charts}/*/node_modules", - "clean:ts": "rm -rf {packages,tools,chat,charts}/*/{dist/**/*.ts,dist/**/*.ts.map,tsconfig.tsbuildinfo,ts-trace,.turbo}", + "clean:builds": "pnpm recursive exec -- rm -rf ./{dist,tsconfig.tsbuildinfo,stories.js}", + "clean:modules": "pnpm recursive exec -- rm -rf node_modules; rm -rf node_modules", "fix": "lg lint --fix", "link": "lg link", "lint": "lg lint", - "prepublishOnly": "yarn build && turbo run docs", - "publish": "yarn changeset publish --public", + "prepublishOnly": "pnpm run build && turbo run docs", + "publish": "pnpm changeset publish --public", "slackbot": "lg slackbot release", "start": "npx storybook dev -p 9001 --no-version-updates", "serve": "npx http-server storybook-static -c5", "test": "lg test", "unlink": "lg unlink", "validate": "lg validate", - "watch": "npx nodemon --watch packages/ -e tsx,ts --exec 'yarn build-storybook --test'" + "watch": "npx nodemon --watch packages/ -e tsx,ts --exec 'pnpm run storybook build --test'" }, "devDependencies": { "@actions/core": "^1.10.1", "@babel/core": "7.24.3", "@changesets/cli": "^2.26.0", - "@lg-tools/cli": "*", - "@lg-tools/storybook-addon": "*", + "@leafygreen-ui/testing-lib": "workspace:^", + "@lg-tools/build": "workspace:^", + "@lg-tools/cli": "workspace:^", + "@lg-tools/lint": "workspace:^", + "@lg-tools/meta": "workspace:^", + "@lg-tools/storybook-addon": "workspace:^", + "@lg-tools/storybook-utils": "workspace:^", + "@lg-tools/test": "workspace:^", + "@storybook/react": "^7.6.20", + "@svgr/babel-plugin-replace-jsx-attribute-value": "8.0.0", + "@testing-library/react": "^12.0.0 || ^13.1.0 || ^14.0.0", + "@testing-library/react-hooks": ">=3.7.0", + "@testing-library/user-event": "13.5.0", + "@types/cross-spawn": "6.0.2", + "@types/fs-extra": "11.0.1", + "@types/jest": "^29.5.12", "@types/lodash": "^4.14.170", + "@types/node": "^20.12.5", "@types/react": "18.2.23", "@types/react-dom": "18.2.8", + "@types/react-transition-group": "^4.4.10", "chromatic": "^11.0.0", + "cross-spawn": "7.0.3", "dotenv": "^10.0.0", + "eslint": "9.16.0", + "fs-extra": "11.1.1", "gh-pages": "^3.1.0", + "node-fetch": "^3.3.2", + "npm-package-json-lint": "8.0.0", "npm-run-all": "^4.1.5", + "prettier": "2.8.8", "react": "^18.2.0", "react-dom": "^18.2.0", - "storybook": "^7.6.17", + "storybook": "^7.6.20", + "ts-node": "^10.9.2", "turbo": "^2.0.6", "typescript": "~4.9.0" }, - "resolutions": { - "caniuse-lite": "^1.0.30001585", - "jackspeak": "2.1.1" + "pnpm": { + "overrides": { + "@types/react": "^18.2.23", + "caniuse-lite": "^1.0.30001585", + "jackspeak": "2.1.1", + "react": "^18.2.0", + "react-dom": "^18.2.0" + } }, - "workspaces": [ - "charts/*", - "chat/*", - "packages/*", - "tools/*" - ], "keywords": [ "mongodb", "ui", @@ -81,5 +101,5 @@ "bugs": { "url": "https://github.com/mongodb/leafygreen-ui/issues" }, - "packageManager": "yarn@1.22.19" + "packageManager": "pnpm@9.15.0" } diff --git a/packages/a11y/package.json b/packages/a11y/package.json index 649a579130..f550b886a9 100644 --- a/packages/a11y/package.json +++ b/packages/a11y/package.json @@ -22,9 +22,9 @@ "access": "public" }, "dependencies": { - "@leafygreen-ui/hooks": "^8.1.3", - "@leafygreen-ui/lib": "^13.6.1", - "@leafygreen-ui/emotion": "^4.0.8" + "@leafygreen-ui/hooks": "workspace:^", + "@leafygreen-ui/lib": "workspace:^", + "@leafygreen-ui/emotion": "workspace:^" }, "homepage": "https://github.com/mongodb/leafygreen-ui/tree/main/packages/a11y", "repository": { @@ -33,5 +33,6 @@ }, "bugs": { "url": "https://jira.mongodb.org/projects/PD/summary" - } + }, + "devDependencies": {} } diff --git a/packages/a11y/src/A11y.spec.tsx b/packages/a11y/src/A11y.spec.tsx index 2f31c60006..9344583505 100644 --- a/packages/a11y/src/A11y.spec.tsx +++ b/packages/a11y/src/A11y.spec.tsx @@ -124,7 +124,7 @@ describe('packages/a11y', () => { }); // testing types - /* eslint-disable jest/no-disabled-tests, jest/expect-expect, @typescript-eslint/no-unused-vars */ + /* eslint-disable jest/no-disabled-tests */ describe.skip('AriaLabelProps types', () => { test('AriaLabelProps', () => { // @ts-expect-error - empty object not allowed diff --git a/packages/avatar/package.json b/packages/avatar/package.json index a7ffbe195b..8441c08dad 100644 --- a/packages/avatar/package.json +++ b/packages/avatar/package.json @@ -22,18 +22,16 @@ "access": "public" }, "dependencies": { - "@leafygreen-ui/emotion": "^4.0.8", - "@leafygreen-ui/icon": "^12.5.0", - "@leafygreen-ui/lib": "^13.5.0", - "@leafygreen-ui/logo": "^9.1.0", - "@leafygreen-ui/palette": "^4.1.1", - "@leafygreen-ui/tokens": "^2.8.0", + "@leafygreen-ui/emotion": "workspace:^", + "@leafygreen-ui/icon": "workspace:^12.5.0", + "@leafygreen-ui/lib": "workspace:^", + "@leafygreen-ui/logo": "workspace:^9.1.0", + "@leafygreen-ui/palette": "workspace:^", + "@leafygreen-ui/tokens": "workspace:^", "lodash": "^4.17.21" }, "peerDependencies": { "@leafygreen-ui/leafygreen-provider": "^3.1.12" }, - "devDependencies": { - "@lg-tools/storybook-utils": "^0.1.1" - } + "devDependencies": {} } diff --git a/packages/badge/package.json b/packages/badge/package.json index 859e3f0319..031fe1a527 100644 --- a/packages/badge/package.json +++ b/packages/badge/package.json @@ -22,10 +22,10 @@ "access": "public" }, "dependencies": { - "@leafygreen-ui/emotion": "^4.0.8", - "@leafygreen-ui/lib": "^13.3.0", - "@leafygreen-ui/palette": "^4.0.9", - "@leafygreen-ui/tokens": "^2.5.2" + "@leafygreen-ui/emotion": "workspace:^", + "@leafygreen-ui/lib": "workspace:^", + "@leafygreen-ui/palette": "workspace:^", + "@leafygreen-ui/tokens": "workspace:^" }, "peerDependencies": { "@leafygreen-ui/leafygreen-provider": "^3.1.12" @@ -39,7 +39,5 @@ "bugs": { "url": "https://jira.mongodb.org/projects/PD/summary" }, - "devDependencies": { - "@lg-tools/storybook-utils": "^0.1.0" - } + "devDependencies": {} } diff --git a/packages/banner/package.json b/packages/banner/package.json index d0100076b3..23b896596a 100644 --- a/packages/banner/package.json +++ b/packages/banner/package.json @@ -22,13 +22,13 @@ "access": "public" }, "dependencies": { - "@leafygreen-ui/lib": "^13.3.0", - "@leafygreen-ui/emotion": "^4.0.8", - "@leafygreen-ui/palette": "^4.0.9", - "@leafygreen-ui/icon": "^12.0.1", - "@leafygreen-ui/icon-button": "^15.0.21", - "@leafygreen-ui/tokens": "^2.5.2", - "@leafygreen-ui/typography": "^19.0.0" + "@leafygreen-ui/lib": "workspace:^", + "@leafygreen-ui/emotion": "workspace:^", + "@leafygreen-ui/palette": "workspace:^", + "@leafygreen-ui/icon": "workspace:^12.0.1", + "@leafygreen-ui/icon-button": "workspace:^15.0.21", + "@leafygreen-ui/tokens": "workspace:^", + "@leafygreen-ui/typography": "workspace:^19.0.0" }, "peerDependencies": { "@leafygreen-ui/leafygreen-provider": "^3.1.12" @@ -41,7 +41,5 @@ "bugs": { "url": "https://jira.mongodb.org/projects/PD/summary" }, - "devDependencies": { - "@lg-tools/storybook-utils": "^0.1.1" - } + "devDependencies": {} } diff --git a/packages/box/package.json b/packages/box/package.json index 073d77c608..a8e8827429 100644 --- a/packages/box/package.json +++ b/packages/box/package.json @@ -30,7 +30,5 @@ "bugs": { "url": "https://jira.mongodb.org/projects/PD/summary" }, - "devDependencies": { - "@lg-tools/storybook-utils": "^0.1.0" - } + "devDependencies": {} } diff --git a/packages/box/src/Box.spec.tsx b/packages/box/src/Box.spec.tsx index 19440a2230..ff5839f131 100644 --- a/packages/box/src/Box.spec.tsx +++ b/packages/box/src/Box.spec.tsx @@ -161,31 +161,26 @@ describe('packages/box', () => { // eslint-disable-next-line jest/no-disabled-tests describe.skip('types work as expected', () => { - // eslint-disable-next-line jest/expect-expect test('does not allow specifying "target", without "as" or "href"', () => { // @ts-expect-error ; }); - // eslint-disable-next-line jest/expect-expect test('does not allow specifying "href", when "as" is set to "div"', () => { // @ts-expect-error ; }); - // eslint-disable-next-line jest/expect-expect test('does not allow props that do not exist on the "as" element', () => { // @ts-expect-error ; }); - // eslint-disable-next-line jest/expect-expect test('expects "href" to be a string when as is an anchor component wrapper', () => { // @ts-expect-error ; }); - // eslint-disable-next-line jest/expect-expect test('expects required props to exist when as is a React Component with required props', () => { // @ts-expect-error ; @@ -195,55 +190,46 @@ describe('packages/box', () => { describe('packages/box/ExtendableBox', () => { // eslint-disable-next-line jest/no-disabled-tests describe.skip('the types work as expected', () => { - // eslint-disable-next-line jest/expect-expect test('does not allow specifying "target", without "as" or "href"', () => { // @ts-expect-error ; }); - // eslint-disable-next-line jest/expect-expect test('does not allow specifying "href", when "as" is set to "div"', () => { // @ts-expect-error ; }); - // eslint-disable-next-line jest/expect-expect test('does not allow props that do not exist on the "as" element', () => { // @ts-expect-error ; }); - // eslint-disable-next-line jest/expect-expect test('expects "href" to be a string when as is an anchor component wrapper', () => { // @ts-expect-error ; }); - // eslint-disable-next-line jest/expect-expect test('expects required props to exist when as is a React Component with required props', () => { // @ts-expect-error ; }); describe('when Extendable Box has a default "as" that is not a "div"', () => { - // eslint-disable-next-line jest/expect-expect test('allows props based on the default supplied', () => { ; }); - // eslint-disable-next-line jest/expect-expect test('errors when "as" overwrites default and props are no longer compatible', () => { // @ts-expect-error ; }); - // eslint-disable-next-line jest/expect-expect test('errors when prop that only belongs on "a" is supplied without setting "as"', () => { // @ts-expect-error ; }); - // eslint-disable-next-line jest/expect-expect test('allows prop that only belongs on "a" when setting "as"', () => { ; }); diff --git a/packages/button/package.json b/packages/button/package.json index 4578c77f4e..3239c674e6 100644 --- a/packages/button/package.json +++ b/packages/button/package.json @@ -22,20 +22,19 @@ "access": "public" }, "dependencies": { - "@leafygreen-ui/box": "^3.1.9", - "@leafygreen-ui/emotion": "^4.0.8", - "@leafygreen-ui/lib": "^13.4.0", - "@leafygreen-ui/palette": "^4.0.10", - "@leafygreen-ui/ripple": "^1.1.13", - "@leafygreen-ui/tokens": "^2.5.2", + "@leafygreen-ui/box": "workspace:^3.1.9", + "@leafygreen-ui/emotion": "workspace:^", + "@leafygreen-ui/lib": "workspace:^", + "@leafygreen-ui/palette": "workspace:^", + "@leafygreen-ui/ripple": "workspace:^1.1.13", + "@leafygreen-ui/tokens": "workspace:^", "@lg-tools/test-harnesses": "^0.1.2", "polished": "^4.2.2" }, "devDependencies": { "next": "^13.0.5", - "@leafygreen-ui/icon": "^12.0.1", - "@leafygreen-ui/loading-indicator": "^2.0.12", - "@lg-tools/storybook-utils": "^0.1.1" + "@leafygreen-ui/icon": "workspace:^12.0.1", + "@leafygreen-ui/loading-indicator": "workspace:^2.0.12" }, "peerDependencies": { "@leafygreen-ui/leafygreen-provider": "^3.1.12" diff --git a/packages/button/src/Button.stories.tsx b/packages/button/src/Button.stories.tsx index ccf38c7bfb..13d2c4fb2f 100644 --- a/packages/button/src/Button.stories.tsx +++ b/packages/button/src/Button.stories.tsx @@ -1,5 +1,5 @@ /* eslint-disable react/jsx-key */ -/* eslint-disable react/display-name */ + import React from 'react'; import { storybookArgTypes, diff --git a/packages/button/src/Button/Button.spec.tsx b/packages/button/src/Button/Button.spec.tsx index 541fb1a7e5..ab441b555f 100644 --- a/packages/button/src/Button/Button.spec.tsx +++ b/packages/button/src/Button/Button.spec.tsx @@ -297,7 +297,7 @@ describe('packages/button', () => { }); }); - /* eslint-disable jest/no-disabled-tests, jest/expect-expect*/ + /* eslint-disable jest/no-disabled-tests*/ describe.skip('types behave as expected', () => { test('does not throw an error when no children are passed to the component', () => {