Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
9aa42a1
refactor: remove `splitVendorChunkPlugin()` from `vite`
Hdoc1509 Jan 1, 2026
a7d8388
fix(vite-plugin-html-minifier): set `config` parameter as optional
Hdoc1509 Jan 2, 2026
066e633
build(contact-page): use local `vite-plugin-html-minifier` package
Hdoc1509 Jan 2, 2026
a1f4a37
build(random-quote): use local `vite-plugin-html-minifier` package
Hdoc1509 Jan 2, 2026
2a189ae
build(qr-code-generator): use local `vite-plugin-html-minifier` package
Hdoc1509 Jan 2, 2026
a893ada
build(multi-step-form): use local `vite-plugin-html-minifier` package
Hdoc1509 Jan 2, 2026
24e1ebd
build(music-player): use local `vite-plugin-html-minifier` package
Hdoc1509 Jan 2, 2026
9b17cad
docs(todo): remove TODO.md
Hdoc1509 Jan 2, 2026
72744f0
ci(vanilla): avoid triggering workflow on `root/*` branches
Hdoc1509 Jan 2, 2026
d479f82
chore(guess-the-word): use `build` script to run type-checks
Hdoc1509 Jan 2, 2026
be42a98
chore(scripts): add `--deploy` flag for build.sh
Hdoc1509 Jan 2, 2026
d6ccd8b
docs(todo): update todos
Hdoc1509 Jan 2, 2026
1cfe750
ci(root,vanilla): build apps instead of only typechecking
Hdoc1509 Jan 2, 2026
ac0b17d
docs(todo): update todos
Hdoc1509 Jan 2, 2026
8784827
chore: use `vite@v7` in most of `vanilla` apps
Hdoc1509 Jan 3, 2026
91a9fb0
docs: add mores TODO.md files
Hdoc1509 Jan 3, 2026
537d04c
chore(guess-the-word): update to `vite@v7`. also update `vitest`
Hdoc1509 Jan 3, 2026
ce7cf25
chore(button-component): update `vite` to `v7`
Hdoc1509 Jan 4, 2026
ece313f
chore: update rest of non-astro apps to use `vite@v7`
Hdoc1509 Jan 5, 2026
6578d92
docs(todo): update plan for legacy apps using `astro`
Hdoc1509 Jan 5, 2026
d6e5ebe
docs(todo): explain requirements for `@astrojs/upgrade` to work
Hdoc1509 Jan 5, 2026
c0320c4
docs(todo): remove completed tasks for `vite@v7` updates
Hdoc1509 Jan 5, 2026
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
6 changes: 3 additions & 3 deletions .github/workflows/ci-root.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI Root
on:
push:
branches:
- 'root/*'
- "root/*"

jobs:
changed-files:
Expand Down Expand Up @@ -41,7 +41,7 @@ jobs:
pnpm install --frozen-lockfile
pnpm run lint

typecheck:
build:
needs: changed-files
runs-on: ubuntu-22.04
if: needs.changed-files.outputs.files != 'true'
Expand All @@ -54,4 +54,4 @@ jobs:
cache: pnpm
- run: |
pnpm install --frozen-lockfile
pnpm run --recursive typecheck
pnpm run build
6 changes: 3 additions & 3 deletions .github/workflows/ci-vanilla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI Vanilla
on:
push:
branches:
- "*/*"
- "!root/*"
paths:
- "vanilla/**"
- ".github/workflows/ci-vanilla.yml"
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
pnpm install --frozen-lockfile --filter "@hdoc/dev-challenges" --filter "$app_name"...
pnpm run lint:vanilla vanilla/"$app_name"

typecheck:
build:
needs: changed-files
runs-on: ubuntu-22.04
if: needs.changed-files.outputs.files != 'true'
Expand All @@ -77,7 +77,7 @@ jobs:
- run: |
app_name='${{ needs.changed-files.outputs.app_name }}'
pnpm install --frozen-lockfile --filter "@hdoc/dev-challenges" --filter "$app_name"...
pnpm --filter "$app_name" typecheck
pnpm --filter "$app_name" build

test-unit:
needs: changed-files
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
run: pnpm install --frozen-lockfile

- name: Build challenges
run: pnpm run build
run: pnpm run build --deploy

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
Expand Down
45 changes: 23 additions & 22 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
# TODO

## Vite
## All apps

### Update to `v7`
- try to remove `typescript` from `devDependencies`. ensure all projects are
using the same version of `typescript`. See [Running scripts in workspaces](https://pnpm.io/9.x/cli/run#details)

- Ensure `github-jobs`, `quote-generator` and `weather-app` uses version from
`catalog:`
## Vanilla

### Use `build.rollupOptions.output.manualChunks` instead of `splitVendorChunkPlugin()`
- ensure all apps are type-checked before building

Create custom `vite-config` package that exports this option. By default, it
will split into `index-<hash>.(js|css)` and `vendor-<hash>.(js|css)`. i.e.:
## Legacy

```js
{
build: {
rollupOptions: {
output: {
manualChunks(id) {}
}
}
}
}
```
- remove `engines` field from `package.json` files. affected apps:

Affected files:
- `button-component`
- `input-component`
- `country-quiz`
- `todo-app`
- `windbnb`

- `legacy/country-quiz/vite.config.ts`
- `legacy/windbnb/vite.config.ts`
- `_templates/app/react/vite.config.ts.hygen`
`pnpm` version is set in `packageManager` of root `package.json` and
`node` version is set in root `.nvmrc`.

- update `tsconfig.*.json` files to match [create-vite@8.2.0][create-vite@8.2.0]
- update `eslint` to `v9` and config files to match [create-vite@8.2.0][create-vite@8.2.0]
- migrate content-only apps to `astro`. pre-render content to static HTML.
- update projects using `astro` to use `astro@v5`
- `@astrojs/upgrade` requires an explicit version in `package.json` instead
of `catalog:` protocol

[create-vite@8.2.0]: https://github.com/vitejs/vite/tree/create-vite%408.2.0/packages/create-vite/template-react-ts
8 changes: 4 additions & 4 deletions _templates/app/react/package.json.hygen
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ to: apps/<%= name %>/package.json
"react-dom": "catalog:"
},
"devDependencies": {
"@vitejs/plugin-react": "catalog:",
"sass": "catalog:",
"typescript": "catalog:",
"vite": "catalog:"
"@vitejs/plugin-react": "catalog:vite7",
"sass": "catalog:vite7",
"typescript": "catalog:vite7",
"vite": "catalog:vite7"
}
}
16 changes: 14 additions & 2 deletions _templates/app/react/vite.config.ts.hygen
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,22 @@
to: apps/<%= name %>/vite.config.ts
---

import { defineConfig, splitVendorChunkPlugin } from 'vite'
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), splitVendorChunkPlugin()],
plugins: [react()],
// TODO: choose a sub-path for `react` apps
// base: '/dev-challenges/PATH/<%= name %>',
build: {
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes("node_modules")) return "vendor";
},
},
},
},
// TODO: add `resolve.alias` option
})
2 changes: 1 addition & 1 deletion _templates/app/vanilla/package.json.hygen
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ to: vanilla/<%= name %>/package.json
"@lib/dom": "workspace:"
},
"devDependencies": {
"vite": "catalog:",
"vite": "catalog:vite7",
"vite-plugin-html-minifier": "workspace:"
}
}
10 changes: 5 additions & 5 deletions legacy/button-component/lib/css/styles.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import "button.scss";
@import "button-outline.scss";
@import "button-text.scss";
@use "button.scss";
@use "button-outline.scss";
@use "button-text.scss";

@import "sizes.scss";
@import "colors.scss";
@use "sizes.scss";
@use "colors.scss";
8 changes: 4 additions & 4 deletions legacy/button-component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
},
"devDependencies": {
"@hrc/type-utils": "catalog:",
"@vitejs/plugin-react": "catalog:",
"sass": "catalog:",
"typescript": "catalog:",
"vite": "catalog:"
"@vitejs/plugin-react": "catalog:vite7",
"sass": "catalog:vite7",
"typescript": "catalog:vite7",
"vite": "catalog:vite7"
},
"engines": {
"node": ">=18",
Expand Down
10 changes: 5 additions & 5 deletions legacy/country-quiz/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
"zustand": "catalog:"
},
"devDependencies": {
"@vitejs/plugin-react": "catalog:",
"sass": "catalog:",
"typescript": "catalog:",
"vite": "catalog:",
"vitest": "catalog:",
"@vitejs/plugin-react": "catalog:vite7",
"sass": "catalog:vite7",
"typescript": "catalog:vite7",
"vite": "catalog:vite7",
"vitest": "catalog:vite7",
"vite-plugin-hrc-import": "catalog:"
},
"engines": {
Expand Down
16 changes: 14 additions & 2 deletions legacy/country-quiz/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
import path from 'path'
import { defineConfig, splitVendorChunkPlugin } from 'vite'
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import hrcImportPlugin from 'vite-plugin-hrc-import'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), splitVendorChunkPlugin(), hrcImportPlugin()],
// NOTE: `vite-plugin-hrc-import` IS COMPATIBLE with vite@v7, but requires
// updating its `peerDependencies` to allow `vite@6` and `vite@7` to suppress
// `unmet peer` warnings.
plugins: [react(), hrcImportPlugin()],
base: '/dev-challenges/legacy/country-quiz',
build: {
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes('node_modules')) return 'vendor';
},
},
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, 'src')
Expand Down
59 changes: 0 additions & 59 deletions legacy/github-jobs/TODO.md

This file was deleted.

1 change: 1 addition & 0 deletions legacy/github-jobs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"react-dom": "catalog:",
"react-paginate": "catalog:",
"react-router-dom": "catalog:",
"vite": "catalog:",
"zod": "catalog:",
"zustand": "catalog:"
},
Expand Down
10 changes: 5 additions & 5 deletions legacy/input-component/lib/css/styles.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import './colors.scss';
@use './colors.scss';

@import './label.scss';
@import './input.scss';
@import './helper-text.scss';
@import './icon.scss'
@use './label.scss';
@use './input.scss';
@use './helper-text.scss';
@use './icon.scss'
8 changes: 4 additions & 4 deletions legacy/input-component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
},
"devDependencies": {
"@hrc/type-utils": "catalog:",
"@vitejs/plugin-react": "catalog:",
"sass": "catalog:",
"typescript": "catalog:",
"vite": "catalog:"
"@vitejs/plugin-react": "catalog:vite7",
"sass": "catalog:vite7",
"typescript": "catalog:vite7",
"vite": "catalog:vite7"
},
"engines": {
"node": ">=18",
Expand Down
1 change: 1 addition & 0 deletions legacy/quote-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"astro": "catalog:",
"react": "catalog:",
"react-dom": "catalog:",
"vite": "catalog:",
"zod": "catalog:"
},
"devDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions legacy/todo-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
"zustand": "catalog:"
},
"devDependencies": {
"@vitejs/plugin-react": "catalog:",
"sass": "catalog:",
"typescript": "catalog:",
"vite": "catalog:",
"@vitejs/plugin-react": "catalog:vite7",
"sass": "catalog:vite7",
"typescript": "catalog:vite7",
"vite": "catalog:vite7",
"vite-plugin-hrc-import": "catalog:"
},
"engines": {
Expand Down
1 change: 1 addition & 0 deletions legacy/weather-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"react": "catalog:",
"react-dom": "catalog:",
"react-loading-skeleton": "catalog:",
"vite": "catalog:",
"zod": "catalog:",
"zustand": "catalog:"
},
Expand Down
5 changes: 5 additions & 0 deletions legacy/windbnb/TODO.md
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
# TODO

- use smaller images for lower screen sizes
- zoom-in image on hover
- try to add a background to `<StayCard />` on hover
- Apply lazy load to `<SearchDrawer />`
8 changes: 4 additions & 4 deletions legacy/windbnb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
},
"devDependencies": {
"@hrc/type-utils": "catalog:",
"@vitejs/plugin-react": "catalog:",
"sass": "catalog:",
"typescript": "catalog:",
"vite": "catalog:"
"@vitejs/plugin-react": "catalog:vite7",
"sass": "catalog:vite7",
"typescript": "catalog:vite7",
"vite": "catalog:vite7"
},
"engines": {
"node": ">=18",
Expand Down
Loading