Skip to content

Commit

Permalink
feat: migration of create-farm-node to create-farm (#1377)
Browse files Browse the repository at this point in the history
* chore: remove vite work in templates

* chore: remove vite work in templates

* chore: remove create-farm packages

* chore: change create-farm-node to create-farm

* chore: test publish crates

* chore: bump version

* chore: update ci
  • Loading branch information
ErKeLost authored Jun 12, 2024
1 parent 90f9a3a commit aabb547
Show file tree
Hide file tree
Showing 390 changed files with 365 additions and 9,890 deletions.
5 changes: 5 additions & 0 deletions .changeset/soft-lies-lay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-farm": patch
---

migration of `create-farm-node` to `create-farm`
20 changes: 10 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
id: download-create-farm-rust
with:
name: ${{ github.sha }}-${{ matrix.settings.abi }}
path: ./packages/create-farm-node
path: ./packages/create-farm

- name: Build Examples - ${{ matrix.settings.abi }}
run: node scripts/test-examples.mjs
Expand All @@ -66,21 +66,21 @@ jobs:
- name: Build Create Farm
run: cd packages/create-farm && npm run build
- name: Test Create Farm React - ${{ matrix.settings.abi }}
run: cd .. && node farm/packages/create-farm/dist/index.js my-test-app-react --template react --skip-install && cd my-test-app-react && pnpm i && pnpm build
run: cd .. && node farm/packages/create-farm/create-farm.js my-test-app-react --template react && cd my-test-app-react && pnpm i && pnpm build
- name: Test Create Farm Vue - ${{ matrix.settings.abi }}
run: cd .. && node farm/packages/create-farm/dist/index.js my-test-app-vue --template vue --skip-install && cd my-test-app-vue && pnpm i && pnpm build
run: cd .. && node farm/packages/create-farm/create-farm.js my-test-app-vue --template vue3 && cd my-test-app-vue && pnpm i && pnpm build
- name: Test Create Farm Solid - ${{ matrix.settings.abi }}
run: cd .. && node farm/packages/create-farm/dist/index.js my-test-app-solid --template solid --skip-install && cd my-test-app-solid && pnpm i && pnpm build
run: cd .. && node farm/packages/create-farm/create-farm.js my-test-app-solid --template solid && cd my-test-app-solid && pnpm i && pnpm build
- name: Test Create Farm Svelte - ${{ matrix.settings.abi }}
run: cd .. && node farm/packages/create-farm/dist/index.js my-test-app-svelte --template svelte --skip-install && cd my-test-app-svelte && pnpm i && pnpm build
run: cd .. && node farm/packages/create-farm/create-farm.js my-test-app-svelte --template svelte && cd my-test-app-svelte && pnpm i && pnpm build
- name: Test Create Farm Lit - ${{ matrix.settings.abi }}
run: cd .. && node farm/packages/create-farm/dist/index.js my-test-app-lit --template lit --skip-install && cd my-test-app-lit && pnpm i && pnpm build
run: cd .. && node farm/packages/create-farm/create-farm.js my-test-app-lit --template lit && cd my-test-app-lit && pnpm i && pnpm build
- name: Test Create Farm Vanilla - ${{ matrix.settings.abi }}
run: cd .. && node farm/packages/create-farm/dist/index.js my-test-app-vanilla --template vanilla --skip-install && cd my-test-app-vanilla && pnpm i && pnpm build
run: cd .. && node farm/packages/create-farm/create-farm.js my-test-app-vanilla --template vanilla && cd my-test-app-vanilla && pnpm i && pnpm build
- name: Test Create Farm Preact - ${{ matrix.settings.abi }}
run: cd .. && node farm/packages/create-farm/dist/index.js my-test-app-preact --template preact --skip-install && cd my-test-app-preact && pnpm i && pnpm build
run: cd .. && node farm/packages/create-farm/create-farm.js my-test-app-preact --template preact && cd my-test-app-preact && pnpm i && pnpm build
- name: Test Create Farm Vue2 - ${{ matrix.settings.abi }}
run: cd .. && node farm/packages/create-farm/dist/index.js my-test-app-vue2 --template vue2 --skip-install && cd my-test-app-vue2 && pnpm i && pnpm build
run: cd .. && node farm/packages/create-farm/create-farm.js my-test-app-vue2 --template vue2 && cd my-test-app-vue2 && pnpm i && pnpm build

type-check:
name: Type Check
Expand Down Expand Up @@ -169,7 +169,7 @@ jobs:
for abi in linux-x64-gnu linux-x64-musl darwin-x64 win32-x64-msvc linux-arm64-musl linux-arm64-gnu darwin-arm64 win32-ia32-msvc win32-arm64-msvc
do
ls /tmp/artifacts/
test -f /tmp/artifacts/${{ github.sha }}-${abi}-create-farm-node/create-farm-node.${abi}.node
test -f /tmp/artifacts/${{ github.sha }}-${abi}-create-farm/create-farm.${abi}.node
done
check-plugin-artifacts:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ jobs:
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-sass/* ./rust-plugins/sass/npm/${abi}
mv /tmp/artifacts/${{ github.sha }}-${abi}-create-farm-node/* ./packages/create-farm-node/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-node/npm/${abi}/create-farm-node.${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/sass/npm/${abi}/index.farm
done
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/rust-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
unset CC &&
cd packages/core &&
npm run build:rs:publish -- --target x86_64-unknown-linux-gnu &&
cd ../create-farm-node &&
cd ../create-farm &&
npm run build -- --target x86_64-unknown-linux-gnu &&
cd ../../rust-plugins/react && npm run build -- --target x86_64-unknown-linux-gnu --abi linux-x64-gnu &&
apt install -y protobuf-compiler &&
Expand All @@ -33,7 +33,7 @@ jobs:
unset CC &&
cd packages/core &&
npm run build:rs:publish -- --target x86_64-unknown-linux-musl &&
cd ../create-farm-node &&
cd ../create-farm &&
npm run build -- --target x86_64-unknown-linux-musl &&
cd ../../rust-plugins/react && npm run build -- --target x86_64-unknown-linux-musl --abi linux-x64-musl &&
apk add protobuf &&
Expand All @@ -55,7 +55,7 @@ jobs:
export CARGO_PROFILE_RELEASE_LTO=false
cargo install cargo-xwin
cd packages/core && npm run build:rs -- --target i686-pc-windows-msvc --cargo-flags="--no-default-features"
cd ../create-farm-node && npm run build -- --target i686-pc-windows-msvc
cd ../create-farm && npm run build -- --target i686-pc-windows-msvc
cd ../../rust-plugins/react && npm run build -- --target i686-pc-windows-msvc --abi win32-ia32-msvc
cd ../sass && npm run build -- --target i686-pc-windows-msvc --abi win32-ia32-msvc
- os: windows-latest
Expand All @@ -66,7 +66,7 @@ jobs:
export CARGO_PROFILE_RELEASE_LTO=false
cargo install cargo-xwin
cd packages/core && npm run build:rs -- --target aarch64-pc-windows-msvc --cargo-flags="--no-default-features"
cd ../create-farm-node && npm run build -- --target aarch64-pc-windows-msvc
cd ../create-farm && npm run build -- --target aarch64-pc-windows-msvc
cd ../../rust-plugins/react && npm run build -- --target aarch64-pc-windows-msvc --abi win32-arm64-msvc
cd ../sass && npm run build -- --target aarch64-pc-windows-msvc --abi win32-arm64-msvc
# linux
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
if: ${{ !matrix.settings.docker && !matrix.settings.build }}
run: >-
cd packages/core && npm run build:rs:publish -- ${{ matrix.settings.target && format('--target {0}', matrix.settings.target) || '' }} ${{ matrix.settings.zig && '--zig' || '' }} &&
cd ../create-farm-node && npm run build -- ${{ matrix.settings.target && format('--target {0}', matrix.settings.target) || '' }} ${{ matrix.settings.zig && '--zig' || '' }} &&
cd ../create-farm && npm run build -- ${{ matrix.settings.target && format('--target {0}', matrix.settings.target) || '' }} ${{ matrix.settings.zig && '--zig' || '' }} &&
cd ../../rust-plugins/react && npm run build -- ${{ matrix.settings.target && format('--target {0}', matrix.settings.target) || '' }} ${{ matrix.settings.zig && '--zig' || '' }} --abi ${{ matrix.settings.abi }} &&
cd ../sass && npm run build -- ${{ matrix.settings.target && format('--target {0}', matrix.settings.target) || '' }} ${{ matrix.settings.zig && '--zig' || '' }} --abi ${{ matrix.settings.abi }}
shell: bash
Expand All @@ -141,8 +141,8 @@ jobs:
- name: Upload Create Farm Rust
uses: actions/upload-artifact@v3
with:
name: ${{ github.sha }}-${{ matrix.settings.abi }}-create-farm-node
path: ./packages/create-farm-node/create-farm-node.${{ matrix.settings.abi }}.node
name: ${{ github.sha }}-${{ matrix.settings.abi }}-create-farm
path: ./packages/create-farm/create-farm.${{ matrix.settings.abi }}.node
- name: Upload Plugin React
uses: actions/upload-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[workspace]
members = [
"crates/*",
"packages/create-farm-node",
"packages/create-farm",
"rust-plugins/*",
]
resolver = "2"
2 changes: 1 addition & 1 deletion crates/create-farm-rs/templates/electron/preact/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
<title>Vite + Preact + TS</title>
<title>Farm + Preact + TS</title>
</head>
<body>
<div id="app"></div>
Expand Down
2 changes: 1 addition & 1 deletion crates/create-farm-rs/templates/preact/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
<title>Vite + Preact + TS</title>
<title>Farm +Preact + TS</title>
</head>
<body>
<div id="app"></div>
Expand Down
2 changes: 1 addition & 1 deletion examples/vite-adapter-svelte/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Check out [SvelteKit](https://github.com/sveltejs/kit#readme), which is also pow
- It brings its own routing solution which might not be preferable for some users.
- It is first and foremost a framework that just happens to use Vite under the hood, not a Vite app.

This template contains as little as possible to get started with Vite + TypeScript + Svelte, while taking into account the developer experience with regards to HMR and intellisense. It demonstrates capabilities on par with the other `create-vite` templates and is a good starting point for beginners dipping their toes into a Vite + Svelte project.
This template contains as little as possible to get started with Farm +TypeScript + Svelte, while taking into account the developer experience with regards to HMR and intellisense. It demonstrates capabilities on par with the other `create-vite` templates and is a good starting point for beginners dipping their toes into a Farm +Svelte project.

Should you later need the extended capabilities and extensibility provided by SvelteKit, the template has been structured similarly to SvelteKit so that it is easy to migrate.

Expand Down
2 changes: 1 addition & 1 deletion examples/vite-adapter-svelte/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Svelte + TS</title>
<title>Farm +Svelte + TS</title>
</head>
<body>
<div id="root"></div>
Expand Down
197 changes: 0 additions & 197 deletions packages/create-farm-node/.gitignore

This file was deleted.

Loading

0 comments on commit aabb547

Please sign in to comment.