Skip to content

Commit

Permalink
Merge pull request #64 from ottomated/updates
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
ottomated authored Sep 3, 2024
2 parents 508f98d + 46dfe18 commit 2c67d22
Show file tree
Hide file tree
Showing 15 changed files with 119 additions and 57 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,48 @@ on:
pull_request:

jobs:
create-shards:
runs-on: ubuntu-latest
outputs:
shards: ${{ steps.shards.outputs.shards }}
shard-count: ${{ steps.shards.outputs.count }}
steps:
- id: shards
run: |
shard_count=6
echo "count=[$shard_count]" >> $GITHUB_OUTPUT
max_shard=$((shard_count - 1))
echo "shards=[$(seq -s ', ' 0 $max_shard)]" >> $GITHUB_OUTPUT
test:
runs-on: ubuntu-latest
needs: create-shards
strategy:
fail-fast: false
matrix:
shard: ${{ fromJson(needs.create-shards.outputs.shards) }}
shard-count: ${{ fromJson(needs.create-shards.outputs.shard-count) }}
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/cache@v4
with:
save-always: true
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt

- name: Install Node.js
uses: actions/setup-node@v4
with:
Expand All @@ -20,3 +53,6 @@ jobs:
run: npm i -g pnpm
- name: Test
run: cargo test
env:
SHARD: ${{ matrix.shard }}
SHARD_COUNT: ${{ matrix.shard-count }}
50 changes: 25 additions & 25 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "create-o7-app"
authors = ["Ottomated"]
version = "0.8.6"
version = "0.8.7"
edition = "2021"

[dependencies]
Expand Down
29 changes: 27 additions & 2 deletions src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,40 @@ fn generate_combinations(features: Vec<FeatureDetails>) -> Vec<HashSet<Feature>>
}
}
}
println!("{next:?}");
last_step = next;
}
last_step
}

fn create_shard(combinations: Vec<HashSet<Feature>>) -> Vec<HashSet<Feature>> {
let shard_index = std::env::var("SHARD")
.ok()
.and_then(|s| s.parse::<usize>().ok());
let shard_count = std::env::var("SHARD_COUNT")
.ok()
.and_then(|s| s.parse::<usize>().ok());

if shard_index.is_none() || shard_count.is_none() {
return combinations;
}
let shard_index = shard_index.unwrap();
let shard_count = shard_count.unwrap();

let mut chunk = vec![];
for (i, item) in combinations.into_iter().enumerate() {
let index = i % shard_count;
if index == shard_index {
chunk.push(item);
}
}
chunk
}

#[test]
fn test() {
let mut combinations = generate_combinations(get_feature_list());
let combinations = generate_combinations(get_feature_list());
let mut combinations = create_shard(combinations);

// let mut combinations = vec![HashSet::new()];
// combinations[0].insert(Feature::Edge);
// combinations[0].insert(Feature::D1);
Expand Down
22 changes: 11 additions & 11 deletions template_builder/templates/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@
},
"dependencies": {},
"devDependencies": {
"@eslint/js": "^9.8.0",
"@sveltejs/adapter-auto": "^3.2.2",
"@sveltejs/kit": "^2.5.20",
"@sveltejs/vite-plugin-svelte": "^3.1.1",
"@eslint/js": "^9.9.1",
"@sveltejs/adapter-auto": "^3.2.4",
"@sveltejs/kit": "^2.5.25",
"@sveltejs/vite-plugin-svelte": "^3.1.2",
"autoprefixer": "^10.4.20",
"eslint": "^9.8.0",
"eslint": "^9.9.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-svelte": "^2.43.0",
"globals": "^15.9.0",
"postcss": "^8.4.41",
"postcss": "^8.4.44",
"postcss-load-config": "^6.0.1",
"prettier": "^3.3.3",
"prettier-plugin-svelte": "^3.2.6",
"prettier-plugin-tailwindcss": "^0.6.5",
"svelte": "^4.2.18",
"svelte-check": "^3.8.5",
"tailwindcss": "^3.4.9",
"prettier-plugin-tailwindcss": "^0.6.6",
"svelte": "^4.2.19",
"svelte-check": "^4.0.0",
"tailwindcss": "^3.4.10",
"typescript": "~5.5.4",
"typescript-eslint": "^8.0.0-alpha.62",
"vite": "^5.4.0"
"vite": "^5.4.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
},
"dependencies": {
"common": "^0.0.0",
"hono": "^4.5.4"
"hono": "^4.5.10"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20240806.0",
"@cloudflare/workers-types": "^4.20240821.1",
"typescript": "^5.5.4",
"wrangler": "^3.69.1"
"wrangler": "^3.73.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
},
"dependencies": {
"common": "workspace:*",
"hono": "^4.5.4"
"hono": "^4.5.10"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20240806.0",
"@cloudflare/workers-types": "^4.20240821.1",
"typescript": "^5.5.4",
"wrangler": "^3.69.1"
"wrangler": "^3.73.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
},
"devDependencies": {
"prisma-kysely": "^1.8.0",
"prisma": "^5.18.0"
"prisma": "^5.19.1"
}
}
2 changes: 1 addition & 1 deletion template_builder/templates/extras/{D1}package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"devDependencies": {
"dotenv": "^16.4.5",
"better-sqlite3": "^11.1.2",
"better-sqlite3": "^11.2.1",
"@types/better-sqlite3": "^7.6.11"
}
}
6 changes: 3 additions & 3 deletions template_builder/templates/extras/{Edge}package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"devDependencies": {
"@cloudflare/workers-types": "^4.20240806.0",
"@sveltejs/adapter-cloudflare": "^4.7.0",
"wrangler": "^3.69.1",
"@cloudflare/workers-types": "^4.20240821.1",
"@sveltejs/adapter-cloudflare": "^4.7.2",
"wrangler": "^3.73.0",
"@sveltejs/adapter-auto": null
}
}
4 changes: 2 additions & 2 deletions template_builder/templates/extras/{Planetscale}package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"db:push": "prisma db push"
},
"dependencies": {
"kysely-planetscale": "^1.4.0",
"@planetscale/database": "^1.18.0"
"kysely-planetscale": "^1.5.0",
"@planetscale/database": "^1.19.0"
}
}
2 changes: 1 addition & 1 deletion template_builder/templates/extras/{Sqlite}package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"db:push": "prisma db push"
},
"dependencies": {
"better-sqlite3": "^11.1.2"
"better-sqlite3": "^11.2.1"
},
"devDependencies": {
"@types/better-sqlite3": "^7.6.11"
Expand Down
5 changes: 3 additions & 2 deletions template_builder/templates/extras/{Svelte5}package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"devDependencies": {
"svelte": "^5.0.0-next.210",
"eslint-plugin-svelte": "^2.36.0-next.13"
"svelte": "^5.0.0-next.243",
"eslint-plugin-svelte": "^2.36.0-next.13",
"@sveltejs/vite-plugin-svelte": "^4.0.0-next.6"
}
}
2 changes: 1 addition & 1 deletion template_builder/templates/extras/{Trpc}package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"dependencies": {
"@tanstack/svelte-query": "^5.51.21",
"@tanstack/svelte-query": "^5.53.3",
"@trpc/client": "^10.45.2",
"@trpc/server": "^10.45.2",
"devalue": "^5.0.0",
Expand Down
Loading

0 comments on commit 2c67d22

Please sign in to comment.