Skip to content

Commit d0c4cf0

Browse files
clean test
1 parent be0a9b8 commit d0c4cf0

File tree

199 files changed

+613
-2486
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

199 files changed

+613
-2486
lines changed

codemods-legacy/bull/bullmq/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
"@codemod-com/tsconfig": "workspace:*",
66
"typescript": "^5.2.2",
77
"jscodeshift": "^0.15.1",
8-
"@types/jscodeshift": "^0.11.10",
9-
"vitest": "^1.0.1",
10-
"@vitest/coverage-v8": "catalog:"
8+
"@types/jscodeshift": "^0.11.10"
119
},
1210
"private": true,
1311
"main": "./dist/index.cjs",

codemods-legacy/cal.com/app-directory-boilerplate-calcom/package.json

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,20 @@
99
},
1010
"devDependencies": {
1111
"@codemod-com/utilities": "workspace:*",
12+
"@codemod-com/filemod": "workspace:*",
1213
"@codemod-com/tsconfig": "workspace:*",
14+
"@types/jscodeshift": "^0.11.10",
15+
"@types/node": "^24.3.0",
1316
"typescript": "^5.2.2",
14-
"@codemod-com/filemod": "workspace:*",
1517
"memfs": "^4.6.0",
1618
"ts-morph": "^19.0.0",
17-
"jscodeshift": "^0.15.1",
18-
"@types/jscodeshift": "^0.11.10",
19-
"vitest": "^1.0.1",
20-
"@vitest/coverage-v8": "catalog:"
19+
"jscodeshift": "^0.15.1"
2120
},
2221
"private": true,
2322
"main": "./dist/index.cjs",
2423
"scripts": {
25-
"test": "vitest run",
26-
"test:watch": "vitest watch",
27-
"coverage": "vitest run --coverage"
24+
"test": "node --test",
25+
"test:watch": "node --test --watch"
2826
},
2927
"files": [
3028
"./README.md",

codemods-legacy/cal.com/app-directory-boilerplate-calcom/src/index.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ const removeLeadingLineBreaks = (input: string): string => {
1111
return input.replace(/^\n+/, "");
1212
};
1313

14-
enum FilePurpose {
15-
ORIGINAL_PAGE = "ORIGINAL_PAGE",
16-
// route directories
17-
ROUTE_PAGE = "ROUTE_PAGE",
18-
}
14+
const FilePurpose = {
15+
ORIGINAL_PAGE: "ORIGINAL_PAGE",
16+
ROUTE_PAGE: "ROUTE_PAGE", // route directories
17+
} as const;
18+
19+
type FilePurpose = typeof FilePurpose[keyof typeof FilePurpose];
1920

2021
const map = new Map([
2122
[FilePurpose.ORIGINAL_PAGE, ""],
@@ -429,7 +430,7 @@ const Page = ({ params }: PageProps) => {
429430
430431
return null;
431432
};
432-
433+
433434
export default Page;`;
434435
}
435436
if (newPagePath.includes("(individual-page-wrapper")) {
@@ -456,17 +457,17 @@ type PageProps = Readonly<{
456457
const Page = async ({ params }: PageProps) => {
457458
const h = headers();
458459
const nonce = h.get("x-nonce") ?? undefined;
459-
460+
460461
const legacyCtx = buildLegacyCtx(headers(), cookies(), params);
461462
const props = await getData(legacyCtx);
462-
463+
463464
return (
464465
<PageWrapper ${usesLayout ? "getLayout={getLayout} " : ""} requiresLicense={false} nonce={nonce} themeBasis={null}>
465466
<OldPage {...props} />
466467
</PageWrapper>
467468
);
468469
};
469-
470+
470471
export default Page;`;
471472
}
472473

codemods-legacy/cal.com/app-directory-boilerplate-calcom/test/test.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { deepStrictEqual, ok } from "node:assert";
1+
import { deepStrictEqual, ok } from "node:assert/strict";
2+
import { describe, it } from "node:test";
23
import { buildApi, executeFilemod } from "@codemod-com/filemod";
34
import { buildPathAPI, buildUnifiedFileSystem } from "@codemod-com/utilities";
45
import type { DirectoryJSON } from "memfs";
56
import { Volume, createFsFromVolume } from "memfs";
67
import tsmorph from "ts-morph";
7-
import { describe, it } from "vitest";
8-
import { repomod } from "../src/index.js";
8+
import { repomod } from "../src/index.ts";
99

1010
const transform = async (json: DirectoryJSON) => {
1111
const volume = Volume.fromJSON(json);
@@ -145,17 +145,17 @@ describe("cal.com app-directory-boilerplate-calcom", () => {
145145
`
146146
import type { Params } from "next/dist/shared/lib/router/utils/route-matcher";
147147
import { getData } from "../page";
148-
148+
149149
type PageProps = Readonly<{
150150
params: Params;
151151
}>;
152-
152+
153153
const Page = ({ params }: PageProps) => {
154154
await getData(params, true);
155-
155+
156156
return null;
157157
};
158-
158+
159159
export default Page;`.replace(/\W/gm, "")
160160
);
161161
}),
@@ -203,7 +203,7 @@ describe("cal.com app-directory-boilerplate-calcom", () => {
203203
`
204204
import Page from "@pages/a/b";
205205
import { _generateMetadata } from "app/_utils";
206-
206+
207207
export const generateMetadata = async () => await _generateMetadata(() => "", () => "");
208208
export default Page;
209209
`.replace(/\W/gm, "")
@@ -240,15 +240,15 @@ describe("cal.com app-directory-boilerplate-calcom", () => {
240240
import { buildLegacyCtx } from "@lib/buildLegacyCtx";
241241
242242
export const generateMetadata = async () => await _generateMetadata(() => "", () => "");
243-
243+
244244
type PageProps = Readonly<{
245245
params: Params;
246246
}>;
247247
248248
const Page = async ({ params }: PageProps) => {
249249
const h = headers();
250250
const nonce = h.get("x-nonce") ?? undefined;
251-
251+
252252
const legacyCtx = buildLegacyCtx(headers(), cookies(), params);
253253
const props = await getData(legacyCtx);
254254
@@ -258,7 +258,7 @@ describe("cal.com app-directory-boilerplate-calcom", () => {
258258
</PageWrapper>
259259
);
260260
};
261-
261+
262262
export default Page;`;
263263

264264
return (
@@ -300,15 +300,15 @@ describe("cal.com app-directory-boilerplate-calcom", () => {
300300
import { buildLegacyCtx } from "@lib/buildLegacyCtx";
301301
302302
export const generateMetadata = async () => await _generateMetadata(() => "", () => "");
303-
303+
304304
type PageProps = Readonly<{
305305
params: Params;
306306
}>;
307307
308308
const Page = async ({ params }: PageProps) => {
309309
const h = headers();
310310
const nonce = h.get("x-nonce") ?? undefined;
311-
311+
312312
const legacyCtx = buildLegacyCtx(headers(), cookies(), params);
313313
const props = await getData(legacyCtx);
314314
@@ -318,7 +318,7 @@ describe("cal.com app-directory-boilerplate-calcom", () => {
318318
</PageWrapper>
319319
);
320320
};
321-
321+
322322
export default Page;`;
323323
return (
324324
command.kind === "upsertFile" &&
@@ -359,7 +359,7 @@ describe("cal.com app-directory-boilerplate-calcom", () => {
359359
export const getServerSideProps = (ctx) => {
360360
return a + b;
361361
}
362-
362+
363363
const getData = () => {
364364
getServerSideProps();
365365
}
@@ -387,14 +387,14 @@ describe("cal.com app-directory-boilerplate-calcom", () => {
387387
import {headers, cookies} from "next/headers";
388388
import { buildLegacyCtx } from "@lib/buildLegacyCtx";
389389
390-
import b from 'b';
390+
import b from 'b';
391391
import { a } from 'a';
392392
const getServerSideProps = (ctx) => {
393393
return a + b;
394394
}
395395
const getData = () => {
396396
getServerSideProps();
397-
}
397+
}
398398
399399
export const generateMetadata = async ()=> await _generateMetadata(()=>"",()=>"");
400400
type PageProps=Readonly<{params:Params;}>;
@@ -404,7 +404,7 @@ describe("cal.com app-directory-boilerplate-calcom", () => {
404404
405405
const legacyCtx = buildLegacyCtx(headers(), cookies(), params);
406406
const props = await getData(legacyCtx);
407-
407+
408408
return(<PageWrapper requiresLicense={false} nonce={nonce }themeBasis={null}><OldPage {...props}/></PageWrapper>);
409409
};
410410
export default Page;

codemods-legacy/cal.com/app-directory-boilerplate-calcom/vitest.config.ts

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

codemods-legacy/cal.com/generate-metadata-tests-calcom/package.json

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,20 @@
22
"name": "@codemod-com/codemod-cal.com-generate-metadata-tests-calcom",
33
"devDependencies": {
44
"@codemod-com/utilities": "workspace:*",
5+
"@codemod-com/filemod": "workspace:*",
56
"@codemod-com/tsconfig": "workspace:*",
7+
"@types/jscodeshift": "^0.11.10",
8+
"@types/node": "^24.3.0",
69
"typescript": "^5.2.2",
7-
"@codemod-com/filemod": "workspace:*",
810
"memfs": "^4.6.0",
911
"ts-morph": "^19.0.0",
10-
"jscodeshift": "^0.15.1",
11-
"@types/jscodeshift": "^0.11.10",
12-
"vitest": "^1.0.1",
13-
"@vitest/coverage-v8": "catalog:"
12+
"jscodeshift": "^0.15.1"
1413
},
1514
"private": true,
1615
"main": "./dist/index.cjs",
1716
"scripts": {
18-
"test": "vitest run",
19-
"test:watch": "vitest watch",
20-
"coverage": "vitest run --coverage"
17+
"test": "node --test",
18+
"test:watch": "node --test --watch"
2119
},
2220
"files": [
2321
"./README.md",

codemods-legacy/cal.com/generate-metadata-tests-calcom/test/test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { deepStrictEqual } from "node:assert";
2+
import { describe, it } from "node:test";
23
import { buildApi, executeFilemod } from "@codemod-com/filemod";
34
import { buildPathAPI, buildUnifiedFileSystem } from "@codemod-com/utilities";
45
import type { DirectoryJSON } from "memfs";
56
import { Volume, createFsFromVolume } from "memfs";
6-
import { describe, it } from "vitest";
7-
import { buildData, repomod } from "../src/index.js";
7+
import { buildData, repomod } from "../src/index.ts";
88

99
const transform = async (json: DirectoryJSON) => {
1010
const volume = Volume.fromJSON(json);

codemods-legacy/cal.com/generate-metadata-tests-calcom/vitest.config.ts

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

codemods-legacy/cal.com/generate-url-patterns/package.json

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,19 @@
33
"devDependencies": {
44
"@codemod-com/utilities": "workspace:*",
55
"@codemod-com/tsconfig": "workspace:*",
6-
"typescript": "^5.2.2",
76
"@codemod-com/filemod": "workspace:*",
7+
"@types/jscodeshift": "^0.11.10",
8+
"@types/node": "^24.3.0",
9+
"typescript": "^5.2.2",
810
"memfs": "^4.6.0",
911
"ts-morph": "^19.0.0",
10-
"jscodeshift": "^0.15.1",
11-
"@types/jscodeshift": "^0.11.10",
12-
"vitest": "^1.0.1",
13-
"@vitest/coverage-v8": "catalog:"
12+
"jscodeshift": "^0.15.1"
1413
},
1514
"private": true,
1615
"main": "./dist/index.cjs",
1716
"scripts": {
18-
"test": "vitest run",
19-
"test:watch": "vitest watch",
20-
"coverage": "vitest run --coverage"
17+
"test": "node --test",
18+
"test:watch": "node --test --watch"
2119
},
2220
"files": [
2321
"./README.md",

codemods-legacy/cal.com/generate-url-patterns/test/test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { deepStrictEqual } from "node:assert";
1+
import { deepStrictEqual } from "node:assert/strict";
2+
import { describe, it } from "node:test";
23
import { buildApi, executeFilemod } from "@codemod-com/filemod";
34
import { buildPathAPI, buildUnifiedFileSystem } from "@codemod-com/utilities";
45
import jscodeshift from "jscodeshift";
56
import type { DirectoryJSON } from "memfs";
67
import { Volume, createFsFromVolume } from "memfs";
7-
import { describe, it } from "vitest";
8-
import { repomod } from "../src/index.js";
8+
import { repomod } from "../src/index.ts";
99

1010
const transform = async (
1111
json: DirectoryJSON,
@@ -61,7 +61,7 @@ const abTestMiddlewareContent = `
6161
const middlewareContent = `
6262
export const config = {
6363
matcher: [
64-
"otherPath",
64+
"otherPath",
6565
]
6666
}
6767
`;
@@ -149,7 +149,7 @@ describe("generate-url-patterns", () => {
149149
newData: `
150150
export const config = {
151151
matcher: [
152-
"otherPath",
152+
"otherPath",
153153
"/noSegment",
154154
"/future/noSegment/",
155155
@@ -162,7 +162,7 @@ describe("generate-url-patterns", () => {
162162
"/dynamicSegment/:b/:c",
163163
"/future/dynamicSegment/:b/:c/",
164164
165-
"/optionalCatchAllDynamicSegments/:element*/f",
165+
"/optionalCatchAllDynamicSegments/:element*/f",
166166
"/future/optionalCatchAllDynamicSegments/:element*/f/"
167167
]
168168
}

0 commit comments

Comments
 (0)