Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: zen-fs/core
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.18.0
Choose a base ref
...
head repository: zen-fs/core
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing with 16,151 additions and 21,729 deletions.
  1. +1 −0 .github/funding.yml
  2. +65 −0 .github/workflows/ci-pr.yaml
  3. +0 −37 .github/workflows/ci-single-platform.yaml
  4. +67 −17 .github/workflows/ci.yaml
  5. +39 −0 .github/workflows/deploy-docs.yaml
  6. +32 −0 .github/workflows/release-common.yaml
  7. +8 −61 .github/workflows/release.yaml
  8. +1 −3 .gitignore
  9. +3 −2 .prettierrc
  10. +3 −1 .vscode/settings.json
  11. +15 −15 contributing.md
  12. +30 −0 documentation/architecture.md
  13. +61 −0 documentation/backends.md
  14. +54 −0 documentation/configuration.md
  15. +35 −0 documentation/internal.md
  16. +61 −0 documentation/security.md
  17. +31 −0 documentation/vfs.md
  18. +3 −13 eslint.config.js
  19. +53 −47 eslint.shared.js
  20. +0 −22 jest.config.json
  21. +1 −1 license.md
  22. +2,416 −12,791 package-lock.json
  23. +32 −33 package.json
  24. +90 −28 readme.md
  25. +0 −80 scripts/build.js
  26. +59 −0 scripts/ci-cli.js
  27. +77 −0 scripts/ci.js
  28. +4 −5 scripts/make-index.js
  29. +225 −0 scripts/test.js
  30. +9 −0 scripts/typedoc-plugin.js
  31. +79 −59 src/backends/backend.ts
  32. +518 −0 src/backends/cow.ts
  33. +151 −129 src/backends/fetch.ts
  34. +0 −210 src/backends/file_index.ts
  35. +10 −0 src/backends/index.ts
  36. +54 −24 src/backends/memory.ts
  37. +0 −561 src/backends/overlay.ts
  38. +342 −0 src/backends/passthrough.ts
  39. +405 −0 src/backends/port.ts
  40. +0 −329 src/backends/port/fs.ts
  41. +0 −54 src/backends/port/readme.md
  42. +0 −165 src/backends/port/rpc.ts
  43. +0 −3 src/backends/readme.md
  44. +386 −0 src/backends/single_buffer.ts
  45. +589 −458 src/backends/store/fs.ts
  46. +85 −0 src/backends/store/map.ts
  47. +0 −9 src/backends/store/readme.md
  48. +0 −150 src/backends/store/simple.ts
  49. +312 −85 src/backends/store/store.ts
  50. +148 −53 src/config.ts
  51. +68 −0 src/context.ts
  52. +0 −31 src/credentials.ts
  53. +0 −984 src/emulation/async.ts
  54. +0 −1,128 src/emulation/promises.ts
  55. +0 −132 src/emulation/shared.ts
  56. +0 −34 src/emulation/streams.ts
  57. +0 −951 src/emulation/sync.ts
  58. +0 −790 src/file.ts
  59. +0 −225 src/filesystem.ts
  60. +17 −18 src/index.ts
  61. +0 −248 src/inode.ts
  62. +62 −0 src/internal/credentials.ts
  63. +486 −0 src/internal/devices.ts
  64. +18 −16 src/{ → internal}/error.ts
  65. +160 −0 src/internal/file_index.ts
  66. +318 −0 src/internal/filesystem.ts
  67. +8 −0 src/internal/index.ts
  68. +212 −0 src/internal/index_fs.ts
  69. +185 −0 src/internal/inode.ts
  70. +314 −0 src/internal/log.ts
  71. +155 −97 src/mixins/async.ts
  72. +1 −0 src/mixins/index.ts
  73. +247 −192 src/mixins/mutexed.ts
  74. +57 −43 src/mixins/readonly.ts
  75. +28 −6 src/mixins/shared.ts
  76. +22 −14 src/mixins/sync.ts
  77. +11 −18 src/{emulation → }/path.ts
  78. +19 −16 src/polyfills.ts
  79. +749 −0 src/readline.ts
  80. +52 −149 src/utils.ts
  81. +905 −0 src/vfs/async.ts
  82. +21 −0 src/vfs/config.ts
  83. +6 −0 src/{emulation → vfs}/constants.ts
  84. +23 −16 src/{emulation → vfs}/dir.ts
  85. +397 −0 src/vfs/file.ts
  86. +6 −5 src/{emulation → vfs}/index.ts
  87. +1,467 −0 src/vfs/promises.ts
  88. +178 −0 src/vfs/shared.ts
  89. +112 −119 src/{ → vfs}/stats.ts
  90. +187 −0 src/vfs/streams.ts
  91. +1,029 −0 src/vfs/sync.ts
  92. +38 −0 src/vfs/types.ts
  93. +38 −26 src/{emulation → vfs}/watchers.ts
  94. +301 −0 src/vfs/xattr.ts
  95. +3 −3 tests/{fs → }/assignment.ts
  96. +4 −1 tests/{port → backend}/config.worker.js
  97. +53 −0 tests/backend/fetch.test.ts
  98. +118 −0 tests/backend/port.test.ts
  99. +8 −0 tests/backend/remote.worker.js
  100. +11 −22 tests/common.ts
  101. +61 −0 tests/common/context.test.ts
  102. +29 −0 tests/common/devices.test.ts
  103. +65 −0 tests/common/handle.test.ts
  104. +36 −0 tests/common/mounts.test.ts
  105. +19 −17 tests/{ → common}/mutex.test.ts
  106. +46 −0 tests/common/path.test.ts
  107. +104 −0 tests/common/readline.test.ts
  108. 0 tests/{fixtures/static → data}/49chars.txt
  109. 0 tests/{fixtures/node → data}/a.js
  110. 0 tests/{fixtures/node → data}/a1.js
  111. 0 tests/{fixtures/node → data}/elipses.txt
  112. 0 tests/{fixtures/node → data}/empty.txt
  113. 0 tests/{fixtures/node → data}/exit.js
  114. BIN tests/data/image.jpg
  115. +1 −0 tests/data/utf8.txt
  116. 0 tests/{fixtures/node → data}/x.txt
  117. +40 −0 tests/fetch/config.js
  118. +20 −0 tests/fetch/fetch.ts
  119. +16 −0 tests/fetch/run.sh
  120. +53 −0 tests/fetch/server.js
  121. +6 −4 tests/fs/{appendFile.test.ts → append.test.ts}
  122. +0 −46 tests/fs/chmod.test.ts
  123. +64 −74 tests/fs/dir.test.ts
  124. +119 −97 tests/fs/directory.test.ts
  125. +32 −44 tests/fs/errors.test.ts
  126. +7 −5 tests/fs/exists.test.ts
  127. +0 −58 tests/fs/handle.test.ts
  128. +49 −11 tests/fs/links.test.ts
  129. +13 −15 tests/fs/open.test.ts
  130. +0 −32 tests/fs/path.test.ts
  131. +60 −17 tests/fs/permissions.test.ts
  132. +20 −18 tests/fs/read.test.ts
  133. +17 −22 tests/fs/readFile.test.ts
  134. +0 −53 tests/fs/readdir.test.ts
  135. +21 −29 tests/fs/rename.test.ts
  136. +56 −20 tests/fs/stat.test.ts
  137. +78 −108 tests/fs/streams.test.ts
  138. +43 −47 tests/fs/times.test.ts
  139. +17 −15 tests/fs/truncate.test.ts
  140. +87 −43 tests/fs/watch.test.ts
  141. +14 −17 tests/fs/write.test.ts
  142. +18 −15 tests/fs/writeFile.test.ts
  143. +104 −0 tests/fs/xattr.test.ts
  144. +22 −0 tests/logs.js
  145. +0 −41 tests/port/channel.test.ts
  146. +0 −40 tests/port/config.test.ts
  147. +0 −40 tests/port/remote.test.ts
  148. +0 −5 tests/port/remote.worker.js
  149. +0 −54 tests/port/timeout.test.ts
  150. +3 −3 tests/readme.md
  151. +48 −0 tests/setup.ts
  152. +9 −0 tests/setup/context.ts
  153. +13 −0 tests/setup/cow.ts
  154. +38 −0 tests/setup/index.ts
  155. +3 −0 tests/setup/memory.ts
  156. +15 −0 tests/setup/port.ts
  157. +9 −0 tests/setup/single-buffer.ts
  158. +3 −5 tests/tsconfig.json
  159. +6 −5 tsconfig.json
  160. +1 −0 types/README.md
  161. +18 −0 types/readable-stream.d.ts
1 change: 1 addition & 0 deletions .github/funding.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [james-pre]
65 changes: 65 additions & 0 deletions .github/workflows/ci-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: CI

on:
workflow_dispatch:
workflow_call:
pull_request:

permissions:
checks: write
contents: read

jobs:
ci:
name: Continuous Integration
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install dependencies
run: npm install

- name: Formatting
run: npm run format:check

- name: Build
run: npm run build

- name: Linting
run: npm run lint

- name: 'Unit tests: common'
run: npx zenfs-test -pfw --common

- name: 'Unit tests: InMemory'
run: npx zenfs-test -pfw tests/setup/memory.ts

- name: 'Unit tests: contexts'
run: npx zenfs-test -pfw tests/setup/context.ts

- name: 'Unit tests: Copy-on-Write'
run: npx zenfs-test -pfw tests/setup/cow.ts

- name: 'Unit tests: Index'
run: npx zenfs-test -pfw tests/setup/index.ts

- name: 'Unit tests: Port'
run: npx zenfs-test -pfw tests/setup/port.ts

- name: 'Unit tests: SingleBuffer'
run: npx zenfs-test -pfw tests/setup/single-buffer.ts

- name: 'Unit tests: Fetch'
run: tests/fetch/run.sh -w

- name: Report coverage
run: npx zenfs-test --report
37 changes: 0 additions & 37 deletions .github/workflows/ci-single-platform.yaml

This file was deleted.

84 changes: 67 additions & 17 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,76 @@
name: Continuous Integration
name: CI

on:
push:
branches:
- main
workflow_dispatch:
workflow_call:
pull_request:

permissions:
checks: write
contents: read

jobs:
ubuntu:
name: Ubuntu
uses: ./.github/workflows/ci-single-platform.yaml
with:
platform: ubuntu-latest
macos:
name: MacOS
uses: ./.github/workflows/ci-single-platform.yaml
with:
platform: macos-latest
win:
name: Windows
uses: ./.github/workflows/ci-single-platform.yaml
with:
platform: windows-latest
ci:
name: Continuous Integration
runs-on: ubuntu-latest
defaults:
run:
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install dependencies
run: npm install

- name: Create sub-checks
run: npx zci init

- name: Formatting
run: npx zci run format "npm run format:check"

- name: Build
run: npx zci run build "npm run build"

- name: Linting
run: npx zci run lint "npm run lint"

- name: 'Unit tests: common'
run: npx zenfs-test -pfwC --common

- name: 'Unit tests: InMemory'
run: npx zenfs-test -pfwC tests/setup/memory.ts

- name: 'Unit tests: Copy-On-Write'
run: npx zenfs-test -pfwC tests/setup/cow.ts

- name: 'Unit tests: contexts'
run: npx zenfs-test -pfwC tests/setup/context.ts

- name: 'Unit tests: Index'
run: npx zenfs-test -pfwC tests/setup/index.ts

- name: 'Unit tests: Port'
run: npx zenfs-test -pfwC tests/setup/port.ts

- name: 'Unit tests: SingleBuffer'
run: npx zenfs-test -pfwC tests/setup/single-buffer.ts

- name: 'Unit tests: Fetch'
run: tests/fetch/run.sh -wC

- name: Report coverage
run: npx zenfs-test --report

- name: Cleanup sub-checks
if: always()
run: npx zci cleanup
39 changes: 39 additions & 0 deletions .github/workflows/deploy-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Docs
on:
workflow_dispatch:
workflow_call:

jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy
permissions:
contents: write
id-token: write
pages: write
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install dependencies
run: npm install

- name: Build
run: npm run build:docs

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./docs

- name: Deploy
id: deploy
uses: actions/deploy-pages@v4
32 changes: 32 additions & 0 deletions .github/workflows/release-common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release
on:
workflow_call:
secrets:
npm_token:
required: true
jobs:
release:
name: Publish
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup npm authentication
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org/

- name: Install dependencies
run: npm install

- name: Build
run: npm run build

- name: Publish
run: npm publish --access=public --provenance
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
69 changes: 8 additions & 61 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -2,69 +2,16 @@ name: Release
on:
release:
types: [created]
workflow_call:
secrets:
npm_token:
required: true
jobs:
ci:
name: CI Checks
uses: ./.github/workflows/ci-single-platform.yaml
with:
platform: ubuntu-latest
uses: ./.github/workflows/ci.yaml
docs:
name: Docs
uses: ./.github/workflows/deploy-docs.yaml
needs: ci
release:
runs-on: ubuntu-latest
name: Release
uses: ./.github/workflows/release-common.yaml
needs: ci
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup npm authenication
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org/

- name: Install dependencies
run: npm install

- name: Build
run: npm run build

- name: Publish
run: npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
docs:
runs-on: ubuntu-latest
name: Docs build and deploy
permissions:
contents: write
id-token: write
pages: write
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install dependencies
run: npm install

- name: Build docs
run: npm run build:docs

- name: Upload docs artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./docs

- name: 'Deploy docs'
id: deploy
uses: actions/deploy-pages@v4
secrets: inherit
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -4,7 +4,5 @@ docs
*.log
tmp
build
tests/fixtures
!tests/fixtures/files
!tests/fixtures/README.md
tests/coverage
.coverage
5 changes: 3 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
"useTabs": true,
"trailingComma": "es5",
"tabWidth": 4,
"printWidth": 180,
"arrowParens": "avoid"
"printWidth": 150,
"arrowParens": "avoid",
"experimentalOperatorPosition": "start"
}
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"deno.enable": false,
"[yaml]": {
"editor.insertSpaces": true,
"editor.tabSize": 4
@@ -16,5 +17,6 @@
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.formatOnSave": true
"editor.formatOnSave": true,
"cSpell.words": ["canonicalized", "mknod"]
}
Loading