Repository navigation
Tags
Tags
fix: keep .nojekyll and CNAME on redeploy (release 3.1.2) (#217) * fix: keep .nojekyll and CNAME on redeploy The cleanup hook from #207 removes every tracked file that is not in dist. gh-pages writes .nojekyll and CNAME into its clone, not into dist, so a redeploy removed the .nojekyll that gh-pages had just created and GitHub Pages ran Jekyll again. CNAME survived only because gh-pages' own remove step unstages non-dot files first. The hook now keeps the files gh-pages generates for the active options. A leftover .nojekyll is still removed when nojekyll is disabled. CI deploys every Angular version twice and checks for .nojekyll. * chore: release 3.1.2 * fix: address review findings for the redeploy fix - CI checks the exact file name (git cat-file -e) and asserts that the second deploy created a commit - generatedFiles is a required parameter of createCleanupBeforeAddHook - unit tests for the hook with a mocked git - comments describe the current behaviour
chore: release 3.1.1 (regenerate lockfile, upgrade devDependencies) (#… …216) * chore: regenerate package-lock.json Fresh lockfile from the current package.json ranges. Resolves most npm audit findings in transitive dependencies (32 -> 13 vulnerable packages). * chore: upgrade vitest to 5 Vitest 3 pulls in tinypool and @vitest/mocker with critical advisories (prototype pollution leading to RCE, path traversal). Dev-only, but these run on maintainer machines and in CI. * chore: upgrade @types/node, json-schema-to-typescript and rimraf * chore: upgrade @Angular-devkit devDependencies to 22 devDependencies no longer stay pinned at Angular 18; the CI matrix runs a real ng new/ng add/ng deploy against every supported major (18-22), which covers the minimum version. Runtime dependency ranges are unchanged (>=18 <23). Resolves the ajv/picomatch advisories in devkit 18. * docs: state the compatibility principle for end users One release should work for as many users as possible, including old Angular versions in enterprise projects. User-facing ranges stay wide; devDependencies are free to change. * fix: restore engines.npm >=9.0.0 The bound was raised to >=10.0.0 as a side effect of the Vitest migration. User-facing ranges stay as wide as possible. * chore: replace copyfiles and rimraf with small node scripts copyfiles is unmaintained and pulls in deprecated packages (glob@7, inflight). Both tools only clean dist/ and copy a fixed list of files, which fs.rmSync and fs.copyFileSync cover without dependencies. The built dist/ is identical. * chore: generate schema.d.ts in the prebuild script * chore: release 3.1.1 * docs: explain the separate README.md copy in postbuild
fix: set CACHE_DIR fallback when no package.json is reachable (#203) (#… …208) * fix: set CACHE_DIR fallback when no package.json is reachable gh-pages@6.3.0 calls find-cache-dir({ name: 'gh-pages' }) for both clean() and publish(). find-cache-dir walks up from cwd looking for a package.json and returns undefined when it finds none. gh-pages then does path.join(undefined, ...) and throws: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined This hit users running `npx angular-cli-ghpages` from a repo that is just a dist/ folder (no package.json). The reporter's workaround of `npm install angular-cli-ghpages` first worked because it created a package.json that find-cache-dir could find. Fix: add ensureGhPagesCacheDir() to engine.prepare-options-helpers and call it from engine.run() before gh-pages is required. If no package.json is reachable from cwd, we set process.env.CACHE_DIR to `<os.tmpdir()>/angular-cli-ghpages-cache`. find-cache-dir honors CACHE_DIR as an explicit override — when set (and not a boolean-ish value 'true'/'false'/'1'/'0') it short-circuits its package.json walk. We do the package.json probe ourselves rather than delegating to find-cache-dir: find-cache-dir captures `const {env} = process` at module load and is then cached in require.cache, which makes it brittle under test reassignment of process.env. Tests: - engine.prepare-options-helpers.spec.ts — unit tests covering: cwd with no package.json sets fallback; cwd with package.json is a no-op; pre-existing user-set CACHE_DIR is preserved; boolean-ish CACHE_DIR values ('true'/'false'/etc.) are treated as unset per find-cache-dir's own semantics; fallback path is deterministically inside os.tmpdir(). - engine.gh-pages-no-package-json.spec.ts — real-git, real-gh-pages end-to-end. Creates a bare repo + workdir with no package.json in any ancestor, process.chdir()s there, runs engine.run(), inspects the remote tree, asserts the dist actually lands. A companion baseline test spawns a child Node process (no shared require.cache) and calls bare gh-pages.clean() in the same workdir, asserting it throws the original TypeError — proving the upstream bug is real. Fixes #203 * chore: keep version at 3.0.3 until all fixes are released together We don't ship a new npm version per fix; all pending fixes (#204, #205, #203, and follow-ups) will be released in a single bump at release time. This also rolls back the earlier per-PR bump that landed on main.
PreviousNext