Skip to content

Commit 65fcd0d

Browse files
committed
Move the stream-compression package from wp-playground to php-wasm
Stream Compression introduced in #851 has no dependencies on WordPress and can be used in any JavaScript project. It also makes sense as a dependency for some `@php-wasm` packages. This commit, therefore, moves it from the `wp-playground` to the `php-wasm` npm namespace, making it reusable across the entire project. In addition, this adds a new `iterateFiles` function to the `@php-wasm/universal` package, which allows iterating over the files in the PHP filesystem. It uses the `stream-compression` package, which was some of the motivation for the move. ## Testing instructions Since the package isn't used anywhere yet, only confirm if the CI checks pass.
1 parent 768a74f commit 65fcd0d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+188
-38
lines changed

.eslintrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
{
1616
"sourceTag": "*",
1717
"notDependOnLibsWithTags": ["scope:web-client"]
18+
},
19+
{
20+
"sourceTag": "scope:independent-from-php-binaries",
21+
"notDependOnLibsWithTags": [
22+
"scope:php-binaries"
23+
]
1824
}
1925
]
2026
}

package-lock.json

Lines changed: 12 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/php-wasm/node/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,5 +161,5 @@
161161
}
162162
}
163163
},
164-
"tags": []
164+
"tags": ["scope:php-binaries"]
165165
}
Lines changed: 11 additions & 0 deletions

packages/playground/stream-compression/package.json renamed to packages/php-wasm/stream-compression/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@wp-playground/stream-compression",
2+
"name": "@php-wasm/stream-compression",
33
"version": "0.0.1",
44
"description": "Stream-based compression bindings.",
55
"repository": {
@@ -24,7 +24,7 @@
2424
},
2525
"publishConfig": {
2626
"access": "public",
27-
"directory": "../../../dist/packages/playground/stream-compression"
27+
"directory": "../../../dist/packages/php-wasm/stream-compression"
2828
},
2929
"license": "GPL-2.0-or-later",
3030
"type": "module",
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
{
2-
"name": "playground-stream-compression",
2+
"name": "php-wasm-stream-compression",
33
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
4-
"sourceRoot": "packages/playground/stream-compression/src",
4+
"sourceRoot": "packages/php-wasm/stream-compression/src",
55
"projectType": "library",
66
"targets": {
77
"build": {
88
"executor": "@nx/vite:build",
99
"outputs": ["{options.outputPath}"],
1010
"options": {
11-
"outputPath": "dist/packages/playground/stream-compression"
11+
"outputPath": "dist/packages/php-wasm/stream-compression"
1212
}
1313
},
1414
"test": {
1515
"executor": "@nx/vite:test",
1616
"outputs": ["{options.reportsDirectory}"],
1717
"options": {
1818
"passWithNoTests": true,
19-
"reportsDirectory": "../../../coverage/packages/playground/stream-compression"
19+
"reportsDirectory": "../../../coverage/packages/php-wasm/stream-compression"
2020
}
2121
},
2222
"lint": {
2323
"executor": "@nx/linter:eslint",
2424
"outputs": ["{options.outputFile}"],
2525
"options": {
2626
"lintFilePatterns": [
27-
"packages/playground/stream-compression/**/*.ts",
28-
"packages/playground/stream-compression/package.json"
27+
"packages/php-wasm/stream-compression/**/*.ts",
28+
"packages/php-wasm/stream-compression/package.json"
2929
]
3030
}
3131
}
3232
},
33-
"tags": []
33+
"tags": ["scope:independent-from-php-binaries"]
3434
}

packages/playground/stream-compression/src/index.ts renamed to packages/php-wasm/stream-compression/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ import '@php-wasm/node-polyfills';
33
export { collectBytes } from './utils/collect-bytes';
44
export { collectFile } from './utils/collect-file';
55
export { iteratorToStream } from './utils/iterator-to-stream';
6-
export { streamWriteToPhp } from './utils/stream-write-to-php';
6+
export { StreamedFile } from './utils/streamed-file';
77
export { encodeZip, decodeZip, decodeRemoteZip } from './zip';

0 commit comments

Comments
 (0)