From 226b8f1b00fe54b5314ed3253a6b0dc53d048352 Mon Sep 17 00:00:00 2001 From: Paul Rastoin <45004772+prastoin@users.noreply.github.com> Date: Thu, 27 Mar 2025 18:19:46 +0100 Subject: [PATCH] [CHORE] Remove `preconstruct` local patch (#11153) # Introduction Please find related parent PR https://github.com/twentyhq/twenty/pull/11083 Custom TypeScript configuration file should be available on "2.8.12" ! See related changeset version dump PR https://github.com/preconstruct/preconstruct/pull/619 --- packages/twenty-docker/twenty/Dockerfile | 1 - packages/twenty-shared/package.json | 3 +- ...econstruct-cli-npm-2.8.11-030abfa6ae.patch | 26 --------- .../twenty-shared/scripts/generateBarrels.ts | 2 + yarn.lock | 56 ++----------------- 5 files changed, 9 insertions(+), 79 deletions(-) delete mode 100644 packages/twenty-shared/patches/@preconstruct-cli-npm-2.8.11-030abfa6ae.patch diff --git a/packages/twenty-docker/twenty/Dockerfile b/packages/twenty-docker/twenty/Dockerfile index 9fb2fa93b..970d874c9 100644 --- a/packages/twenty-docker/twenty/Dockerfile +++ b/packages/twenty-docker/twenty/Dockerfile @@ -13,7 +13,6 @@ COPY ./packages/twenty-server/package.json /app/packages/twenty-server/ COPY ./packages/twenty-server/patches /app/packages/twenty-server/patches COPY ./packages/twenty-ui/package.json /app/packages/twenty-ui/ COPY ./packages/twenty-shared/package.json /app/packages/twenty-shared/ -COPY ./packages/twenty-shared/patches /app/packages/twenty-shared/patches COPY ./packages/twenty-front/package.json /app/packages/twenty-front/ # Install all dependencies diff --git a/packages/twenty-shared/package.json b/packages/twenty-shared/package.json index 34596ac93..45a125cf2 100644 --- a/packages/twenty-shared/package.json +++ b/packages/twenty-shared/package.json @@ -14,7 +14,7 @@ }, "devDependencies": { "@babel/preset-env": "^7.26.9", - "@preconstruct/cli": "patch:@preconstruct/cli@npm%3A2.8.11#./patches/@preconstruct-cli-npm-2.8.11-030abfa6ae.patch", + "@preconstruct/cli": "^2.8.12", "@prettier/sync": "^0.5.2", "@types/babel__preset-env": "^7", "babel-plugin-module-resolver": "^5.0.2", @@ -26,6 +26,7 @@ "zod": "3.23.8" }, "preconstruct": { + "tsconfig": "tsconfig.lib.json", "entrypoints": [ "./index.ts", "./constants/index.ts", diff --git a/packages/twenty-shared/patches/@preconstruct-cli-npm-2.8.11-030abfa6ae.patch b/packages/twenty-shared/patches/@preconstruct-cli-npm-2.8.11-030abfa6ae.patch deleted file mode 100644 index 0015ea37b..000000000 --- a/packages/twenty-shared/patches/@preconstruct-cli-npm-2.8.11-030abfa6ae.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/cli/dist/preconstruct-cli-cli.cjs.js b/cli/dist/preconstruct-cli-cli.cjs.js -index 8fbd4efc8ee4d98bc72d16344ff6f6ab4e5e2736..cf451d99128fd06053426d1a265f4e305380dd7b 100644 ---- a/cli/dist/preconstruct-cli-cli.cjs.js -+++ b/cli/dist/preconstruct-cli-cli.cjs.js -@@ -1509,7 +1509,7 @@ let memoizedGetProgram = weakMemoize(typescript => memoize(async configFileName - return nonMemoizedGetProgram(typescript, configFileName); - })); - async function getProgram(dirname, pkgName, ts) { -- let configFileName = ts.findConfigFile(dirname, ts.sys.fileExists); -+ let configFileName = ts.findConfigFile(dirname, ts.sys.fileExists, 'tsconfig.lib.json'); - if (!configFileName) { - throw new FatalError("an entrypoint source file ends with the .ts or tsx extension but no TypeScript config exists, please create one.", pkgName); - } -diff --git a/cli/dist/preconstruct-cli-cli.esm.js b/cli/dist/preconstruct-cli-cli.esm.js -index 0045392b46c8928753af564f67681886e0f15bed..164a9bfbae85f1a8f41fffc87c6a3c4014cb9d33 100644 ---- a/cli/dist/preconstruct-cli-cli.esm.js -+++ b/cli/dist/preconstruct-cli-cli.esm.js -@@ -1460,7 +1460,7 @@ let memoizedGetProgram = weakMemoize(typescript => memoize(async configFileName - return nonMemoizedGetProgram(typescript, configFileName); - })); - async function getProgram(dirname, pkgName, ts) { -- let configFileName = ts.findConfigFile(dirname, ts.sys.fileExists); -+ let configFileName = ts.findConfigFile(dirname, ts.sys.fileExists, 'tsconfig.lib.json'); - if (!configFileName) { - throw new FatalError("an entrypoint source file ends with the .ts or tsx extension but no TypeScript config exists, please create one.", pkgName); - } diff --git a/packages/twenty-shared/scripts/generateBarrels.ts b/packages/twenty-shared/scripts/generateBarrels.ts index 16d4fdf12..e5a1d78f9 100644 --- a/packages/twenty-shared/scripts/generateBarrels.ts +++ b/packages/twenty-shared/scripts/generateBarrels.ts @@ -194,6 +194,8 @@ const computePackageJsonFilesAndPreconstructConfig = ( return { preconstruct: { + // TODO refactor to merge in existing configuration + tsconfig: 'tsconfig.lib.json', entrypoints: [ './index.ts', ...entrypoints.map((module) => `./${module}/index.ts`), diff --git a/yarn.lock b/yarn.lock index 4e7bb15e9..25929632e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12543,9 +12543,9 @@ __metadata: languageName: node linkType: hard -"@preconstruct/cli@npm:2.8.11": - version: 2.8.11 - resolution: "@preconstruct/cli@npm:2.8.11" +"@preconstruct/cli@npm:^2.8.12": + version: 2.8.12 + resolution: "@preconstruct/cli@npm:2.8.12" dependencies: "@babel/code-frame": "npm:^7.5.5" "@babel/core": "npm:^7.7.7" @@ -12585,53 +12585,7 @@ __metadata: zod: "npm:^3.21.4" bin: preconstruct: bin.js - checksum: 10c0/8f79bc789e0eae239c1a622c93928bed86bad6f994a9eeeacd9e8c7da4e06865fb465b1c57cf1f64cbc84b2a8e5c957e2fcd4feea0f1d37d1c0dd156852fd7a8 - languageName: node - linkType: hard - -"@preconstruct/cli@patch:@preconstruct/cli@npm%3A2.8.11#./patches/@preconstruct-cli-npm-2.8.11-030abfa6ae.patch::locator=twenty-shared%40workspace%3Apackages%2Ftwenty-shared": - version: 2.8.11 - resolution: "@preconstruct/cli@patch:@preconstruct/cli@npm%3A2.8.11#./patches/@preconstruct-cli-npm-2.8.11-030abfa6ae.patch::version=2.8.11&hash=976544&locator=twenty-shared%40workspace%3Apackages%2Ftwenty-shared" - dependencies: - "@babel/code-frame": "npm:^7.5.5" - "@babel/core": "npm:^7.7.7" - "@babel/helper-module-imports": "npm:^7.10.4" - "@babel/runtime": "npm:^7.7.7" - "@preconstruct/hook": "npm:^0.4.0" - "@rollup/plugin-alias": "npm:^3.1.1" - "@rollup/plugin-commonjs": "npm:^15.0.0" - "@rollup/plugin-json": "npm:^4.1.0" - "@rollup/plugin-node-resolve": "npm:^11.2.1" - "@rollup/plugin-replace": "npm:^2.4.1" - builtin-modules: "npm:^3.1.0" - chalk: "npm:^4.1.0" - ci-info: "npm:^3.8.0" - dataloader: "npm:^2.0.0" - detect-indent: "npm:^6.0.0" - enquirer: "npm:^2.3.6" - estree-walker: "npm:^2.0.1" - fast-deep-equal: "npm:^2.0.1" - fast-glob: "npm:^3.2.4" - fs-extra: "npm:^9.0.1" - is-reference: "npm:^1.2.1" - jest-worker: "npm:^26.3.0" - magic-string: "npm:^0.30.0" - ms: "npm:^2.1.2" - normalize-path: "npm:^3.0.0" - npm-packlist: "npm:^2.1.2" - p-limit: "npm:^3.0.2" - parse-glob: "npm:^3.0.4" - parse-json: "npm:^5.1.0" - quick-lru: "npm:^5.1.1" - resolve-from: "npm:^5.0.0" - rollup: "npm:^2.79.1" - semver: "npm:^7.3.4" - terser: "npm:^5.16.8" - v8-compile-cache: "npm:^2.1.1" - zod: "npm:^3.21.4" - bin: - preconstruct: bin.js - checksum: 10c0/7b8c885057f2ec0a6fce5f91f3a8c13ec5d685707d52238199dabe538cd1c405df8333bca2d30899e57e1e3d8cfe451aa4067bb61d6a8c1069afbb544540cb6d + checksum: 10c0/775d9df65c1ab03b80a4e78337393c659244190b0a1671444f0de5a2b59f006a1b591065eee2f8a0b0b1db494117ab0720815c714765bd2d7df7e1f9f89f3622 languageName: node linkType: hard @@ -53126,7 +53080,7 @@ __metadata: resolution: "twenty-shared@workspace:packages/twenty-shared" dependencies: "@babel/preset-env": "npm:^7.26.9" - "@preconstruct/cli": "patch:@preconstruct/cli@npm%3A2.8.11#./patches/@preconstruct-cli-npm-2.8.11-030abfa6ae.patch" + "@preconstruct/cli": "npm:^2.8.12" "@prettier/sync": "npm:^0.5.2" "@sniptt/guards": "npm:^0.2.0" "@types/babel__preset-env": "npm:^7"