Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node-version: [lts/*, '23']
node-version: [lts/*, latest]

steps:
- uses: actions/checkout@v6
Expand All @@ -34,7 +34,7 @@ jobs:
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
files: coverage/lcov.info
files: lcov.info
parallel: true

coverage:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ sandbox.js
package-lock.json
public
coverage
lcov.info
.tap
.tmp-*

Expand Down
7 changes: 3 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ import { basename, dirname, relative, resolve } from 'node:path'
// @ts-expect-error
import makeArray from 'make-array'
import ignore from 'ignore'
// @ts-expect-error
import cpx from 'cpx2'
import { watch as cpxWatch } from 'cpx2'
import { inspect } from 'util'
import browserSync from 'browser-sync'
import { find } from '@11ty/dependency-tree-typescript'
Expand Down Expand Up @@ -250,8 +249,8 @@ export class DomStack {
const copyDirs = getCopyDirs(this.opts.copy)

this.#cpxWatchers = [
cpx.watch(getCopyGlob(this.#src), this.#dest, { ignore: this.opts.ignore }),
...copyDirs.map(copyDir => cpx.watch(copyDir, this.#dest))
cpxWatch(getCopyGlob(this.#src), this.#dest, { ignore: this.opts.ignore }),
...copyDirs.map(copyDir => cpxWatch(copyDir, this.#dest))
]
if (serve) {
const bs = browserSync.create()
Expand Down
6 changes: 2 additions & 4 deletions lib/build-copy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
* @import { BuildStepResult, BuildStep } from '../builder.js'
*/

// @ts-expect-error
import cpx from 'cpx2'
import { copy } from 'cpx2'
import { join } from 'node:path'
const copy = cpx.copy

/**
* @typedef {BuildStepResult<'static', CopyBuilderReport>} CopyBuildStepResult
Expand Down Expand Up @@ -51,7 +49,7 @@ export async function buildCopy (_src, dest, _siteData, opts) {
const buildError = new Error('Error copying copy folders', { cause: result.reason })
results.errors.push(buildError)
} else {
results.report[copyDir] = result.value
/** @type {Record<string, object>} */ (results.report)[copyDir] = result.value
}
}
return results
Expand Down
6 changes: 2 additions & 4 deletions lib/build-static/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
* @import { BuildStepResult } from '../builder.js'
* @import { BuildStep } from '../builder.js'
*/
// @ts-ignore
import cpx from 'cpx2'
const copy = cpx.copy
import { copy } from 'cpx2'

/**
* @typedef {Awaited<ReturnType<typeof copy>>} StaticBuilderReport
Expand Down Expand Up @@ -42,7 +40,7 @@ export async function buildStatic (src, dest, _siteData, opts) {
}

try {
const report = await copy(getCopyGlob(src), dest, { ignore: opts?.ignore })
const report = await copy(getCopyGlob(src), dest, ...(opts?.ignore ? [{ ignore: opts.ignore }] : []))
results.report = report
} catch (err) {
const buildError = new Error('Error copying static files', { cause: err })
Expand Down
5 changes: 3 additions & 2 deletions lib/helpers/generate-tree-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,9 @@ export function generateTreeData (cwd, src, dest, results) {
if (layoutInfo.layoutClient) targetNode.leaf[layoutInfo.layoutClient.basename] = join(layoutInfo.parentName, layoutInfo.layoutClient.outputName ?? layoutInfo.layoutClient.basename)
}

if (results?.staticResults?.report?.copied) {
for (const file of results?.staticResults?.report?.copied) {
const staticReport = /** @type {{ copied?: Array<{ source: string, output: string }> }} */ (results?.staticResults?.report ?? {})
if (staticReport?.copied) {
for (const file of staticReport.copied) {
const srcFile = relative(srcDir, file.source)
const destFile = relative(destDir, file.output)
const segments = srcFile.split(sep)
Expand Down
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"url": "https://github.com/bcomnes/domstack/issues"
},
"engines": {
"node": ">=22.0.0"
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@voxpelli is this going to screw you up if I release this in a non major release?

"node": "^22.0.0 || >=24.0.0"
},
"dependencies": {
"@11ty/dependency-tree-typescript": "^1.0.0",
Expand All @@ -23,7 +23,7 @@
"browser-sync": "^3.0.2",
"chokidar": "^5.0.0",
"clean-deep": "^3.4.0",
"cpx2": "^8.0.0",
"cpx2": "^9.0.0",
"esbuild": "^0.28.0",
"handlebars": "^4.7.8",
"highlight.js": "^11.9.0",
Expand Down Expand Up @@ -57,20 +57,19 @@
"write-package": "^7.0.1"
},
"devDependencies": {
"c8": "^11.0.0",
"cheerio": "^1.0.0-rc.10",
"@types/browser-sync": "^2.29.0",
"@types/js-yaml": "^4.0.9",
"@types/markdown-it": "^14.1.1",
"@types/markdown-it-footnote": "^3.0.4",
"@types/node": "^25.3.0",
"@voxpelli/tsconfig": "^16.0.0",
"auto-changelog": "^2.4.0",
"cheerio": "^1.0.0-rc.10",
"gh-release": "^7.0.2",
"installed-check": "^10.0.1",
"jsonfeed-to-atom": "^1.2.5",
"neostandard": "^0.13.0",
"npm-run-all2": "^8.0.1",
"npm-run-all2": "^9.0.0",
"typescript": "~5.9.2"
},
"homepage": "https://github.com/bcomnes/domstack",
Expand All @@ -89,7 +88,7 @@
"test": "npm run clean && run-s test:*",
"test:installed-check": "installed-check --ignore-dev",
"test:neostandard": "eslint . --ignore-pattern 'test-cases/build-errors/src/**/*.js' --ignore-pattern 'test-cases/page-build-errors/src/**/*.js'",
"test:node-test": "c8 --reporter=lcov --reporter=text node --test --test-reporter spec",
"test:node-test": "node --test --experimental-test-coverage --test-reporter=spec --test-reporter=lcov --test-reporter-destination=stdout --test-reporter-destination=lcov.info",
"test:tsc": "tsc",
"build-examples": "run-p example:*",
"clean": "run-p clean:*",
Expand Down