Skip to content

Commit bf18f72

Browse files
matyasfclaude
andcommitted
refactor(ui-scripts,command-utils): remove pkg-utils package and update deps
Finalize the merge of @instructure/pkg-utils into ui-scripts: move its package utilities into lib/utils/pkg-utils/package-utils.ts, add getPackages() there, and repoint all imports (bump, deprecate, publish, publish-private, tag, npm, addNewExportsEntiresToPackageJSONs) at the local module. Drop the package from the tsconfig references and the eslint node-package list. Convert the root scripts/*.js to ESM (.mjs) so they can consume the ESM-only chalk 5 and read-package-up, and update dependencies: chalk 5, which 7, read-package-up 12, @vitejs/plugin-react, and codesandbox-import-utils. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 6aebaeb commit bf18f72

35 files changed

Lines changed: 299 additions & 2889 deletions

cypress/component/Tooltip.cy.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ describe('<Tooltip/>', () => {
158158
})
159159
})
160160

161-
it('should close when Esc key is pressed', async () => {
161+
it('should close when Esc key is pressed', () => {
162162
cy.mount(
163163
<Tooltip renderTip={<h2>Hello</h2>}>
164164
<a data-testid="trigger" href="example.html">
@@ -173,15 +173,17 @@ describe('<Tooltip/>', () => {
173173

174174
cy.get(tooltip).should('not.be.visible')
175175

176-
cy.contains('Hover me!').realHover()
176+
cy.get('[data-testid="trigger"]').focus()
177+
178+
cy.get(tooltip).should('be.visible')
177179

178-
cy.get(tooltip).should('be.visible').realPress('Escape')
180+
cy.get('[data-testid="trigger"]').realPress('Escape')
179181

180182
cy.get(tooltip).should('not.be.visible')
181183
})
182184
})
183185

184-
it('should close when Esc key is pressed and Tooltip is hovered over', async () => {
186+
it('should close when Esc key is pressed and Tooltip is hovered over', () => {
185187
cy.mount(
186188
<Tooltip renderTip={<h2>Hello</h2>}>
187189
<a data-testid="trigger" href="example.html">
@@ -256,7 +258,6 @@ describe('<Tooltip/>', () => {
256258
.realPress('Escape')
257259
.then(() => {
258260
cy.get(tooltip).should('not.be.visible')
259-
cy.wait(300)
260261
cy.get('[role="dialog"]').should('be.visible')
261262
})
262263

eslint.config.mjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ const NODE_PACKAGES = [
6565
'ui-webpack-config',
6666
'command-utils',
6767
'instui-cli',
68-
'babel-plugin-transform-imports',
69-
'pkg-utils'
68+
'babel-plugin-transform-imports'
7069
].join("|")
7170

7271
const finalConfig = tseslint.config(

package.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@
2727
"lint:changes": "pnpm run lint -- --since HEAD^",
2828
"lint:fix": "pnpm -r --stream lint:fix",
2929
"lint:commits": "commitlint --from=HEAD^1",
30-
"bootstrap": "node scripts/bootstrap.js",
30+
"bootstrap": "node scripts/bootstrap.mjs",
3131
"build": "pnpm -r --stream build",
3232
"build:watch": "pnpm -r --stream build:watch",
3333
"build:docs": "pnpm --filter docs-app bundle",
3434
"build:themes": "ui-scripts build-themes",
3535
"build:tokens": "ui-scripts generate-all-tokens",
3636
"build:types": "tsc -b tsconfig.references.json",
3737
"build:ts": "pnpm --filter @instructure/ui-icons prepare-build && pnpm run build:types",
38-
"clean": "node scripts/clean.js",
39-
"clean-node": "node scripts/clean.js --nuke_node",
38+
"clean": "node scripts/clean.mjs",
39+
"clean-node": "node scripts/clean.mjs --nuke_node",
4040
"export:icons": "pnpm --filter @instructure/ui-icons export",
4141
"create-component-version": "ui-scripts create-component-version",
4242
"bump": "ui-scripts bump",
@@ -47,7 +47,7 @@
4747
"release": "ui-scripts publish",
4848
"publish-private": "ui-scripts publish-private",
4949
"commit": "cz",
50-
"husky:pre-commit": "lint-staged && node scripts/checkTSReferences.js",
50+
"husky:pre-commit": "lint-staged && node scripts/checkTSReferences.mjs",
5151
"postinstall": "husky",
5252
"ts:check": "pnpm -r --stream ts:check"
5353
},
@@ -63,7 +63,6 @@
6363
"@emotion/react": "^11.14.0",
6464
"@eslint/js": "^9.39.4",
6565
"@instructure/browserslist-config-instui": "workspace:*",
66-
"@instructure/pkg-utils": "workspace:*",
6766
"@instructure/ui-babel-preset": "workspace:*",
6867
"@instructure/ui-scripts": "workspace:*",
6968
"@testing-library/dom": "^10.4.1",
@@ -74,11 +73,11 @@
7473
"@types/node": "^24",
7574
"@types/react": "18.3.26",
7675
"@types/react-dom": "18.3.1",
77-
"@vitejs/plugin-react": "^6.0.3",
76+
"@vitejs/plugin-react": "^5.2.0",
7877
"@vitest/eslint-plugin": "^1.6.20",
7978
"babel-plugin-add-import-extension": "^1.6.0",
8079
"chai": "^4.4.1",
81-
"chalk": "^4.1.2",
80+
"chalk": "^5.6.2",
8281
"commitizen": "^4.3.2",
8382
"concurrently": "^9.2.3",
8483
"cross-spawn": "^7.0.6",
@@ -94,6 +93,7 @@
9493
"eslint-plugin-jsx-a11y": "^6.10.2",
9594
"eslint-plugin-notice": "^1.0.0",
9695
"eslint-plugin-react": "^7.37.5",
96+
"read-package-up": "^12.0.0",
9797
"globals": "^17.7.0",
9898
"husky": "^9.1.7",
9999
"jsdom": "^29.1.1",
@@ -108,7 +108,6 @@
108108
"//dependency-comments": {
109109
"scripts": "The '--' at the end of commands is needed so user parameters are passed forward",
110110
"danger": "^11.3.1 -- add this back if we use it in pr-validation.yml",
111-
"chalk": "Chalk 5 is ESM. (used here by the scripts/ folder)",
112111
"tar": "Lerna 8 needs tar for this fixed(?) bug: https://github.com/lerna/lerna/issues/4005",
113112
"eslint-import-resolver-typescript": "^3.6.1 not supported by ESLint 9",
114113
"eslint-plugin-import-x": "^3.1.0 not supported by ESLint 9",

packages/__docs__/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
"babel-loader": "^10.1.1",
116116
"@babel/runtime": "^7.29.7",
117117
"@babel/standalone": "^7.29.3",
118-
"codesandbox": "^2.2.3",
118+
"codesandbox-import-utils": "^2.2.3",
119119
"lorem-ipsum": "^3.0.0",
120120
"marked-react": "^4.0.0",
121121
"moment": "^2.30.1",

packages/__docs__/src/CodeSandboxButton/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*/
2424

2525
import { Component } from 'react'
26-
import { getParameters } from 'codesandbox/lib/api/define'
26+
import { getParameters } from 'codesandbox-import-utils/lib/api/define'
2727

2828
import { Tooltip } from '@instructure/ui-tooltip'
2929
import { SVGIcon } from '@instructure/ui-svg-images'

packages/command-utils/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
},
1919
"license": "MIT",
2020
"dependencies": {
21-
"chalk": "^5.4.1",
21+
"chalk": "^5.6.2",
2222
"cross-spawn": "^7.0.6",
23-
"which": "^4.0.0"
23+
"which": "^7.0.0"
2424
},
2525
"publishConfig": {
2626
"access": "public"

packages/pkg-utils/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/pkg-utils/.npmignore

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)