Commit Graph
47 Commits
Author SHA1 Message Date
Yoshihiro OKUMURA bfc618fada feat: enable GA4 tracking
Set the measurement ID that replaces the Universal Analytics property
shut down in 2023, which leaves tracking disabled until now. Update
the README section, which still described the ID as empty.
2026-09-11 21:24:07 +09:00
Yoshihiro OKUMURA 90c6a8f7ce style: keep the browser's own font on form controls
modern-normalize hands form controls the inherited page font and puts
a system stack on `html`. The XOOPS theme styles `body` and leaves
the rest to the defaults it was authored against, so the search box
rendered in the theme font at the theme size rather than as the plain
controls it was drawn for.

State those defaults explicitly instead, so the rendering no longer
depends on whichever browser is in use. box-sizing: border-box stays
-- the theme has no measurements that assume content-box.
2026-09-11 21:24:01 +09:00
Yoshihiro OKUMURA 0271796534 fix: make the browser revalidate the site data
sirv sent no Cache-Control for static-contents, only an ETag, so the
browser was free to apply heuristic caching and answer from a stale
copy without revalidating. A re-dump would then go unnoticed, and two
sites served from the same localhost port answered with each other's
JSON.

maxAge 0 sends `public, max-age=0, must-revalidate`; a matching ETag
still yields a 304, so nothing extra is transferred.
2026-09-11 21:23:53 +09:00
Yoshihiro OKUMURA 9a0ba44fb0 chore: tidy up files left over from the conversion
- adopt bsi-ni's .gitignore, which is the vite template's
- delete dl-limit-items.csv, an exporter report that xoops-static-
  exporter now writes into its own data/
- add a description meta tag, which bsi-ni already had
- the ncu config is .ncurc.js now, not .ncurc.json
v2.0.0
2026-09-11 19:18:07 +09:00
Yoshihiro OKUMURA 8e2a40bf92 feat: resolve data URLs through Config.BASE_URL
Every data URL was written as a root-absolute path, so the app only
worked when served from the document root. Derive a base from
import.meta.env.BASE_URL the way bsi-ni does, and prefix the URLs
with it. Routing still assumes the root: BrowserRouter takes no
basename in either site.
2026-09-11 19:17:56 +09:00
Yoshihiro OKUMURA d5d25d5657 build: align the TypeScript and vite setup with bsi-ni
The tsconfigs were still the ones the CRA conversion produced, while
bsi-ni had been brought in line with the npm create vite@latest
react-ts template.

- take the three tsconfigs from bsi-ni verbatim: ES2023, and
  types: ["vite/client"] in place of src/vite-env.d.ts, which the
  template no longer ships
- drop the CRA leftovers useDefineForClassFields, resolveJsonModule,
  esModuleInterop and forceConsistentCasingInFileNames
- pin typescript with ~ rather than ^, as bsi-ni does
- drop the redundant build.outDir and the server/preview port
  overrides, leaving vite's defaults
- fix a vite.config comment that still pointed at the removed etc/
2026-09-11 19:17:47 +09:00
Yoshihiro OKUMURA 1c73645552 docs: write down the deployment procedure
The old section said only "upload the contents of dist/", which misses
everything the modules/ layout needs.

- spell out the five steps: build, send the data, push the build, link
  the data in, check the result
- push the build before creating the symlinks, so that --delete needs
  no --exclude and each deploy recreates the links from scratch
- link the data in with a glob over static-contents/, which keeps
  rss.xml from being forgotten: it sits beside modules/ rather than
  inside it, so linking only modules leaves /rss.xml a 404 that
  npm run preview cannot reproduce
- record what an upgrade from v1.0.0 does and does not need
2026-09-11 18:51:54 +09:00
Yoshihiro OKUMURA 40c27aa70d refactor: move the site data under modules/
The dumped data shared a namespace with the SPA routes: /database
served both /database/item/1587 and /database/file/..., and the same
went for /credits and the pico modules. It only worked because a real
file wins over the SPA fallback. Group it by source XOOPS module the
way bsi-ni.brain.riken.jp does, so routes and data no longer collide.

- database/ -> modules/xoonips/, credits/ -> modules/credits/,
  manual_ja/ and primface/ -> modules/
- give each pico module its own modules/<dirname>/config.json instead
  of one shared pico/config.json, so its index sits next to its pages
- redirect the v1.0.0 /database/file/ links to their new home, and
  point the legacy download.php redirect there too
2026-09-11 18:28:44 +09:00
Yoshihiro OKUMURA d05ceb49a4 build: split dependencies into vendor chunks
The bundle was a single 745 kB chunk, and lokijs pulled in a bare `fs`
import that vite had to externalize.

- externalize fs and exclude it from dependency optimization
- split node_modules into vendor-react (react, react-dom, scheduler)
  and vendor-misc: react is over 200 kB on its own, so a single
  dependency chunk would stay above the 500 kB warning threshold, and
  it changes far less often than the rest
- configure this through rolldownOptions.output.codeSplitting, the
  native rolldown API: manualChunks is only a compatibility shim under
  vite 8 and did not group the react packages as asked, and
  rollupOptions is deprecated
2026-09-11 18:01:11 +09:00
Yoshihiro OKUMURA 4990f95d71 build: track @types/node patches within the 24.x line
@types/node was excluded from ncu via `reject`, which also hid patch
and minor releases inside the 24.x line we pin to match the Node 24
runtime. Its "latest" dist-tag points at the 22.x line, so merely
dropping the rule would report no updates either. Select the target
per package instead.

- replace .ncurc.json with .ncurc.js so target can be a function
- use the "minor" target for @types/node, "latest" for everything else
- pick up @types/node 24.13.4
2026-09-11 17:36:23 +09:00
Yoshihiro OKUMURA 2b47d882f7 refactor: clear all biome lint diagnostics
Biome reported 229 diagnostics after aligning the config with
bsi-ni.brain.riken.jp. Fix them all so `biome check` passes clean
without per-rule overrides.

- replace `any` in LokiJS queries with an `ItemFilter` interface and
  a single `asLokiQuery()` cast, matching bsi-ni
- type the XOOPS redirect maps as
  `Record<string, { key: string; isNumber: boolean }>`
- use `ItemSubTypes<string>` instead of `any` for sub item types
- join author lists with `.join(', ')` instead of index-keyed nodes
- give list elements stable keys derived from their own data
- return `React.ReactNode` from `ListBase.renderBody()`
- drop the temporary `noArrayIndexKey` override from biome.json
2026-09-11 17:28:44 +09:00
Yoshihiro OKUMURA 5a8d2f209f style: align the biome config with the other sites
- narrow lineWidth to 120 and use es5 trailing commas
- format JSON at the same indent as the rest, dropping the override
- exclude the vendored XOOPS theme under src/common/assets
- drop the stale static-contents and public exclusions
2026-09-11 17:19:20 +09:00
Yoshihiro OKUMURA c514de9b17 refactor: drop xregexp for the native dotAll flag
The only use was the s flag in the multilingual tag stripper, which
JavaScript has supported natively since ES2018.
2026-09-11 17:18:42 +09:00
Yoshihiro OKUMURA 3dcca6c848 docs: describe the current data layout
etc/ has moved to xoops-static-exporter, static-contents/ now sits next
to the repository, and the build no longer copies it into dist/.
2026-09-11 17:17:35 +09:00
Yoshihiro OKUMURA 5a8a26eaa4 chore: move XOOPS conversion tools to xoops-static-exporter
The dump scripts under etc/ are shared with the other archived sites,
so they now live in a dedicated repository instead of being
duplicated per site.
2026-09-11 17:17:12 +09:00
Yoshihiro OKUMURA e8a044950b refactor: load the generated JSON at runtime
The dumps were imported into the bundle, which tied a data refresh to a
rebuild and put generated content in the source tree. They now sit in
static-contents/ with the rest of the site data, as on
bsi-ni.brain.riken.jp.

- add siteData.ts, which fetches the six files in parallel
- hand them to the singletons from main.tsx before the first render, so
  components still read them synchronously
- type the four ranking lists, which have three different shapes
2026-09-11 17:15:41 +09:00
Yoshihiro OKUMURA 62bdc2876a refactor: replace the withRouter shim with router hooks
react-router removed withRouter in v6, and the shim that replaced it
kept nineteen components tied to injected router props. They now read
the state directly, matching how bsi-ni.brain.riken.jp is written.

- convert the remaining class components to function components
- call useLocation, useNavigate and useParams in place of the props
- drop src/common/lib/withRouter.tsx
2026-09-11 17:10:58 +09:00
Yoshihiro OKUMURA a312a420ae fix: remove the stray td elements from the center column
They are left over from the XOOPS table layout, render nothing, and
make React report invalid nesting under a div.
2026-09-11 17:02:05 +09:00
Yoshihiro OKUMURA 9808d6692c build: keep static-contents out of the build output
writeBundle copied all 10 GB of it into dist/ on every build, although
the web server maps the directory in directly.

- drop the copy, which takes dist from 10 GB to 4.8 MB
- mount the directory on the preview server too, so that previewing a
  build still behaves like production
2026-09-11 17:02:05 +09:00
Yoshihiro OKUMURA f6bf706372 chore: move static-contents next to the repository
The generated site data is not part of the source tree, so it now sits
beside the checkout, matching the bsi-ni.brain.riken.jp layout.

- resolve the directory from config.root rather than the process cwd
- drop the ignore rule, which no longer matches anything
2026-09-11 17:02:03 +09:00
Yoshihiro OKUMURA d240bbae03 feat: migrate from Create React App to Vite
The CRA toolchain was several major versions behind and no longer
maintained, so the whole build, lint and runtime stack is replaced.

- replace react-scripts with Vite 8 and TypeScript 7
- upgrade to React 19 and react-router 8
- swap unmaintained libraries: react-html-parser, axios, react-ga,
  react-image-lightbox, react-helmet, moment, react-spinner-material
- replace ESLint with Biome for linting and formatting
- switch the package manager from yarn to npm
- serve static-contents/ with sirv in dev and copy it into the bundle
- keep a withRouter shim so the class components can stay as they are
  for now
2026-09-11 16:48:14 +09:00
Yoshihiro OKUMURA 270011cfe5 ignore .eslintcache from git v1.0.0 2021-05-28 13:56:05 +09:00
Yoshihiro OKUMURA cd11927719 update required libraries 2021-05-28 13:48:36 +09:00
Yoshihiro OKUMURA 7c7f57ef1c update required libraries 2021-01-19 15:06:37 +09:00
Yoshihiro OKUMURA cc480e67ea update required libraries 2020-07-27 19:19:15 +09:00
Yoshihiro OKUMURA 4ffe223488 update required libraries 2020-05-23 14:43:22 +09:00
Yoshihiro OKUMURA 637443bda2 add rule for index.html 2020-05-23 13:40:10 +09:00
Yoshihiro OKUMURA 9ed4b34df9 add script to generate rss 2020-04-30 14:36:58 +09:00
Yoshihiro OKUMURA 9b5dd3e274 update required libraries 2020-04-29 19:41:47 +09:00
Yoshihiro OKUMURA 2cc53fe2cb update required libraries 2020-02-18 01:22:43 +09:00
Yoshihiro OKUMURA 269abc439d update required libraries 2019-12-23 11:26:21 +09:00
Yoshihiro OKUMURA 230bc9e35b update required libraries 2019-11-25 18:04:26 +09:00
Yoshihiro OKUMURA 215ea71695 update required libraries. 2019-11-06 19:59:42 +09:00
Yoshihiro OKUMURA 8feeb8f2b9 dont use table page layout. 2019-07-12 17:50:56 +09:00
Yoshihiro OKUMURA f0637c1791 apply changes and minor bug fixes from cerebellum sources. 2019-07-12 16:44:03 +09:00
Yoshihiro OKUMURA a6f4848bc3 removed unused forum module. 2019-06-27 19:25:27 +09:00
Yoshihiro OKUMURA af8539999c fixed bug to show book title. 2019-06-27 14:39:20 +09:00
Yoshihiro OKUMURA e9052e7f30 removed data json. 2019-06-27 13:59:49 +09:00
Yoshihiro OKUMURA dd384f0c1c use ForumUtils to get title. 2019-06-27 13:45:51 +09:00
Yoshihiro OKUMURA 6260d9e754 update libraries. 2019-06-27 11:14:39 +09:00
Yoshihiro OKUMURA f49100aac5 use react-ga only in AppRoot class. 2019-06-27 11:13:56 +09:00
Yoshihiro OKUMURA cbc22c5546 fixed bug to select preview images. 2019-06-27 10:35:08 +09:00
Yoshihiro OKUMURA adc9a8e5ed fixed bug for null doi field. 2019-06-25 18:52:51 +09:00
Yoshihiro OKUMURA 5a96a37e91 fixed bug for mod redirect rule. 2019-06-25 11:33:41 +09:00
Yoshihiro OKUMURA 9a7b3a57d9 add google analytics code. 2019-06-25 10:37:05 +09:00
Yoshihiro OKUMURA bc8ae06329 add source code of visiome. 2019-06-25 10:11:07 +09:00
Yoshihiro OKUMURA 4dcbb1d4e2 Initial commit from Create React App 2019-06-17 16:13:09 +09:00