From 2e3c16bc605a63b9e54942ba5c62c4fdd5fbda28 Mon Sep 17 00:00:00 2001 From: faridevnz Date: Wed, 30 Oct 2024 17:14:57 +0100 Subject: [PATCH] chore: change import strategy --- examples/commands-in-code/.gitignore | 1 + examples/commands-in-code/index.ts | 16 ++++++++++++---- examples/commands-in-code/tsconfig.json | 22 ++++++++++++++++++++++ package.json | 4 +--- src/index.ts | 1 + tsconfig.json | 4 ++-- 6 files changed, 39 insertions(+), 9 deletions(-) create mode 100644 examples/commands-in-code/.gitignore create mode 100644 examples/commands-in-code/tsconfig.json create mode 100644 src/index.ts diff --git a/examples/commands-in-code/.gitignore b/examples/commands-in-code/.gitignore new file mode 100644 index 0000000..b512c09 --- /dev/null +++ b/examples/commands-in-code/.gitignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/examples/commands-in-code/index.ts b/examples/commands-in-code/index.ts index 4efb536..d941fee 100644 --- a/examples/commands-in-code/index.ts +++ b/examples/commands-in-code/index.ts @@ -1,5 +1,13 @@ -import { migrate, MigrateDevCommand, MigrateDeployCommand, MigrateResetCommand } from "@futura-dev/cosmoprism/migrate"; +import { + migrate, + MigrateDevCommand, + MigrateDeployCommand, + MigrateResetCommand +} from "@futura-dev/cosmoprism"; -migrate.dev({ mode: 'all' } satisfies MigrateDevCommand) -migrate.deploy({ mode: 'tenant', tenant: 'fake-tenant' } satisfies MigrateDeployCommand) -migrate.reset({ mode: 'central' } satisfies MigrateResetCommand) +migrate.dev({ mode: "all" } satisfies MigrateDevCommand); +migrate.deploy({ + mode: "tenant", + tenant: "fake-tenant" +} satisfies MigrateDeployCommand); +migrate.reset({ mode: "central" } satisfies MigrateResetCommand); diff --git a/examples/commands-in-code/tsconfig.json b/examples/commands-in-code/tsconfig.json new file mode 100644 index 0000000..d503031 --- /dev/null +++ b/examples/commands-in-code/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "strict": true, + "module": "commonjs", + "declaration": true, + "removeComments": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "allowSyntheticDefaultImports": true, + "target": "esnext", + "sourceMap": true, + "outDir": "./dist", + "baseUrl": "./", + "incremental": true, + "skipLibCheck": true, + "strictNullChecks": true, + "noImplicitAny": true, + "strictBindCallApply": true, + "forceConsistentCasingInFileNames": false, + "noFallthroughCasesInSwitch": false + } +} diff --git a/package.json b/package.json index da9a2b0..74313a2 100644 --- a/package.json +++ b/package.json @@ -17,9 +17,7 @@ "files": [ "/dist" ], - "exports": { - "./migrate": "./dist/cmd/migrate/index.js" - }, + "main": "./dist/", "bin": { "@futura-dev/cosmoprism": "dist/cli.js" }, diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..b40969d --- /dev/null +++ b/src/index.ts @@ -0,0 +1 @@ +export * from "./cmd/migrate"; diff --git a/tsconfig.json b/tsconfig.json index 125e994..bb4d078 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,13 +1,13 @@ { "compilerOptions": { - "target": "esnext", "module": "commonjs", "outDir": "./dist", "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "strict": true, "skipLibCheck": true, - "declaration": true + "declaration": true, + "declarationMap": true, }, "exclude": ["./examples"] }