Skip to content

Commit

Permalink
Merge branch 'v2-dev' into refactor/preview-server
Browse files Browse the repository at this point in the history
  • Loading branch information
fu050409 authored Nov 10, 2024
2 parents 24dfd4b + 3cceff0 commit ed61594
Show file tree
Hide file tree
Showing 347 changed files with 11,088 additions and 11,445 deletions.
5 changes: 5 additions & 0 deletions .changeset/clever-wasps-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@farmfe/core": major
---

export loadenv api
5 changes: 0 additions & 5 deletions .changeset/happy-mice-visit.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/shiny-guests-deliver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@farmfe/core": major
---

build cjs script
37 changes: 6 additions & 31 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: actions/download-artifact@v4
id: download-plugin-replace-dirname
with:
name: ${{ github.sha }}-${{ matrix.settings.abi }}-plugin-replace-dirname
path: ./rust-plugins/replace-dirname/npm/${{ matrix.settings.abi }}
- name: Install Dependencies
run: npm install -g [email protected] && pnpm i --frozen-lockfile
- name: Build CLI and Core
Expand Down Expand Up @@ -189,6 +194,7 @@ jobs:
settings:
- name: plugin-sass
- name: plugin-react
- name: plugin-replace-dirname
steps:
- uses: actions/download-artifact@v4
with:
Expand All @@ -199,34 +205,3 @@ jobs:
do
test -f /tmp/artifacts/${{ github.sha }}-${abi}-${{ matrix.settings.name }}/index.farm
done
benchmarks:
needs: [call-rust-build]
runs-on: ${{ matrix.settings.os }}
strategy:
fail-fast: false
matrix:
settings:
- os: ubuntu-latest
abi: linux-x64-gnu
steps:
- uses: "actions/checkout@v3"
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install Dependencies
run: npm install -g [email protected] && pnpm i --frozen-lockfile
- name: Build CLI and Core
run: pnpm --filter @farmfe/cli run build
- uses: actions/download-artifact@v4
id: download
with:
name: ${{ github.sha }}-${{ matrix.settings.abi }}
path: ./packages/core/binding
- name: Build Core CJS
run: cd packages/core && pnpm run build:cjs
# - name: Run benchmarks
# uses: CodSpeedHQ/action@v3
# with:
# run: npm exec vitest bench
# token: ${{ secrets.CODSPEED_TOKEN }}
2 changes: 2 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@ jobs:
do
mv /tmp/artifacts/${{ github.sha }}-${abi}/* ./packages/core/npm/${abi}
mv /tmp/artifacts/${{ github.sha }}-${abi}-plugin-react/* ./rust-plugins/react/npm/${abi}
mv /tmp/artifacts/${{ github.sha }}-${abi}-plugin-replace-dirname/* ./rust-plugins/replace-dirname/npm/${abi}
mv /tmp/artifacts/${{ github.sha }}-${abi}-plugin-sass/* ./rust-plugins/sass/npm/${abi}
mv /tmp/artifacts/${{ github.sha }}-${abi}-create-farm/* ./packages/create-farm/npm/${abi}
test -f ./packages/core/npm/${abi}/farm.${abi}.node
test -f ./packages/create-farm/npm/${abi}/create-farm.${abi}.node
test -f ./rust-plugins/react/npm/${abi}/index.farm
test -f ./rust-plugins/replace-dirname/npm/${abi}/index.farm
test -f ./rust-plugins/sass/npm/${abi}/index.farm
done
for abi in android-arm-eabi linux-arm-gnueabihf android-arm64
Expand Down
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
<a href="https://github.com/farm-fe/farm/blob/main/LICENSE">
<img src="https://img.shields.io/npm/l/@farmfe/core?style=flat-square&colorA=ffe3f5&colorB=711a5f" alt="license" />
</a>
<a href="https://gurubase.io/g/farm">
<img src="https://img.shields.io/badge/Gurubase-Ask%20Farm%20Guru-711a5f?style=flat-square&labelColor=ffe3f5" alt="Gurubase" />
</a>
</p>
<br/>
</div>
Expand Down
8 changes: 8 additions & 0 deletions crates/compiler/src/build/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,14 @@ impl Compiler {
return;
}

if let ResolveKind::Entry(ref name) = resolve_param.kind {
context
.module_graph
.write()
.entries
.insert(module.id.clone(), name.to_string());
}

match Self::build_module(
resolve_module_id_result.resolve_result,
&mut module,
Expand Down
4 changes: 2 additions & 2 deletions crates/compiler/src/generate/render_resource_pots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ pub fn render_resource_pots_and_generate_resources(
&mut resource_pot_info,
)?;

let r = &mut res.resource;
let resource_pot_info: ResourcePotInfo = resource_pot_info.unwrap();
res.resource.info = Some(resource_pot_info);
let r = &mut res.resource;

// ignore runtime resource
if !matches!(r.resource_type, ResourceType::Runtime) {
Expand Down Expand Up @@ -149,7 +150,6 @@ pub fn render_resource_pots_and_generate_resources(

resource_pot.add_resource(res.resource.name.clone());

res.resource.info = Some(resource_pot_info);

resources.lock().push(res.resource);
Ok::<(), CompilationError>(())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,59 +1,65 @@
---
source: crates/compiler/src/generate/partial_bundling.rs
input_file: crates/compiler/src/generate/partial_bundling.rs
input_file: crates/testing_helpers/src/lib.rs
---
(
(
"immutable",
false,
),
(
"modules",
[
ModuleId {
relative_path: "B",
query_string: "",
},
ModuleId {
relative_path: "E",
query_string: "",
},
],
),
(
"resource_pot_type",
Custom(
"__farm_unknown",
),
),
(
"name",
"B_2f5d",
),
(
"id",
"B_2f5d",
),
(
"entry",
Some(
ModuleId {
relative_path: "B",
query_string: "",
},
),
),
(
"resources",
[],
),
(
"module_groups",
[
ModuleId {
relative_path: "B",
query_string: "",
},
],
),
name: A_66be
id: A_66be
immutable: false
resource_pot_type: Js
entry: Some(
ModuleId {
relative_path: "A",
query_string: "",
},
)
module_groups: [
ModuleId {
relative_path: "A",
query_string: "",
},
ModuleId {
relative_path: "F",
query_string: "",
},
]
modules: [
ModuleId {
relative_path: "A",
query_string: "",
},
ModuleId {
relative_path: "C",
query_string: "",
},
]
resources: []

-------

name: B_2f5d
id: B_2f5d
immutable: false
resource_pot_type: Js
entry: Some(
ModuleId {
relative_path: "B",
query_string: "",
},
)
module_groups: [
ModuleId {
relative_path: "B",
query_string: "",
},
]
modules: [
ModuleId {
relative_path: "B",
query_string: "",
},
ModuleId {
relative_path: "E",
query_string: "",
},
]
resources: []
Loading

0 comments on commit ed61594

Please sign in to comment.