@lincyaw/workspace 1.0.0-rc.139 → 1.0.0-rc.140

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lincyaw/workspace",
3
- "version": "1.0.0-rc.139",
3
+ "version": "1.0.0-rc.140",
4
4
  "description": "Presmium's workspace service (presmium serve): documents, their history, reviews and the workspace site",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -37,13 +37,13 @@
37
37
  "mime-types": "3.0.2",
38
38
  "playwright-chromium": "1.64.1",
39
39
  "yaml": "^2.9.1",
40
- "@lincyaw/compiler": "1.0.0-rc.139",
41
- "@lincyaw/server": "1.0.0-rc.139",
42
- "@lincyaw/kernel": "1.0.0-rc.139",
43
- "@lincyaw/design": "1.0.0-rc.139"
40
+ "@lincyaw/compiler": "1.0.0-rc.140",
41
+ "@lincyaw/design": "1.0.0-rc.140",
42
+ "@lincyaw/server": "1.0.0-rc.140",
43
+ "@lincyaw/kernel": "1.0.0-rc.140"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/mime-types": "^3.0.1",
47
- "@lincyaw/mcp": "1.0.0-rc.139"
47
+ "@lincyaw/mcp": "1.0.0-rc.140"
48
48
  }
49
49
  }
@@ -69,6 +69,7 @@ export async function openLocalHistory(root: string, env: NodeJS.ProcessEnv = pr
69
69
  export async function captureLocalBaseline(git: Git, paths: string[], initial = false): Promise<void> {
70
70
  if (paths.some(path => isAbsolute(path) || leavesRoot(relative(git.root, resolve(git.root, path)).split(sep).join('/')) || path.split(/[\\/]/).includes('.git'))) throw new Error('history-path-outside-workspace')
71
71
  const literal = { GIT_LITERAL_PATHSPECS: '1' }
72
+ if (!initial && !(await git.output(['status', '--porcelain=v1', '-z', '--no-renames', '--untracked-files=all', '--', ...paths], { ...literal, GIT_OPTIONAL_LOCKS: '0' }))) return
72
73
  const tracked = new Set((await git.output(['ls-files', '-z', '--', ...paths], literal)).split('\0').filter(Boolean))
73
74
  const excluded = await git.run(['check-ignore', '-z', '--stdin'], {}, Buffer.from(paths.map(path => `${path}\0`).join('')))
74
75
  if (excluded.code !== 0 && excluded.code !== 1) throw new Error(excluded.stderr)
@@ -394,8 +394,8 @@ export class Revisions implements RevisionService {
394
394
  }
395
395
 
396
396
  async status(paths: string[] = ['']): Promise<{ branch?: string, uncommitted: number }> {
397
- const branch = await this.#git.tryOutput(['symbolic-ref', '--quiet', '--short', 'HEAD'])
398
- return { ...branch.ok ? { branch: branch.output.trim() } : {}, uncommitted: (await this.#statusOf(paths)).length }
397
+ const [branch, files] = await Promise.all([this.#git.tryOutput(['symbolic-ref', '--quiet', '--short', 'HEAD']), this.#statusOf(paths)])
398
+ return { ...branch.ok ? { branch: branch.output.trim() } : {}, uncommitted: files.length }
399
399
  }
400
400
 
401
401
  async uncommittedFiles(paths: string[]): Promise<UncommittedFile[]> {