Files
ocis/web/package.json
T
Matteo 30ff89b1de [full-ci] chore(web): adopt Nx as task orchestrator for web/ (#13039)
feat(web): adopt Nx as task orchestrator for web/

Introduces Nx on top of the existing pnpm workspace, so lint/typecheck/
test can be scoped to only the projects affected by a change instead of
running against the whole monorepo on every PR.

- Phase 0: add nx (^23.2.1) as a workspace devDependency, nx.json with a
  targetDefaults entry for test:unit (cache: true), ignore .nx/cache and
  .nx/workspace-data. No behavior change to any existing script.
- Phase 1: register @nx/vitest's inference plugin so every package with
  a vitest.config.ts gets a real, cached "test" target read directly
  from its own config, not just the packages that happened to already
  declare a "test:unit" npm script. Excludes vite.config.common.ts,
  the root vite.config.ts and vite.cern.config.ts from the plugin's
  default glob - none of them are test configs, and loading them as one
  aborts the whole project graph. defaultBase: "master" (bare `nx
  affected` defaults to a branch named "main"). testMode: "run" so `nx
  run <project>:test` doesn't default to vitest's watch mode locally.
- Phase 2a: register @nx/eslint/plugin for a per-project "lint" target
  on every project (root `lint` script untouched).
- Phase 2b: register @nx/vite/plugin's typecheckTargetName for a
  per-project "typecheck" target on projects with their own real
  vite.config.ts (design-system, web-client, web-pkg, web-test-helpers).
  The ~20 web-app-*/web-runtime projects only have a vitest.config.ts
  and aren't covered; root `pnpm run check:types` (whole-repo vue-tsc)
  stays the one check that covers everything.
- Phase 3 (CI): adds a `full-run` output to detect-web-changes - true for
  push to master/stable-* or a `[full-ci]` PR title (unchanged behavior),
  false for a normal PR, which instead runs `nx affected -t lint` / `nx
  affected -t test --base=<PR base sha>`. Added fetch-depth: 0 to
  web-build-test's checkout, needed for `nx affected --base=<sha>` to
  find that commit. Check types and the full-run unit-test path
  deliberately stay whole-repo (see inline comments for why).

Also:
- removes design-system's broken "lint": "lint:stylelint" alias (needed
  the "lint" name free for the new per-project target; it was never
  callable as written - "lint:stylelint" isn't a binary - and nothing
  called it).
- makes the design system's webfontloader import fire-and-forget so an
  in-flight rejection at test teardown doesn't surface as an unhandled
  rejection under vitest's per-project runs.
- pin `typescript` via `pnpm.overrides`. Adding nx's own devDependencies
  makes pnpm re-resolve the workspace's peer graph, and today's registry
  now has a typescript 6.x that some peer ranges accept - without the
  pin, half the vue-peer-dependent packages (pinia, vue-router,
  vue3-gettext, focus-trap-vue, ...) fork into a second, incompatible
  module instance. Same pin as the dependency-cycle fix, for an
  unrelated reason; needed independently here since this branch changes
  package.json on its own.

nx's `dependsOn: ["^target"]` errors outright on a circular task graph,
so this only works once the pre-existing web-pkg/design-system/
web-test-helpers dependency cycle is fixed - see
fix(web): break web-pkg/design-system/web-test-helpers dependency cycle,
which this PR targets rather than master.

Verified: nx run-many -t test / lint / typecheck succeed for all
projects; nx show projects --affected --files=... resolves correctly for
shared config changes; nx affected -t lint --base=<sha> matches pnpm
lint; root pnpm lint/check:types/check:format/test:unit/build all still
pass unchanged (380 files / 3128 tests).
2026-10-02 08:58:49 +02:00

142 lines
5.2 KiB
JSON

{
"version": "12.5.0",
"private": true,
"homepage": "https://github.com/owncloud/web",
"license": "Apache-2.0",
"author": "ownCloud GmbH <devops@owncloud.com>",
"type": "module",
"scripts": {
"build": "vue-demi-fix && pnpm build:tokens && pnpm vite build",
"build:w": "pnpm build --watch",
"build:tokens": "pnpm --filter @ownclouders/design-system tokens",
"lint": "eslint vite.config.ts '{packages,tests}/**/*.{js,ts,vue}' --color",
"serve": "SERVER=true pnpm build:w",
"test:e2e:playwright": "NODE_TLS_REJECT_UNAUTHORIZED=0 npx playwright test --config=tests/e2e/",
"docs:screenshots": "NODE_TLS_REJECT_UNAUTHORIZED=0 npx playwright test --config=tests/e2e/docs/playwright.config.ts",
"test:unit": "NODE_OPTIONS=--unhandled-rejections=throw vitest",
"licenses:check": "license-checker-rseidelsohn --summary --relativeLicensePath --onlyAllow 'Python-2.0;Apache*;Apache License, Version 2.0;Apache-2.0;Apache 2.0;Artistic-2.0;BSD;BSD-3-Clause;CC-BY-3.0;CC-BY-4.0;CC0-1.0;ISC;MIT;MPL-2.0;Public Domain;Unicode-TOU;Unlicense;WTFPL;BlueOak-1.0.0' --excludePackages '@ownclouders/babel-preset;@ownclouders/eslint-config;@ownclouders/prettier-config;@ownclouders/tsconfig;@ownclouders/web-client;@ownclouders/web-pkg;external;web-app-files;text-editor;preview;web-app-ocm;@ownclouders/design-system;pdf-viewer;web-app-search;admin-settings;webfinger;web-runtime;@ownclouders/web-test-helpers'",
"licenses:csv": "license-checker-rseidelsohn --relativeLicensePath --csv --out ./third-party-licenses/third-party-licenses.csv",
"licenses:save": "license-checker-rseidelsohn --relativeLicensePath --out /dev/null --files ./third-party-licenses/third-party-licenses",
"vite": "vue-demi-fix && vite",
"check:types": "pnpm build:tokens && vue-tsc --noEmit",
"check:format": "prettier --check \"./**/*.{ts,js,vue}\"",
"check:all": "pnpm check:types && pnpm lint --fix && pnpm check:format && pnpm test:unit",
"format": "prettier --write \"./**/*.{ts,js,vue}\""
},
"browserslist": [
"last 1 year",
"> .2%",
"not dead",
"not Explorer > 0",
"not ExplorerMobile > 0",
"not BlackBerry > 0",
"not OperaMini all",
"not OperaMobile > 0"
],
"devDependencies": {
"@axe-core/playwright": "^4.11.0",
"@babel/core": "7.29.6",
"@babel/preset-env": "7.28.5",
"@babel/register": "7.28.3",
"@noble/hashes": "2.0.1",
"@nx/eslint": "23.2.1",
"@nx/vite": "23.2.1",
"@nx/vitest": "23.2.1",
"@ownclouders/babel-preset": "workspace:*",
"@ownclouders/eslint-config": "workspace:*",
"@ownclouders/prettier-config": "workspace:*",
"@ownclouders/tsconfig": "workspace:*",
"@playwright/test": "1.59.1",
"@types/luxon": "3.7.1",
"@types/mark.js": "8.11.12",
"@types/semver": "7.7.1",
"@types/uuid": "11.0.0",
"@vitejs/plugin-vue": "6.0.1",
"@vitest/coverage-v8": "4.1.5",
"@vitest/web-worker": "4.1.5",
"@vue/compiler-dom": "3.5.29",
"@vue/compiler-sfc": "3.5.29",
"@vue/test-utils": "2.4.6",
"axe-core": "^4.11.0",
"browserslist-to-esbuild": "^2.1.1",
"browserslist-useragent-regexp": "^4.1.3",
"commander": "14.0.2",
"debug": "^4.4.3",
"ejs": "4.0.1",
"eslint": "9.39.1",
"git-repo-info": "2.1.1",
"globals": "^16.5.0",
"happy-dom": "20.8.9",
"jimp": "^1.6.0",
"jsdom": "^27.2.0",
"jsqr": "^1.4.0",
"license-checker-rseidelsohn": "4.4.2",
"node-fetch": "3.3.2",
"nx": "^23.2.1",
"pino": "10.1.0",
"pino-pretty": "13.1.2",
"prettier": "^3.6.2",
"qs": "6.15.2",
"requirejs": "2.3.7",
"rollup-plugin-gzip": "^4.1.1",
"rollup-plugin-visualizer": "6.0.5",
"simple-git": "3.36.0",
"speakeasy": "^2.0.0",
"ts-node": "10.9.2",
"tslib": "2.8.1",
"typescript": "5.9.3",
"vite": "7.3.5",
"vite-plugin-environment": "^1.1.3",
"vite-plugin-node-polyfills": "0.24.0",
"vite-plugin-static-copy": "^3.1.4",
"vite-plugin-treat-umd-as-commonjs": "0.1.4",
"vitest": "^4.1.11",
"vitest-mock-extended": "3.1.0",
"vue": "3.5.29",
"vue-demi": "0.14.10",
"vue-tsc": "3.1.4",
"vue3-gettext": "^4.0.1"
},
"engines": {
"node": ">=24.15.0"
},
"packageManager": "pnpm@10.33.3",
"volta": {
"node": "24.15.0"
},
"pnpm": {
"overrides": {
"typescript": "5.9.3",
"nanoid": "^3.3.17",
"elliptic": "6.6.1",
"sha.js": "2.4.12",
"vitest": "4.1.11",
"@types/node": "24.13.2",
"@xmldom/xmldom": "0.8.15",
"flatted": "3.4.2",
"form-data": "4.0.6",
"immutable": "5.1.8",
"js-cookie": "3.0.7",
"linkify-it": "5.0.2",
"minimatch": "10.2.5",
"brace-expansion": "5.0.11",
"ws": "8.21.0",
"js-yaml": "4.3.2",
"fast-uri": "3.1.7",
"browserslist": "4.28.7"
},
"patchedDependencies": {
"caf@15.0.1": "patches/caf@15.0.1.patch",
"portal-vue@3.0.0": "patches/portal-vue@3.0.0.patch",
"vue-select@4.0.0-beta.6": "patches/vue-select@4.0.0-beta.6.patch"
}
},
"dependencies": {
"@chevrotain/regexp-to-ast": "^11.2.0",
"crelt": "^1.0.6",
"mermaid": "^11.16.1",
"vscode-jsonrpc": "^8.2.1",
"vscode-languageserver-types": "^3.17.5"
}
}