Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: move optimizer to qwik-optimizer WIP #6872

Draft
wants to merge 2 commits into
base: build/v2
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[workspace]

members = [
"packages/qwik/src/napi",
"packages/qwik/src/wasm",
"packages/qwik/src/optimizer/cli",
"packages/qwik/src/optimizer/core",
"packages/qwik-optimizer/rust/napi",
"packages/qwik-optimizer/rust/wasm",
"packages/qwik-optimizer/rust/cli",
"packages/qwik-optimizer/rust/core",
]
exclude = ["packages/qwik/src/wasm"]
exclude = ["packages/qwik-optimizer/rust/wasm"]
resolver = "2"

[profile.release]
Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ add-target:
install-all: install-rust install-rust-deps

install-cli:
cd src/optimizer/cli && cargo install --path .
cd rust/cli && cargo install --path .

fix:
cargo fmt
Expand All @@ -26,21 +26,21 @@ lint:

# We only test core because there are no other tests and qwik-napi breaks the build
test:
cargo test --manifest-path packages/qwik/src/optimizer/core/Cargo.toml
cargo test --manifest-path packages/qwik-optimizer/rust/core/Cargo.toml

test-update:
if ! cargo test --manifest-path packages/qwik/src/optimizer/core/Cargo.toml; then \
cd packages/qwik/src/optimizer/core/src/snapshots/; \
if ! cargo test --manifest-path packages/qwik-optimizer/rust/core/Cargo.toml; then \
cd packages/qwik-optimizer/rust/core/src/snapshots/; \
for i in *.new; do f=$$(basename $$i .new); mv $$i $$f; done; \
cd -; \
cargo test --manifest-path packages/qwik/src/optimizer/core/Cargo.toml; \
cargo test --manifest-path packages/qwik-optimizer/rust/core/Cargo.toml; \
fi

publish-core:
cd src/optimizer/core && cargo publish --all-features
cd rust/core && cargo publish --all-features

publish-cli:
cd src/optimizer/cli && cargo publish
cd rust/cli && cargo publish

publish: publish-core publish-cli

Expand Down
17 changes: 14 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@
],
"pinVersion": "^5"
},
{
"label": "The optimizer version must be fixed",
"dependencies": [
"@builder.io/qwik-optimizer"
],
"dependencyTypes": [
"!local"
],
"pinVersion": "workspace:*"
},
{
"label": "use workspace protocol for local packages and allow patch versions (used in e.g. qwik-react)",
"dependencies": [
Expand Down Expand Up @@ -167,10 +177,11 @@
"packageManager": "[email protected]",
"pnpm": {
"overrides": {
"typescript": "5.4.5",
"vfile": "6.0.1",
"@microsoft/api-extractor": "$@microsoft/api-extractor",
"@supabase/realtime-js": "2.8.4",
"sharp": ">=0.33",
"@supabase/realtime-js": "2.8.4"
"typescript": "$typescript",
"vfile": "$vfile"
},
"patchedDependencies": {
"[email protected]": "patches/[email protected]"
Expand Down
1 change: 1 addition & 0 deletions packages/qwik-optimizer/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bindings
17 changes: 17 additions & 0 deletions packages/qwik-optimizer/api-extractor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "<projectFolder>/lib/index.d.ts",
"apiReport": {
"enabled": true,
"reportFileName": "api.md",
"reportFolder": "<projectFolder>/src/",
"reportTempFolder": "<projectFolder>/dist-dev/api-extractor/optimizer/"
},
"dtsRollup": {
"enabled": false
},
"docModel": {
"enabled": true,
"apiJsonFilePath": "<projectFolder>/../../dist-dev/api/qwik/optimizer/docs.api.json"
}
}
28 changes: 28 additions & 0 deletions packages/qwik-optimizer/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"annotation": "This package is for internal use in the monorepo, the build gets copied into qwik",
"name": "@builder.io/qwik-optimizer",
"version": "1.5.1",
"files": [
"bindings",
"lib"
],
"license": "MIT",
"exports": {
".": {
"import": "./lib/index.mjs",
"require": "./lib/index.cjs",
"types": "./lib/index.d.ts"
}
},
"repository": {
"type": "git",
"url": "https://github.com/BuilderIO/qwik.git",
"directory": "packages/qwik-optimizer"
},
"sideEffects": false,
"type": "module",
"devDependencies": {
"image-size": "1.1.1",
"kleur": "4.1.5"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: packages/qwik/src/optimizer/core/src/test.rs
assertion_line: 90
source: packages/qwik-optimizer/rust/core/src/test.rs
assertion_line: 91
expression: output
---
==INPUT==
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: packages/qwik/src/optimizer/core/src/test.rs
assertion_line: 267
source: packages/qwik-optimizer/rust/core/src/test.rs
assertion_line: 268
expression: output
---
==INPUT==
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: packages/qwik/src/optimizer/core/src/test.rs
assertion_line: 297
source: packages/qwik-optimizer/rust/core/src/test.rs
assertion_line: 298
expression: output
---
==INPUT==
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: packages/qwik/src/optimizer/core/src/test.rs
assertion_line: 111
source: packages/qwik-optimizer/rust/core/src/test.rs
assertion_line: 112
expression: output
---
==INPUT==
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: packages/qwik/src/optimizer/core/src/test.rs
assertion_line: 128
source: packages/qwik-optimizer/rust/core/src/test.rs
assertion_line: 129
expression: output
---
==INPUT==
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: packages/qwik/src/optimizer/core/src/test.rs
assertion_line: 148
source: packages/qwik-optimizer/rust/core/src/test.rs
assertion_line: 149
expression: output
---
==INPUT==
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: packages/qwik/src/optimizer/core/src/test.rs
assertion_line: 168
source: packages/qwik-optimizer/rust/core/src/test.rs
assertion_line: 169
expression: output
---
==INPUT==
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: packages/qwik/src/optimizer/core/src/test.rs
assertion_line: 187
source: packages/qwik-optimizer/rust/core/src/test.rs
assertion_line: 188
expression: output
---
==INPUT==
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: packages/qwik/src/optimizer/core/src/test.rs
assertion_line: 199
source: packages/qwik-optimizer/rust/core/src/test.rs
assertion_line: 200
expression: output
---
==INPUT==
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: packages/qwik/src/optimizer/core/src/test.rs
assertion_line: 223
source: packages/qwik-optimizer/rust/core/src/test.rs
assertion_line: 224
expression: output
---
==INPUT==
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: packages/qwik/src/optimizer/core/src/test.rs
assertion_line: 245
source: packages/qwik-optimizer/rust/core/src/test.rs
assertion_line: 246
expression: output
---
==INPUT==
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: packages/qwik/src/optimizer/core/src/test.rs
assertion_line: 2730
source: packages/qwik-optimizer/rust/core/src/test.rs
assertion_line: 2731
expression: output
---
==INPUT==
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: packages/qwik/src/optimizer/core/src/test.rs
assertion_line: 1023
source: packages/qwik-optimizer/rust/core/src/test.rs
assertion_line: 1024
expression: output
---
==INPUT==
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: packages/qwik/src/optimizer/core/src/test.rs
assertion_line: 1044
source: packages/qwik-optimizer/rust/core/src/test.rs
assertion_line: 1045
expression: output
---
==INPUT==
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: packages/qwik/src/optimizer/core/src/test.rs
assertion_line: 2647
source: packages/qwik-optimizer/rust/core/src/test.rs
assertion_line: 2648
expression: output
---
==INPUT==
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: packages/qwik/src/optimizer/core/src/test.rs
assertion_line: 1306
source: packages/qwik-optimizer/rust/core/src/test.rs
assertion_line: 1307
expression: output
---
==INPUT==
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: packages/qwik/src/optimizer/core/src/test.rs
assertion_line: 448
source: packages/qwik-optimizer/rust/core/src/test.rs
assertion_line: 449
expression: output
---
==INPUT==
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: packages/qwik/src/optimizer/core/src/test.rs
assertion_line: 1547
source: packages/qwik-optimizer/rust/core/src/test.rs
assertion_line: 1548
expression: output
---
==INPUT==
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: packages/qwik/src/optimizer/core/src/test.rs
assertion_line: 1572
source: packages/qwik-optimizer/rust/core/src/test.rs
assertion_line: 1573
expression: output
---
==INPUT==
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: packages/qwik/src/optimizer/core/src/test.rs
assertion_line: 1593
source: packages/qwik-optimizer/rust/core/src/test.rs
assertion_line: 1594
expression: output
---
==INPUT==
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: packages/qwik/src/optimizer/core/src/test.rs
assertion_line: 2861
source: packages/qwik-optimizer/rust/core/src/test.rs
assertion_line: 2862
expression: output
---
==INPUT==
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: packages/qwik/src/optimizer/core/src/test.rs
assertion_line: 2994
source: packages/qwik-optimizer/rust/core/src/test.rs
assertion_line: 2995
expression: output
---
==INPUT==
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: packages/qwik/src/optimizer/core/src/test.rs
assertion_line: 2962
source: packages/qwik-optimizer/rust/core/src/test.rs
assertion_line: 2963
expression: output
---
==INPUT==
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: packages/qwik/src/optimizer/core/src/test.rs
assertion_line: 2773
source: packages/qwik-optimizer/rust/core/src/test.rs
assertion_line: 2774
expression: output
---
==INPUT==
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: packages/qwik/src/optimizer/core/src/test.rs
assertion_line: 2916
source: packages/qwik-optimizer/rust/core/src/test.rs
assertion_line: 2917
expression: output
---
==INPUT==
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: packages/qwik/src/optimizer/core/src/test.rs
assertion_line: 2298
source: packages/qwik-optimizer/rust/core/src/test.rs
assertion_line: 2299
expression: output
---
==INPUT==
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: packages/qwik/src/optimizer/core/src/test.rs
assertion_line: 2320
source: packages/qwik-optimizer/rust/core/src/test.rs
assertion_line: 2321
expression: output
---
==INPUT==
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: packages/qwik/src/optimizer/core/src/test.rs
assertion_line: 820
source: packages/qwik-optimizer/rust/core/src/test.rs
assertion_line: 821
expression: output
---
==INPUT==
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source: packages/qwik/src/optimizer/core/src/test.rs
assertion_line: 1412
source: packages/qwik-optimizer/rust/core/src/test.rs
assertion_line: 1413
expression: output
---
==INPUT==
Expand Down
Loading
Loading