@c15t/cli 0.0.1-rc.19 → 0.0.1-rc.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.mjs +5 -13
  2. package/package.json +8 -8
package/dist/index.mjs CHANGED
@@ -270,10 +270,8 @@ const generatePrismaSchema = async ({ adapter, options, file })=>{
270
270
  const prismaModel = builder.findByType('model', {
271
271
  name: modelName
272
272
  });
273
- if (!prismaModel) {
274
- if ('mongodb' === provider) builder.model(modelName).field('id', 'String').attribute('id').attribute('map("_id")');
275
- else builder.model(modelName).field('id', 'String').attribute('id');
276
- }
273
+ if (!prismaModel) if ('mongodb' === provider) builder.model(modelName).field('id', 'String').attribute('id').attribute('map("_id")');
274
+ else builder.model(modelName).field('id', 'String').attribute('id');
277
275
  for(const field in fields)if (Object.hasOwn(fields, field)) {
278
276
  const attr = fields[field];
279
277
  const existingField = builder.findByType('field', {
@@ -599,7 +597,7 @@ async function getConfig({ cwd, configPath }) {
599
597
  for (const possiblePath of possiblePaths){
600
598
  const configPath = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(dir, possiblePath);
601
599
  const fullPath = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(cwd, configPath);
602
- if (!!__WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].existsSync(fullPath)) {
600
+ if (__WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].existsSync(fullPath)) {
603
601
  foundPaths.push(fullPath);
604
602
  try {
605
603
  const { config } = await (0, __WEBPACK_EXTERNAL_MODULE_c12__.loadConfig)({
@@ -698,10 +696,7 @@ async function generateAction(opts) {
698
696
  cwd,
699
697
  configPath: options.config
700
698
  });
701
- if (!config) {
702
- utils_logger.error('No configuration file found. Add a `c15t.ts` file to your project or pass the path to the configuration file using the `--config` flag.');
703
- return;
704
- }
699
+ if (!config) return void utils_logger.error('No configuration file found. Add a `c15t.ts` file to your project or pass the path to the configuration file using the `--config` flag.');
705
700
  const adapter = await (0, __WEBPACK_EXTERNAL_MODULE__c15t_backend_pkgs_db_adapters_cee37d0f__.getAdapter)(config).catch((e)=>{
706
701
  utils_logger.error(e.message);
707
702
  process.exit(1);
@@ -782,10 +777,7 @@ async function migrateAction(opts) {
782
777
  cwd,
783
778
  configPath: options.config
784
779
  });
785
- if (!config) {
786
- utils_logger.error('No configuration file found. Add a `c15t.ts` file to your project or pass the path to the configuration file using the `--config` flag.');
787
- return;
788
- }
780
+ if (!config) return void utils_logger.error('No configuration file found. Add a `c15t.ts` file to your project or pass the path to the configuration file using the `--config` flag.');
789
781
  const db = await (0, __WEBPACK_EXTERNAL_MODULE__c15t_backend_pkgs_db_adapters_cee37d0f__.getAdapter)(config);
790
782
  if (!db) {
791
783
  utils_logger.error("Invalid database configuration. Make sure you're not using adapters. Migrate command only works with built-in Kysely adapter.");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c15t/cli",
3
- "version": "0.0.1-rc.19",
3
+ "version": "0.0.1-rc.20",
4
4
  "description": "The CLI for c15t",
5
5
  "exports": "./dist/index.mjs",
6
6
  "main": "./dist/index.mjs",
@@ -13,24 +13,24 @@
13
13
  ],
14
14
  "dependencies": {
15
15
  "@babel/preset-react": "^7.26.3",
16
- "@babel/preset-typescript": "^7.26.0",
16
+ "@babel/preset-typescript": "^7.27.0",
17
17
  "@mrleebo/prisma-ast": "^0.12.1",
18
- "@types/better-sqlite3": "^7.6.12",
18
+ "@types/better-sqlite3": "^7.6.13",
19
19
  "@types/prompts": "^2.4.9",
20
- "better-sqlite3": "^11.8.1",
21
- "c12": "^3.0.2",
20
+ "better-sqlite3": "^11.9.1",
21
+ "c12": "^3.0.3",
22
22
  "chalk": "^5.4.1",
23
23
  "commander": "^13.1.0",
24
- "dotenv": "^16.4.7",
24
+ "dotenv": "^16.5.0",
25
25
  "fs-extra": "^11.3.0",
26
26
  "prompts": "^2.4.2",
27
27
  "yocto-spinner": "^0.2.1",
28
28
  "zod": "^3.24.2",
29
- "@c15t/backend": "0.0.1-rc.19"
29
+ "@c15t/backend": "0.0.1-rc.20"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/fs-extra": "^11.0.4",
33
- "vitest": "^3.0.8",
33
+ "vitest": "^3.1.1",
34
34
  "@c15t/typescript-config": "0.0.1-beta.1"
35
35
  },
36
36
  "publishConfig": {