From f4790879b498c4dfd65b61307a54ae580b020058 Mon Sep 17 00:00:00 2001 From: Oliver Shi Date: Fri, 22 Sep 2023 12:16:09 -0400 Subject: [PATCH] v0.23.1 (#383) ### Fixes * Removes the tsconfig extends from the studio tsconfig. * Adds virtual modules to optimizeDeps.exclude in studio's vite config. --- bump-versions.mjs | 30 ++++ package-lock.json | 205 +++++++++++++++++++--------- packages/studio-plugin/package.json | 2 +- packages/studio-ui/package.json | 6 +- packages/studio/package.json | 6 +- packages/studio/tsconfig.json | 14 +- packages/studio/vite.config.ts | 3 + update-minor-versions.mjs | 49 ------- 8 files changed, 190 insertions(+), 125 deletions(-) create mode 100644 bump-versions.mjs delete mode 100644 update-minor-versions.mjs diff --git a/bump-versions.mjs b/bump-versions.mjs new file mode 100644 index 000000000..b3d0896d6 --- /dev/null +++ b/bump-versions.mjs @@ -0,0 +1,30 @@ +import { execSync } from "child_process"; +import fs from "fs"; + +const newVersion = process.argv[2]; + +function bumpStudio() { + const packageJsonPath = "./packages/studio/package.json"; + const packageJson = readJson(packageJsonPath); + packageJson.dependencies["@yext/studio-plugin"] = newVersion; + packageJson.dependencies["@yext/studio-ui"] = newVersion; + fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2)); + bumpPackage("studio"); +} + +function bumpPackage(packageName) { + console.log(`... bumping ${packageName}`); + execSync(`npm version ${newVersion} -w=packages/${packageName}`); +} + +function readJson(filepath) { + return JSON.parse(fs.readFileSync(filepath, "utf-8")); +} + +function main() { + bumpPackage("studio-plugin"); + bumpPackage("studio-ui"); + bumpStudio(); +} + +main(); diff --git a/package-lock.json b/package-lock.json index 563dfe79e..ee203318c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5719,6 +5719,53 @@ "node": ">=10.13.0" } }, + "node_modules/@ts-morph/common": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.19.0.tgz", + "integrity": "sha512-Unz/WHmd4pGax91rdIKWi51wnVUW11QttMEPpBiBgIewnc9UQIX7UDLxr5vRlqeByXCwhkF6VabSsI0raWcyAQ==", + "dependencies": { + "fast-glob": "^3.2.12", + "minimatch": "^7.4.3", + "mkdirp": "^2.1.6", + "path-browserify": "^1.0.1" + } + }, + "node_modules/@ts-morph/common/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@ts-morph/common/node_modules/minimatch": { + "version": "7.4.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-7.4.6.tgz", + "integrity": "sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@ts-morph/common/node_modules/mkdirp": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-2.1.6.tgz", + "integrity": "sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A==", + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/@tsconfig/node10": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", @@ -8958,6 +9005,11 @@ "node": ">=4" } }, + "node_modules/code-block-writer": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-12.0.0.tgz", + "integrity": "sha512-q4dMFMlXtKR3XNBHyMHt/3pwYNA69EDk00lloMOaaUMKPUXBw6lpXtbu3MMVG6/uOihGnRDOlkyqsONEUj60+w==" + }, "node_modules/collect-v8-coverage": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz", @@ -22393,6 +22445,15 @@ "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==" }, + "node_modules/ts-morph": { + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-18.0.0.tgz", + "integrity": "sha512-Kg5u0mk19PIIe4islUI/HWRvm9bC1lHejK4S0oh1zaZ77TMZAEmQC0sHQYiu2RgCQFZKXz1fMVi/7nOOeirznA==", + "dependencies": { + "@ts-morph/common": "~0.19.0", + "code-block-writer": "^12.0.0" + } + }, "node_modules/ts-node": { "version": "10.9.1", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", @@ -24460,11 +24521,11 @@ }, "packages/studio": { "name": "@yext/studio", - "version": "0.23.0", + "version": "0.23.1", "dependencies": { "@vitejs/plugin-react": "^4.0.4", - "@yext/studio-plugin": "0.23.0", - "@yext/studio-ui": "0.23.0", + "@yext/studio-plugin": "0.23.1", + "@yext/studio-ui": "0.23.1", "autoprefixer": "^10.4.14", "cac": "^6.7.14", "cross-env": "^7.0.3", @@ -24484,7 +24545,7 @@ }, "packages/studio-plugin": { "name": "@yext/studio-plugin", - "version": "0.23.0", + "version": "0.23.1", "dependencies": { "@babel/parser": "^7.21.8", "@babel/preset-env": "^7.22.4", @@ -25643,17 +25704,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "packages/studio-plugin/node_modules/@ts-morph/common": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.19.0.tgz", - "integrity": "sha512-Unz/WHmd4pGax91rdIKWi51wnVUW11QttMEPpBiBgIewnc9UQIX7UDLxr5vRlqeByXCwhkF6VabSsI0raWcyAQ==", - "dependencies": { - "fast-glob": "^3.2.12", - "minimatch": "^7.4.3", - "mkdirp": "^2.1.6", - "path-browserify": "^1.0.1" - } - }, "packages/studio-plugin/node_modules/ansi-styles": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", @@ -25762,14 +25812,6 @@ "@babel/core": "^7.0.0" } }, - "packages/studio-plugin/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, "packages/studio-plugin/node_modules/browserslist": { "version": "4.21.7", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.7.tgz", @@ -25812,11 +25854,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "packages/studio-plugin/node_modules/code-block-writer": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-12.0.0.tgz", - "integrity": "sha512-q4dMFMlXtKR3XNBHyMHt/3pwYNA69EDk00lloMOaaUMKPUXBw6lpXtbu3MMVG6/uOihGnRDOlkyqsONEUj60+w==" - }, "packages/studio-plugin/node_modules/colors": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", @@ -26452,34 +26489,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "packages/studio-plugin/node_modules/minimatch": { - "version": "7.4.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-7.4.6.tgz", - "integrity": "sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw==", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "packages/studio-plugin/node_modules/mkdirp": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-2.1.6.tgz", - "integrity": "sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A==", - "bin": { - "mkdirp": "dist/cjs/src/bin.js" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "packages/studio-plugin/node_modules/node-fetch": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", @@ -26569,15 +26578,6 @@ "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" }, - "packages/studio-plugin/node_modules/ts-morph": { - "version": "18.0.0", - "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-18.0.0.tgz", - "integrity": "sha512-Kg5u0mk19PIIe4islUI/HWRvm9bC1lHejK4S0oh1zaZ77TMZAEmQC0sHQYiu2RgCQFZKXz1fMVi/7nOOeirznA==", - "dependencies": { - "@ts-morph/common": "~0.19.0", - "code-block-writer": "^12.0.0" - } - }, "packages/studio-plugin/node_modules/upath": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/upath/-/upath-2.0.1.tgz", @@ -26658,7 +26658,7 @@ }, "packages/studio-ui": { "name": "@yext/studio-ui", - "version": "0.23.0", + "version": "0.23.1", "dependencies": { "@dhmk/zustand-lens": "^2.0.5", "@minoru/react-dnd-treeview": "^3.4.1", @@ -26699,7 +26699,7 @@ "@types/react": "^18.0.26", "@types/react-dom": "^18.0.10", "@types/react-modal": "3.13.1", - "@yext/studio-plugin": "0.23.0", + "@yext/studio-plugin": "*", "copyfiles": "^2.4.1", "jest": "^29.5.0", "jest-environment-jsdom": "^29.3.1", @@ -26712,7 +26712,76 @@ "vite-plugin-svgr": "^2.4.0" }, "peerDependencies": { - "@yext/studio-plugin": "0.23.0" + "@yext/studio-plugin": "*" + } + }, + "packages/studio-ui/node_modules/@babel/helper-annotate-as-pure": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz", + "integrity": "sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "packages/studio-ui/node_modules/@babel/helper-validator-identifier": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "packages/studio-ui/node_modules/@babel/plugin-syntax-jsx": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz", + "integrity": "sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "packages/studio-ui/node_modules/@babel/plugin-transform-react-jsx": { + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.22.15.tgz", + "integrity": "sha512-oKckg2eZFa8771O/5vi7XeTvmM6+O9cxZu+kanTU7tD4sin5nO/G8jGJhq8Hvt2Z0kUoEDRayuZLaUlYl8QuGA==", + "dev": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-module-imports": "^7.22.15", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-jsx": "^7.22.5", + "@babel/types": "^7.22.15" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "packages/studio-ui/node_modules/@babel/types": { + "version": "7.22.19", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.19.tgz", + "integrity": "sha512-P7LAw/LbojPzkgp5oznjE6tQEIWbp4PkkfrZDINTro9zgBRtI324/EYsiSI7lhPbpIQ+DCeR2NNmMWANGGfZsg==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.19", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" } }, "packages/studio-ui/node_modules/@types/node": { diff --git a/packages/studio-plugin/package.json b/packages/studio-plugin/package.json index 2df51a3b6..04e760b7d 100644 --- a/packages/studio-plugin/package.json +++ b/packages/studio-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@yext/studio-plugin", - "version": "0.23.0", + "version": "0.23.1", "types": "./lib/index.d.ts", "main": "./lib/index.js", "type": "module", diff --git a/packages/studio-ui/package.json b/packages/studio-ui/package.json index dd8acf975..f7ae33470 100644 --- a/packages/studio-ui/package.json +++ b/packages/studio-ui/package.json @@ -1,6 +1,6 @@ { "name": "@yext/studio-ui", - "version": "0.23.0", + "version": "0.23.1", "types": "./lib/src/index.d.ts", "main": "./lib/src/index.js", "type": "module", @@ -62,7 +62,7 @@ "@types/react": "^18.0.26", "@types/react-dom": "^18.0.10", "@types/react-modal": "3.13.1", - "@yext/studio-plugin": "0.23.0", + "@yext/studio-plugin": "*", "copyfiles": "^2.4.1", "jest": "^29.5.0", "jest-environment-jsdom": "^29.3.1", @@ -75,6 +75,6 @@ "vite-plugin-svgr": "^2.4.0" }, "peerDependencies": { - "@yext/studio-plugin": "0.23.0" + "@yext/studio-plugin": "*" } } diff --git a/packages/studio/package.json b/packages/studio/package.json index 9c28ed3cb..b01fc3e4f 100644 --- a/packages/studio/package.json +++ b/packages/studio/package.json @@ -1,6 +1,6 @@ { "name": "@yext/studio", - "version": "0.23.0", + "version": "0.23.1", "types": "./lib/types.d.ts", "type": "module", "bin": { @@ -14,8 +14,8 @@ }, "dependencies": { "@vitejs/plugin-react": "^4.0.4", - "@yext/studio-plugin": "0.23.0", - "@yext/studio-ui": "0.23.0", + "@yext/studio-plugin": "0.23.1", + "@yext/studio-ui": "0.23.1", "autoprefixer": "^10.4.14", "cac": "^6.7.14", "cross-env": "^7.0.3", diff --git a/packages/studio/tsconfig.json b/packages/studio/tsconfig.json index 6635747b7..be425c224 100644 --- a/packages/studio/tsconfig.json +++ b/packages/studio/tsconfig.json @@ -1,6 +1,18 @@ { - "extends": "../../tsconfig.json", "compilerOptions": { + "module": "ESNext", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "noImplicitAny": false, + "moduleResolution": "node", + "resolveJsonModule": true, + "forceConsistentCasingInFileNames": true, + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "jsx": "react-jsx", + "target": "ESNext", "outDir": "lib", "types": [ "vite/client", diff --git a/packages/studio/vite.config.ts b/packages/studio/vite.config.ts index 6d5fe3fa7..95a3ab95f 100644 --- a/packages/studio/vite.config.ts +++ b/packages/studio/vite.config.ts @@ -31,5 +31,8 @@ export default defineConfig((args: ConfigEnv): UserConfig => { css: { postcss: __dirname, }, + optimizeDeps: { + exclude: ["virtual_yext-studio", "virtual_yext-studio-git-data"], + }, }; }); diff --git a/update-minor-versions.mjs b/update-minor-versions.mjs deleted file mode 100644 index 4f838e1b8..000000000 --- a/update-minor-versions.mjs +++ /dev/null @@ -1,49 +0,0 @@ -import { execSync } from "child_process"; -import fs from "fs"; - -function bumpStudioPlugin() { - console.log("... bumping studio-plugin"); - execSync("npm version minor -w=packages/studio-plugin"); - return readVersion("./packages/studio-plugin/package.json"); -} - -function bumpStudio(pluginVersion, uiVersion) { - console.log("... bumping studio"); - const packageJsonPath = "./packages/studio/package.json"; - const packageJson = readJson(packageJsonPath); - // `npm i @yext/studio-plugin@${newVersion} --save-exact` does not update the package json, - // likely because the new version does not exist yet. - packageJson.dependencies["@yext/studio-plugin"] = pluginVersion; - packageJson.dependencies["@yext/studio-ui"] = uiVersion; - fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2)); - execSync("npm version minor -w=packages/studio"); -} - -function bumpStudioUI() { - console.log("... bumping studio-ui"); - execSync("npm version minor -w=packages/studio-ui"); - return readVersion("./packages/studio-ui/package.json"); -} - -function readJson(filepath) { - return JSON.parse(fs.readFileSync(filepath, "utf-8")); -} - -function readVersion(packageJsonPath) { - const packageJson = readJson(packageJsonPath); - const newVersion = packageJson?.version; - if (!newVersion) { - throw new Error( - `Could not parse version from package.json at ${packageJsonPath}` - ); - } - return newVersion; -} - -function main() { - const pluginVersion = bumpStudioPlugin(); - const uiVersion = bumpStudioUI(); - bumpStudio(pluginVersion, uiVersion); -} - -main();