From 9c92ccac1d61bcfe378034f8243e2d93b4952338 Mon Sep 17 00:00:00 2001 From: Jack Stevenson Date: Thu, 3 Oct 2024 17:29:18 +1000 Subject: [PATCH] feat(type-safe-api): simpler and faster parse and mock data scripts (#835) Move the `parse-openapi-spec` and `generate-mock-data` scripts to just node executables, rather than bash scripts which install dependencies and then execute using `ts-node`. Additionally refactor to use a single entry point with subcommands so we need only ship a single javascript bundle, rather than one for each script. --- .projen/tasks.json | 12 +- packages/pdk/package.json | 10 +- packages/type-safe-api/.gitignore | 2 +- packages/type-safe-api/.projen/tasks.json | 5 +- packages/type-safe-api/package.json | 10 +- packages/type-safe-api/project.json | 2 +- .../custom/mock-data/generate-mock-data | 58 ------- .../custom/mock-data/generate-mock-data.ts | 19 +- .../{generate.ts => generate-next.ts} | 13 +- .../type-safe-api/parser/parse-openapi-spec | 43 ----- .../parser/parse-openapi-spec.ts | 7 +- .../scripts/type-safe-api/run.ts | 29 ++++ .../src/project/codegen/components/utils.ts | 10 +- .../model/type-safe-api-model-project-base.ts | 6 +- .../type-safe-api-project.test.ts.snap | 164 +++++++++--------- ...pe-safe-websocket-api-project.test.ts.snap | 28 +-- ...d-typescript-handlers-project.test.ts.snap | 2 +- ...va-cdk-infrastructure-project.test.ts.snap | 2 +- ...on-cdk-infrastructure-project.test.ts.snap | 2 +- ...pt-cdk-infrastructure-project.test.ts.snap | 4 +- ...ed-typescript-runtime-project.test.ts.snap | 2 +- .../type-safe-api-model-project.test.ts.snap | 12 +- ...e-websocket-api-model-project.test.ts.snap | 8 +- .../mock-data/generate-mock-data.test.ts | 8 +- .../typescript-cdk-infrastructure.test.ts | 6 +- .../typescript-lambda-handlers.test.ts | 2 +- .../typescript-react-query-hooks.test.ts | 2 +- .../scripts/generators/typescript.test.ts | 2 +- .../scripts/parser/parse-openapi-spec.test.ts | 12 +- projenrc/projects/type-safe-api-project.ts | 22 +-- 30 files changed, 208 insertions(+), 296 deletions(-) delete mode 100755 packages/type-safe-api/scripts/type-safe-api/custom/mock-data/generate-mock-data rename packages/type-safe-api/scripts/type-safe-api/generators/{generate.ts => generate-next.ts} (98%) delete mode 100755 packages/type-safe-api/scripts/type-safe-api/parser/parse-openapi-spec create mode 100644 packages/type-safe-api/scripts/type-safe-api/run.ts diff --git a/.projen/tasks.json b/.projen/tasks.json index efe60a7c6..200702858 100644 --- a/.projen/tasks.json +++ b/.projen/tasks.json @@ -237,6 +237,9 @@ { "exec": "ln -s $PWD/packages/monorepo/scripts/monorepo/nx-dir-hasher.js $(pnpm bin)/monorepo.nx-dir-hasher &>/dev/null; exit 0;" }, + { + "exec": "ln -s $PWD/packages/type-safe-api/scripts/type-safe-api/run.js $(pnpm bin)/type-safe-api &>/dev/null; exit 0;" + }, { "exec": "ln -s $PWD/packages/type-safe-api/scripts/type-safe-api/custom/clean-openapi-generated-code/clean-openapi-generated-code $(pnpm bin)/type-safe-api.clean-openapi-generated-code &>/dev/null; exit 0;" }, @@ -260,15 +263,6 @@ }, { "exec": "ln -s $PWD/packages/type-safe-api/scripts/type-safe-api/custom/docs/html-redoc $(pnpm bin)/type-safe-api.generate-html-redoc-docs &>/dev/null; exit 0;" - }, - { - "exec": "ln -s $PWD/packages/type-safe-api/scripts/type-safe-api/custom/mock-data/generate-mock-data $(pnpm bin)/type-safe-api.generate-mock-data &>/dev/null; exit 0;" - }, - { - "exec": "ln -s $PWD/packages/type-safe-api/scripts/type-safe-api/generators/generate.js $(pnpm bin)/type-safe-api.generate-next &>/dev/null; exit 0;" - }, - { - "exec": "ln -s $PWD/packages/type-safe-api/scripts/type-safe-api/parser/parse-openapi-spec $(pnpm bin)/type-safe-api.parse-openapi-spec &>/dev/null; exit 0;" } ] } diff --git a/packages/pdk/package.json b/packages/pdk/package.json index c13003194..79f12c8de 100644 --- a/packages/pdk/package.json +++ b/packages/pdk/package.json @@ -7,6 +7,7 @@ "bin": { "pdk": "./_scripts/pdk.sh", "monorepo.nx-dir-hasher": "././scripts/monorepo/nx-dir-hasher.js", + "type-safe-api": "./scripts/type-safe-api/run.js", "type-safe-api.clean-openapi-generated-code": "./scripts/type-safe-api/custom/clean-openapi-generated-code/clean-openapi-generated-code", "type-safe-api.copy-async-smithy-transformer": "./scripts/type-safe-api/custom/smithy-async-transformer/copy-transformer", "type-safe-api.copy-gradle-wrapper": "./scripts/type-safe-api/custom/gradle-wrapper/copy-gradle-wrapper", @@ -14,10 +15,7 @@ "type-safe-api.generate-asyncapi-html-docs": "./scripts/type-safe-api/custom/docs/asyncapi-html", "type-safe-api.generate-asyncapi-markdown-docs": "./scripts/type-safe-api/custom/docs/asyncapi-markdown", "type-safe-api.generate-asyncapi-spec": "./scripts/type-safe-api/custom/generate-asyncapi-spec/generate-asyncapi-spec", - "type-safe-api.generate-html-redoc-docs": "./scripts/type-safe-api/custom/docs/html-redoc", - "type-safe-api.generate-mock-data": "./scripts/type-safe-api/custom/mock-data/generate-mock-data", - "type-safe-api.generate-next": "./scripts/type-safe-api/generators/generate.js", - "type-safe-api.parse-openapi-spec": "./scripts/type-safe-api/parser/parse-openapi-spec" + "type-safe-api.generate-html-redoc-docs": "./scripts/type-safe-api/custom/docs/html-redoc" }, "scripts": { "build": "pnpm exec projen build", @@ -200,10 +198,8 @@ "./scripts/type-safe-api/custom/docs/asyncapi-html", "./scripts/type-safe-api/custom/docs/asyncapi-markdown", "./scripts/type-safe-api/generators/generate", - "./scripts/type-safe-api/generators/generate.js", - "./scripts/type-safe-api/parser/parse-openapi-spec", + "./scripts/type-safe-api/run.js", "./scripts/type-safe-api/custom/clean-openapi-generated-code/clean-openapi-generated-code", - "./scripts/type-safe-api/custom/mock-data/generate-mock-data", "./scripts/type-safe-api/custom/gradle-wrapper/copy-gradle-wrapper", "./scripts/type-safe-api/custom/gradle-wrapper/gradlew", "./scripts/type-safe-api/custom/gradle-wrapper/gradlew.bat", diff --git a/packages/type-safe-api/.gitignore b/packages/type-safe-api/.gitignore index 969afb89f..67b2b8465 100644 --- a/packages/type-safe-api/.gitignore +++ b/packages/type-safe-api/.gitignore @@ -48,7 +48,7 @@ tsconfig.json !/README.md tmp/.* scripts/type-safe-api/custom/smithy-async-transformer/aws-pdk-smithy-async-transformer.jar -scripts/type-safe-api/generators/generate.js +scripts/type-safe-api/run.js !/LICENSE !/src/construct/waf/generated-types.ts !/src/construct/websocket/websocket-api-props.ts diff --git a/packages/type-safe-api/.projen/tasks.json b/packages/type-safe-api/.projen/tasks.json index aa850b41b..f5559ca52 100644 --- a/packages/type-safe-api/.projen/tasks.json +++ b/packages/type-safe-api/.projen/tasks.json @@ -158,7 +158,10 @@ "exec": "cp ../../internal/smithy-async-transformer/dist/java/software/aws/pdk/smithy-async-transformer/0.0.1/smithy-async-transformer-0.0.1.jar scripts/type-safe-api/custom/smithy-async-transformer/aws-pdk-smithy-async-transformer.jar" }, { - "exec": "esbuild --bundle scripts/type-safe-api/generators/generate.ts --platform=node --outfile=scripts/type-safe-api/generators/generate.js" + "exec": "esbuild --bundle scripts/type-safe-api/run.ts --platform=node --outfile=scripts/type-safe-api/run.js" + }, + { + "exec": "chmod +x scripts/type-safe-api/run.js" } ] }, diff --git a/packages/type-safe-api/package.json b/packages/type-safe-api/package.json index 1ac818d5a..dfb0e1e3a 100644 --- a/packages/type-safe-api/package.json +++ b/packages/type-safe-api/package.json @@ -5,6 +5,7 @@ "url": "https://github.com/aws/aws-pdk" }, "bin": { + "type-safe-api": "scripts/type-safe-api/run.js", "type-safe-api.clean-openapi-generated-code": "scripts/type-safe-api/custom/clean-openapi-generated-code/clean-openapi-generated-code", "type-safe-api.copy-async-smithy-transformer": "scripts/type-safe-api/custom/smithy-async-transformer/copy-transformer", "type-safe-api.copy-gradle-wrapper": "scripts/type-safe-api/custom/gradle-wrapper/copy-gradle-wrapper", @@ -12,10 +13,7 @@ "type-safe-api.generate-asyncapi-html-docs": "scripts/type-safe-api/custom/docs/asyncapi-html", "type-safe-api.generate-asyncapi-markdown-docs": "scripts/type-safe-api/custom/docs/asyncapi-markdown", "type-safe-api.generate-asyncapi-spec": "scripts/type-safe-api/custom/generate-asyncapi-spec/generate-asyncapi-spec", - "type-safe-api.generate-html-redoc-docs": "scripts/type-safe-api/custom/docs/html-redoc", - "type-safe-api.generate-mock-data": "scripts/type-safe-api/custom/mock-data/generate-mock-data", - "type-safe-api.generate-next": "scripts/type-safe-api/generators/generate.js", - "type-safe-api.parse-openapi-spec": "scripts/type-safe-api/parser/parse-openapi-spec" + "type-safe-api.generate-html-redoc-docs": "scripts/type-safe-api/custom/docs/html-redoc" }, "scripts": { "build": "pnpm exec projen build", @@ -119,10 +117,8 @@ "scripts/type-safe-api/custom/docs/asyncapi-html", "scripts/type-safe-api/custom/docs/asyncapi-markdown", "scripts/type-safe-api/generators/generate", - "scripts/type-safe-api/generators/generate.js", - "scripts/type-safe-api/parser/parse-openapi-spec", + "scripts/type-safe-api/run.js", "scripts/type-safe-api/custom/clean-openapi-generated-code/clean-openapi-generated-code", - "scripts/type-safe-api/custom/mock-data/generate-mock-data", "scripts/type-safe-api/custom/gradle-wrapper/copy-gradle-wrapper", "scripts/type-safe-api/custom/gradle-wrapper/gradlew", "scripts/type-safe-api/custom/gradle-wrapper/gradlew.bat", diff --git a/packages/type-safe-api/project.json b/packages/type-safe-api/project.json index 1913965ec..2087e65ed 100644 --- a/packages/type-safe-api/project.json +++ b/packages/type-safe-api/project.json @@ -21,7 +21,7 @@ "{projectRoot}/test-reports", "{projectRoot}/docs/api", "{projectRoot}/scripts/type-safe-api/custom/smithy-async-transformer/aws-pdk-smithy-async-transformer.jar", - "{projectRoot}/scripts/type-safe-api/generators/generate.js" + "{projectRoot}/scripts/type-safe-api/run.js" ], "dependsOn": [ "^build" diff --git a/packages/type-safe-api/scripts/type-safe-api/custom/mock-data/generate-mock-data b/packages/type-safe-api/scripts/type-safe-api/custom/mock-data/generate-mock-data deleted file mode 100755 index ff7755089..000000000 --- a/packages/type-safe-api/scripts/type-safe-api/custom/mock-data/generate-mock-data +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash - -set -e - -# Parse arguments -spec_path='' -output_path='' -locale='en' -max_array_length='3' -seed='1337' -while [[ "$#" -gt 0 ]]; do case $1 in - --spec-path) spec_path="$2"; shift;; - --output-path) output_path="$2"; shift;; - --locale) locale="$2"; shift;; - --max-array-length) max_array_length="$2"; shift;; - --seed) seed="$2"; shift;; -esac; shift; done - -echo "Generating Mock Data..." - -working_dir=$(pwd) -script_dir="$( cd -- "$(dirname $([ -L "${BASH_SOURCE[0]:-$0}" ] && readlink -f "${BASH_SOURCE[0]:-$0}" || echo "${BASH_SOURCE[0]:-$0}"))" >/dev/null 2>&1 ; pwd -P )"; - -# load common package manager helper functions -. "$script_dir/../../common/common.sh" - -# Create a temporary directory -tmp_dir=$(mktemp -d "${TMPDIR:-/tmp/}generate-mock-data.XXXXXXXXX") -cd $tmp_dir - -log "mock-data :: tmp_dir :: $tmp_dir" - -# Copy the script directory into the temp directory -cp -r $script_dir/* . - -# Install dependencies -install_packages - -outdir="$working_dir/$output_path/mocks" - -log "mock-data :: deleting outdir :: $outdir" -rm -rf $outdir -mkdir -p $outdir - -# Generate -log "mock-data :: generate" -run_command ts-node generate-mock-data.ts \ - --specPath="$working_dir/$spec_path" \ - --outputPath="$working_dir/$output_path/mocks" \ - --locale="$locale" \ - --maxArrayLength="$max_array_length" \ - --seed="$seed" - -echo "Mock data generation done!" - -# Clean up -cd $working_dir -rm -rf $tmp_dir diff --git a/packages/type-safe-api/scripts/type-safe-api/custom/mock-data/generate-mock-data.ts b/packages/type-safe-api/scripts/type-safe-api/custom/mock-data/generate-mock-data.ts index 6c2a257be..b6a1bc82a 100644 --- a/packages/type-safe-api/scripts/type-safe-api/custom/mock-data/generate-mock-data.ts +++ b/packages/type-safe-api/scripts/type-safe-api/custom/mock-data/generate-mock-data.ts @@ -250,14 +250,14 @@ const generateMockString = (faker: Faker, schema: OpenAPIV3.SchemaObject, inProp }; // Entry point -void (async () => { +export default async (argv: string[]) => { const args = parse({ specPath: { type: String }, outputPath: { type: String }, - locale: { type: String }, - maxArrayLength: { type: Number }, - seed: { type: Number }, - }); + locale: { type: String, defaultValue: 'en' }, + maxArrayLength: { type: Number, defaultValue: 3 }, + seed: { type: Number, defaultValue: 1337 }, + }, { argv }); const faker = allFakers[args.locale as keyof typeof allFakers]; @@ -273,6 +273,11 @@ void (async () => { // Dereference all but circular references spec = await SwaggerParser.dereference(spec, { dereference: { circular: 'ignore' } }) as OpenAPIV3.Document; + // Write mocks to a "mocks" directory. Clean it up if it doesn't exist already. + const outPath = path.join(args.outputPath, "mocks"); + fs.rmSync(outPath, { recursive: true, force: true }); + fs.mkdirSync(outPath, { recursive: true }); + Object.entries(spec.paths ?? {}).forEach(([p, pathOp]) => { Object.entries(pathOp ?? {}).forEach(([method, operation]) => { if (operation && typeof operation === "object" && "responses" in operation) { @@ -280,7 +285,7 @@ void (async () => { if (!isRef(response)) { const schema = response?.content?.['application/json']?.schema; if (schema) { - const mockResponseFilePath = path.join(args.outputPath, `${method.toLowerCase()}${p.replace(/\//g, "-")}-${responseCode}.json`); + const mockResponseFilePath = path.join(outPath, `${method.toLowerCase()}${p.replace(/\//g, "-")}-${responseCode}.json`); const mockResponse = generateMockResponse(spec, { faker, maxArrayLength: args.maxArrayLength, @@ -293,4 +298,4 @@ void (async () => { } }); }); -})(); +}; diff --git a/packages/type-safe-api/scripts/type-safe-api/generators/generate.ts b/packages/type-safe-api/scripts/type-safe-api/generators/generate-next.ts similarity index 98% rename from packages/type-safe-api/scripts/type-safe-api/generators/generate.ts rename to packages/type-safe-api/scripts/type-safe-api/generators/generate-next.ts index 367d8d918..3ccc79cc7 100755 --- a/packages/type-safe-api/scripts/type-safe-api/generators/generate.ts +++ b/packages/type-safe-api/scripts/type-safe-api/generators/generate-next.ts @@ -1,4 +1,3 @@ -#!/usr/bin/env node /*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ import * as fs from "fs"; @@ -545,9 +544,9 @@ const buildData = (inSpec: OpenAPIV3.Document, metadata: any) => { }; }; -const resolveTemplateDir = (templateDir: string) => { +const resolveTemplateDir = (rootScriptDir: string, templateDir: string) => { // Prefer built in template, eg "typescript-lambda-handlers" - const builtinTemplateDir = path.resolve(__dirname, templateDir); + const builtinTemplateDir = path.join(rootScriptDir, "generators", templateDir); if (fs.existsSync(builtinTemplateDir)) { return builtinTemplateDir; } @@ -560,13 +559,13 @@ const resolveTemplateDir = (templateDir: string) => { throw new Error(`Template directory ${templateDir} does not exist!`); }; -void (async () => { +export default async (argv: string[], rootScriptDir: string) => { const args = parse({ specPath: { type: String }, metadata: { type: String, optional: true }, templateDirs: { type: String, multiple: true }, outputPath: { type: String }, - }); + }, { argv }); const spec = (await SwaggerParser.bundle(args.specPath)) as any; @@ -587,7 +586,7 @@ void (async () => { const data = buildData(spec, JSON.parse(args.metadata ?? '{}')); // Read all .ejs files in each template directory - const templates = args.templateDirs.flatMap(t => fs.readdirSync(resolveTemplateDir(t), { + const templates = args.templateDirs.flatMap(t => fs.readdirSync(resolveTemplateDir(rootScriptDir, t), { recursive: true, withFileTypes: true }).filter(f => f.isFile() && f.name.endsWith('.ejs')).map(f => path.join(f.parentPath, f.name))); @@ -603,4 +602,4 @@ void (async () => { // Write the rendered files splitAndWriteFiles(renderedFiles, args.outputPath); -})(); +}; diff --git a/packages/type-safe-api/scripts/type-safe-api/parser/parse-openapi-spec b/packages/type-safe-api/scripts/type-safe-api/parser/parse-openapi-spec deleted file mode 100755 index 996076727..000000000 --- a/packages/type-safe-api/scripts/type-safe-api/parser/parse-openapi-spec +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -set -e - -# Parse arguments -spec_path='' -output_path='' -smithy_json_path='' -while [[ "$#" -gt 0 ]]; do case $1 in - --spec-path) spec_path="$2"; shift;; - --output-path) output_path="$2"; shift;; - --smithy-json-path) smithy_json_path="$2"; shift;; -esac; shift; done - -working_dir=$(pwd) -script_dir="$( cd -- "$(dirname $([ -L "${BASH_SOURCE[0]:-$0}" ] && readlink -f "${BASH_SOURCE[0]:-$0}" || echo "${BASH_SOURCE[0]:-$0}"))" >/dev/null 2>&1 ; pwd -P )"; - -# load common package manager helper functions -. "$script_dir/../common/common.sh" - -# Create a temporary directory -tmp_dir=$(mktemp -d "${TMPDIR:-/tmp/}parse-openapi-spec.XXXXXXXXX") -cd $tmp_dir - -log "parse-openapi-spec :: tmp_dir :: $tmp_dir" - -# Copy the parse script into the temp directory -cp -r $script_dir/* . - -# Install dependencies -install_packages - -# Run the parse script -run_command ts-node parse-openapi-spec.ts \ - --specPath="$working_dir/$spec_path" \ - --outputPath="$working_dir/$output_path" \ - ${smithy_json_path:+"--smithyJsonPath=$working_dir/$smithy_json_path"} - -echo "openapi-spec parsed" - -# Clean up -cd $working_dir -rm -rf $tmp_dir diff --git a/packages/type-safe-api/scripts/type-safe-api/parser/parse-openapi-spec.ts b/packages/type-safe-api/scripts/type-safe-api/parser/parse-openapi-spec.ts index 9859e4ecb..b19eea1d4 100644 --- a/packages/type-safe-api/scripts/type-safe-api/parser/parse-openapi-spec.ts +++ b/packages/type-safe-api/scripts/type-safe-api/parser/parse-openapi-spec.ts @@ -3,7 +3,6 @@ SPDX-License-Identifier: Apache-2.0 */ import SwaggerParser from "@apidevtools/swagger-parser"; import { writeFile } from "projen/lib/util"; import { parse } from "ts-command-line-args"; -import * as _ from "lodash"; import fs from "fs"; // Smithy HTTP trait is used to map Smithy operations to their location in the spec @@ -92,12 +91,12 @@ const getVendorExtensionFromTrait = (traitId: string): string => { ?? `x-${traitId}`; }; -void (async () => { +export default async (argv: string[]) => { const args = parse({ specPath: { type: String, alias: "s" }, smithyJsonPath: { type: String, optional: true }, outputPath: { type: String, alias: "o" }, - }); + }, { argv }); const spec = (await SwaggerParser.bundle(args.specPath)) as any; @@ -207,4 +206,4 @@ void (async () => { writeFile(args.outputPath, JSON.stringify(spec, null, 2), { readonly: true, }); -})(); +}; diff --git a/packages/type-safe-api/scripts/type-safe-api/run.ts b/packages/type-safe-api/scripts/type-safe-api/run.ts new file mode 100644 index 000000000..fd583e595 --- /dev/null +++ b/packages/type-safe-api/scripts/type-safe-api/run.ts @@ -0,0 +1,29 @@ +#!/usr/bin/env node +import { parse } from "ts-command-line-args"; +import generateMockData from "./custom/mock-data/generate-mock-data"; +import parseOpenapiSpec from "./parser/parse-openapi-spec"; +import generate from "./generators/generate-next"; +import * as path from "path"; + +interface SubCommandArgs { + readonly command: string; +} + +void (async () => { + const subCommandArgs = parse({ + command: { type: String, defaultOption: true }, + }, { stopAtFirstUnknown: true }); + + const argv = (subCommandArgs as any)._unknown as string[]; + + switch (subCommandArgs.command) { + case "generate-mock-data": + return await generateMockData(argv); + case "parse-openapi-spec": + return await parseOpenapiSpec(argv); + case "generate": + return await generate(argv, path.resolve(__dirname)); + default: + throw new Error(`Unknown subcommand ${subCommandArgs.command}`); + } +})(); diff --git a/packages/type-safe-api/src/project/codegen/components/utils.ts b/packages/type-safe-api/src/project/codegen/components/utils.ts index ef118791a..9391dfa15 100644 --- a/packages/type-safe-api/src/project/codegen/components/utils.ts +++ b/packages/type-safe-api/src/project/codegen/components/utils.ts @@ -38,10 +38,10 @@ export enum OtherGenerators { * If adding a script here, ensure you map it in TypeSafeApiProject (in /projenrc/projects) */ export enum TypeSafeApiScript { - PARSE_OPENAPI_SPEC = "type-safe-api.parse-openapi-spec", + PARSE_OPENAPI_SPEC = "type-safe-api parse-openapi-spec", GENERATE = "type-safe-api.generate", - GENERATE_NEXT = "type-safe-api.generate-next", - GENERATE_MOCK_DATA = "type-safe-api.generate-mock-data", + GENERATE_NEXT = "type-safe-api generate", + GENERATE_MOCK_DATA = "type-safe-api generate-mock-data", GENERATE_HTML_REDOC_DOCS = "type-safe-api.generate-html-redoc-docs", GENERATE_ASYNCAPI_HTML_DOCS = "type-safe-api.generate-asyncapi-html-docs", GENERATE_ASYNCAPI_MARKDOWN_DOCS = "type-safe-api.generate-asyncapi-markdown-docs", @@ -233,12 +233,12 @@ export const buildInvokeMockDataGeneratorCommand = ( const locale = options.locale ? ` --locale ${options.locale}` : ""; const maxArrayLength = options.maxArrayLength !== undefined - ? ` --max-array-length ${options.maxArrayLength}` + ? ` --maxArrayLength ${options.maxArrayLength}` : ""; const seed = options.seed !== undefined ? ` --seed ${options.seed}` : ""; return buildTypeSafeApiExecCommand( TypeSafeApiScript.GENERATE_MOCK_DATA, - `--spec-path ${options.specPath} --output-path ${outputPath}${locale}${maxArrayLength}${seed}` + `--specPath ${options.specPath} --outputPath ${outputPath}${locale}${maxArrayLength}${seed}` ); }; diff --git a/packages/type-safe-api/src/project/model/type-safe-api-model-project-base.ts b/packages/type-safe-api/src/project/model/type-safe-api-model-project-base.ts index 720fdfb5f..6b7371cbc 100644 --- a/packages/type-safe-api/src/project/model/type-safe-api-model-project-base.ts +++ b/packages/type-safe-api/src/project/model/type-safe-api-model-project-base.ts @@ -125,12 +125,10 @@ export abstract class TypeSafeApiModelProjectBase extends Project { this.generateTask.exec( buildTypeSafeApiExecCommand( TypeSafeApiScript.PARSE_OPENAPI_SPEC, - `--spec-path ${openApiSpecificationPath} --output-path ${ + `--specPath ${openApiSpecificationPath} --outputPath ${ this.parsedSpecFile }${ - smithyJsonModelPath - ? ` --smithy-json-path ${smithyJsonModelPath}` - : "" + smithyJsonModelPath ? ` --smithyJsonPath ${smithyJsonModelPath}` : "" }` ) ); 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 037aa89be..4064f8cde 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 @@ -922,7 +922,7 @@ dist/java "exec": "echo $(pwd) > src/main/resources/project-absolute-path.txt", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-mock-data --spec-path ../../../model/.api.json --output-path src/main/resources", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate-mock-data --specPath ../../../model/.api.json --outputPath src/main/resources", }, ], }, @@ -2288,7 +2288,7 @@ strict-peer-dependencies=false "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", }, ], }, @@ -2757,7 +2757,7 @@ node_modules/ "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path src/main/openapi/main.yaml --output-path .api.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath src/main/openapi/main.yaml --outputPath .api.json", }, ], }, @@ -6112,7 +6112,7 @@ dist/java "exec": "echo $(pwd) > src/main/resources/project-absolute-path.txt", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-mock-data --spec-path ../../../model/.api.json --output-path src/main/resources", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate-mock-data --specPath ../../../model/.api.json --outputPath src/main/resources", }, ], }, @@ -8287,7 +8287,7 @@ README.md "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", }, ], }, @@ -8840,7 +8840,7 @@ node_modules/ "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path src/main/openapi/main.yaml --output-path .api.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath src/main/openapi/main.yaml --outputPath .api.json", }, ], }, @@ -10320,7 +10320,7 @@ mocks "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate --generator python-nextgen --spec-path ../../../model/.api.json --output-path . --generator-dir python-cdk-infrastructure --src-dir openapi_python_python_infra --tst-dir test --openapi-normalizer "KEEP_ONLY_FIRST_TAG_IN_OPERATION=true" --extra-vendor-extensions '{"x-runtime-module-name":"openapi_python_python_runtime","x-relative-spec-path":"../../../../model/.api.json","x-enable-mock-integrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":"","x-handlers-node-lambda-runtime-version":"","x-handlers-python-lambda-runtime-version":"","x-handlers-java-lambda-runtime-version":""}' --generate-alias-as-model", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-mock-data --spec-path ../../../model/.api.json --output-path .", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate-mock-data --specPath ../../../model/.api.json --outputPath .", }, ], }, @@ -11646,7 +11646,7 @@ strict-peer-dependencies=false "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", }, ], }, @@ -12115,7 +12115,7 @@ node_modules/ "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path src/main/openapi/main.yaml --output-path .api.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath src/main/openapi/main.yaml --outputPath .api.json", }, ], }, @@ -15429,7 +15429,7 @@ mocks "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate --generator python-nextgen --spec-path ../../../model/.api.json --output-path . --generator-dir python-cdk-infrastructure --src-dir openapi_python_python_infra --tst-dir test --openapi-normalizer "KEEP_ONLY_FIRST_TAG_IN_OPERATION=true" --extra-vendor-extensions '{"x-runtime-module-name":"openapi_python_python_runtime","x-relative-spec-path":"../../../../model/.api.json","x-enable-mock-integrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":"","x-handlers-node-lambda-runtime-version":"","x-handlers-python-lambda-runtime-version":"","x-handlers-java-lambda-runtime-version":""}' --generate-alias-as-model", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-mock-data --spec-path ../../../model/.api.json --output-path .", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate-mock-data --specPath ../../../model/.api.json --outputPath .", }, ], }, @@ -17577,7 +17577,7 @@ README.md "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", }, ], }, @@ -18130,7 +18130,7 @@ node_modules/ "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path src/main/openapi/main.yaml --output-path .api.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath src/main/openapi/main.yaml --outputPath .api.json", }, ], }, @@ -19559,7 +19559,7 @@ resolution-mode=highest "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript-cdk-infrastructure" --metadata '{"srcDir":"src","runtimePackageName":"openapi-typescript-typescript-runtime","relativeSpecPath":"../assets/api.json","enableMockIntegrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":"","x-handlers-node-lambda-runtime-version":"","x-handlers-python-lambda-runtime-version":"","x-handlers-java-lambda-runtime-version":""}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript-cdk-infrastructure" --metadata '{"srcDir":"src","runtimePackageName":"openapi-typescript-typescript-runtime","relativeSpecPath":"../assets/api.json","enableMockIntegrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":"","x-handlers-node-lambda-runtime-version":"","x-handlers-python-lambda-runtime-version":"","x-handlers-java-lambda-runtime-version":""}'", }, { "exec": "mkdir -p assets", @@ -19568,7 +19568,7 @@ resolution-mode=highest "exec": "cp -f ../../../model/.api.json assets/api.json", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-mock-data --spec-path ../../../model/.api.json --output-path .", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate-mock-data --specPath ../../../model/.api.json --outputPath .", }, ], }, @@ -21177,7 +21177,7 @@ strict-peer-dependencies=false "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", }, ], }, @@ -21646,7 +21646,7 @@ node_modules/ "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path src/main/openapi/main.yaml --output-path .api.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath src/main/openapi/main.yaml --outputPath .api.json", }, ], }, @@ -24900,7 +24900,7 @@ mocks "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript-cdk-infrastructure" --metadata '{"srcDir":"src","runtimePackageName":"openapi-typescript-typescript-runtime","relativeSpecPath":"../assets/api.json","enableMockIntegrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":"","x-handlers-node-lambda-runtime-version":"","x-handlers-python-lambda-runtime-version":"","x-handlers-java-lambda-runtime-version":""}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript-cdk-infrastructure" --metadata '{"srcDir":"src","runtimePackageName":"openapi-typescript-typescript-runtime","relativeSpecPath":"../assets/api.json","enableMockIntegrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":"","x-handlers-node-lambda-runtime-version":"","x-handlers-python-lambda-runtime-version":"","x-handlers-java-lambda-runtime-version":""}'", }, { "exec": "mkdir -p assets", @@ -24909,7 +24909,7 @@ mocks "exec": "cp -f ../../../model/.api.json assets/api.json", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-mock-data --spec-path ../../../model/.api.json --output-path .", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate-mock-data --specPath ../../../model/.api.json --outputPath .", }, ], }, @@ -27112,7 +27112,7 @@ README.md "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", }, ], }, @@ -27665,7 +27665,7 @@ node_modules/ "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path src/main/openapi/main.yaml --output-path .api.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath src/main/openapi/main.yaml --outputPath .api.json", }, ], }, @@ -28618,7 +28618,7 @@ resolution-mode=highest "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript-cdk-infrastructure" --metadata '{"srcDir":"src","runtimePackageName":"smithy-handlers-typescript-runtime","relativeSpecPath":"../assets/api.json","enableMockIntegrations":true,"x-handlers-python-module":"smithy_handlers_python_handlers","x-handlers-java-package":"com.generated.api.smithyhandlersjavahandlers.handlers","x-handlers-typescript-asset-path":"../../../handlers/typescript/dist/lambda","x-handlers-python-asset-path":"../../../handlers/python/dist/lambda","x-handlers-java-asset-path":"../../../handlers/java/dist/java/com/generated/api/smithy-handlers-java-handlers/0.0.0/smithy-handlers-java-handlers-0.0.0.jar","x-handlers-node-lambda-runtime-version":"NODEJS_18_X","x-handlers-python-lambda-runtime-version":"PYTHON_3_11","x-handlers-java-lambda-runtime-version":"JAVA_17"}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript-cdk-infrastructure" --metadata '{"srcDir":"src","runtimePackageName":"smithy-handlers-typescript-runtime","relativeSpecPath":"../assets/api.json","enableMockIntegrations":true,"x-handlers-python-module":"smithy_handlers_python_handlers","x-handlers-java-package":"com.generated.api.smithyhandlersjavahandlers.handlers","x-handlers-typescript-asset-path":"../../../handlers/typescript/dist/lambda","x-handlers-python-asset-path":"../../../handlers/python/dist/lambda","x-handlers-java-asset-path":"../../../handlers/java/dist/java/com/generated/api/smithy-handlers-java-handlers/0.0.0/smithy-handlers-java-handlers-0.0.0.jar","x-handlers-node-lambda-runtime-version":"NODEJS_18_X","x-handlers-python-lambda-runtime-version":"PYTHON_3_11","x-handlers-java-lambda-runtime-version":"JAVA_17"}'", }, { "exec": "mkdir -p assets", @@ -28627,7 +28627,7 @@ resolution-mode=highest "exec": "cp -f ../../../model/.api.json assets/api.json", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-mock-data --spec-path ../../../model/.api.json --output-path .", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate-mock-data --specPath ../../../model/.api.json --outputPath .", }, ], }, @@ -30236,7 +30236,7 @@ strict-peer-dependencies=false "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", }, ], }, @@ -32099,7 +32099,7 @@ resolution-mode=highest "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../model/.api.json --outputPath . --templateDirs "typescript-lambda-handlers" --metadata '{"srcDir":"src","tstDir":"test","runtimePackageName":"smithy-handlers-typescript-runtime"}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../model/.api.json --outputPath . --templateDirs "typescript-lambda-handlers" --metadata '{"srcDir":"src","tstDir":"test","runtimePackageName":"smithy-handlers-typescript-runtime"}'", }, ], }, @@ -32773,7 +32773,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-handlers-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-handlers-model/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath build/smithyprojections/smithy-handlers-model/openapi/openapi/MyService.openapi.json --outputPath .api.json --smithyJsonPath build/smithyprojections/smithy-handlers-model/openapi/model/model.json", }, ], }, @@ -33405,7 +33405,7 @@ resolution-mode=highest "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript-cdk-infrastructure" --metadata '{"srcDir":"src","runtimePackageName":"smithy-typescript-react-query-hooks-typescript-runtime","relativeSpecPath":"../assets/api.json","enableMockIntegrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":"","x-handlers-node-lambda-runtime-version":"","x-handlers-python-lambda-runtime-version":"","x-handlers-java-lambda-runtime-version":""}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript-cdk-infrastructure" --metadata '{"srcDir":"src","runtimePackageName":"smithy-typescript-react-query-hooks-typescript-runtime","relativeSpecPath":"../assets/api.json","enableMockIntegrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":"","x-handlers-node-lambda-runtime-version":"","x-handlers-python-lambda-runtime-version":"","x-handlers-java-lambda-runtime-version":""}'", }, { "exec": "mkdir -p assets", @@ -33414,7 +33414,7 @@ resolution-mode=highest "exec": "cp -f ../../../model/.api.json assets/api.json", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-mock-data --spec-path ../../../model/.api.json --output-path .", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate-mock-data --specPath ../../../model/.api.json --outputPath .", }, ], }, @@ -34079,7 +34079,7 @@ strict-peer-dependencies=false "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript/templates/client" "typescript-react-query-hooks" --metadata '{"srcDir":"src"}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript/templates/client" "typescript-react-query-hooks" --metadata '{"srcDir":"src"}'", }, ], }, @@ -34659,7 +34659,7 @@ strict-peer-dependencies=false "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", }, ], }, @@ -35148,7 +35148,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-typescript-react-query-hooks-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-typescript-react-query-hooks-model/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath build/smithyprojections/smithy-typescript-react-query-hooks-model/openapi/openapi/MyService.openapi.json --outputPath .api.json --smithyJsonPath build/smithyprojections/smithy-typescript-react-query-hooks-model/openapi/model/model.json", }, ], }, @@ -36348,7 +36348,7 @@ dist/java "exec": "echo $(pwd) > src/main/resources/project-absolute-path.txt", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-mock-data --spec-path ../../../model/.api.json --output-path src/main/resources", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate-mock-data --specPath ../../../model/.api.json --outputPath src/main/resources", }, ], }, @@ -37714,7 +37714,7 @@ strict-peer-dependencies=false "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", }, ], }, @@ -38203,7 +38203,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-java-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-java-model/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath build/smithyprojections/smithy-java-model/openapi/openapi/MyService.openapi.json --outputPath .api.json --smithyJsonPath build/smithyprojections/smithy-java-model/openapi/model/model.json", }, ], }, @@ -41632,7 +41632,7 @@ dist/java "exec": "echo $(pwd) > src/main/resources/project-absolute-path.txt", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-mock-data --spec-path ../../../model/.api.json --output-path src/main/resources", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate-mock-data --specPath ../../../model/.api.json --outputPath src/main/resources", }, ], }, @@ -43807,7 +43807,7 @@ README.md "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", }, ], }, @@ -44380,7 +44380,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-java-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-java-model/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath build/smithyprojections/smithy-java-model/openapi/openapi/MyService.openapi.json --outputPath .api.json --smithyJsonPath build/smithyprojections/smithy-java-model/openapi/model/model.json", }, ], }, @@ -45868,7 +45868,7 @@ mocks "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript-cdk-infrastructure" --metadata '{"srcDir":"src","runtimePackageName":"smithy-npm-typescript-runtime","relativeSpecPath":"../assets/api.json","enableMockIntegrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":"","x-handlers-node-lambda-runtime-version":"","x-handlers-python-lambda-runtime-version":"","x-handlers-java-lambda-runtime-version":""}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript-cdk-infrastructure" --metadata '{"srcDir":"src","runtimePackageName":"smithy-npm-typescript-runtime","relativeSpecPath":"../assets/api.json","enableMockIntegrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":"","x-handlers-node-lambda-runtime-version":"","x-handlers-python-lambda-runtime-version":"","x-handlers-java-lambda-runtime-version":""}'", }, { "exec": "mkdir -p assets", @@ -45877,7 +45877,7 @@ mocks "exec": "cp -f ../../../model/.api.json assets/api.json", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-mock-data --spec-path ../../../model/.api.json --output-path .", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate-mock-data --specPath ../../../model/.api.json --outputPath .", }, ], }, @@ -46551,7 +46551,7 @@ strict-peer-dependencies=false "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", }, ], }, @@ -47040,7 +47040,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-npm-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-npm-model/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath build/smithyprojections/smithy-npm-model/openapi/openapi/MyService.openapi.json --outputPath .api.json --smithyJsonPath build/smithyprojections/smithy-npm-model/openapi/model/model.json", }, ], }, @@ -50354,7 +50354,7 @@ mocks "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript-cdk-infrastructure" --metadata '{"srcDir":"src","runtimePackageName":"smithy-npm-typescript-runtime","relativeSpecPath":"../assets/api.json","enableMockIntegrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":"","x-handlers-node-lambda-runtime-version":"","x-handlers-python-lambda-runtime-version":"","x-handlers-java-lambda-runtime-version":""}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript-cdk-infrastructure" --metadata '{"srcDir":"src","runtimePackageName":"smithy-npm-typescript-runtime","relativeSpecPath":"../assets/api.json","enableMockIntegrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":"","x-handlers-node-lambda-runtime-version":"","x-handlers-python-lambda-runtime-version":"","x-handlers-java-lambda-runtime-version":""}'", }, { "exec": "mkdir -p assets", @@ -50363,7 +50363,7 @@ mocks "exec": "cp -f ../../../model/.api.json assets/api.json", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-mock-data --spec-path ../../../model/.api.json --output-path .", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate-mock-data --specPath ../../../model/.api.json --outputPath .", }, ], }, @@ -51022,7 +51022,7 @@ README.md "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", }, ], }, @@ -51595,7 +51595,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-npm-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-npm-model/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath build/smithyprojections/smithy-npm-model/openapi/openapi/MyService.openapi.json --outputPath .api.json --smithyJsonPath build/smithyprojections/smithy-npm-model/openapi/model/model.json", }, ], }, @@ -53090,7 +53090,7 @@ resolution-mode=highest "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript-cdk-infrastructure" --metadata '{"srcDir":"src","runtimePackageName":"smithy-pnpm-typescript-runtime","relativeSpecPath":"../assets/api.json","enableMockIntegrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":"","x-handlers-node-lambda-runtime-version":"","x-handlers-python-lambda-runtime-version":"","x-handlers-java-lambda-runtime-version":""}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript-cdk-infrastructure" --metadata '{"srcDir":"src","runtimePackageName":"smithy-pnpm-typescript-runtime","relativeSpecPath":"../assets/api.json","enableMockIntegrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":"","x-handlers-node-lambda-runtime-version":"","x-handlers-python-lambda-runtime-version":"","x-handlers-java-lambda-runtime-version":""}'", }, { "exec": "mkdir -p assets", @@ -53099,7 +53099,7 @@ resolution-mode=highest "exec": "cp -f ../../../model/.api.json assets/api.json", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-mock-data --spec-path ../../../model/.api.json --output-path .", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate-mock-data --specPath ../../../model/.api.json --outputPath .", }, ], }, @@ -53773,7 +53773,7 @@ strict-peer-dependencies=false "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", }, ], }, @@ -54262,7 +54262,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-pnpm-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-pnpm-model/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath build/smithyprojections/smithy-pnpm-model/openapi/openapi/MyService.openapi.json --outputPath .api.json --smithyJsonPath build/smithyprojections/smithy-pnpm-model/openapi/model/model.json", }, ], }, @@ -57594,7 +57594,7 @@ mocks "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript-cdk-infrastructure" --metadata '{"srcDir":"src","runtimePackageName":"smithy-pnpm-typescript-runtime","relativeSpecPath":"../assets/api.json","enableMockIntegrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":"","x-handlers-node-lambda-runtime-version":"","x-handlers-python-lambda-runtime-version":"","x-handlers-java-lambda-runtime-version":""}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript-cdk-infrastructure" --metadata '{"srcDir":"src","runtimePackageName":"smithy-pnpm-typescript-runtime","relativeSpecPath":"../assets/api.json","enableMockIntegrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":"","x-handlers-node-lambda-runtime-version":"","x-handlers-python-lambda-runtime-version":"","x-handlers-java-lambda-runtime-version":""}'", }, { "exec": "mkdir -p assets", @@ -57603,7 +57603,7 @@ mocks "exec": "cp -f ../../../model/.api.json assets/api.json", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-mock-data --spec-path ../../../model/.api.json --output-path .", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate-mock-data --specPath ../../../model/.api.json --outputPath .", }, ], }, @@ -58264,7 +58264,7 @@ README.md "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", }, ], }, @@ -58837,7 +58837,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-pnpm-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-pnpm-model/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath build/smithyprojections/smithy-pnpm-model/openapi/openapi/MyService.openapi.json --outputPath .api.json --smithyJsonPath build/smithyprojections/smithy-pnpm-model/openapi/model/model.json", }, ], }, @@ -60397,7 +60397,7 @@ mocks "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate --generator python-nextgen --spec-path ../../../model/.api.json --output-path . --generator-dir python-cdk-infrastructure --src-dir smithy_python_python_infra --tst-dir test --openapi-normalizer "KEEP_ONLY_FIRST_TAG_IN_OPERATION=true" --extra-vendor-extensions '{"x-runtime-module-name":"smithy_python_python_runtime","x-relative-spec-path":"../../../../model/.api.json","x-enable-mock-integrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":"","x-handlers-node-lambda-runtime-version":"","x-handlers-python-lambda-runtime-version":"","x-handlers-java-lambda-runtime-version":""}' --generate-alias-as-model", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-mock-data --spec-path ../../../model/.api.json --output-path .", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate-mock-data --specPath ../../../model/.api.json --outputPath .", }, ], }, @@ -61723,7 +61723,7 @@ strict-peer-dependencies=false "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", }, ], }, @@ -62212,7 +62212,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-python-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-python-model/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath build/smithyprojections/smithy-python-model/openapi/openapi/MyService.openapi.json --outputPath .api.json --smithyJsonPath build/smithyprojections/smithy-python-model/openapi/model/model.json", }, ], }, @@ -65600,7 +65600,7 @@ mocks "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate --generator python-nextgen --spec-path ../../../model/.api.json --output-path . --generator-dir python-cdk-infrastructure --src-dir smithy_python_python_infra --tst-dir test --openapi-normalizer "KEEP_ONLY_FIRST_TAG_IN_OPERATION=true" --extra-vendor-extensions '{"x-runtime-module-name":"smithy_python_python_runtime","x-relative-spec-path":"../../../../model/.api.json","x-enable-mock-integrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":"","x-handlers-node-lambda-runtime-version":"","x-handlers-python-lambda-runtime-version":"","x-handlers-java-lambda-runtime-version":""}' --generate-alias-as-model", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-mock-data --spec-path ../../../model/.api.json --output-path .", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate-mock-data --specPath ../../../model/.api.json --outputPath .", }, ], }, @@ -67748,7 +67748,7 @@ README.md "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", }, ], }, @@ -68321,7 +68321,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-python-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-python-model/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath build/smithyprojections/smithy-python-model/openapi/openapi/MyService.openapi.json --outputPath .api.json --smithyJsonPath build/smithyprojections/smithy-python-model/openapi/model/model.json", }, ], }, @@ -69824,7 +69824,7 @@ resolution-mode=highest "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript-cdk-infrastructure" --metadata '{"srcDir":"src","runtimePackageName":"smithy-typescript-typescript-runtime","relativeSpecPath":"../assets/api.json","enableMockIntegrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":"","x-handlers-node-lambda-runtime-version":"","x-handlers-python-lambda-runtime-version":"","x-handlers-java-lambda-runtime-version":""}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript-cdk-infrastructure" --metadata '{"srcDir":"src","runtimePackageName":"smithy-typescript-typescript-runtime","relativeSpecPath":"../assets/api.json","enableMockIntegrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":"","x-handlers-node-lambda-runtime-version":"","x-handlers-python-lambda-runtime-version":"","x-handlers-java-lambda-runtime-version":""}'", }, { "exec": "mkdir -p assets", @@ -69833,7 +69833,7 @@ resolution-mode=highest "exec": "cp -f ../../../model/.api.json assets/api.json", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-mock-data --spec-path ../../../model/.api.json --output-path .", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate-mock-data --specPath ../../../model/.api.json --outputPath .", }, ], }, @@ -71442,7 +71442,7 @@ strict-peer-dependencies=false "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", }, ], }, @@ -71931,7 +71931,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-typescript-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-typescript-model/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath build/smithyprojections/smithy-typescript-model/openapi/openapi/MyService.openapi.json --outputPath .api.json --smithyJsonPath build/smithyprojections/smithy-typescript-model/openapi/model/model.json", }, ], }, @@ -75259,7 +75259,7 @@ mocks "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript-cdk-infrastructure" --metadata '{"srcDir":"src","runtimePackageName":"smithy-typescript-typescript-runtime","relativeSpecPath":"../assets/api.json","enableMockIntegrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":"","x-handlers-node-lambda-runtime-version":"","x-handlers-python-lambda-runtime-version":"","x-handlers-java-lambda-runtime-version":""}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript-cdk-infrastructure" --metadata '{"srcDir":"src","runtimePackageName":"smithy-typescript-typescript-runtime","relativeSpecPath":"../assets/api.json","enableMockIntegrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":"","x-handlers-node-lambda-runtime-version":"","x-handlers-python-lambda-runtime-version":"","x-handlers-java-lambda-runtime-version":""}'", }, { "exec": "mkdir -p assets", @@ -75268,7 +75268,7 @@ mocks "exec": "cp -f ../../../model/.api.json assets/api.json", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-mock-data --spec-path ../../../model/.api.json --output-path .", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate-mock-data --specPath ../../../model/.api.json --outputPath .", }, ], }, @@ -77471,7 +77471,7 @@ README.md "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", }, ], }, @@ -78044,7 +78044,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-typescript-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-typescript-model/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath build/smithyprojections/smithy-typescript-model/openapi/openapi/MyService.openapi.json --outputPath .api.json --smithyJsonPath build/smithyprojections/smithy-typescript-model/openapi/model/model.json", }, ], }, @@ -79546,7 +79546,7 @@ mocks "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript-cdk-infrastructure" --metadata '{"srcDir":"src","runtimePackageName":"smithy-yarn-berry-typescript-runtime","relativeSpecPath":"../assets/api.json","enableMockIntegrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":"","x-handlers-node-lambda-runtime-version":"","x-handlers-python-lambda-runtime-version":"","x-handlers-java-lambda-runtime-version":""}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript-cdk-infrastructure" --metadata '{"srcDir":"src","runtimePackageName":"smithy-yarn-berry-typescript-runtime","relativeSpecPath":"../assets/api.json","enableMockIntegrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":"","x-handlers-node-lambda-runtime-version":"","x-handlers-python-lambda-runtime-version":"","x-handlers-java-lambda-runtime-version":""}'", }, { "exec": "mkdir -p assets", @@ -79555,7 +79555,7 @@ mocks "exec": "cp -f ../../../model/.api.json assets/api.json", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-mock-data --spec-path ../../../model/.api.json --output-path .", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate-mock-data --specPath ../../../model/.api.json --outputPath .", }, ], }, @@ -80234,7 +80234,7 @@ strict-peer-dependencies=false "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", }, ], }, @@ -80723,7 +80723,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-yarn_berry-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-yarn_berry-model/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath build/smithyprojections/smithy-yarn_berry-model/openapi/openapi/MyService.openapi.json --outputPath .api.json --smithyJsonPath build/smithyprojections/smithy-yarn_berry-model/openapi/model/model.json", }, ], }, @@ -84073,7 +84073,7 @@ mocks "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript-cdk-infrastructure" --metadata '{"srcDir":"src","runtimePackageName":"smithy-yarn-berry-typescript-runtime","relativeSpecPath":"../assets/api.json","enableMockIntegrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":"","x-handlers-node-lambda-runtime-version":"","x-handlers-python-lambda-runtime-version":"","x-handlers-java-lambda-runtime-version":""}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript-cdk-infrastructure" --metadata '{"srcDir":"src","runtimePackageName":"smithy-yarn-berry-typescript-runtime","relativeSpecPath":"../assets/api.json","enableMockIntegrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":"","x-handlers-node-lambda-runtime-version":"","x-handlers-python-lambda-runtime-version":"","x-handlers-java-lambda-runtime-version":""}'", }, { "exec": "mkdir -p assets", @@ -84082,7 +84082,7 @@ mocks "exec": "cp -f ../../../model/.api.json assets/api.json", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-mock-data --spec-path ../../../model/.api.json --output-path .", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate-mock-data --specPath ../../../model/.api.json --outputPath .", }, ], }, @@ -84760,7 +84760,7 @@ README.md "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", }, ], }, @@ -85338,7 +85338,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-yarn_berry-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-yarn_berry-model/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath build/smithyprojections/smithy-yarn_berry-model/openapi/openapi/MyService.openapi.json --outputPath .api.json --smithyJsonPath build/smithyprojections/smithy-yarn_berry-model/openapi/model/model.json", }, ], }, @@ -86826,7 +86826,7 @@ mocks "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript-cdk-infrastructure" --metadata '{"srcDir":"src","runtimePackageName":"smithy-yarn-classic-typescript-runtime","relativeSpecPath":"../assets/api.json","enableMockIntegrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":"","x-handlers-node-lambda-runtime-version":"","x-handlers-python-lambda-runtime-version":"","x-handlers-java-lambda-runtime-version":""}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript-cdk-infrastructure" --metadata '{"srcDir":"src","runtimePackageName":"smithy-yarn-classic-typescript-runtime","relativeSpecPath":"../assets/api.json","enableMockIntegrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":"","x-handlers-node-lambda-runtime-version":"","x-handlers-python-lambda-runtime-version":"","x-handlers-java-lambda-runtime-version":""}'", }, { "exec": "mkdir -p assets", @@ -86835,7 +86835,7 @@ mocks "exec": "cp -f ../../../model/.api.json assets/api.json", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-mock-data --spec-path ../../../model/.api.json --output-path .", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate-mock-data --specPath ../../../model/.api.json --outputPath .", }, ], }, @@ -87509,7 +87509,7 @@ strict-peer-dependencies=false "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", }, ], }, @@ -87998,7 +87998,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-yarn_classic-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-yarn_classic-model/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath build/smithyprojections/smithy-yarn_classic-model/openapi/openapi/MyService.openapi.json --outputPath .api.json --smithyJsonPath build/smithyprojections/smithy-yarn_classic-model/openapi/model/model.json", }, ], }, @@ -91313,7 +91313,7 @@ mocks "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript-cdk-infrastructure" --metadata '{"srcDir":"src","runtimePackageName":"smithy-yarn-classic-typescript-runtime","relativeSpecPath":"../assets/api.json","enableMockIntegrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":"","x-handlers-node-lambda-runtime-version":"","x-handlers-python-lambda-runtime-version":"","x-handlers-java-lambda-runtime-version":""}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript-cdk-infrastructure" --metadata '{"srcDir":"src","runtimePackageName":"smithy-yarn-classic-typescript-runtime","relativeSpecPath":"../assets/api.json","enableMockIntegrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":"","x-handlers-node-lambda-runtime-version":"","x-handlers-python-lambda-runtime-version":"","x-handlers-java-lambda-runtime-version":""}'", }, { "exec": "mkdir -p assets", @@ -91322,7 +91322,7 @@ mocks "exec": "cp -f ../../../model/.api.json assets/api.json", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-mock-data --spec-path ../../../model/.api.json --output-path .", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate-mock-data --specPath ../../../model/.api.json --outputPath .", }, ], }, @@ -91981,7 +91981,7 @@ README.md "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath ../../../model/.api.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", }, ], }, @@ -92554,7 +92554,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-yarn_classic-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-yarn_classic-model/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath build/smithyprojections/smithy-yarn_classic-model/openapi/openapi/MyService.openapi.json --outputPath .api.json --smithyJsonPath build/smithyprojections/smithy-yarn_classic-model/openapi/model/model.json", }, ], }, diff --git a/packages/type-safe-api/test/project/__snapshots__/type-safe-websocket-api-project.test.ts.snap b/packages/type-safe-api/test/project/__snapshots__/type-safe-websocket-api-project.test.ts.snap index 2708b66db..57737a871 100644 --- a/packages/type-safe-api/test/project/__snapshots__/type-safe-websocket-api-project.test.ts.snap +++ b/packages/type-safe-api/test/project/__snapshots__/type-safe-websocket-api-project.test.ts.snap @@ -1816,7 +1816,7 @@ node_modules/ "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path src/main/openapi/main.yaml --output-path .api.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath src/main/openapi/main.yaml --outputPath .api.json", }, { "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-asyncapi-spec --spec-path .api.json --output-path .asyncapi.json", @@ -5508,7 +5508,7 @@ node_modules/ "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path src/main/openapi/main.yaml --output-path .api.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath src/main/openapi/main.yaml --outputPath .api.json", }, { "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-asyncapi-spec --spec-path .api.json --output-path .asyncapi.json", @@ -8779,7 +8779,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-handlers-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-handlers-model/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath build/smithyprojections/smithy-handlers-model/openapi/openapi/MyService.openapi.json --outputPath .api.json --smithyJsonPath build/smithyprojections/smithy-handlers-model/openapi/model/model.json", }, { "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-asyncapi-spec --spec-path .api.json --output-path .asyncapi.json", @@ -12036,7 +12036,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-typescript-websocket-hooks-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-typescript-websocket-hooks-model/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath build/smithyprojections/smithy-typescript-websocket-hooks-model/openapi/openapi/MyService.openapi.json --outputPath .api.json --smithyJsonPath build/smithyprojections/smithy-typescript-websocket-hooks-model/openapi/model/model.json", }, { "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-asyncapi-spec --spec-path .api.json --output-path .asyncapi.json", @@ -14278,7 +14278,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-npm-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-npm-model/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath build/smithyprojections/smithy-npm-model/openapi/openapi/MyService.openapi.json --outputPath .api.json --smithyJsonPath build/smithyprojections/smithy-npm-model/openapi/model/model.json", }, { "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-asyncapi-spec --spec-path .api.json --output-path .asyncapi.json", @@ -18196,7 +18196,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-npm-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-npm-model/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath build/smithyprojections/smithy-npm-model/openapi/openapi/MyService.openapi.json --outputPath .api.json --smithyJsonPath build/smithyprojections/smithy-npm-model/openapi/model/model.json", }, { "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-asyncapi-spec --spec-path .api.json --output-path .asyncapi.json", @@ -20840,7 +20840,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-pnpm-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-pnpm-model/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath build/smithyprojections/smithy-pnpm-model/openapi/openapi/MyService.openapi.json --outputPath .api.json --smithyJsonPath build/smithyprojections/smithy-pnpm-model/openapi/model/model.json", }, { "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-asyncapi-spec --spec-path .api.json --output-path .asyncapi.json", @@ -24778,7 +24778,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-pnpm-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-pnpm-model/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath build/smithyprojections/smithy-pnpm-model/openapi/openapi/MyService.openapi.json --outputPath .api.json --smithyJsonPath build/smithyprojections/smithy-pnpm-model/openapi/model/model.json", }, { "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-asyncapi-spec --spec-path .api.json --output-path .asyncapi.json", @@ -27428,7 +27428,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-typescript-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-typescript-model/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath build/smithyprojections/smithy-typescript-model/openapi/openapi/MyService.openapi.json --outputPath .api.json --smithyJsonPath build/smithyprojections/smithy-typescript-model/openapi/model/model.json", }, { "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-asyncapi-spec --spec-path .api.json --output-path .asyncapi.json", @@ -31347,7 +31347,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-typescript-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-typescript-model/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath build/smithyprojections/smithy-typescript-model/openapi/openapi/MyService.openapi.json --outputPath .api.json --smithyJsonPath build/smithyprojections/smithy-typescript-model/openapi/model/model.json", }, { "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-asyncapi-spec --spec-path .api.json --output-path .asyncapi.json", @@ -34003,7 +34003,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-yarn_berry-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-yarn_berry-model/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath build/smithyprojections/smithy-yarn_berry-model/openapi/openapi/MyService.openapi.json --outputPath .api.json --smithyJsonPath build/smithyprojections/smithy-yarn_berry-model/openapi/model/model.json", }, { "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-asyncapi-spec --spec-path .api.json --output-path .asyncapi.json", @@ -37981,7 +37981,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-yarn_berry-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-yarn_berry-model/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath build/smithyprojections/smithy-yarn_berry-model/openapi/openapi/MyService.openapi.json --outputPath .api.json --smithyJsonPath build/smithyprojections/smithy-yarn_berry-model/openapi/model/model.json", }, { "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-asyncapi-spec --spec-path .api.json --output-path .asyncapi.json", @@ -40618,7 +40618,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-yarn_classic-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-yarn_classic-model/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath build/smithyprojections/smithy-yarn_classic-model/openapi/openapi/MyService.openapi.json --outputPath .api.json --smithyJsonPath build/smithyprojections/smithy-yarn_classic-model/openapi/model/model.json", }, { "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-asyncapi-spec --spec-path .api.json --output-path .asyncapi.json", @@ -44537,7 +44537,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-yarn_classic-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-yarn_classic-model/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath build/smithyprojections/smithy-yarn_classic-model/openapi/openapi/MyService.openapi.json --outputPath .api.json --smithyJsonPath build/smithyprojections/smithy-yarn_classic-model/openapi/model/model.json", }, { "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-asyncapi-spec --spec-path .api.json --output-path .asyncapi.json", diff --git a/packages/type-safe-api/test/project/codegen/handlers/__snapshots__/generated-typescript-handlers-project.test.ts.snap b/packages/type-safe-api/test/project/codegen/handlers/__snapshots__/generated-typescript-handlers-project.test.ts.snap index 9efc1e160..1de6b5da1 100644 --- a/packages/type-safe-api/test/project/codegen/handlers/__snapshots__/generated-typescript-handlers-project.test.ts.snap +++ b/packages/type-safe-api/test/project/codegen/handlers/__snapshots__/generated-typescript-handlers-project.test.ts.snap @@ -843,7 +843,7 @@ pull_request_rules: "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath my-spec.json --outputPath . --templateDirs "typescript-lambda-handlers" --metadata '{"srcDir":"src","tstDir":"test","runtimePackageName":"test-ts-client"}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath my-spec.json --outputPath . --templateDirs "typescript-lambda-handlers" --metadata '{"srcDir":"src","tstDir":"test","runtimePackageName":"test-ts-client"}'", }, ], }, diff --git a/packages/type-safe-api/test/project/codegen/infrastructure/cdk/__snapshots__/generated-java-cdk-infrastructure-project.test.ts.snap b/packages/type-safe-api/test/project/codegen/infrastructure/cdk/__snapshots__/generated-java-cdk-infrastructure-project.test.ts.snap index ce7b49320..ef074571d 100644 --- a/packages/type-safe-api/test/project/codegen/infrastructure/cdk/__snapshots__/generated-java-cdk-infrastructure-project.test.ts.snap +++ b/packages/type-safe-api/test/project/codegen/infrastructure/cdk/__snapshots__/generated-java-cdk-infrastructure-project.test.ts.snap @@ -371,7 +371,7 @@ dist/java "exec": "echo $(pwd) > src/main/resources/project-absolute-path.txt", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-mock-data --spec-path my-spec.json --output-path src/main/resources", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate-mock-data --specPath my-spec.json --outputPath src/main/resources", }, ], }, diff --git a/packages/type-safe-api/test/project/codegen/infrastructure/cdk/__snapshots__/generated-python-cdk-infrastructure-project.test.ts.snap b/packages/type-safe-api/test/project/codegen/infrastructure/cdk/__snapshots__/generated-python-cdk-infrastructure-project.test.ts.snap index 180e166c6..eb8fc8eab 100644 --- a/packages/type-safe-api/test/project/codegen/infrastructure/cdk/__snapshots__/generated-python-cdk-infrastructure-project.test.ts.snap +++ b/packages/type-safe-api/test/project/codegen/infrastructure/cdk/__snapshots__/generated-python-cdk-infrastructure-project.test.ts.snap @@ -327,7 +327,7 @@ mocks "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate --generator python-nextgen --spec-path my-spec.json --output-path . --generator-dir python-cdk-infrastructure --src-dir test_infra --tst-dir test --openapi-normalizer "KEEP_ONLY_FIRST_TAG_IN_OPERATION=true" --extra-vendor-extensions '{"x-runtime-module-name":"test_client","x-relative-spec-path":"../my-spec.json","x-enable-mock-integrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":"","x-handlers-node-lambda-runtime-version":"","x-handlers-python-lambda-runtime-version":"","x-handlers-java-lambda-runtime-version":""}' --generate-alias-as-model", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-mock-data --spec-path my-spec.json --output-path .", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate-mock-data --specPath my-spec.json --outputPath .", }, ], }, diff --git a/packages/type-safe-api/test/project/codegen/infrastructure/cdk/__snapshots__/generated-typescript-cdk-infrastructure-project.test.ts.snap b/packages/type-safe-api/test/project/codegen/infrastructure/cdk/__snapshots__/generated-typescript-cdk-infrastructure-project.test.ts.snap index 445223339..d2857523b 100644 --- a/packages/type-safe-api/test/project/codegen/infrastructure/cdk/__snapshots__/generated-typescript-cdk-infrastructure-project.test.ts.snap +++ b/packages/type-safe-api/test/project/codegen/infrastructure/cdk/__snapshots__/generated-typescript-cdk-infrastructure-project.test.ts.snap @@ -578,7 +578,7 @@ pull_request_rules: "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath my-spec.json --outputPath . --templateDirs "typescript-cdk-infrastructure" --metadata '{"srcDir":"src","runtimePackageName":"test-ts-client","relativeSpecPath":"../assets/api.json","enableMockIntegrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":"","x-handlers-node-lambda-runtime-version":"","x-handlers-python-lambda-runtime-version":"","x-handlers-java-lambda-runtime-version":""}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath my-spec.json --outputPath . --templateDirs "typescript-cdk-infrastructure" --metadata '{"srcDir":"src","runtimePackageName":"test-ts-client","relativeSpecPath":"../assets/api.json","enableMockIntegrations":true,"x-handlers-python-module":"","x-handlers-java-package":"","x-handlers-typescript-asset-path":"","x-handlers-python-asset-path":"","x-handlers-java-asset-path":"","x-handlers-node-lambda-runtime-version":"","x-handlers-python-lambda-runtime-version":"","x-handlers-java-lambda-runtime-version":""}'", }, { "exec": "mkdir -p assets", @@ -587,7 +587,7 @@ pull_request_rules: "exec": "cp -f my-spec.json assets/api.json", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-mock-data --spec-path my-spec.json --output-path .", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate-mock-data --specPath my-spec.json --outputPath .", }, ], }, 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 b96ed6d50..959fdd109 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 @@ -561,7 +561,7 @@ pull_request_rules: "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-next --specPath my-spec.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api generate --specPath my-spec.json --outputPath . --templateDirs "typescript" --metadata '{"srcDir":"src"}'", }, ], }, diff --git a/packages/type-safe-api/test/project/model/__snapshots__/type-safe-api-model-project.test.ts.snap b/packages/type-safe-api/test/project/model/__snapshots__/type-safe-api-model-project.test.ts.snap index 8cf044933..c86244718 100644 --- a/packages/type-safe-api/test/project/model/__snapshots__/type-safe-api-model-project.test.ts.snap +++ b/packages/type-safe-api/test/project/model/__snapshots__/type-safe-api-model-project.test.ts.snap @@ -79,7 +79,7 @@ node_modules/ "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path src/main/openapi/main.yaml --output-path .api.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath src/main/openapi/main.yaml --outputPath .api.json", }, ], }, @@ -402,7 +402,7 @@ node_modules/ "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path src/main/openapi/main.yaml --output-path .api.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath src/main/openapi/main.yaml --outputPath .api.json", }, ], }, @@ -747,7 +747,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-model/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath build/smithyprojections/smithy-model/openapi/openapi/MyService.openapi.json --outputPath .api.json --smithyJsonPath build/smithyprojections/smithy-model/openapi/model/model.json", }, ], }, @@ -1164,7 +1164,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-model-with-build-options/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-model-with-build-options/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath build/smithyprojections/smithy-model-with-build-options/openapi/openapi/MyService.openapi.json --outputPath .api.json --smithyJsonPath build/smithyprojections/smithy-model-with-build-options/openapi/model/model.json", }, ], }, @@ -1587,7 +1587,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-model-consumer/openapi/openapi/Consumer.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-model-consumer/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath build/smithyprojections/smithy-model-consumer/openapi/openapi/Consumer.openapi.json --outputPath .api.json --smithyJsonPath build/smithyprojections/smithy-model-consumer/openapi/model/model.json", }, ], }, @@ -2005,7 +2005,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-handlers/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-handlers/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath build/smithyprojections/smithy-handlers/openapi/openapi/MyService.openapi.json --outputPath .api.json --smithyJsonPath build/smithyprojections/smithy-handlers/openapi/model/model.json", }, ], }, diff --git a/packages/type-safe-api/test/project/model/__snapshots__/type-safe-websocket-api-model-project.test.ts.snap b/packages/type-safe-api/test/project/model/__snapshots__/type-safe-websocket-api-model-project.test.ts.snap index 35fc106e9..a12250dbe 100644 --- a/packages/type-safe-api/test/project/model/__snapshots__/type-safe-websocket-api-model-project.test.ts.snap +++ b/packages/type-safe-api/test/project/model/__snapshots__/type-safe-websocket-api-model-project.test.ts.snap @@ -80,7 +80,7 @@ node_modules/ "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path src/main/openapi/main.yaml --output-path .api.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath src/main/openapi/main.yaml --outputPath .api.json", }, { "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-asyncapi-spec --spec-path .api.json --output-path .asyncapi.json", @@ -366,7 +366,7 @@ node_modules/ "name": "generate", "steps": [ { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path src/main/openapi/main.yaml --output-path .api.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath src/main/openapi/main.yaml --outputPath .api.json", }, { "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-asyncapi-spec --spec-path .api.json --output-path .asyncapi.json", @@ -682,7 +682,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-async-model/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-async-model/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath build/smithyprojections/smithy-async-model/openapi/openapi/MyService.openapi.json --outputPath .api.json --smithyJsonPath build/smithyprojections/smithy-async-model/openapi/model/model.json", }, { "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-asyncapi-spec --spec-path .api.json --output-path .asyncapi.json", @@ -1195,7 +1195,7 @@ smithy-output "exec": "./gradlew build", }, { - "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.parse-openapi-spec --spec-path build/smithyprojections/smithy-async-handlers/openapi/openapi/MyService.openapi.json --output-path .api.json --smithy-json-path build/smithyprojections/smithy-async-handlers/openapi/model/model.json", + "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api parse-openapi-spec --specPath build/smithyprojections/smithy-async-handlers/openapi/openapi/MyService.openapi.json --outputPath .api.json --smithyJsonPath build/smithyprojections/smithy-async-handlers/openapi/model/model.json", }, { "exec": "npx --yes -p @aws/pdk@$AWS_PDK_VERSION type-safe-api.generate-asyncapi-spec --spec-path .api.json --output-path .asyncapi.json", diff --git a/packages/type-safe-api/test/scripts/custom/mock-data/generate-mock-data.test.ts b/packages/type-safe-api/test/scripts/custom/mock-data/generate-mock-data.test.ts index 3a62f7835..e0d7405bd 100644 --- a/packages/type-safe-api/test/scripts/custom/mock-data/generate-mock-data.test.ts +++ b/packages/type-safe-api/test/scripts/custom/mock-data/generate-mock-data.test.ts @@ -11,7 +11,7 @@ describe("Generate Mock Data Unit Tests", () => { withTmpDirSnapshot(os.tmpdir(), (tmpDir) => { const specPath = "../../../resources/specs/single.yaml"; const outputPath = path.relative(path.resolve(__dirname), tmpDir); - const command = `../../../../scripts/type-safe-api/custom/mock-data/generate-mock-data --spec-path ${specPath} --output-path ${outputPath}`; + const command = `../../../../scripts/type-safe-api/run.js generate-mock-data --specPath ${specPath} --outputPath ${outputPath}`; exec(command, { cwd: path.resolve(__dirname), }); @@ -24,7 +24,7 @@ describe("Generate Mock Data Unit Tests", () => { withTmpDirSnapshot(os.tmpdir(), (tmpDir) => { const specPath = "../../../resources/specs/recursive.yaml"; const outputPath = path.relative(path.resolve(__dirname), tmpDir); - const command = `../../../../scripts/type-safe-api/custom/mock-data/generate-mock-data --spec-path ${specPath} --output-path ${outputPath}`; + const command = `../../../../scripts/type-safe-api/run.js generate-mock-data --specPath ${specPath} --outputPath ${outputPath}`; exec(command, { cwd: path.resolve(__dirname), }); @@ -37,7 +37,7 @@ describe("Generate Mock Data Unit Tests", () => { withTmpDirSnapshot(os.tmpdir(), (tmpDir) => { const specPath = "../../../resources/specs/recursive-required.yaml"; const outputPath = path.relative(path.resolve(__dirname), tmpDir); - const command = `../../../../scripts/type-safe-api/custom/mock-data/generate-mock-data --spec-path ${specPath} --output-path ${outputPath}`; + const command = `../../../../scripts/type-safe-api/run.js generate-mock-data --specPath ${specPath} --outputPath ${outputPath}`; exec(command, { cwd: path.resolve(__dirname), }); @@ -50,7 +50,7 @@ describe("Generate Mock Data Unit Tests", () => { withTmpDirSnapshot(os.tmpdir(), (tmpDir) => { const specPath = "../../../resources/specs/data-types.yaml"; const outputPath = path.relative(path.resolve(__dirname), tmpDir); - const command = `../../../../scripts/type-safe-api/custom/mock-data/generate-mock-data --spec-path ${specPath} --output-path ${outputPath}`; + const command = `../../../../scripts/type-safe-api/run.js generate-mock-data --specPath ${specPath} --outputPath ${outputPath}`; exec(command, { cwd: path.resolve(__dirname), }); diff --git a/packages/type-safe-api/test/scripts/generators/typescript-cdk-infrastructure.test.ts b/packages/type-safe-api/test/scripts/generators/typescript-cdk-infrastructure.test.ts index e47aff585..14cbaac72 100644 --- a/packages/type-safe-api/test/scripts/generators/typescript-cdk-infrastructure.test.ts +++ b/packages/type-safe-api/test/scripts/generators/typescript-cdk-infrastructure.test.ts @@ -36,7 +36,7 @@ describe("Typescript Infrastructure Code Generation Script Unit Tests", () => { exec( `${path.resolve( __dirname, - "../../../scripts/type-safe-api/generators/generate.js" + "../../../scripts/type-safe-api/run.js generate" )} ${project.buildGenerateCommandArgs()}`, { cwd: infraOutdir, @@ -82,7 +82,7 @@ describe("Typescript Infrastructure Code Generation Script Unit Tests", () => { exec( `${path.resolve( __dirname, - "../../../scripts/type-safe-api/generators/generate.js" + "../../../scripts/type-safe-api/run.js generate" )} ${project.buildGenerateCommandArgs()}`, { cwd: infraOutdir, @@ -119,7 +119,7 @@ describe("Typescript Infrastructure Code Generation Script Unit Tests", () => { exec( `${path.resolve( __dirname, - "../../../scripts/type-safe-api/generators/generate.js" + "../../../scripts/type-safe-api/run.js generate" )} ${project.buildGenerateCommandArgs()}`, { cwd: infraOutdir, diff --git a/packages/type-safe-api/test/scripts/generators/typescript-lambda-handlers.test.ts b/packages/type-safe-api/test/scripts/generators/typescript-lambda-handlers.test.ts index d93c5cfcb..ee1ae1d10 100644 --- a/packages/type-safe-api/test/scripts/generators/typescript-lambda-handlers.test.ts +++ b/packages/type-safe-api/test/scripts/generators/typescript-lambda-handlers.test.ts @@ -34,7 +34,7 @@ describe("Typescript Handlers Code Generation Script Unit Tests", () => { exec( `${path.resolve( __dirname, - "../../../scripts/type-safe-api/generators/generate.js" + "../../../scripts/type-safe-api/run.js generate" )} ${project.buildGenerateCommandArgs()}`, { cwd: handlersOutdir, diff --git a/packages/type-safe-api/test/scripts/generators/typescript-react-query-hooks.test.ts b/packages/type-safe-api/test/scripts/generators/typescript-react-query-hooks.test.ts index c7a8a88b0..e9db0ed4f 100644 --- a/packages/type-safe-api/test/scripts/generators/typescript-react-query-hooks.test.ts +++ b/packages/type-safe-api/test/scripts/generators/typescript-react-query-hooks.test.ts @@ -28,7 +28,7 @@ describe("Typescript React Query Hooks Code Generation Script Unit Tests", () => exec( `${path.resolve( __dirname, - "../../../scripts/type-safe-api/generators/generate.js" + "../../../scripts/type-safe-api/run.js generate" )} ${project.buildGenerateCommandArgs()}`, { cwd: outdir, diff --git a/packages/type-safe-api/test/scripts/generators/typescript.test.ts b/packages/type-safe-api/test/scripts/generators/typescript.test.ts index 5d9666d6d..f7f92b726 100644 --- a/packages/type-safe-api/test/scripts/generators/typescript.test.ts +++ b/packages/type-safe-api/test/scripts/generators/typescript.test.ts @@ -31,7 +31,7 @@ describe("Typescript Client Code Generation Script Unit Tests", () => { exec( `${path.resolve( __dirname, - "../../../scripts/type-safe-api/generators/generate.js" + "../../../scripts/type-safe-api/run.js generate" )} ${project.buildGenerateCommandArgs()}`, { cwd: outdir, diff --git a/packages/type-safe-api/test/scripts/parser/parse-openapi-spec.test.ts b/packages/type-safe-api/test/scripts/parser/parse-openapi-spec.test.ts index 325374f26..a19776b3f 100644 --- a/packages/type-safe-api/test/scripts/parser/parse-openapi-spec.test.ts +++ b/packages/type-safe-api/test/scripts/parser/parse-openapi-spec.test.ts @@ -14,7 +14,7 @@ describe("Parse OpenAPI Spec Script Unit Tests", () => { path.relative(path.resolve(__dirname), tmpDir), ".api.json" ); - const command = `../../../scripts/type-safe-api/parser/parse-openapi-spec --spec-path ${specPath} --output-path ${outputPath}`; + const command = `../../../scripts/type-safe-api/run.js parse-openapi-spec --specPath ${specPath} --outputPath ${outputPath}`; exec(command, { cwd: path.resolve(__dirname), }); @@ -33,7 +33,7 @@ describe("Parse OpenAPI Spec Script Unit Tests", () => { path.relative(path.resolve(__dirname), tmpDir), ".api.json" ); - const command = `../../../scripts/type-safe-api/parser/parse-openapi-spec --spec-path ${specPath} --output-path ${outputPath} --smithy-json-path ${smithyJsonModelPath}`; + const command = `../../../scripts/type-safe-api/run.js parse-openapi-spec --specPath ${specPath} --outputPath ${outputPath} --smithyJsonPath ${smithyJsonModelPath}`; exec(command, { cwd: path.resolve(__dirname), }); @@ -52,7 +52,7 @@ describe("Parse OpenAPI Spec Script Unit Tests", () => { path.relative(path.resolve(__dirname), tmpDir), ".api.json" ); - const command = `../../../scripts/type-safe-api/parser/parse-openapi-spec --spec-path ${specPath} --output-path ${outputPath} --smithy-json-path ${smithyJsonModelPath}`; + const command = `../../../scripts/type-safe-api/run.js parse-openapi-spec --specPath ${specPath} --outputPath ${outputPath} --smithyJsonPath ${smithyJsonModelPath}`; exec(command, { cwd: path.resolve(__dirname), }); @@ -67,7 +67,7 @@ describe("Parse OpenAPI Spec Script Unit Tests", () => { path.relative(path.resolve(__dirname), tmpDir), ".api.json" ); - const command = `../../../scripts/type-safe-api/parser/parse-openapi-spec --spec-path ${specPath} --output-path ${outputPath}`; + const command = `../../../scripts/type-safe-api/run.js parse-openapi-spec --specPath ${specPath} --outputPath ${outputPath}`; expect(() => { exec(command, { cwd: path.resolve(__dirname), @@ -86,7 +86,7 @@ describe("Parse OpenAPI Spec Script Unit Tests", () => { path.relative(path.resolve(__dirname), tmpDir), ".api.json" ); - const command = `../../../scripts/type-safe-api/parser/parse-openapi-spec --spec-path ${specPath} --output-path ${outputPath}`; + const command = `../../../scripts/type-safe-api/run.js parse-openapi-spec --specPath ${specPath} --outputPath ${outputPath}`; exec(command, { cwd: path.resolve(__dirname), }); @@ -104,7 +104,7 @@ describe("Parse OpenAPI Spec Script Unit Tests", () => { path.relative(path.resolve(__dirname), tmpDir), ".api.json" ); - const command = `../../../scripts/type-safe-api/parser/parse-openapi-spec --spec-path ${specPath} --output-path ${outputPath} --smithy-json-path ${smithyJsonModelPath}`; + const command = `../../../scripts/type-safe-api/run.js parse-openapi-spec --specPath ${specPath} --outputPath ${outputPath} --smithyJsonPath ${smithyJsonModelPath}`; exec(command, { cwd: path.resolve(__dirname), }); diff --git a/projenrc/projects/type-safe-api-project.ts b/projenrc/projects/type-safe-api-project.ts index 20e66b44d..549e6d204 100644 --- a/projenrc/projects/type-safe-api-project.ts +++ b/projenrc/projects/type-safe-api-project.ts @@ -72,10 +72,8 @@ export class TypeSafeApiProject extends PDKProject { "scripts/type-safe-api/custom/docs/asyncapi-html", "scripts/type-safe-api/custom/docs/asyncapi-markdown", "scripts/type-safe-api/generators/generate", - "scripts/type-safe-api/generators/generate.js", - "scripts/type-safe-api/parser/parse-openapi-spec", + "scripts/type-safe-api/run.js", "scripts/type-safe-api/custom/clean-openapi-generated-code/clean-openapi-generated-code", - "scripts/type-safe-api/custom/mock-data/generate-mock-data", "scripts/type-safe-api/custom/gradle-wrapper/copy-gradle-wrapper", "scripts/type-safe-api/custom/gradle-wrapper/gradlew", "scripts/type-safe-api/custom/gradle-wrapper/gradlew.bat", @@ -84,13 +82,8 @@ export class TypeSafeApiProject extends PDKProject { ], }, bin: { - "type-safe-api.parse-openapi-spec": - "scripts/type-safe-api/parser/parse-openapi-spec", + "type-safe-api": "scripts/type-safe-api/run.js", "type-safe-api.generate": "scripts/type-safe-api/generators/generate", - "type-safe-api.generate-next": - "scripts/type-safe-api/generators/generate.js", - "type-safe-api.generate-mock-data": - "scripts/type-safe-api/custom/mock-data/generate-mock-data", "type-safe-api.generate-html-redoc-docs": "scripts/type-safe-api/custom/docs/html-redoc", "type-safe-api.generate-asyncapi-html-docs": @@ -139,16 +132,17 @@ export class TypeSafeApiProject extends PDKProject { ); this.gitignore.addPatterns(smithyAsyncTransformerJar); - // Build the generate script - const generateScript = "scripts/type-safe-api/generators/generate.js"; + // Build the "run" script + const runScript = "scripts/type-safe-api/run"; this.preCompileTask.exec( - `esbuild --bundle scripts/type-safe-api/generators/generate.ts --platform=node --outfile=${generateScript}` + `esbuild --bundle ${runScript}.ts --platform=node --outfile=${runScript}.js` ); + this.preCompileTask.exec(`chmod +x ${runScript}.js`); NxProject.of(this)?.addBuildTargetFiles( [], - [`{projectRoot}/${generateScript}`] + [`{projectRoot}/${runScript}.js`] ); - this.gitignore.addPatterns(generateScript); + this.gitignore.addPatterns(`${runScript}.js`); this.generateInterfaces(); }