Commit 3e4759e4 authored by David Sveningsson's avatar David Sveningsson
Browse files

feat(cli): cli uses esm (with `esmResolver`)

BREAKING CHANGE: CLI uses ESM (with `esmResolver`). For most part this shouldn't
affect anything but in some cases you might need slight configuration
migration. See Migration Guide for details.

refactor(cli): use ESM in CLI
parent 81b47770
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -263,6 +263,7 @@ Module:
  script:
    - npm exec tsc -- --build tests/integration/${BUILD}
    - node tests/integration/${BUILD}
    - npm exec html-validate tests/integration/${BUILD}-cli

.release:
  stage: release

bin/html-validate.js

deleted100755 → 0
+0 −4
Original line number Diff line number Diff line
#!/usr/bin/env node
"use strict";

require("../dist/cjs/html-validate");

bin/html-validate.mjs

0 → 100755
+3 −0
Original line number Diff line number Diff line
#!/usr/bin/env node

import "../dist/es/html-validate.js";
+25 −1
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@
      "license": "MIT",
      "workspaces": [
        "docs",
        "tests/integration/cjs-cli",
        "tests/integration/esm-cli",
        "tests/vitest"
      ],
      "dependencies": {
@@ -31,7 +33,7 @@
        "semver": "^7.0.0"
      },
      "bin": {
        "html-validate": "bin/html-validate.js"
        "html-validate": "bin/html-validate.mjs"
      },
      "devDependencies": {
        "@babel/code-frame": "7.26.2",
@@ -6306,6 +6308,10 @@
        "node": ">= 0.10"
      }
    },
    "node_modules/cjs-cli": {
      "resolved": "tests/integration/cjs-cli",
      "link": true
    },
    "node_modules/cjs-module-lexer": {
      "version": "1.4.1",
      "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.4.1.tgz",
@@ -8605,6 +8611,10 @@
        "url": "https://github.com/sponsors/sindresorhus"
      }
    },
    "node_modules/esm-cli": {
      "resolved": "tests/integration/esm-cli",
      "link": true
    },
    "node_modules/espree": {
      "version": "9.6.1",
      "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz",
@@ -9603,6 +9613,10 @@
      "dev": true,
      "license": "MIT"
    },
    "node_modules/html-validate": {
      "resolved": "",
      "link": true
    },
    "node_modules/htmlescape": {
      "version": "1.1.1",
      "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz",
@@ -17884,6 +17898,16 @@
        "url": "https://github.com/sponsors/sindresorhus"
      }
    },
    "tests/integration/cjs-cli": {
      "dependencies": {
        "html-validate": "file:../../../"
      }
    },
    "tests/integration/esm-cli": {
      "dependencies": {
        "html-validate": "file:../../../"
      }
    },
    "tests/vitest": {
      "name": "tests-vitest",
      "devDependencies": {
+4 −2
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@
  "module": "dist/es/index.js",
  "browser": "dist/cjs/browser.js",
  "bin": {
    "html-validate": "bin/html-validate.js"
    "html-validate": "bin/html-validate.mjs"
  },
  "files": [
    "bin",
@@ -97,6 +97,8 @@
  ],
  "workspaces": [
    "docs",
    "tests/integration/cjs-cli",
    "tests/integration/esm-cli",
    "tests/vitest"
  ],
  "scripts": {
@@ -114,7 +116,7 @@
    "postdocs": "tsc -b docs/examples",
    "eslint": "eslint --cache .",
    "eslint:fix": "eslint --cache --fix .",
    "htmlvalidate": "node ./bin/html-validate.js",
    "htmlvalidate": "node ./bin/html-validate.mjs",
    "prepublishOnly": "release-prepublish --bundle",
    "postpublish": "release-postpublish",
    "prepare": "husky && npm run codegen",
Loading