diff --git a/.gitignore b/.gitignore index 1b89f1029..3ebdfcece 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,7 @@ packages/client/src/generatedNoCheck packages/client.test.ontology/src/generatedNoCheck packages/legacy-client/src/generatedNoCheck packages/create-app.template.*/src/generatedNoCheck +packages/e2e.test.foundry-sdk-generator/src/generatedNoCheck .log pnpm-publish-summary.json diff --git a/.monorepolint.config.mjs b/.monorepolint.config.mjs index 1113ae435..d7379b62f 100644 --- a/.monorepolint.config.mjs +++ b/.monorepolint.config.mjs @@ -51,6 +51,7 @@ const nonStandardPackages = [ "@osdk/e2e.sandbox.todoapp", "@osdk/examples.*", "@osdk/foundry-sdk-generator", + "@osdk/e2e.test.foundry-sdk-generator", "@osdk/monorepo.*", // internal monorepo packages "@osdk/shared.client", // hand written package that only exposes a symbol "@osdk/tests.*", @@ -241,7 +242,7 @@ function getTsconfigOptions(baseTsconfigPath, opts) { * legacy: boolean, * esmOnly?: boolean, * customTsconfigExcludes?: string[], - * tsVersion?: "^5.5.2"|"^4.9.5", + * tsVersion?: typeof LATEST_TYPESCRIPT_DEP | "^4.9.5", * skipTsconfigReferences?: boolean * singlePackageName?: string * }} options @@ -491,7 +492,15 @@ NOTE: DO NOT EDIT THIS README BY HAND. It is generated by monorepolint. legacy: false, tsVersion: LATEST_TYPESCRIPT_DEP, customTsconfigExcludes: [ - "./src/__e2e_tests__/**/**.test.ts", + "./src/generatedNoCheck/**/*", + ], + }), + ...standardPackageRules({ + includePackages: ["@osdk/e2e.test.foundry-sdk-generator"], + }, { + legacy: false, + tsVersion: LATEST_TYPESCRIPT_DEP, + customTsconfigExcludes: [ "./src/generatedNoCheck/**/*", ], }), diff --git a/packages/foundry-sdk-generator/src/__e2e_tests__/testSetup.ts b/packages/e2e.test.foundry-sdk-generator/generateMockOntology.js old mode 100755 new mode 100644 similarity index 62% rename from packages/foundry-sdk-generator/src/__e2e_tests__/testSetup.ts rename to packages/e2e.test.foundry-sdk-generator/generateMockOntology.js index f81a88c16..524720ca1 --- a/packages/foundry-sdk-generator/src/__e2e_tests__/testSetup.ts +++ b/packages/e2e.test.foundry-sdk-generator/generateMockOntology.js @@ -1,5 +1,5 @@ /* - * Copyright 2023 Palantir Technologies, Inc. All rights reserved. + * Copyright 2024 Palantir Technologies, Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,21 +14,29 @@ * limitations under the License. */ +// @ts-check +import { __testSeamOnly_NotSemverStable__GeneratePackageCommand as GeneratePackageCommand } from "@osdk/foundry-sdk-generator"; import { apiServer } from "@osdk/shared.test"; -import { rm } from "fs/promises"; -import { join } from "path"; -import { GeneratePackageCommand } from "../generate/index.js"; +import * as fs from "node:fs/promises"; +import * as path from "node:path"; +import { fileURLToPath } from "node:url"; -const dir = `${__dirname}/../generatedNoCheck/`; -export async function setup() { +const dir = path.join( + path.dirname(fileURLToPath(import.meta.url)), + "src", + "generatedNoCheck", +); +async function setup() { apiServer.listen(); - try { - await rm(join(dir, "@test-app"), { recursive: true }); - await rm(join(dir, "@test-app2"), { recursive: true }); - } catch (e) { - // Only needed for regenerations - } + const testAppDir = path.join(dir, "@test-app"); + const testApp2Dir = path.join(dir, "@test-app2"); + + await rmRf(testAppDir); + await rmRf(testApp2Dir); + + await safeStat(testAppDir, "should not exist"); + await safeStat(testApp2Dir, "should not exist"); const generatePackageCommand = new GeneratePackageCommand(); await generatePackageCommand.handler({ @@ -69,6 +77,8 @@ export async function setup() { $0: "", }); + await safeStat(testAppDir, "should exist"); + await generatePackageCommand.handler({ packageName: "@test-app2/osdk", packageVersion: "0.0.1", @@ -107,10 +117,54 @@ export async function setup() { _: [], $0: "", }); + + await safeStat(testApp2Dir, "should exist"); } export async function teardown() { // eslint-disable-next-line no-console - console.log("Test teardown: stopping API server"); + console.log("teardown: stopping API server"); apiServer.close(); } + +await setup(); +await teardown(); + +/** + * @param {string} testAppDir + */ +async function rmRf(testAppDir) { + try { + await fs.rm(testAppDir, { recursive: true }); + } catch (e) { + // eslint-disable-next-line no-console + console.debug("rm error", e); + // Only needed for regenerations + } +} + +/** + * @param {string} filePath + * @param {"should exist" | "should not exist"} type + * @returns + */ +async function safeStat(filePath, type) { + try { + const ret = await fs.stat(filePath); + if (type !== "should exist") { + throw new Error(`Expected ${filePath} to not exist`); + } + + // eslint-disable-next-line no-console + console.log(`safeStat: ${filePath} exists`); + return ret; + } catch (e) { + if (type === "should exist") { + throw new Error(`Expected ${filePath} to exist`); + } + + // eslint-disable-next-line no-console + console.log(`safeStat: ${filePath} does not exist`); + return undefined; + } +} diff --git a/packages/e2e.test.foundry-sdk-generator/package.json b/packages/e2e.test.foundry-sdk-generator/package.json index e8e8aba55..1522fefbe 100644 --- a/packages/e2e.test.foundry-sdk-generator/package.json +++ b/packages/e2e.test.foundry-sdk-generator/package.json @@ -23,6 +23,7 @@ "check-attw": "monorepo.tool.attw both", "check-spelling": "cspell --quiet .", "clean": "rm -rf lib dist types build tsconfig.tsbuildinfo", + "codegen": "node ./generateMockOntology.js", "fix-lint": "eslint . --fix && dprint fmt --config $(find-up dprint.json)", "lint": "eslint . && dprint check --config $(find-up dprint.json)", "test": "vitest run --pool=forks", @@ -34,9 +35,11 @@ "execa": "^9.3.0" }, "devDependencies": { + "@osdk/legacy-client": "workspace:~", "@osdk/monorepo.api-extractor": "workspace:~", "@osdk/monorepo.tsconfig": "workspace:~", "@osdk/monorepo.tsup": "workspace:~", + "@osdk/shared.test": "workspace:~", "typescript": "^5.5.4" }, "publishConfig": { diff --git a/packages/foundry-sdk-generator/src/generate/GeneratePackageCommand.test.ts b/packages/e2e.test.foundry-sdk-generator/src/GeneratePackageCommand.test.ts similarity index 88% rename from packages/foundry-sdk-generator/src/generate/GeneratePackageCommand.test.ts rename to packages/e2e.test.foundry-sdk-generator/src/GeneratePackageCommand.test.ts index 5bb26dfb4..8a8266977 100644 --- a/packages/foundry-sdk-generator/src/generate/GeneratePackageCommand.test.ts +++ b/packages/e2e.test.foundry-sdk-generator/src/GeneratePackageCommand.test.ts @@ -14,18 +14,18 @@ * limitations under the License. */ +import { __testSeamOnly_NotSemverStable__GeneratePackageCommand as GeneratePackageCommand } from "@osdk/foundry-sdk-generator"; import { existsSync } from "node:fs"; import * as fs from "node:fs/promises"; import * as path from "node:path"; +import { fileURLToPath } from "node:url"; import { describe, expect, it } from "vitest"; -import { GeneratePackageCommand } from "./GeneratePackageCommand.js"; describe(GeneratePackageCommand, () => { // ensure that we do not break backcompat by retaining our scripts export that links to the bundled types and esm output it("has a public scripts export", async () => { const generatedPath = path.join( - __dirname, - "..", + path.dirname(fileURLToPath(import.meta.url)), "generatedNoCheck", "@test-app", "osdk", diff --git a/packages/foundry-sdk-generator/src/__e2e_tests__/actions.test.ts b/packages/e2e.test.foundry-sdk-generator/src/legacy-client/actions.test.ts similarity index 100% rename from packages/foundry-sdk-generator/src/__e2e_tests__/actions.test.ts rename to packages/e2e.test.foundry-sdk-generator/src/legacy-client/actions.test.ts diff --git a/packages/foundry-sdk-generator/src/__e2e_tests__/aggregations.test.ts b/packages/e2e.test.foundry-sdk-generator/src/legacy-client/aggregations.test.ts similarity index 100% rename from packages/foundry-sdk-generator/src/__e2e_tests__/aggregations.test.ts rename to packages/e2e.test.foundry-sdk-generator/src/legacy-client/aggregations.test.ts diff --git a/packages/foundry-sdk-generator/src/__e2e_tests__/attachements.test.ts b/packages/e2e.test.foundry-sdk-generator/src/legacy-client/attachements.test.ts similarity index 100% rename from packages/foundry-sdk-generator/src/__e2e_tests__/attachements.test.ts rename to packages/e2e.test.foundry-sdk-generator/src/legacy-client/attachements.test.ts diff --git a/packages/foundry-sdk-generator/src/__e2e_tests__/consola.ts b/packages/e2e.test.foundry-sdk-generator/src/legacy-client/consola.ts similarity index 100% rename from packages/foundry-sdk-generator/src/__e2e_tests__/consola.ts rename to packages/e2e.test.foundry-sdk-generator/src/legacy-client/consola.ts diff --git a/packages/foundry-sdk-generator/src/__e2e_tests__/loadObjects.test.ts b/packages/e2e.test.foundry-sdk-generator/src/legacy-client/loadObjects.test.ts similarity index 98% rename from packages/foundry-sdk-generator/src/__e2e_tests__/loadObjects.test.ts rename to packages/e2e.test.foundry-sdk-generator/src/legacy-client/loadObjects.test.ts index 693ba82ae..4a623321f 100644 --- a/packages/foundry-sdk-generator/src/__e2e_tests__/loadObjects.test.ts +++ b/packages/e2e.test.foundry-sdk-generator/src/legacy-client/loadObjects.test.ts @@ -14,6 +14,7 @@ * limitations under the License. */ +import { apiServer, loadAll, stubData } from "@osdk/shared.test"; import { afterAll, beforeAll, @@ -39,8 +40,6 @@ import type { Page, Result, } from "../generatedNoCheck/@test-app/osdk/index.js"; - -import { apiServer, loadAll, stubData } from "@osdk/shared.test"; import type { Employee, Office, @@ -123,7 +122,7 @@ describe("LoadObjects", () => { const emp = assertOkOrThrow(result); - expectTypeOf(emp).toEqualTypeOf<{ + expectTypeOf(emp).branded.toEqualTypeOf<{ readonly fullName: string | undefined; readonly __primaryKey: number; readonly __apiName: "Employee"; @@ -141,7 +140,7 @@ describe("LoadObjects", () => { const emp = assertOkOrThrow(result); - expectTypeOf(emp).toEqualTypeOf<{ + expectTypeOf(emp).branded.toEqualTypeOf<{ readonly fullName: string | undefined; readonly __primaryKey: number; readonly __apiName: "Employee"; @@ -157,7 +156,7 @@ describe("LoadObjects", () => { const emp = await client.ontology.objects.Employee.select(["fullName"]) .fetchOne(stubData.employee1.__primaryKey); - expectTypeOf(emp).toEqualTypeOf<{ + expectTypeOf(emp).branded.toEqualTypeOf<{ readonly fullName: string | undefined; readonly __primaryKey: number; readonly __apiName: "Employee"; @@ -500,7 +499,7 @@ describe("LoadObjects", () => { .all(); const employees = assertOkOrThrow(result); expect(employees.length).toEqual(3); - expectTypeOf(employees[0]).toEqualTypeOf<{ + expectTypeOf(employees[0]).branded.toEqualTypeOf<{ readonly fullName: string | undefined; readonly __primaryKey: number; readonly __apiName: "Employee"; @@ -515,7 +514,7 @@ describe("LoadObjects", () => { .asyncIter(), ); expect(employees.length).toEqual(3); - expectTypeOf(employees[0]).toEqualTypeOf<{ + expectTypeOf(employees[0]).branded.toEqualTypeOf<{ readonly fullName: string | undefined; readonly __primaryKey: number; readonly __apiName: "Employee"; @@ -529,7 +528,7 @@ describe("LoadObjects", () => { .fetchPageWithErrors({ pageSize: 2 }); const employees = assertOkOrThrow(result); expect(employees.data.length).toEqual(2); - expectTypeOf(employees.data[0]).toEqualTypeOf<{ + expectTypeOf(employees.data[0]).branded.toEqualTypeOf<{ readonly fullName: string | undefined; readonly __primaryKey: number; readonly __apiName: "Employee"; diff --git a/packages/foundry-sdk-generator/src/__e2e_tests__/module.d.ts b/packages/e2e.test.foundry-sdk-generator/src/legacy-client/module.d.ts similarity index 100% rename from packages/foundry-sdk-generator/src/__e2e_tests__/module.d.ts rename to packages/e2e.test.foundry-sdk-generator/src/legacy-client/module.d.ts diff --git a/packages/foundry-sdk-generator/src/__e2e_tests__/objectSet.test.ts b/packages/e2e.test.foundry-sdk-generator/src/legacy-client/objectSet.test.ts similarity index 100% rename from packages/foundry-sdk-generator/src/__e2e_tests__/objectSet.test.ts rename to packages/e2e.test.foundry-sdk-generator/src/legacy-client/objectSet.test.ts diff --git a/packages/foundry-sdk-generator/src/__e2e_tests__/paginationHelpers.ts b/packages/e2e.test.foundry-sdk-generator/src/legacy-client/paginationHelpers.ts similarity index 100% rename from packages/foundry-sdk-generator/src/__e2e_tests__/paginationHelpers.ts rename to packages/e2e.test.foundry-sdk-generator/src/legacy-client/paginationHelpers.ts diff --git a/packages/foundry-sdk-generator/src/__e2e_tests__/queries.test.ts b/packages/e2e.test.foundry-sdk-generator/src/legacy-client/queries.test.ts similarity index 100% rename from packages/foundry-sdk-generator/src/__e2e_tests__/queries.test.ts rename to packages/e2e.test.foundry-sdk-generator/src/legacy-client/queries.test.ts diff --git a/packages/foundry-sdk-generator/src/__e2e_tests__/resultUtils.ts b/packages/e2e.test.foundry-sdk-generator/src/legacy-client/resultUtils.ts similarity index 100% rename from packages/foundry-sdk-generator/src/__e2e_tests__/resultUtils.ts rename to packages/e2e.test.foundry-sdk-generator/src/legacy-client/resultUtils.ts diff --git a/packages/foundry-sdk-generator/src/__e2e_tests__/search.test.ts b/packages/e2e.test.foundry-sdk-generator/src/legacy-client/search.test.ts similarity index 98% rename from packages/foundry-sdk-generator/src/__e2e_tests__/search.test.ts rename to packages/e2e.test.foundry-sdk-generator/src/legacy-client/search.test.ts index 16e5e39ea..4ec195f35 100644 --- a/packages/foundry-sdk-generator/src/__e2e_tests__/search.test.ts +++ b/packages/e2e.test.foundry-sdk-generator/src/legacy-client/search.test.ts @@ -14,6 +14,7 @@ * limitations under the License. */ +import { apiServer, loadAll } from "@osdk/shared.test"; import { afterAll, beforeAll, @@ -35,8 +36,6 @@ import type { Result, SearchObjectsError, } from "../generatedNoCheck/@test-app/osdk/index.js"; - -import { apiServer, loadAll } from "@osdk/shared.test"; import type { Employee, Office, @@ -428,10 +427,12 @@ describe("SearchObjects", () => { const employees = assertOkOrThrow(result); expect(employees.data.length).toEqual(1); expect(employees.data[0].fullName).toEqual("John Doe"); - expectTypeOf(employees.data[0]).toEqualTypeOf<{ + expectTypeOf(employees.data[0]).branded.toEqualTypeOf<{ readonly fullName: string | undefined; readonly __primaryKey: number; readonly __apiName: "Employee"; + readonly $primaryKey: number; + readonly $apiName: "Employee"; }>(); }); @@ -446,10 +447,12 @@ describe("SearchObjects", () => { const employees = assertOkOrThrow(result); expect(employees.data.length).toEqual(1); expect(employees.data[0].fullName).toEqual("John Doe"); - expectTypeOf(employees.data[0]).toEqualTypeOf<{ + expectTypeOf(employees.data[0]).branded.toEqualTypeOf<{ readonly fullName: string | undefined; readonly __primaryKey: number; readonly __apiName: "Employee"; + readonly $primaryKey: number; + readonly $apiName: "Employee"; }>(); }); diff --git a/packages/e2e.test.foundry-sdk-generator/tsconfig.cjs.json b/packages/e2e.test.foundry-sdk-generator/tsconfig.cjs.json index 3e2ecf7d1..ac1b8bdfb 100644 --- a/packages/e2e.test.foundry-sdk-generator/tsconfig.cjs.json +++ b/packages/e2e.test.foundry-sdk-generator/tsconfig.cjs.json @@ -10,5 +10,8 @@ "include": [ "./src/**/*" ], + "exclude": [ + "./src/generatedNoCheck/**/*" + ], "references": [] } diff --git a/packages/e2e.test.foundry-sdk-generator/tsconfig.json b/packages/e2e.test.foundry-sdk-generator/tsconfig.json index 6c1ec6f17..27fae9420 100644 --- a/packages/e2e.test.foundry-sdk-generator/tsconfig.json +++ b/packages/e2e.test.foundry-sdk-generator/tsconfig.json @@ -7,5 +7,8 @@ "include": [ "./src/**/*" ], + "exclude": [ + "./src/generatedNoCheck/**/*" + ], "references": [] } diff --git a/packages/e2e.test.foundry-sdk-generator/turbo.json b/packages/e2e.test.foundry-sdk-generator/turbo.json index e5c117d27..4966d8326 100644 --- a/packages/e2e.test.foundry-sdk-generator/turbo.json +++ b/packages/e2e.test.foundry-sdk-generator/turbo.json @@ -2,7 +2,17 @@ "extends": ["//"], "tasks": { "test": { - "dependsOn": ["@osdk/foundry-sdk-generator#transpile"] + "dependsOn": ["@osdk/foundry-sdk-generator#transpile", "codegen"] + }, + "codegen": { + "inputs": ["generateMockOntology.js"], + "outputs": ["src/generatedNoCheck/**/*"], + "dependsOn": [ + "@osdk/foundry-sdk-generator#transpile", + "@osdk/foundry-sdk-generator#typecheck", + "@osdk/shared.test#transpile", + "@osdk/shared.test#typecheck" + ] } } } diff --git a/packages/e2e.test.foundry-sdk-generator/vitest.config.mts b/packages/e2e.test.foundry-sdk-generator/vitest.config.mts new file mode 100644 index 000000000..21fdca144 --- /dev/null +++ b/packages/e2e.test.foundry-sdk-generator/vitest.config.mts @@ -0,0 +1,33 @@ +/* + * Copyright 2024 Palantir Technologies, Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { dirname, join } from "path"; +import { fileURLToPath } from "url"; +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + alias: { + "consola": join( + dirname(fileURLToPath(import.meta.url)), + "src", + "legacy-client", + "consola.ts", + ), + }, + pool: "forks", + }, +}); diff --git a/packages/foundry-sdk-generator/src/generate/betaClient/generatePackage.ts b/packages/foundry-sdk-generator/src/generate/betaClient/generatePackage.ts index e7ca20735..30a3496cb 100644 --- a/packages/foundry-sdk-generator/src/generate/betaClient/generatePackage.ts +++ b/packages/foundry-sdk-generator/src/generate/betaClient/generatePackage.ts @@ -20,7 +20,8 @@ import { generateClientSdkVersionTwoPointZero, } from "@osdk/generator"; import { mkdir, readdir, readFile, writeFile } from "fs/promises"; -import { isAbsolute, join, normalize } from "path"; +import { fileURLToPath } from "node:url"; +import { dirname, isAbsolute, join, normalize } from "path"; import { USER_AGENT } from "../../utils/UserAgent.js"; import { generateBundles } from "../generateBundles.js"; import { bundleDependencies } from "./bundleDependencies.js"; @@ -108,7 +109,7 @@ export async function generatePackage( const { findUp } = await import("find-up"); const nodeModulesPath = await findUp("node_modules", { - cwd: __dirname, + cwd: dirname(fileURLToPath(import.meta.url)), type: "directory", }); @@ -172,7 +173,9 @@ async function getDependencyVersion(dependency: string): Promise { return dependencies[dependency]!; } const { findUp } = await import("find-up"); - const result = await findUp("package.json", { cwd: __dirname }); + const result = await findUp("package.json", { + cwd: dirname(fileURLToPath(import.meta.url)), + }); const packageJson = await readFile(result!, { encoding: "utf-8", }); diff --git a/packages/foundry-sdk-generator/src/generate/generateBundles.ts b/packages/foundry-sdk-generator/src/generate/generateBundles.ts index 738b1caee..ece7dd898 100644 --- a/packages/foundry-sdk-generator/src/generate/generateBundles.ts +++ b/packages/foundry-sdk-generator/src/generate/generateBundles.ts @@ -16,6 +16,8 @@ import commonjs from "@rollup/plugin-commonjs"; import { nodeResolve } from "@rollup/plugin-node-resolve"; +import { dirname } from "node:path"; +import { fileURLToPath } from "node:url"; import type { ModuleFormat, RollupBuild } from "rollup"; import { rollup } from "rollup"; import nodePolyfill from "rollup-plugin-polyfill-node"; @@ -28,7 +30,7 @@ async function createRollupBuild( const { findUp } = await import("find-up"); const nodeModulesPath = await findUp("node_modules", { - cwd: __dirname, + cwd: dirname(fileURLToPath(import.meta.url)), type: "directory", }); diff --git a/packages/foundry-sdk-generator/src/index.ts b/packages/foundry-sdk-generator/src/index.ts index fe5e8ab5e..fa05f6cfb 100644 --- a/packages/foundry-sdk-generator/src/index.ts +++ b/packages/foundry-sdk-generator/src/index.ts @@ -15,3 +15,4 @@ */ export { cli } from "./cli/foundrySdkGeneratorCli.js"; +export { GeneratePackageCommand as __testSeamOnly_NotSemverStable__GeneratePackageCommand } from "./generate/index.js"; diff --git a/packages/foundry-sdk-generator/src/__e2e_tests__/__snapshots__/metadataResolver.test.ts.snap b/packages/foundry-sdk-generator/src/ontologyMetadata/__snapshots__/metadataResolver.test.ts.snap similarity index 100% rename from packages/foundry-sdk-generator/src/__e2e_tests__/__snapshots__/metadataResolver.test.ts.snap rename to packages/foundry-sdk-generator/src/ontologyMetadata/__snapshots__/metadataResolver.test.ts.snap diff --git a/packages/foundry-sdk-generator/src/__e2e_tests__/metadataResolver.test.ts b/packages/foundry-sdk-generator/src/ontologyMetadata/metadataResolver.test.ts similarity index 98% rename from packages/foundry-sdk-generator/src/__e2e_tests__/metadataResolver.test.ts rename to packages/foundry-sdk-generator/src/ontologyMetadata/metadataResolver.test.ts index 6b81022e9..2339acf4c 100644 --- a/packages/foundry-sdk-generator/src/__e2e_tests__/metadataResolver.test.ts +++ b/packages/foundry-sdk-generator/src/ontologyMetadata/metadataResolver.test.ts @@ -14,10 +14,9 @@ * limitations under the License. */ -import { afterAll, beforeAll, describe, expect, it } from "vitest"; -import { OntologyMetadataResolver } from "../ontologyMetadata/ontologyMetadataResolver.js"; - import { apiServer, handlers } from "@osdk/shared.test"; +import { afterAll, beforeAll, describe, expect, it } from "vitest"; +import { OntologyMetadataResolver } from "./ontologyMetadataResolver.js"; describe("Load Ontologies Metadata", () => { beforeAll(() => { diff --git a/packages/foundry-sdk-generator/tsconfig.cjs.json b/packages/foundry-sdk-generator/tsconfig.cjs.json index 7d4281f50..ac1b8bdfb 100644 --- a/packages/foundry-sdk-generator/tsconfig.cjs.json +++ b/packages/foundry-sdk-generator/tsconfig.cjs.json @@ -11,7 +11,6 @@ "./src/**/*" ], "exclude": [ - "./src/__e2e_tests__/**/**.test.ts", "./src/generatedNoCheck/**/*" ], "references": [] diff --git a/packages/foundry-sdk-generator/tsconfig.json b/packages/foundry-sdk-generator/tsconfig.json index 677669b3b..27fae9420 100644 --- a/packages/foundry-sdk-generator/tsconfig.json +++ b/packages/foundry-sdk-generator/tsconfig.json @@ -8,7 +8,6 @@ "./src/**/*" ], "exclude": [ - "./src/__e2e_tests__/**/**.test.ts", "./src/generatedNoCheck/**/*" ], "references": [] diff --git a/packages/foundry-sdk-generator/vitest.config.mts b/packages/foundry-sdk-generator/vitest.config.mts index efbef9e5a..6310c21f7 100644 --- a/packages/foundry-sdk-generator/vitest.config.mts +++ b/packages/foundry-sdk-generator/vitest.config.mts @@ -18,13 +18,13 @@ import { dirname, join } from "path"; import { fileURLToPath } from "url"; import { defineConfig } from "vitest/config"; -const __dirname = dirname(fileURLToPath(import.meta.url)); - export default defineConfig({ test: { - globalSetup: [join(__dirname, "./src/__e2e_tests__/testSetup.ts")], alias: { - "consola": join(__dirname, "./src/__e2e_tests__/consola.ts"), + "consola": join( + dirname(fileURLToPath(import.meta.url)), + "./src/__e2e_tests__/consola.ts", + ), }, pool: "forks", }, diff --git a/packages/monorepo.cspell/cspell.config.js b/packages/monorepo.cspell/cspell.config.js index fedc8bb0a..4435af984 100644 --- a/packages/monorepo.cspell/cspell.config.js +++ b/packages/monorepo.cspell/cspell.config.js @@ -53,6 +53,7 @@ const cspell = { "node_modules/**", ".git/**", ".gitignore", + "**/.turbo/**/*", // Ignore these files for now "_gitignore", @@ -83,7 +84,7 @@ const cspell = { // this is the conjure generated code that we won't keep forever "packages/client.unstable/src/generated/**", - "packages/foundry-sdk-generator/src/generatedNoCheck/**/*", + "packages/e2e.test.foundry-sdk-generator/src/generatedNoCheck/**/*", ], dictionaryDefinitions: [ ...getDictionaryDefinitions(), diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b638df295..7b067cf71 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1410,6 +1410,9 @@ importers: specifier: ^9.3.0 version: 9.3.0 devDependencies: + '@osdk/legacy-client': + specifier: workspace:~ + version: link:../legacy-client '@osdk/monorepo.api-extractor': specifier: workspace:~ version: link:../monorepo.api-extractor @@ -1419,6 +1422,9 @@ importers: '@osdk/monorepo.tsup': specifier: workspace:~ version: link:../monorepo.tsup + '@osdk/shared.test': + specifier: workspace:~ + version: link:../shared.test typescript: specifier: ^5.5.4 version: 5.5.4