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.
- package/LICENSE +10 -16
- package/dist/api/client.d.ts +22 -0
- package/dist/api/client.js +9 -0
- package/dist/commands/dev.js +20 -70
- package/dist/commands/integrations.d.ts +2 -0
- package/dist/commands/integrations.js +86 -0
- package/dist/commands/upgrade.d.ts +2 -0
- package/dist/commands/upgrade.js +165 -0
- package/dist/generated/bundled-types.js +32 -32
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.js +1 -1
- package/dist/git/__tests__/auto-commit.test.d.ts +1 -0
- package/dist/git/__tests__/auto-commit.test.js +373 -0
- package/dist/git/__tests__/manifest.test.d.ts +1 -0
- package/dist/git/__tests__/manifest.test.js +377 -0
- package/dist/git/__tests__/sync.test.d.ts +1 -0
- package/dist/git/__tests__/sync.test.js +403 -0
- package/dist/git/auto-commit.d.ts +1 -0
- package/dist/git/auto-commit.js +15 -5
- package/dist/git/sync.d.ts +15 -0
- package/dist/git/sync.js +116 -0
- package/dist/index.js +4 -0
- package/dist/logs/tailer.js +5 -11
- package/dist/template/manifest.js +24 -4
- package/package.json +3 -3
- package/dist/auth/browser.d.ts +0 -2
- package/dist/auth/browser.js +0 -7
|
@@ -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
|
-
|
|
69
|
-
const
|
|
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.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "CLI for Runwork: develop, preview, and deploy Runwork apps from your local machine.",
|
|
5
|
-
"license": "
|
|
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/
|
|
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",
|
package/dist/auth/browser.d.ts
DELETED