@lark-apaas/db-schema-sync 0.1.4-alpha.0 → 0.1.4-alpha.2

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.
package/dist/bin.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  __toESM,
7
7
  generateSchema,
8
8
  resolveEnvOptions
9
- } from "./chunk-Q7VSULU2.js";
9
+ } from "./chunk-FYE77WXG.js";
10
10
 
11
11
  // node_modules/dotenv/package.json
12
12
  var require_package = __commonJS({
@@ -407,6 +407,8 @@ var require_main = __commonJS({
407
407
  var import_dotenv = __toESM(require_main(), 1);
408
408
  import { resolve, dirname } from "path";
409
409
  import { writeFileSync, mkdirSync, existsSync } from "fs";
410
+
411
+ // src/cli-args.ts
410
412
  function parseArgs(argv) {
411
413
  const args = argv.slice(2);
412
414
  const getArg = (name) => {
@@ -419,6 +421,8 @@ function parseArgs(argv) {
419
421
  exportCustomTypes: hasFlag("--export-custom-types")
420
422
  };
421
423
  }
424
+
425
+ // src/bin.ts
422
426
  async function main() {
423
427
  const envPath = resolve(process.cwd(), ".env");
424
428
  if (existsSync(envPath)) {
@@ -1908,11 +1908,15 @@ var inlineTypesEnhancer = {
1908
1908
  let text = source;
1909
1909
  text = text.replace(/import \{[^}]*\} from ["']\.\/types["'];?\n*/g, "");
1910
1910
  const usedTypes = /* @__PURE__ */ new Set();
1911
- for (const rule of TYPE_RULES) {
1912
- if (text.includes(rule.usageName + "(") && !text.includes(rule.definitionCheck)) {
1913
- usedTypes.add(rule.usageName);
1914
- if (rule.deps) {
1915
- for (const dep of rule.deps) usedTypes.add(dep);
1911
+ if (exportCustomTypes) {
1912
+ for (const rule of TYPE_RULES) usedTypes.add(rule.usageName);
1913
+ } else {
1914
+ for (const rule of TYPE_RULES) {
1915
+ if (text.includes(rule.usageName + "(") && !text.includes(rule.definitionCheck)) {
1916
+ usedTypes.add(rule.usageName);
1917
+ if (rule.deps) {
1918
+ for (const dep of rule.deps) usedTypes.add(dep);
1919
+ }
1916
1920
  }
1917
1921
  }
1918
1922
  }
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  generateSchemaFromData,
6
6
  normalizeApiResponse,
7
7
  resolveEnvOptions
8
- } from "./chunk-Q7VSULU2.js";
8
+ } from "./chunk-FYE77WXG.js";
9
9
  export {
10
10
  generateSchema,
11
11
  generateSchemaCode,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/db-schema-sync",
3
- "version": "0.1.4-alpha.0",
3
+ "version": "0.1.4-alpha.2",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",