runwork 0.2.0 → 0.2.5

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.
@@ -63,10 +63,13 @@ export async function loadManifest(dir) {
63
63
  */
64
64
  export async function detectUserEdits(dir, manifest) {
65
65
  const edits = [];
66
- // 1. Uncommitted changes to tracked files
66
+ // 1. Uncommitted changes to tracked files (skip if no commits yet)
67
+ // Use -c core.quotePath=false to get real filenames instead of octal-escaped quoted strings
68
+ // for non-ASCII characters (e.g. "caf\303\251.txt" → café.txt)
67
69
  try {
68
- const modified = execFileSync('git', ['diff', '--name-only', 'HEAD'], { cwd: dir, encoding: 'utf-8' }).trim();
69
- const staged = execFileSync('git', ['diff', '--cached', '--name-only'], { cwd: dir, encoding: 'utf-8' }).trim();
70
+ execFileSync('git', ['rev-parse', 'HEAD'], { cwd: dir, stdio: 'pipe' });
71
+ const modified = execFileSync('git', ['-c', 'core.quotePath=false', 'diff', '--name-only', 'HEAD'], { cwd: dir, encoding: 'utf-8' }).trim();
72
+ const staged = execFileSync('git', ['-c', 'core.quotePath=false', 'diff', '--cached', '--name-only'], { cwd: dir, encoding: 'utf-8' }).trim();
70
73
  for (const file of [...modified.split('\n'), ...staged.split('\n')]) {
71
74
  if (file && !edits.includes(file))
72
75
  edits.push(file);
@@ -77,7 +80,7 @@ export async function detectUserEdits(dir, manifest) {
77
80
  }
78
81
  // 2. Untracked files that aren't template files
79
82
  try {
80
- const untracked = execFileSync('git', ['ls-files', '--others', '--exclude-standard'], { cwd: dir, encoding: 'utf-8' }).trim();
83
+ const untracked = execFileSync('git', ['-c', 'core.quotePath=false', 'ls-files', '--others', '--exclude-standard'], { cwd: dir, encoding: 'utf-8' }).trim();
81
84
  for (const relPath of untracked.split('\n')) {
82
85
  if (!relPath)
83
86
  continue;
@@ -98,5 +101,22 @@ export async function detectUserEdits(dir, manifest) {
98
101
  catch {
99
102
  // No git repo
100
103
  }
104
+ // 3. Scan manifest files on disk directly — catches gitignored files that
105
+ // git ls-files --exclude-standard would miss. If a template file was added
106
+ // to .gitignore by the user and then modified, only this check detects it.
107
+ for (const [relPath, expectedHash] of Object.entries(manifest.files)) {
108
+ if (edits.includes(relPath))
109
+ continue;
110
+ const filePath = join(dir, relPath);
111
+ try {
112
+ const content = readFileSync(filePath);
113
+ if (sha256(content) !== expectedHash) {
114
+ edits.push(relPath);
115
+ }
116
+ }
117
+ catch {
118
+ // File doesn't exist on disk — not an edit to detect
119
+ }
120
+ }
101
121
  return edits;
102
122
  }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "runwork",
3
- "version": "0.2.0",
3
+ "version": "0.2.5",
4
4
  "description": "CLI for Runwork: develop, preview, and deploy Runwork apps from your local machine.",
5
- "license": "MIT",
5
+ "license": "UNLICENSED",
6
6
  "author": "Runwork <info@runwork.ai> (https://www.runwork.ai)",
7
7
  "homepage": "https://www.runwork.ai",
8
8
  "keywords": [
@@ -27,7 +27,7 @@
27
27
  "runwork": "./bin/runwork.js"
28
28
  },
29
29
  "scripts": {
30
- "prebuild": "mkdir -p bundled-types && cp ../framework/dist/*.d.ts bundled-types/ 2>/dev/null || true && bun run scripts/embed-types.ts",
30
+ "prebuild": "cd ../framework && bun run build && cd ../runwork-cli && mkdir -p bundled-types && cp ../framework/dist/*.d.ts bundled-types/ && bun run scripts/embed-types.ts",
31
31
  "build": "bun run prebuild && tsc",
32
32
  "build:binary": "bun run prebuild && bun build src/index.ts --compile --outfile dist/runwork",
33
33
  "build:binaries": "bun run scripts/build-binaries.ts",
@@ -1,2 +0,0 @@
1
- export declare function openBrowserForAuth(_authUrl: string): Promise<void>;
2
- export declare function startAuthCallbackServer(_port: number): Promise<string>;
@@ -1,7 +0,0 @@
1
- export async function openBrowserForAuth(_authUrl) {
2
- // TODO: implement browser-based auth flow
3
- }
4
- export async function startAuthCallbackServer(_port) {
5
- // TODO: implement local callback server for OAuth
6
- return '';
7
- }