@take-out/cli 0.7.0 → 0.7.1-1784516754882

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.
@@ -5,8 +5,7 @@
5
5
  import { execSync, spawn, spawnSync } from 'node:child_process'
6
6
  import { existsSync, mkdtempSync, readFileSync, writeFileSync } from 'node:fs'
7
7
  import { tmpdir } from 'node:os'
8
- import { dirname, join, parse } from 'node:path'
9
- import { fileURLToPath } from 'node:url'
8
+ import { join } from 'node:path'
10
9
 
11
10
  import { defineCommand } from 'citty'
12
11
  import pc from 'picocolors'
@@ -25,26 +24,14 @@ const UPSTREAM_REMOTE = 'takeout-upstream'
25
24
  const TAKEOUT_FILE = '.takeout'
26
25
 
27
26
  function getSyncPrompt(): string {
28
- try {
29
- // find monorepo root by looking for packages/docs
30
- const currentDir = dirname(fileURLToPath(import.meta.url))
31
- let monorepoRoot = currentDir
32
-
33
- // go up directories until we find packages/docs/sync-prompt.md
34
- while (monorepoRoot !== parse(monorepoRoot).root) {
35
- const promptPath = join(monorepoRoot, 'packages', 'docs', 'sync-prompt.md')
36
- if (existsSync(promptPath)) {
37
- return readFileSync(promptPath, 'utf-8')
38
- }
39
- monorepoRoot = dirname(monorepoRoot)
40
- }
41
-
42
- throw new Error('Could not find sync-prompt.md in packages/docs')
43
- } catch (error) {
27
+ const promptPath = join(process.cwd(), 'docs', 'upgrade.md')
28
+ if (!existsSync(promptPath)) {
44
29
  throw new Error(
45
- `Could not load sync prompt: ${error instanceof Error ? error.message : 'Unknown error'}`,
30
+ 'Missing docs/upgrade.md. Copy it from https://github.com/tamagui/takeout2/blob/main/docs/upgrade.md and rerun `bun tko sync`.',
46
31
  )
47
32
  }
33
+
34
+ return readFileSync(promptPath, 'utf-8')
48
35
  }
49
36
 
50
37
  function checkToolAvailable(command: string): boolean {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Docs command - list and retrieve documentation files from the package
2
+ * docs command group - read the current repository's documentation
3
3
  */
4
4
  export declare const docsCommand: import("citty").CommandDef<import("citty").ArgsDef>;
5
5
  //# sourceMappingURL=docs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/commands/docs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAmTH,eAAO,MAAM,WAAW,qDAWtB,CAAA"}
1
+ {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/commands/docs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAuJH,eAAO,MAAM,WAAW,qDAUtB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/commands/skills.ts"],"names":[],"mappings":"AAAA;;GAEG;AA0SH,eAAO,MAAM,aAAa,qDAQxB,CAAA"}
1
+ {"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/commands/skills.ts"],"names":[],"mappings":"AAAA;;GAEG;AA8QH,eAAO,MAAM,aAAa,qDAQxB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/commands/sync.ts"],"names":[],"mappings":"AAAA;;GAEG;AA8FH,eAAO,MAAM,WAAW;;;;;;;;;;;EA2OtB,CAAA"}
1
+ {"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/commands/sync.ts"],"names":[],"mappings":"AAAA;;GAEG;AAiFH,eAAO,MAAM,WAAW;;;;;;;;;;;EA2OtB,CAAA"}