From 0df84087f593503da1a48d42ee93df9749d3d34b Mon Sep 17 00:00:00 2001 From: Sami Jaber Date: Wed, 15 Jan 2025 12:22:00 -0400 Subject: [PATCH 1/4] rm dep --- packages/core/package.json | 2 -- packages/core/src/__tests__/qwik.test.ts | 4 ++-- packages/core/src/parsers/jsx/hooks/use-metadata.ts | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/core/package.json b/packages/core/package.json index 96c6a4ecf0..8be7f083ec 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -86,7 +86,6 @@ "@types/babel__core": "7.1.14", "@types/dedent": "^0.7.0", "@types/estree": "^1.0.2", - "@types/fs-extra-promise": "^1.0.10", "@types/hash-sum": "^1.0.0", "@types/json5": "0.0.30", "@types/lodash": "^4.14.165", @@ -95,7 +94,6 @@ "@types/prettier": "^2.1.5", "@types/rollup__plugin-virtual": "^2.0.1", "concurrently": "^8.2.2", - "fs-extra-promise": "^1.0.1", "rimraf": "^5.0.5", "rollup": "^2.70.1", "strip-ansi": "^6.0.1", diff --git a/packages/core/src/__tests__/qwik.test.ts b/packages/core/src/__tests__/qwik.test.ts index 53cf4458d7..440d4c92c9 100644 --- a/packages/core/src/__tests__/qwik.test.ts +++ b/packages/core/src/__tests__/qwik.test.ts @@ -1,4 +1,4 @@ -import { outputFileAsync } from 'fs-extra-promise'; +import { writeFileSync } from 'fs'; import { resolve } from 'path'; import stripAnsi from 'strip-ansi'; import { File } from '../generators/qwik'; @@ -27,7 +27,7 @@ const debugOutput = async (fileSet: FileSet) => { if (debugFiles) { for (const key in fileSet) { const file = (fileSet as any)[key]; - await outputFileAsync(resolve(base, file.path), file.contents); + await writeFileSync(resolve(base, file.path), file.contents); } } }; diff --git a/packages/core/src/parsers/jsx/hooks/use-metadata.ts b/packages/core/src/parsers/jsx/hooks/use-metadata.ts index 534cf7e0cd..4ffd9fc430 100644 --- a/packages/core/src/parsers/jsx/hooks/use-metadata.ts +++ b/packages/core/src/parsers/jsx/hooks/use-metadata.ts @@ -9,7 +9,7 @@ import { Context, ParseMitosisOptions, ResolvedImport } from '@/parsers/jsx/type import { MitosisImport } from '@/types/mitosis-component'; import * as babel from '@babel/core'; import { NodePath } from '@babel/core'; -import { existsSync, readFileSync } from 'fs-extra-promise'; +import { existsSync, readFileSync } from 'fs'; import * as path from 'path'; type ResolveData = { From ef89c0d58519b8579b16cda7c3a0041ac329ba93 Mon Sep 17 00:00:00 2001 From: Sami Jaber Date: Wed, 15 Jan 2025 12:22:20 -0400 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=91=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yarn.lock | 68 ------------------------------------------------------- 1 file changed, 68 deletions(-) diff --git a/yarn.lock b/yarn.lock index 313e86fc11..7f35947e90 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3376,7 +3376,6 @@ __metadata: "@types/babel__core": "npm:7.1.14" "@types/dedent": "npm:^0.7.0" "@types/estree": "npm:^1.0.2" - "@types/fs-extra-promise": "npm:^1.0.10" "@types/hash-sum": "npm:^1.0.0" "@types/json5": "npm:0.0.30" "@types/lodash": "npm:^4.14.165" @@ -3388,7 +3387,6 @@ __metadata: concurrently: "npm:^8.2.2" csstype: "npm:^3.0.4" fp-ts: "npm:^2.11.10" - fs-extra-promise: "npm:^1.0.1" hash-sum: "npm:^2.0.0" json5: "npm:^2.1.3" lodash: "npm:^4.17.20" @@ -6226,13 +6224,6 @@ __metadata: languageName: node linkType: hard -"@types/bluebird@npm:*": - version: 3.5.36 - resolution: "@types/bluebird@npm:3.5.36" - checksum: 10/74d3870a745a3a70a5f516b8a85746938506b013ca4f8722b4f9b252860efd645d7ce7599dca8e0c86b4145c290f67daa812ad6c9274cc1b450d690b60de7b19 - languageName: node - linkType: hard - "@types/body-parser@npm:*": version: 1.19.2 resolution: "@types/body-parser@npm:1.19.2" @@ -6453,26 +6444,6 @@ __metadata: languageName: node linkType: hard -"@types/fs-extra-promise@npm:^1.0.10": - version: 1.0.10 - resolution: "@types/fs-extra-promise@npm:1.0.10" - dependencies: - "@types/bluebird": "npm:*" - "@types/fs-extra": "npm:^4" - "@types/node": "npm:*" - checksum: 10/a65d59cb9335df5ed30deade86763c99771b76694b04bec15bbadaeedf4e4f8557aa7d7cbf6d08f2e92ac4e5b4be071e9a89f50d03490dd3fe8d2699029e6b74 - languageName: node - linkType: hard - -"@types/fs-extra@npm:^4": - version: 4.0.12 - resolution: "@types/fs-extra@npm:4.0.12" - dependencies: - "@types/node": "npm:*" - checksum: 10/a78250cb222bb64966747ca16120485e1b14d985a2d1bb6b2d4f21113925c39155e02749c4d6fcc4c6e10b80fc332345a89f5a93756439aaede6f7d4ea81db89 - languageName: node - linkType: hard - "@types/fs-extra@npm:^9.0.13": version: 9.0.13 resolution: "@types/fs-extra@npm:9.0.13" @@ -8756,13 +8727,6 @@ __metadata: languageName: node linkType: hard -"bluebird@npm:^3.5.0": - version: 3.7.2 - resolution: "bluebird@npm:3.7.2" - checksum: 10/007c7bad22c5d799c8dd49c85b47d012a1fe3045be57447721e6afbd1d5be43237af1db62e26cb9b0d9ba812d2e4ca3bac82f6d7e016b6b88de06ee25ceb96e7 - languageName: node - linkType: hard - "bn.js@npm:^4.0.0, bn.js@npm:^4.1.0, bn.js@npm:^4.11.9": version: 4.12.0 resolution: "bn.js@npm:4.12.0" @@ -12879,16 +12843,6 @@ __metadata: languageName: node linkType: hard -"fs-extra-promise@npm:^1.0.1": - version: 1.0.1 - resolution: "fs-extra-promise@npm:1.0.1" - dependencies: - bluebird: "npm:^3.5.0" - fs-extra: "npm:^2.1.2" - checksum: 10/09b29c5df8e1b333090deef0127ba9094ebb7dc9a4cd7c8163b048b82eaccb978674b2cf3565d2d8332c40ecfd0e6587f1415d10ff3b7f99735b5c52b676d62e - languageName: node - linkType: hard - "fs-extra@npm:^10.1.0": version: 10.1.0 resolution: "fs-extra@npm:10.1.0" @@ -12911,16 +12865,6 @@ __metadata: languageName: node linkType: hard -"fs-extra@npm:^2.1.2": - version: 2.1.2 - resolution: "fs-extra@npm:2.1.2" - dependencies: - graceful-fs: "npm:^4.1.2" - jsonfile: "npm:^2.1.0" - checksum: 10/2cd92acba96fc2a180b7fc9d7966765d3eb4dfe8b52c112da62d421b40d07554e814ead8364f7be002449bfecb2180ec9ee37f85c4eee28e5281c7969c5cd059 - languageName: node - linkType: hard - "fs-extra@npm:^7.0.1, fs-extra@npm:~7.0.1": version: 7.0.1 resolution: "fs-extra@npm:7.0.1" @@ -15044,18 +14988,6 @@ __metadata: languageName: node linkType: hard -"jsonfile@npm:^2.1.0": - version: 2.4.0 - resolution: "jsonfile@npm:2.4.0" - dependencies: - graceful-fs: "npm:^4.1.6" - dependenciesMeta: - graceful-fs: - optional: true - checksum: 10/517656e0a7c4eda5a90341dd0ec9e9b7590d0c77d66d8aad0162615dfc7c5f219c82565b927cc4cc774ca93e484d118a274ef0def74279a3d8afb4ff2f4e4800 - languageName: node - linkType: hard - "jsonfile@npm:^4.0.0": version: 4.0.0 resolution: "jsonfile@npm:4.0.0" From 77fed82497e4b55406b356c318f9ca343ab272a2 Mon Sep 17 00:00:00 2001 From: Sami Jaber Date: Wed, 15 Jan 2025 12:22:51 -0400 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=8F=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/gold-cougars-collect.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/gold-cougars-collect.md diff --git a/.changeset/gold-cougars-collect.md b/.changeset/gold-cougars-collect.md new file mode 100644 index 0000000000..f34ebf2581 --- /dev/null +++ b/.changeset/gold-cougars-collect.md @@ -0,0 +1,6 @@ +--- +'@builder.io/mitosis': patch +'@builder.io/mitosis-cli': patch +--- + +Misc: stop using `fs-extra-promise` dependency From ddec7a1b3c2d4a5227b5231680d34a222da11043 Mon Sep 17 00:00:00 2001 From: Sami Jaber Date: Wed, 15 Jan 2025 14:38:09 -0400 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=91=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/__tests__/qwik.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/core/src/__tests__/qwik.test.ts b/packages/core/src/__tests__/qwik.test.ts index 440d4c92c9..f7aa030ca5 100644 --- a/packages/core/src/__tests__/qwik.test.ts +++ b/packages/core/src/__tests__/qwik.test.ts @@ -1,9 +1,9 @@ -import { writeFileSync } from 'fs'; +import { mkdirSync, writeFileSync } from 'fs'; import { resolve } from 'path'; import stripAnsi from 'strip-ansi'; import { File } from '../generators/qwik'; import { componentToQwik } from '../generators/qwik/component-generator'; -import { addComponent, createFileSet, FileSet } from '../generators/qwik/index'; +import { FileSet, addComponent, createFileSet } from '../generators/qwik/index'; import { builderContentToMitosisComponent } from '../parsers/builder'; import { parseJsx } from '../parsers/jsx'; import { @@ -27,6 +27,7 @@ const debugOutput = async (fileSet: FileSet) => { if (debugFiles) { for (const key in fileSet) { const file = (fileSet as any)[key]; + await mkdirSync(base, { recursive: true }); await writeFileSync(resolve(base, file.path), file.contents); } }