Repository navigation
Align the tooling, workflows and development environment with React UI - #69
Draft
bedrich-schindler wants to merge 28 commits into
Draft
bedrich-schindler wants to merge 28 commits into
bedrich-schindler wants to merge 28 commits into
Conversation
`sudo chown` ran before `fixuid` remapped the user, so it failed on Linux hosts with a UID other than 1000.
The common sections (dependencies, local environment, AI assistant files, IDE, Python, logs, `.gitkeep`) now have the same lines in the same order in every project with a development environment. Project paths are in the `# Project` section at the top. * Ignore `/.env*` except the `.dist` files instead of `.env` in any directory. * Ignore `/docker-compose.yml.backup`, `npm-debug.log*`, Python caches and the IDE directories `.idea` and `.vscode`.
The RACOM projects use the name `writeLockfileHash.sh` for the same script. The file mode changes to 644 as in those projects, because `postinstall` runs the script with `sh`.
The development environment was an older copy of the one that the other projects use. The paths, the directory names and `setup.sh` differed, so the files could not be compared or updated together. * Split the devcontainer into `docker/frontend-devcontainer/`, which is a copy of the shared `frontend-devcontainer` image source, and `docker/docoff-devcontainer/`, which adds the `node`, `npm` and `npx` wrappers and the `sudo` restriction. The copy adds the check that warns when the environment definition changed after the container was created. * Name the Docker directories and images with `-` instead of `_`: `docoff-devcontainer` and `docoff-devcontainer-local`. * Replace `setup.sh` and `docker/build-docker-images.sh` with the shared versions. `setup.sh` gains `--rebuild-docker-images` and `--recreate-files`, normalizes the project name and maps `SHELL`, `EDITOR` and `VISUAL` to values that exist in the container. * Move `scripts/mcps/chrome-host/` to `tools/agents/mcps/chrome-host/` and `scripts/auto-start-node.sh` to `scripts/docker/autoStartNode.sh`. * Add `tools/run-in-devcontainer.sh`. * Remove `RUN mkdir /workspace` from the `node` and `playwright` images, because `WORKDIR` creates the directory. * Update the paths in `.gitignore`, `.mcp.json`, `opencode.json`, `CLAUDE.md` and `docs/ai-integration.md`.
The default host ports in `.env.dist` were 8080 and 9323, and the host Chrome debug port was 9333. The other projects used the same defaults, so two projects with the default configuration could not run side by side. * Rename `COMPOSE_START_PORT` to `COMPOSE_WEB_SERVER_PORT`, which is the name that the other projects and the shared `start-host-chrome.sh` use, and set it to 21040. `docker-compose.base.yml` no longer has a fallback for the variable, as for the other port. * Set `COMPOSE_PLAYWRIGHT_REPORT_PORT` to 21042 and `CHROME_DEBUG_PORT` to 21043. * Set `CHROME_START_URL` to the dev server over HTTP, because `start-host-chrome.sh` opens the application over HTTPS by default. * Leave `COMPOSE_UID` and `COMPOSE_GID` empty. `setup.sh` fills them in, and the preset 1000 hid a missing configuration on hosts with another UID. * Fix the width of the section frames and use the comments of the other projects. * Update the variable name and the default ports in `README.md` and `docs/`. The ports inside the containers stay the same.
The config is now an ES module with the same structure and option order as `babel.config.mjs` of React UI. The differences to React UI are the `prismjs` plugin and nothing else. * Read the `core-js` version with a JSON import instead of `require`. * Apply `@babel/preset-react` through `overrides` that exclude `.ts` files, like React UI does. Docoff has no `.ts` sources, so the build output is the same.
The layout is the one React UI uses: `webpack.config.mjs` calls `webpack/webpackConfig.mjs`, which builds the configuration from one file per section in `webpack/_config/`. The files are ES modules. * Remove the first `headers` key of the dev server config. The second `headers` key in the same object overrode it. * Rename `MAX_OUTPUT_SIZE_KB` to `MAX_OUTPUT_SIZE_BYTES`, because webpack reads the limit in bytes. * Resolve the `resolve.fallback` packages with `createRequire`. * Add `/webpack/` to `CODEOWNERS`. The production `bundle.js` is byte-identical to the one built with the previous `webpack.config.js`.
No module in `src/` imports a CSS file, so the rule matched nothing and the bundle contains no `style-loader` runtime. The production `bundle.js` stays byte-identical. webpack 5.111 sets `experiments.css` to `auto`, which enables its own CSS support when no rule matches `.css` files. A CSS import added later is handled by webpack itself. * Remove the `style-loader` and `css-loader` development dependencies.
The scripts have the names and the commands used in React UI and in the RACOM projects, where `npm run lint` runs the linters and `npm test` does not exist. * Rename `test:eslint` to `lint:eslint` and add `lint`, which runs it. * Remove `test`. Run `npm run lint` and `npm run test:jest` instead. * Add the allowlist `globalIgnores` to `eslint.config.mjs` and run `eslint` without a path. ESLint lints `src`, `webpack` and the `*.config.js` and `*.config.mjs` files in the root, which is 148 files instead of the 134 files in `src`. * Let the tooling files import development dependencies. * Order the scripts by name and put `scripts` before `dependencies`. The workflows in `.github/workflows` still call `npm run test:eslint`.
The `docoff/tooling` block has the same three rules as the `tooling` block in React UI and in the RACOM projects. It turns off `import-x/extensions` and `no-console` for the tooling files in addition to allowing development dependencies.
React UI and the RACOM projects keep the Jest config in a config file and build `transformIgnorePatterns` from a list of package names. docoff now does the same. The pattern exempts the same three packages as before.
The `test:eslint` script was renamed to `lint:eslint`, so `lint.yml` and `release-management.yml` called a script that does not exist. Both now call `npm run lint`, which runs `lint:eslint`.
`pull-request-meta.yml` set `repo-token` under `env`, where the action does not read it. The action took its default token. `repo-token` is now under `with`, as in `eslint-config` and `stylelint-config`.
- Define `NODE_VERSION` and `NPM_VERSION` in `env` of `lint.yml`, `test.yml` and `release-management.yml` and install the pinned npm after Node.js. Node.js 26.13.1 bundles npm 11.20.0, so the versions in use do not change. - Use `actions/checkout@v6` and `actions/setup-node@v7` in all workflows. - Name the step that runs `npm run lint` in `lint.yml` `Lint`. `lint.yml` is now the same file as in `react-ui`, `eslint-config` and `stylelint-config`.
The step "Write out the release URL" prints `steps.github_release.outputs.release_url`, but the step `github_release` never wrote that output, so the printed URL was empty. The added line is the one that `eslint-config` and `stylelint-config` use.
Jest transforms the tests with `babel-jest` and `babel.config.mjs`, but only `jest` was declared. React UI declares `babel-jest` with the same range. The installed version stays 30.5.2.
React UI, `eslint-config` and `stylelint-config` lint their Markdown files, Docoff did not. * Add `.markdownlint.jsonc` and `.markdownlint-cli2.jsonc`, byte-identical to the React UI files. * Add `markdownlint-cli2` with the range that React UI uses, and the script `lint:markdownlint`, which `npm run lint` now runs too. * Reformat `README.md` and one line of `.claude/agents/code-reviewer.md` to pass: wrap lines at 80 characters, surround fenced code blocks with blank lines, indent nested lists by 4 spaces. The words are unchanged. The packages that `markdownlint-cli2` adds to the lockfile have the versions that the React UI lockfile has.
Docoff ships `tools/agents/mcps/chrome-host/` and sets `CHROME_START_URL` in `.env.dist`, but had no script that starts the host Chrome. The script is the one that React UI has.
`bugs.url` in `package.json` pointed to the issues of `react-ui-org/react-ui`, while `homepage` and `repository` point to `react-ui-org/docoff`.
The limit was 1600000 bytes while the production bundle has 1782259 bytes, and `hints` was not set. Every build therefore printed three warnings and passed. `performanceConfig` now has the shape of the React UI file: one limit for production and one for development, with `hints: 'error'`. The limits are about 10 % above the current bundle sizes, which are 1782259 bytes in production and 10743086 bytes in development.
`.editorconfig` is now byte-identical to the file of React UI, `eslint-config` and `stylelint-config`. The shared file indents CSS and Markdown files by 4 spaces, so `public/main.css` and `public/shadow.css` are reindented.
Docoff has no Playwright config and no `test:playwright*` script, so nothing reads `PW_WORKERS` and `PW_CT_PORT`. The `playwright` service and its report port stay.
Add `/jest.config.mjs`, which React UI lists, and `/scripts/`, `/setup.sh` and `/tools/`, which belong to the development environment like `/docker/`.
The port is the one that `COMPOSE_WEB_SERVER_PORT` publishes, and RA2W and WECL label the forwarded port of their web server "Web server".
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request. Check if the Files changed in this pull request are included in default exclusions.
`/.devcontainer/`, `/.env.dist` and `/.github/workflows/` get the owners of the other infrastructure and build tooling entries.
The URL pointed to the contributors of `react-ui`. `eslint-config` and `stylelint-config` link their own contributors page.
The devcontainer limited passwordless `sudo` to `docker` and `chown`. The other projects use the `frontend-devcontainer` image without that limit, and the project layer is now the same as theirs.
fixuid before chown in the devcontainer entrypoint`tools/agents/mcps/chrome-host/cdp_proxy.py` is indented with 4 spaces, and
`.editorconfig` set 2 spaces for every file without its own section.
* Add a `[*.py]` section with `indent_size = 4` after `[*.{cpp,hpp}]`.
The file stays byte-identical in frontend_tooling, React UI, docoff,
eslint-config and stylelint-config.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Align the build, lint and test configs, the GitHub workflows and the
development environment with React UI and the RACOM projects. The library
source code does not change, and the production
bundle.jsis byte-identical.Dependencies
babel-jestand addmarkdownlint-cli2with the ranges of ReactUI. Remove
style-loaderandcss-loader.bugs.urland theauthorURL to the Docoff repository.Build
babel.config.mjswith the structure of theReact UI file. The only difference is the
prismjsplugin.webpack/with the React UI layout, andremove the overridden first
headerskey and the.cssrule, whichmatched no module.
performanceConfigone limit for production and one for development,about 10 % above the current bundle sizes, with
hints: 'error'.Lint
test:eslinttolint:eslintand addlint, which runs ESLint andmarkdownlint.
globalIgnorestoeslint.config.mjs, so thateslintwithout a path lints
src,webpackand the root config files. Use thetoolingblock of the other projects for the tooling files..markdownlint.jsoncand.markdownlint-cli2.jsoncof React UI and thescript
lint:markdownlint. ReformatREADME.mdand one line of.claude/agents/code-reviewer.mdto pass, with the words unchanged.Tests
package.jsontojest.config.mjs. The samethree packages are exempt from
transformIgnorePatterns.testscript.CI
npm run lintinlint.ymlandrelease-management.yml.NODE_VERSIONandNPM_VERSION, and useactions/checkout@v6andactions/setup-node@v7.lint.ymlis the samefile as in
react-ui,eslint-configandstylelint-config.repo-tokentopr-labeler-actionunderwith, and set therelease_urloutput, which the release workflow prints.CODEOWNERS.Development environment
setup.shanddocker/build-docker-images.shof the other projects, without thesudorestriction. Add
tools/run-in-devcontainer.shand the scriptstart:chrome.scripts/mcps/chrome-host/totools/agents/mcps/chrome-host/,scripts/auto-start-node.shtoscripts/docker/autoStartNode.shandscripts/write-lockfile-hash.shtoscripts/writeLockfileHash.sh.fixuidbeforechownin the devcontainer entrypoint, which failed onhosts with a UID other than 1000.
.env.distand.gitignorewith the other projects, and remove theunused
PW_WORKERSandPW_CT_PORT..editorconfigand reindentpublic/main.cssandpublic/shadow.csswith 4 spaces..editorconfig.Behaviour changes
test:eslintis renamed tolint:eslint, andnpm testno longer exists.Run
npm run lintandnpm run test:jest.printed three size warnings and passed.
COMPOSE_START_PORTis renamed toCOMPOSE_WEB_SERVER_PORT. The defaulthost ports are 21040 for the web server, 21042 for the Playwright report and
21043 for the host Chrome debug port, instead of 8080, 9323 and 9333.
docoff-devcontaineranddocoff-devcontainer-local. An existing.envanddocker-compose.ymluse the old names, so developers recreate them once with
bash setup.sh --recreate-files.Testing
Before the last push,
npm ci, lint, Jest and the build passed from a cleaninstall in this repository.