From 33ebe6c2258ba299f5b107b2a9c5f468fb55d766 Mon Sep 17 00:00:00 2001 From: zetashift Date: Mon, 4 Sep 2023 18:52:20 +0200 Subject: [PATCH 1/3] feat(type-safe-api): add compilation to ESM for TypeScript --- .../generated-typescript-runtime-project.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/type-safe-api/src/project/codegen/runtime/generated-typescript-runtime-project.ts b/packages/type-safe-api/src/project/codegen/runtime/generated-typescript-runtime-project.ts index af8aef8eb..571a2bd39 100644 --- a/packages/type-safe-api/src/project/codegen/runtime/generated-typescript-runtime-project.ts +++ b/packages/type-safe-api/src/project/codegen/runtime/generated-typescript-runtime-project.ts @@ -1,7 +1,7 @@ /*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ import { NodePackageUtils } from "@aws/monorepo"; -import { IgnoreFile } from "projen"; +import { IgnoreFile, JsonFile } from "projen"; import { NodePackageManager, TypeScriptModuleResolution, @@ -124,6 +124,22 @@ export class GeneratedTypescriptRuntimeProject extends TypeScriptProject { this.preCompileTask.spawn(generateTask); + // Add compilation to ESM as well + const compileESMTask = this.addTask("compile-esm"); + compileESMTask.exec("tsc -p tsconfig.esm.json"); + new JsonFile(this, "tsconfig.esm.json", { + obj: { + extends: "./tsconfig.dev.json", + compilerOptions: { + module: "esnext", + moduleResolution: "nodenext", + outDir: "lib/esm", + }, + }, + }); + + this.compileTask.spawn(compileESMTask); + // Ignore all the generated code this.gitignore.addPatterns( "src", From 04ee6196eb70379eaa34685845d44f550f8d8294 Mon Sep 17 00:00:00 2001 From: zetashift Date: Tue, 5 Sep 2023 09:17:29 +0200 Subject: [PATCH 2/3] test(type-safe-api): add snapshots for ESM compilation --- .../type-safe-api-project.test.ts.snap | 598 ++++++++++++++++++ ...ed-typescript-runtime-project.test.ts.snap | 24 + 2 files changed, 622 insertions(+) diff --git a/packages/type-safe-api/test/project/__snapshots__/type-safe-api-project.test.ts.snap b/packages/type-safe-api/test/project/__snapshots__/type-safe-api-project.test.ts.snap index 3e82d7b1f..ff966b3f3 100644 --- a/packages/type-safe-api/test/project/__snapshots__/type-safe-api-project.test.ts.snap +++ b/packages/type-safe-api/test/project/__snapshots__/type-safe-api-project.test.ts.snap @@ -2060,6 +2060,7 @@ dev-dependencies = { } /openapitools.json linguist-generated /package.json linguist-generated /tsconfig.dev.json linguist-generated +/tsconfig.esm.json linguist-generated /tsconfig.json linguist-generated /yarn.lock linguist-generated", "generated/runtime/typescript/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". @@ -2103,6 +2104,7 @@ jspm_packages/ !/.npmignore !/.openapi-generator-ignore !/openapitools.json +!/tsconfig.esm.json src .npmignore README.md @@ -2173,6 +2175,7 @@ tsconfig.esm.json "LICENSE", "openapitools.json", "tsconfig.dev.json", + "tsconfig.esm.json", "tsconfig.json", ], }, @@ -2210,6 +2213,17 @@ tsconfig.esm.json { "exec": "tsc --build", }, + { + "spawn": "compile-esm", + }, + ], + }, + "compile-esm": { + "name": "compile-esm", + "steps": [ + { + "exec": "tsc -p tsconfig.esm.json", + }, ], }, "default": { @@ -2558,6 +2572,7 @@ tsconfig.esm.json "scripts": { "build": "npx projen build", "compile": "npx projen compile", + "compile-esm": "npx projen compile-esm", "default": "npx projen default", "generate": "npx projen generate", "package": "npx projen package", @@ -2610,6 +2625,15 @@ tsconfig.esm.json "test/**/*.ts", ], }, + "generated/runtime/typescript/tsconfig.esm.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "compilerOptions": { + "module": "esnext", + "moduleResolution": "nodenext", + "outDir": "lib/esm", + }, + "extends": "./tsconfig.dev.json", + }, "generated/runtime/typescript/tsconfig.json": { "compilerOptions": { "alwaysStrict": false, @@ -6273,6 +6297,7 @@ dev-dependencies = { } /package.json linguist-generated /project.json linguist-generated /tsconfig.dev.json linguist-generated +/tsconfig.esm.json linguist-generated /tsconfig.json linguist-generated /yarn.lock linguist-generated", "packages/api/generated/runtime/typescript/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". @@ -6316,6 +6341,7 @@ jspm_packages/ !/.npmignore !/.openapi-generator-ignore !/openapitools.json +!/tsconfig.esm.json src .npmignore README.md @@ -6387,6 +6413,7 @@ tsconfig.esm.json "openapitools.json", "project.json", "tsconfig.dev.json", + "tsconfig.esm.json", "tsconfig.json", ], }, @@ -6424,6 +6451,17 @@ tsconfig.esm.json { "exec": "tsc --build", }, + { + "spawn": "compile-esm", + }, + ], + }, + "compile-esm": { + "name": "compile-esm", + "steps": [ + { + "exec": "tsc -p tsconfig.esm.json", + }, ], }, "default": { @@ -6763,6 +6801,7 @@ tsconfig.esm.json "scripts": { "build": "npx projen build", "compile": "npx projen compile", + "compile-esm": "npx projen compile-esm", "default": "npx projen default", "generate": "npx projen generate", "package": "npx projen package", @@ -6798,6 +6837,13 @@ tsconfig.esm.json "cwd": "packages/api/generated/runtime/typescript", }, }, + "compile-esm": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen compile-esm", + "cwd": "packages/api/generated/runtime/typescript", + }, + }, "default": { "executor": "nx:run-commands", "options": { @@ -6901,6 +6947,15 @@ tsconfig.esm.json "test/**/*.ts", ], }, + "packages/api/generated/runtime/typescript/tsconfig.esm.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "compilerOptions": { + "module": "esnext", + "moduleResolution": "nodenext", + "outDir": "lib/esm", + }, + "extends": "./tsconfig.dev.json", + }, "packages/api/generated/runtime/typescript/tsconfig.json": { "compilerOptions": { "alwaysStrict": false, @@ -9337,6 +9392,7 @@ dev-dependencies = { } /openapitools.json linguist-generated /package.json linguist-generated /tsconfig.dev.json linguist-generated +/tsconfig.esm.json linguist-generated /tsconfig.json linguist-generated /yarn.lock linguist-generated", "generated/runtime/typescript/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". @@ -9380,6 +9436,7 @@ jspm_packages/ !/.npmignore !/.openapi-generator-ignore !/openapitools.json +!/tsconfig.esm.json src .npmignore README.md @@ -9450,6 +9507,7 @@ tsconfig.esm.json "LICENSE", "openapitools.json", "tsconfig.dev.json", + "tsconfig.esm.json", "tsconfig.json", ], }, @@ -9487,6 +9545,17 @@ tsconfig.esm.json { "exec": "tsc --build", }, + { + "spawn": "compile-esm", + }, + ], + }, + "compile-esm": { + "name": "compile-esm", + "steps": [ + { + "exec": "tsc -p tsconfig.esm.json", + }, ], }, "default": { @@ -9835,6 +9904,7 @@ tsconfig.esm.json "scripts": { "build": "npx projen build", "compile": "npx projen compile", + "compile-esm": "npx projen compile-esm", "default": "npx projen default", "generate": "npx projen generate", "package": "npx projen package", @@ -9887,6 +9957,15 @@ tsconfig.esm.json "test/**/*.ts", ], }, + "generated/runtime/typescript/tsconfig.esm.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "compilerOptions": { + "module": "esnext", + "moduleResolution": "nodenext", + "outDir": "lib/esm", + }, + "extends": "./tsconfig.dev.json", + }, "generated/runtime/typescript/tsconfig.json": { "compilerOptions": { "alwaysStrict": false, @@ -13457,6 +13536,7 @@ dev-dependencies = { } /package.json linguist-generated /project.json linguist-generated /tsconfig.dev.json linguist-generated +/tsconfig.esm.json linguist-generated /tsconfig.json linguist-generated /yarn.lock linguist-generated", "packages/api/generated/runtime/typescript/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". @@ -13500,6 +13580,7 @@ jspm_packages/ !/.npmignore !/.openapi-generator-ignore !/openapitools.json +!/tsconfig.esm.json src .npmignore README.md @@ -13571,6 +13652,7 @@ tsconfig.esm.json "openapitools.json", "project.json", "tsconfig.dev.json", + "tsconfig.esm.json", "tsconfig.json", ], }, @@ -13608,6 +13690,17 @@ tsconfig.esm.json { "exec": "tsc --build", }, + { + "spawn": "compile-esm", + }, + ], + }, + "compile-esm": { + "name": "compile-esm", + "steps": [ + { + "exec": "tsc -p tsconfig.esm.json", + }, ], }, "default": { @@ -13947,6 +14040,7 @@ tsconfig.esm.json "scripts": { "build": "npx projen build", "compile": "npx projen compile", + "compile-esm": "npx projen compile-esm", "default": "npx projen default", "generate": "npx projen generate", "package": "npx projen package", @@ -13982,6 +14076,13 @@ tsconfig.esm.json "cwd": "packages/api/generated/runtime/typescript", }, }, + "compile-esm": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen compile-esm", + "cwd": "packages/api/generated/runtime/typescript", + }, + }, "default": { "executor": "nx:run-commands", "options": { @@ -14085,6 +14186,15 @@ tsconfig.esm.json "test/**/*.ts", ], }, + "packages/api/generated/runtime/typescript/tsconfig.esm.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "compilerOptions": { + "module": "esnext", + "moduleResolution": "nodenext", + "outDir": "lib/esm", + }, + "extends": "./tsconfig.dev.json", + }, "packages/api/generated/runtime/typescript/tsconfig.json": { "compilerOptions": { "alwaysStrict": false, @@ -16825,6 +16935,7 @@ dev-dependencies = { } /openapitools.json linguist-generated /package.json linguist-generated /tsconfig.dev.json linguist-generated +/tsconfig.esm.json linguist-generated /tsconfig.json linguist-generated /yarn.lock linguist-generated", "generated/runtime/typescript/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". @@ -16868,6 +16979,7 @@ jspm_packages/ !/.npmignore !/.openapi-generator-ignore !/openapitools.json +!/tsconfig.esm.json src .npmignore README.md @@ -16938,6 +17050,7 @@ tsconfig.esm.json "LICENSE", "openapitools.json", "tsconfig.dev.json", + "tsconfig.esm.json", "tsconfig.json", ], }, @@ -16975,6 +17088,17 @@ tsconfig.esm.json { "exec": "tsc --build", }, + { + "spawn": "compile-esm", + }, + ], + }, + "compile-esm": { + "name": "compile-esm", + "steps": [ + { + "exec": "tsc -p tsconfig.esm.json", + }, ], }, "default": { @@ -17323,6 +17447,7 @@ tsconfig.esm.json "scripts": { "build": "npx projen build", "compile": "npx projen compile", + "compile-esm": "npx projen compile-esm", "default": "npx projen default", "generate": "npx projen generate", "package": "npx projen package", @@ -17375,6 +17500,15 @@ tsconfig.esm.json "test/**/*.ts", ], }, + "generated/runtime/typescript/tsconfig.esm.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "compilerOptions": { + "module": "esnext", + "moduleResolution": "nodenext", + "outDir": "lib/esm", + }, + "extends": "./tsconfig.dev.json", + }, "generated/runtime/typescript/tsconfig.json": { "compilerOptions": { "alwaysStrict": false, @@ -21234,6 +21368,7 @@ dev-dependencies = { } /package.json linguist-generated /project.json linguist-generated /tsconfig.dev.json linguist-generated +/tsconfig.esm.json linguist-generated /tsconfig.json linguist-generated /yarn.lock linguist-generated", "packages/api/generated/runtime/typescript/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". @@ -21277,6 +21412,7 @@ jspm_packages/ !/.npmignore !/.openapi-generator-ignore !/openapitools.json +!/tsconfig.esm.json src .npmignore README.md @@ -21348,6 +21484,7 @@ tsconfig.esm.json "openapitools.json", "project.json", "tsconfig.dev.json", + "tsconfig.esm.json", "tsconfig.json", ], }, @@ -21385,6 +21522,17 @@ tsconfig.esm.json { "exec": "tsc --build", }, + { + "spawn": "compile-esm", + }, + ], + }, + "compile-esm": { + "name": "compile-esm", + "steps": [ + { + "exec": "tsc -p tsconfig.esm.json", + }, ], }, "default": { @@ -21724,6 +21872,7 @@ tsconfig.esm.json "scripts": { "build": "npx projen build", "compile": "npx projen compile", + "compile-esm": "npx projen compile-esm", "default": "npx projen default", "generate": "npx projen generate", "package": "npx projen package", @@ -21759,6 +21908,13 @@ tsconfig.esm.json "cwd": "packages/api/generated/runtime/typescript", }, }, + "compile-esm": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen compile-esm", + "cwd": "packages/api/generated/runtime/typescript", + }, + }, "default": { "executor": "nx:run-commands", "options": { @@ -21862,6 +22018,15 @@ tsconfig.esm.json "test/**/*.ts", ], }, + "packages/api/generated/runtime/typescript/tsconfig.esm.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "compilerOptions": { + "module": "esnext", + "moduleResolution": "nodenext", + "outDir": "lib/esm", + }, + "extends": "./tsconfig.dev.json", + }, "packages/api/generated/runtime/typescript/tsconfig.json": { "compilerOptions": { "alwaysStrict": false, @@ -24184,6 +24349,7 @@ dev-dependencies = { } /openapitools.json linguist-generated /package.json linguist-generated /tsconfig.dev.json linguist-generated +/tsconfig.esm.json linguist-generated /tsconfig.json linguist-generated /yarn.lock linguist-generated", "generated/runtime/typescript/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". @@ -24227,6 +24393,7 @@ jspm_packages/ !/.npmignore !/.openapi-generator-ignore !/openapitools.json +!/tsconfig.esm.json src .npmignore README.md @@ -24297,6 +24464,7 @@ tsconfig.esm.json "LICENSE", "openapitools.json", "tsconfig.dev.json", + "tsconfig.esm.json", "tsconfig.json", ], }, @@ -24334,6 +24502,17 @@ tsconfig.esm.json { "exec": "tsc --build", }, + { + "spawn": "compile-esm", + }, + ], + }, + "compile-esm": { + "name": "compile-esm", + "steps": [ + { + "exec": "tsc -p tsconfig.esm.json", + }, ], }, "default": { @@ -24682,6 +24861,7 @@ tsconfig.esm.json "scripts": { "build": "npx projen build", "compile": "npx projen compile", + "compile-esm": "npx projen compile-esm", "default": "npx projen default", "generate": "npx projen generate", "package": "npx projen package", @@ -24734,6 +24914,15 @@ tsconfig.esm.json "test/**/*.ts", ], }, + "generated/runtime/typescript/tsconfig.esm.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "compilerOptions": { + "module": "esnext", + "moduleResolution": "nodenext", + "outDir": "lib/esm", + }, + "extends": "./tsconfig.dev.json", + }, "generated/runtime/typescript/tsconfig.json": { "compilerOptions": { "alwaysStrict": false, @@ -28673,6 +28862,7 @@ Each runtime project includes types from your API model, as well as type-safe cl /openapitools.json linguist-generated /package.json linguist-generated /tsconfig.dev.json linguist-generated +/tsconfig.esm.json linguist-generated /tsconfig.json linguist-generated /yarn.lock linguist-generated", "generated/runtime/typescript/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". @@ -28716,6 +28906,7 @@ jspm_packages/ !/.npmignore !/.openapi-generator-ignore !/openapitools.json +!/tsconfig.esm.json src .npmignore README.md @@ -28786,6 +28977,7 @@ tsconfig.esm.json "LICENSE", "openapitools.json", "tsconfig.dev.json", + "tsconfig.esm.json", "tsconfig.json", ], }, @@ -28823,6 +29015,17 @@ tsconfig.esm.json { "exec": "tsc --build", }, + { + "spawn": "compile-esm", + }, + ], + }, + "compile-esm": { + "name": "compile-esm", + "steps": [ + { + "exec": "tsc -p tsconfig.esm.json", + }, ], }, "default": { @@ -29171,6 +29374,7 @@ tsconfig.esm.json "scripts": { "build": "npx projen build", "compile": "npx projen compile", + "compile-esm": "npx projen compile-esm", "default": "npx projen default", "generate": "npx projen generate", "package": "npx projen package", @@ -29223,6 +29427,15 @@ tsconfig.esm.json "test/**/*.ts", ], }, + "generated/runtime/typescript/tsconfig.esm.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "compilerOptions": { + "module": "esnext", + "moduleResolution": "nodenext", + "outDir": "lib/esm", + }, + "extends": "./tsconfig.dev.json", + }, "generated/runtime/typescript/tsconfig.json": { "compilerOptions": { "alwaysStrict": false, @@ -31662,6 +31875,7 @@ dev-dependencies = { } /openapitools.json linguist-generated /package.json linguist-generated /tsconfig.dev.json linguist-generated +/tsconfig.esm.json linguist-generated /tsconfig.json linguist-generated /yarn.lock linguist-generated", "generated/runtime/typescript/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". @@ -31705,6 +31919,7 @@ jspm_packages/ !/.npmignore !/.openapi-generator-ignore !/openapitools.json +!/tsconfig.esm.json src .npmignore README.md @@ -31775,6 +31990,7 @@ tsconfig.esm.json "LICENSE", "openapitools.json", "tsconfig.dev.json", + "tsconfig.esm.json", "tsconfig.json", ], }, @@ -31812,6 +32028,17 @@ tsconfig.esm.json { "exec": "tsc --build", }, + { + "spawn": "compile-esm", + }, + ], + }, + "compile-esm": { + "name": "compile-esm", + "steps": [ + { + "exec": "tsc -p tsconfig.esm.json", + }, ], }, "default": { @@ -32160,6 +32387,7 @@ tsconfig.esm.json "scripts": { "build": "npx projen build", "compile": "npx projen compile", + "compile-esm": "npx projen compile-esm", "default": "npx projen default", "generate": "npx projen generate", "package": "npx projen package", @@ -32212,6 +32440,15 @@ tsconfig.esm.json "test/**/*.ts", ], }, + "generated/runtime/typescript/tsconfig.esm.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "compilerOptions": { + "module": "esnext", + "moduleResolution": "nodenext", + "outDir": "lib/esm", + }, + "extends": "./tsconfig.dev.json", + }, "generated/runtime/typescript/tsconfig.json": { "compilerOptions": { "alwaysStrict": false, @@ -35968,6 +36205,7 @@ dev-dependencies = { } /package.json linguist-generated /project.json linguist-generated /tsconfig.dev.json linguist-generated +/tsconfig.esm.json linguist-generated /tsconfig.json linguist-generated /yarn.lock linguist-generated", "packages/api/generated/runtime/typescript/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". @@ -36011,6 +36249,7 @@ jspm_packages/ !/.npmignore !/.openapi-generator-ignore !/openapitools.json +!/tsconfig.esm.json src .npmignore README.md @@ -36082,6 +36321,7 @@ tsconfig.esm.json "openapitools.json", "project.json", "tsconfig.dev.json", + "tsconfig.esm.json", "tsconfig.json", ], }, @@ -36119,6 +36359,17 @@ tsconfig.esm.json { "exec": "tsc --build", }, + { + "spawn": "compile-esm", + }, + ], + }, + "compile-esm": { + "name": "compile-esm", + "steps": [ + { + "exec": "tsc -p tsconfig.esm.json", + }, ], }, "default": { @@ -36458,6 +36709,7 @@ tsconfig.esm.json "scripts": { "build": "npx projen build", "compile": "npx projen compile", + "compile-esm": "npx projen compile-esm", "default": "npx projen default", "generate": "npx projen generate", "package": "npx projen package", @@ -36493,6 +36745,13 @@ tsconfig.esm.json "cwd": "packages/api/generated/runtime/typescript", }, }, + "compile-esm": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen compile-esm", + "cwd": "packages/api/generated/runtime/typescript", + }, + }, "default": { "executor": "nx:run-commands", "options": { @@ -36596,6 +36855,15 @@ tsconfig.esm.json "test/**/*.ts", ], }, + "packages/api/generated/runtime/typescript/tsconfig.esm.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "compilerOptions": { + "module": "esnext", + "moduleResolution": "nodenext", + "outDir": "lib/esm", + }, + "extends": "./tsconfig.dev.json", + }, "packages/api/generated/runtime/typescript/tsconfig.json": { "compilerOptions": { "alwaysStrict": false, @@ -38549,6 +38817,7 @@ Each runtime project includes types from your API model, as well as type-safe cl /openapitools.json linguist-generated /package.json linguist-generated /tsconfig.dev.json linguist-generated +/tsconfig.esm.json linguist-generated /tsconfig.json linguist-generated /yarn.lock linguist-generated", "generated/runtime/typescript/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". @@ -38592,6 +38861,7 @@ jspm_packages/ !/.npmignore !/.openapi-generator-ignore !/openapitools.json +!/tsconfig.esm.json src .npmignore README.md @@ -38662,6 +38932,7 @@ tsconfig.esm.json "LICENSE", "openapitools.json", "tsconfig.dev.json", + "tsconfig.esm.json", "tsconfig.json", ], }, @@ -38699,6 +38970,17 @@ tsconfig.esm.json { "exec": "tsc --build", }, + { + "spawn": "compile-esm", + }, + ], + }, + "compile-esm": { + "name": "compile-esm", + "steps": [ + { + "exec": "tsc -p tsconfig.esm.json", + }, ], }, "default": { @@ -39047,6 +39329,7 @@ tsconfig.esm.json "scripts": { "build": "npx projen build", "compile": "npx projen compile", + "compile-esm": "npx projen compile-esm", "default": "npx projen default", "generate": "npx projen generate", "package": "npx projen package", @@ -39099,6 +39382,15 @@ tsconfig.esm.json "test/**/*.ts", ], }, + "generated/runtime/typescript/tsconfig.esm.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "compilerOptions": { + "module": "esnext", + "moduleResolution": "nodenext", + "outDir": "lib/esm", + }, + "extends": "./tsconfig.dev.json", + }, "generated/runtime/typescript/tsconfig.json": { "compilerOptions": { "alwaysStrict": false, @@ -42012,6 +42304,7 @@ Each runtime project includes types from your API model, as well as type-safe cl /package.json linguist-generated /project.json linguist-generated /tsconfig.dev.json linguist-generated +/tsconfig.esm.json linguist-generated /tsconfig.json linguist-generated", "packages/api/generated/runtime/typescript/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". !/.gitattributes @@ -42054,6 +42347,7 @@ jspm_packages/ !/.npmignore !/.openapi-generator-ignore !/openapitools.json +!/tsconfig.esm.json src .npmignore README.md @@ -42125,6 +42419,7 @@ tsconfig.esm.json "openapitools.json", "project.json", "tsconfig.dev.json", + "tsconfig.esm.json", "tsconfig.json", ], }, @@ -42162,6 +42457,17 @@ tsconfig.esm.json { "exec": "tsc --build", }, + { + "spawn": "compile-esm", + }, + ], + }, + "compile-esm": { + "name": "compile-esm", + "steps": [ + { + "exec": "tsc -p tsconfig.esm.json", + }, ], }, "default": { @@ -42501,6 +42807,7 @@ tsconfig.esm.json "scripts": { "build": "npx projen build", "compile": "npx projen compile", + "compile-esm": "npx projen compile-esm", "default": "npx projen default", "generate": "npx projen generate", "package": "npx projen package", @@ -42536,6 +42843,13 @@ tsconfig.esm.json "cwd": "packages/api/generated/runtime/typescript", }, }, + "compile-esm": { + "executor": "nx:run-commands", + "options": { + "command": "npx projen compile-esm", + "cwd": "packages/api/generated/runtime/typescript", + }, + }, "default": { "executor": "nx:run-commands", "options": { @@ -42639,6 +42953,15 @@ tsconfig.esm.json "test/**/*.ts", ], }, + "packages/api/generated/runtime/typescript/tsconfig.esm.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "compilerOptions": { + "module": "esnext", + "moduleResolution": "nodenext", + "outDir": "lib/esm", + }, + "extends": "./tsconfig.dev.json", + }, "packages/api/generated/runtime/typescript/tsconfig.json": { "compilerOptions": { "alwaysStrict": false, @@ -44597,6 +44920,7 @@ Each runtime project includes types from your API model, as well as type-safe cl /openapitools.json linguist-generated /package.json linguist-generated /tsconfig.dev.json linguist-generated +/tsconfig.esm.json linguist-generated /tsconfig.json linguist-generated /yarn.lock linguist-generated", "generated/runtime/typescript/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". @@ -44640,6 +44964,7 @@ jspm_packages/ !/.npmignore !/.openapi-generator-ignore !/openapitools.json +!/tsconfig.esm.json src .npmignore README.md @@ -44710,6 +45035,7 @@ tsconfig.esm.json "LICENSE", "openapitools.json", "tsconfig.dev.json", + "tsconfig.esm.json", "tsconfig.json", ], }, @@ -44747,6 +45073,17 @@ tsconfig.esm.json { "exec": "tsc --build", }, + { + "spawn": "compile-esm", + }, + ], + }, + "compile-esm": { + "name": "compile-esm", + "steps": [ + { + "exec": "tsc -p tsconfig.esm.json", + }, ], }, "default": { @@ -45095,6 +45432,7 @@ tsconfig.esm.json "scripts": { "build": "npx projen build", "compile": "npx projen compile", + "compile-esm": "npx projen compile-esm", "default": "npx projen default", "generate": "npx projen generate", "package": "npx projen package", @@ -45147,6 +45485,15 @@ tsconfig.esm.json "test/**/*.ts", ], }, + "generated/runtime/typescript/tsconfig.esm.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "compilerOptions": { + "module": "esnext", + "moduleResolution": "nodenext", + "outDir": "lib/esm", + }, + "extends": "./tsconfig.dev.json", + }, "generated/runtime/typescript/tsconfig.json": { "compilerOptions": { "alwaysStrict": false, @@ -48071,6 +48418,7 @@ Each runtime project includes types from your API model, as well as type-safe cl /pnpm-lock.yaml linguist-generated /project.json linguist-generated /tsconfig.dev.json linguist-generated +/tsconfig.esm.json linguist-generated /tsconfig.json linguist-generated", "packages/api/generated/runtime/typescript/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". !/.gitattributes @@ -48113,6 +48461,7 @@ jspm_packages/ !/.npmignore !/.openapi-generator-ignore !/openapitools.json +!/tsconfig.esm.json src .npmignore README.md @@ -48184,6 +48533,7 @@ tsconfig.esm.json "openapitools.json", "project.json", "tsconfig.dev.json", + "tsconfig.esm.json", "tsconfig.json", ], }, @@ -48221,6 +48571,17 @@ tsconfig.esm.json { "exec": "tsc --build", }, + { + "spawn": "compile-esm", + }, + ], + }, + "compile-esm": { + "name": "compile-esm", + "steps": [ + { + "exec": "tsc -p tsconfig.esm.json", + }, ], }, "default": { @@ -48561,6 +48922,7 @@ tsconfig.esm.json "scripts": { "build": "npx projen build", "compile": "npx projen compile", + "compile-esm": "npx projen compile-esm", "default": "npx projen default", "generate": "npx projen generate", "package": "npx projen package", @@ -48596,6 +48958,13 @@ tsconfig.esm.json "cwd": "packages/api/generated/runtime/typescript", }, }, + "compile-esm": { + "executor": "nx:run-commands", + "options": { + "command": "pnpm exec projen compile-esm", + "cwd": "packages/api/generated/runtime/typescript", + }, + }, "default": { "executor": "nx:run-commands", "options": { @@ -48699,6 +49068,15 @@ tsconfig.esm.json "test/**/*.ts", ], }, + "packages/api/generated/runtime/typescript/tsconfig.esm.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "compilerOptions": { + "module": "esnext", + "moduleResolution": "nodenext", + "outDir": "lib/esm", + }, + "extends": "./tsconfig.dev.json", + }, "packages/api/generated/runtime/typescript/tsconfig.json": { "compilerOptions": { "alwaysStrict": false, @@ -51240,6 +51618,7 @@ dev-dependencies = { } /openapitools.json linguist-generated /package.json linguist-generated /tsconfig.dev.json linguist-generated +/tsconfig.esm.json linguist-generated /tsconfig.json linguist-generated /yarn.lock linguist-generated", "generated/runtime/typescript/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". @@ -51283,6 +51662,7 @@ jspm_packages/ !/.npmignore !/.openapi-generator-ignore !/openapitools.json +!/tsconfig.esm.json src .npmignore README.md @@ -51353,6 +51733,7 @@ tsconfig.esm.json "LICENSE", "openapitools.json", "tsconfig.dev.json", + "tsconfig.esm.json", "tsconfig.json", ], }, @@ -51390,6 +51771,17 @@ tsconfig.esm.json { "exec": "tsc --build", }, + { + "spawn": "compile-esm", + }, + ], + }, + "compile-esm": { + "name": "compile-esm", + "steps": [ + { + "exec": "tsc -p tsconfig.esm.json", + }, ], }, "default": { @@ -51738,6 +52130,7 @@ tsconfig.esm.json "scripts": { "build": "npx projen build", "compile": "npx projen compile", + "compile-esm": "npx projen compile-esm", "default": "npx projen default", "generate": "npx projen generate", "package": "npx projen package", @@ -51790,6 +52183,15 @@ tsconfig.esm.json "test/**/*.ts", ], }, + "generated/runtime/typescript/tsconfig.esm.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "compilerOptions": { + "module": "esnext", + "moduleResolution": "nodenext", + "outDir": "lib/esm", + }, + "extends": "./tsconfig.dev.json", + }, "generated/runtime/typescript/tsconfig.json": { "compilerOptions": { "alwaysStrict": false, @@ -55453,6 +55855,7 @@ dev-dependencies = { } /package.json linguist-generated /project.json linguist-generated /tsconfig.dev.json linguist-generated +/tsconfig.esm.json linguist-generated /tsconfig.json linguist-generated /yarn.lock linguist-generated", "packages/api/generated/runtime/typescript/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". @@ -55496,6 +55899,7 @@ jspm_packages/ !/.npmignore !/.openapi-generator-ignore !/openapitools.json +!/tsconfig.esm.json src .npmignore README.md @@ -55567,6 +55971,7 @@ tsconfig.esm.json "openapitools.json", "project.json", "tsconfig.dev.json", + "tsconfig.esm.json", "tsconfig.json", ], }, @@ -55604,6 +56009,17 @@ tsconfig.esm.json { "exec": "tsc --build", }, + { + "spawn": "compile-esm", + }, + ], + }, + "compile-esm": { + "name": "compile-esm", + "steps": [ + { + "exec": "tsc -p tsconfig.esm.json", + }, ], }, "default": { @@ -55943,6 +56359,7 @@ tsconfig.esm.json "scripts": { "build": "npx projen build", "compile": "npx projen compile", + "compile-esm": "npx projen compile-esm", "default": "npx projen default", "generate": "npx projen generate", "package": "npx projen package", @@ -55978,6 +56395,13 @@ tsconfig.esm.json "cwd": "packages/api/generated/runtime/typescript", }, }, + "compile-esm": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen compile-esm", + "cwd": "packages/api/generated/runtime/typescript", + }, + }, "default": { "executor": "nx:run-commands", "options": { @@ -56081,6 +56505,15 @@ tsconfig.esm.json "test/**/*.ts", ], }, + "packages/api/generated/runtime/typescript/tsconfig.esm.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "compilerOptions": { + "module": "esnext", + "moduleResolution": "nodenext", + "outDir": "lib/esm", + }, + "extends": "./tsconfig.dev.json", + }, "packages/api/generated/runtime/typescript/tsconfig.json": { "compilerOptions": { "alwaysStrict": false, @@ -58914,6 +59347,7 @@ dev-dependencies = { } /openapitools.json linguist-generated /package.json linguist-generated /tsconfig.dev.json linguist-generated +/tsconfig.esm.json linguist-generated /tsconfig.json linguist-generated /yarn.lock linguist-generated", "generated/runtime/typescript/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". @@ -58957,6 +59391,7 @@ jspm_packages/ !/.npmignore !/.openapi-generator-ignore !/openapitools.json +!/tsconfig.esm.json src .npmignore README.md @@ -59027,6 +59462,7 @@ tsconfig.esm.json "LICENSE", "openapitools.json", "tsconfig.dev.json", + "tsconfig.esm.json", "tsconfig.json", ], }, @@ -59064,6 +59500,17 @@ tsconfig.esm.json { "exec": "tsc --build", }, + { + "spawn": "compile-esm", + }, + ], + }, + "compile-esm": { + "name": "compile-esm", + "steps": [ + { + "exec": "tsc -p tsconfig.esm.json", + }, ], }, "default": { @@ -59412,6 +59859,7 @@ tsconfig.esm.json "scripts": { "build": "npx projen build", "compile": "npx projen compile", + "compile-esm": "npx projen compile-esm", "default": "npx projen default", "generate": "npx projen generate", "package": "npx projen package", @@ -59464,6 +59912,15 @@ tsconfig.esm.json "test/**/*.ts", ], }, + "generated/runtime/typescript/tsconfig.esm.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "compilerOptions": { + "module": "esnext", + "moduleResolution": "nodenext", + "outDir": "lib/esm", + }, + "extends": "./tsconfig.dev.json", + }, "generated/runtime/typescript/tsconfig.json": { "compilerOptions": { "alwaysStrict": false, @@ -63416,6 +63873,7 @@ dev-dependencies = { } /package.json linguist-generated /project.json linguist-generated /tsconfig.dev.json linguist-generated +/tsconfig.esm.json linguist-generated /tsconfig.json linguist-generated /yarn.lock linguist-generated", "packages/api/generated/runtime/typescript/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". @@ -63459,6 +63917,7 @@ jspm_packages/ !/.npmignore !/.openapi-generator-ignore !/openapitools.json +!/tsconfig.esm.json src .npmignore README.md @@ -63530,6 +63989,7 @@ tsconfig.esm.json "openapitools.json", "project.json", "tsconfig.dev.json", + "tsconfig.esm.json", "tsconfig.json", ], }, @@ -63567,6 +64027,17 @@ tsconfig.esm.json { "exec": "tsc --build", }, + { + "spawn": "compile-esm", + }, + ], + }, + "compile-esm": { + "name": "compile-esm", + "steps": [ + { + "exec": "tsc -p tsconfig.esm.json", + }, ], }, "default": { @@ -63906,6 +64377,7 @@ tsconfig.esm.json "scripts": { "build": "npx projen build", "compile": "npx projen compile", + "compile-esm": "npx projen compile-esm", "default": "npx projen default", "generate": "npx projen generate", "package": "npx projen package", @@ -63941,6 +64413,13 @@ tsconfig.esm.json "cwd": "packages/api/generated/runtime/typescript", }, }, + "compile-esm": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen compile-esm", + "cwd": "packages/api/generated/runtime/typescript", + }, + }, "default": { "executor": "nx:run-commands", "options": { @@ -64044,6 +64523,15 @@ tsconfig.esm.json "test/**/*.ts", ], }, + "packages/api/generated/runtime/typescript/tsconfig.esm.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "compilerOptions": { + "module": "esnext", + "moduleResolution": "nodenext", + "outDir": "lib/esm", + }, + "extends": "./tsconfig.dev.json", + }, "packages/api/generated/runtime/typescript/tsconfig.json": { "compilerOptions": { "alwaysStrict": false, @@ -65997,6 +66485,7 @@ Each runtime project includes types from your API model, as well as type-safe cl /openapitools.json linguist-generated /package.json linguist-generated /tsconfig.dev.json linguist-generated +/tsconfig.esm.json linguist-generated /tsconfig.json linguist-generated /yarn.lock linguist-generated", "generated/runtime/typescript/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". @@ -66040,6 +66529,7 @@ jspm_packages/ !/.npmignore !/.openapi-generator-ignore !/openapitools.json +!/tsconfig.esm.json src .npmignore README.md @@ -66110,6 +66600,7 @@ tsconfig.esm.json "LICENSE", "openapitools.json", "tsconfig.dev.json", + "tsconfig.esm.json", "tsconfig.json", ], }, @@ -66147,6 +66638,17 @@ tsconfig.esm.json { "exec": "tsc --build", }, + { + "spawn": "compile-esm", + }, + ], + }, + "compile-esm": { + "name": "compile-esm", + "steps": [ + { + "exec": "tsc -p tsconfig.esm.json", + }, ], }, "default": { @@ -66495,6 +66997,7 @@ tsconfig.esm.json "scripts": { "build": "npx projen build", "compile": "npx projen compile", + "compile-esm": "npx projen compile-esm", "default": "npx projen default", "generate": "npx projen generate", "package": "npx projen package", @@ -66547,6 +67050,15 @@ tsconfig.esm.json "test/**/*.ts", ], }, + "generated/runtime/typescript/tsconfig.esm.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "compilerOptions": { + "module": "esnext", + "moduleResolution": "nodenext", + "outDir": "lib/esm", + }, + "extends": "./tsconfig.dev.json", + }, "generated/runtime/typescript/tsconfig.json": { "compilerOptions": { "alwaysStrict": false, @@ -69460,6 +69972,7 @@ Each runtime project includes types from your API model, as well as type-safe cl /package.json linguist-generated /project.json linguist-generated /tsconfig.dev.json linguist-generated +/tsconfig.esm.json linguist-generated /tsconfig.json linguist-generated /yarn.lock linguist-generated", "packages/api/generated/runtime/typescript/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". @@ -69503,6 +70016,7 @@ jspm_packages/ !/.npmignore !/.openapi-generator-ignore !/openapitools.json +!/tsconfig.esm.json src .npmignore README.md @@ -69574,6 +70088,7 @@ tsconfig.esm.json "openapitools.json", "project.json", "tsconfig.dev.json", + "tsconfig.esm.json", "tsconfig.json", ], }, @@ -69611,6 +70126,17 @@ tsconfig.esm.json { "exec": "tsc --build", }, + { + "spawn": "compile-esm", + }, + ], + }, + "compile-esm": { + "name": "compile-esm", + "steps": [ + { + "exec": "tsc -p tsconfig.esm.json", + }, ], }, "default": { @@ -69950,6 +70476,7 @@ tsconfig.esm.json "scripts": { "build": "npx projen build", "compile": "npx projen compile", + "compile-esm": "npx projen compile-esm", "default": "npx projen default", "generate": "npx projen generate", "package": "npx projen package", @@ -69985,6 +70512,13 @@ tsconfig.esm.json "cwd": "packages/api/generated/runtime/typescript", }, }, + "compile-esm": { + "executor": "nx:run-commands", + "options": { + "command": "yarn projen compile-esm", + "cwd": "packages/api/generated/runtime/typescript", + }, + }, "default": { "executor": "nx:run-commands", "options": { @@ -70088,6 +70622,15 @@ tsconfig.esm.json "test/**/*.ts", ], }, + "packages/api/generated/runtime/typescript/tsconfig.esm.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "compilerOptions": { + "module": "esnext", + "moduleResolution": "nodenext", + "outDir": "lib/esm", + }, + "extends": "./tsconfig.dev.json", + }, "packages/api/generated/runtime/typescript/tsconfig.json": { "compilerOptions": { "alwaysStrict": false, @@ -72041,6 +72584,7 @@ Each runtime project includes types from your API model, as well as type-safe cl /openapitools.json linguist-generated /package.json linguist-generated /tsconfig.dev.json linguist-generated +/tsconfig.esm.json linguist-generated /tsconfig.json linguist-generated /yarn.lock linguist-generated", "generated/runtime/typescript/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". @@ -72084,6 +72628,7 @@ jspm_packages/ !/.npmignore !/.openapi-generator-ignore !/openapitools.json +!/tsconfig.esm.json src .npmignore README.md @@ -72154,6 +72699,7 @@ tsconfig.esm.json "LICENSE", "openapitools.json", "tsconfig.dev.json", + "tsconfig.esm.json", "tsconfig.json", ], }, @@ -72191,6 +72737,17 @@ tsconfig.esm.json { "exec": "tsc --build", }, + { + "spawn": "compile-esm", + }, + ], + }, + "compile-esm": { + "name": "compile-esm", + "steps": [ + { + "exec": "tsc -p tsconfig.esm.json", + }, ], }, "default": { @@ -72539,6 +73096,7 @@ tsconfig.esm.json "scripts": { "build": "npx projen build", "compile": "npx projen compile", + "compile-esm": "npx projen compile-esm", "default": "npx projen default", "generate": "npx projen generate", "package": "npx projen package", @@ -72591,6 +73149,15 @@ tsconfig.esm.json "test/**/*.ts", ], }, + "generated/runtime/typescript/tsconfig.esm.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "compilerOptions": { + "module": "esnext", + "moduleResolution": "nodenext", + "outDir": "lib/esm", + }, + "extends": "./tsconfig.dev.json", + }, "generated/runtime/typescript/tsconfig.json": { "compilerOptions": { "alwaysStrict": false, @@ -75508,6 +76075,7 @@ Each runtime project includes types from your API model, as well as type-safe cl /package.json linguist-generated /project.json linguist-generated /tsconfig.dev.json linguist-generated +/tsconfig.esm.json linguist-generated /tsconfig.json linguist-generated /yarn.lock linguist-generated", "packages/api/generated/runtime/typescript/.gitignore": "# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". @@ -75551,6 +76119,7 @@ jspm_packages/ !/.npmignore !/.openapi-generator-ignore !/openapitools.json +!/tsconfig.esm.json src .npmignore README.md @@ -75622,6 +76191,7 @@ tsconfig.esm.json "openapitools.json", "project.json", "tsconfig.dev.json", + "tsconfig.esm.json", "tsconfig.json", ], }, @@ -75659,6 +76229,17 @@ tsconfig.esm.json { "exec": "tsc --build", }, + { + "spawn": "compile-esm", + }, + ], + }, + "compile-esm": { + "name": "compile-esm", + "steps": [ + { + "exec": "tsc -p tsconfig.esm.json", + }, ], }, "default": { @@ -75998,6 +76579,7 @@ tsconfig.esm.json "scripts": { "build": "npx projen build", "compile": "npx projen compile", + "compile-esm": "npx projen compile-esm", "default": "npx projen default", "generate": "npx projen generate", "package": "npx projen package", @@ -76033,6 +76615,13 @@ tsconfig.esm.json "cwd": "packages/api/generated/runtime/typescript", }, }, + "compile-esm": { + "executor": "nx:run-commands", + "options": { + "command": "yarn exec projen compile-esm", + "cwd": "packages/api/generated/runtime/typescript", + }, + }, "default": { "executor": "nx:run-commands", "options": { @@ -76136,6 +76725,15 @@ tsconfig.esm.json "test/**/*.ts", ], }, + "packages/api/generated/runtime/typescript/tsconfig.esm.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "compilerOptions": { + "module": "esnext", + "moduleResolution": "nodenext", + "outDir": "lib/esm", + }, + "extends": "./tsconfig.dev.json", + }, "packages/api/generated/runtime/typescript/tsconfig.json": { "compilerOptions": { "alwaysStrict": false, diff --git a/packages/type-safe-api/test/project/codegen/types/__snapshots__/generated-typescript-runtime-project.test.ts.snap b/packages/type-safe-api/test/project/codegen/types/__snapshots__/generated-typescript-runtime-project.test.ts.snap index 580dbc7d6..ee7613115 100644 --- a/packages/type-safe-api/test/project/codegen/types/__snapshots__/generated-typescript-runtime-project.test.ts.snap +++ b/packages/type-safe-api/test/project/codegen/types/__snapshots__/generated-typescript-runtime-project.test.ts.snap @@ -23,6 +23,7 @@ exports[`Generated Typescript Runtime Unit Tests Synth 1`] = ` /openapitools.json linguist-generated /package.json linguist-generated /tsconfig.dev.json linguist-generated +/tsconfig.esm.json linguist-generated /tsconfig.json linguist-generated /yarn.lock linguist-generated", ".github/pull_request_template.md": "Fixes #", @@ -335,6 +336,7 @@ jspm_packages/ !/.npmignore !/.openapi-generator-ignore !/openapitools.json +!/tsconfig.esm.json src .npmignore README.md @@ -441,6 +443,7 @@ tsconfig.esm.json "LICENSE", "openapitools.json", "tsconfig.dev.json", + "tsconfig.esm.json", "tsconfig.json", ], }, @@ -530,6 +533,17 @@ tsconfig.esm.json { "exec": "tsc --build", }, + { + "spawn": "compile-esm", + }, + ], + }, + "compile-esm": { + "name": "compile-esm", + "steps": [ + { + "exec": "tsc -p tsconfig.esm.json", + }, ], }, "default": { @@ -932,6 +946,7 @@ tsconfig.esm.json "bump": "npx projen bump", "clobber": "npx projen clobber", "compile": "npx projen compile", + "compile-esm": "npx projen compile-esm", "default": "npx projen default", "eject": "npx projen eject", "generate": "npx projen generate", @@ -987,6 +1002,15 @@ tsconfig.esm.json "test/**/*.ts", ], }, + "tsconfig.esm.json": { + "//": "~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".", + "compilerOptions": { + "module": "esnext", + "moduleResolution": "nodenext", + "outDir": "lib/esm", + }, + "extends": "./tsconfig.dev.json", + }, "tsconfig.json": { "compilerOptions": { "alwaysStrict": false, From 1b0d8b44cbe1fac64f8531d365acfb6bd8ee126f Mon Sep 17 00:00:00 2001 From: zetashift Date: Sun, 10 Sep 2023 13:28:20 +0200 Subject: [PATCH 3/3] style(generated-typescript-runtime): fix formatting --- .../generated-typescript-runtime-project.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/type-safe-api/src/project/codegen/runtime/generated-typescript-runtime-project.ts b/packages/type-safe-api/src/project/codegen/runtime/generated-typescript-runtime-project.ts index a6fb7d66f..4c45bdfb3 100644 --- a/packages/type-safe-api/src/project/codegen/runtime/generated-typescript-runtime-project.ts +++ b/packages/type-safe-api/src/project/codegen/runtime/generated-typescript-runtime-project.ts @@ -92,7 +92,7 @@ export class GeneratedTypescriptRuntimeProject extends TypeScriptProject { "@types/aws-lambda", "@aws-lambda-powertools/tracer", "@aws-lambda-powertools/logger", - "@aws-lambda-powertools/metrics", + "@aws-lambda-powertools/metrics" ); // Minimal .npmignore to avoid impacting OpenAPI Generator @@ -102,12 +102,12 @@ export class GeneratedTypescriptRuntimeProject extends TypeScriptProject { // Tell OpenAPI Generator CLI not to generate files that we will generate via this project, or don't need. const openapiGeneratorIgnore = new OpenApiGeneratorIgnoreFile(this); openapiGeneratorIgnore.addPatterns( - ...GeneratedTypescriptRuntimeProject.openApiIgnorePatterns, + ...GeneratedTypescriptRuntimeProject.openApiIgnorePatterns ); // Add OpenAPI Generator cli configuration OpenApiToolsJsonFile.ensure(this).addOpenApiGeneratorCliConfig( - options.openApiGeneratorCliConfig, + options.openApiGeneratorCliConfig ); const generateTask = this.addTask("generate"); @@ -115,8 +115,8 @@ export class GeneratedTypescriptRuntimeProject extends TypeScriptProject { generateTask.exec( buildTypeSafeApiExecCommand( TypeSafeApiScript.GENERATE, - this.buildGenerateCommandArgs(), - ), + this.buildGenerateCommandArgs() + ) ); this.preCompileTask.spawn(generateTask); @@ -142,7 +142,7 @@ export class GeneratedTypescriptRuntimeProject extends TypeScriptProject { "src", ".npmignore", "README.md", - ".openapi-generator", + ".openapi-generator" ); // If we're not in a monorepo, we need to link the generated client such that any local dependency on it can be @@ -155,7 +155,7 @@ export class GeneratedTypescriptRuntimeProject extends TypeScriptProject { this.tasks .tryFind("install") ?.exec( - NodePackageUtils.command.cmd(this.package.packageManager, "link"), + NodePackageUtils.command.cmd(this.package.packageManager, "link") ); break; case NodePackageManager.PNPM: @@ -163,7 +163,7 @@ export class GeneratedTypescriptRuntimeProject extends TypeScriptProject { break; default: console.warn( - `Unknown package manager ${this.package.packageManager}. Cannot link generated typescript runtime project.`, + `Unknown package manager ${this.package.packageManager}. Cannot link generated typescript runtime project.` ); } }