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

chore: migrate to `dist` folder

BREAKING CHANGE: The `build` folder has been renamed to `dist`.

This affects API users only and in general should not be an issue unless
importing files via full path. In that case replace `import
'html-validate/build/...'` with `import 'html-validate/dist/...` but in general
those imports are discouraged.

Instead users should import only via `import { ... } from "html-validate"` and file an issue
if an export is missing.

This does not affect the `elements` imports which is considered a safe to import
as-is.
parent 4904eba6
Pipeline #211932394 passed with stages
in 10 minutes and 2 seconds
build/
dist/
node_modules/
public/assets/
......@@ -2,7 +2,7 @@
/*.tgz
/.nyc_output/
/.tscache/
/build
/dist
/coverage
/node_modules
/public
......
......@@ -27,7 +27,7 @@ Build:
artifacts:
name: ${CI_PROJECT_PATH_SLUG}-${CI_PIPELINE_ID}-build
paths:
- build/
- dist/
script:
- npm run build
......
......@@ -3,7 +3,7 @@
/package-lock.json
# compiled files
/build
/dist
/coverage
/public/**/*.html
/public/assets
......
#!/usr/bin/env node
"use strict";
require("../build/cli/html-validate");
require("../dist/cli/html-validate");
......@@ -99,7 +99,7 @@ formatted string:
```typescript
import { HtmlValidate } from "html-validate";
import text from "html-validate/build/formatters/text";
import text from "html-validate/dist/formatters/text";
const htmlvalidate = new HtmlValidate();
const report = htmlvalidate.validateFile("myfile.html");
......@@ -111,7 +111,7 @@ Using the CLI API there is a factory function to retrieve formatters (see
`html-validate --help` for details about the format):
```typescript
import { getFormatter } from "html-validate/build/cli/formatter";
import { getFormatter } from "html-validate/dist/cli/formatter";
const stylish = getFormatter("stylish");
console.log(stylish(report));
......@@ -150,7 +150,7 @@ tests:
```typescript
import { HtmlValidate } from "html-validate";
import "html-validate/build/matchers";
import "html-validate/jest";
const config = {
rules: {
......
const chalk = require("chalk");
const HtmlValidate = require("../../../../build/htmlvalidate").default;
const codeframe = require("../../../../build/formatters/codeframe").default;
const HtmlValidate = require("../../../../dist/htmlvalidate").default;
const codeframe = require("../../../../dist/formatters/codeframe").default;
module.exports = function generateValidationResultsProcessor(log, validateMap) {
return {
......
const a17y = require("../../../build/config/presets/a17y");
const document = require("../../../build/config/presets/document");
const recommended = require("../../../build/config/presets/recommended");
const standard = require("../../../build/config/presets/standard");
const a17y = require("../../../dist/config/presets/a17y");
const document = require("../../../dist/config/presets/document");
const recommended = require("../../../dist/config/presets/recommended");
const standard = require("../../../dist/config/presets/standard");
/* sort order */
const availablePresets = ["recommended", "standard", "a17y", "document"];
......
......@@ -44,7 +44,7 @@ it("should give error when using <div> as content", () => {
When using Jest in particular there are helper functions to make it even easier:
```js
require("html-validate/build/matchers");
require("html-validate/jest");
it("should give error when using <div> as content", () => {
const report = htmlvalidate.validateString("<my-component><div>lorem ipsum</div></my-component>");
......
/* eslint-disable-next-line import/export, import/no-unresolved */
export * from "./build/matchers";
export * from "./dist/matchers";
module.exports = require("./build/matchers");
module.exports = require("./dist/matchers");
......@@ -18,7 +18,7 @@
"bugs": {
"url": "https://gitlab.com/html-validate/html-validate/issues/new"
},
"main": "build/shim.js",
"main": "dist/shim.js",
"engines": {
"node": ">= 10.0"
},
......@@ -27,7 +27,7 @@
},
"files": [
"bin",
"build",
"dist",
"elements",
"jest.{js,d.ts}",
"!*.snap",
......@@ -35,7 +35,7 @@
"!*.spec.js",
"!*.spec.ts",
"!__mocks__",
"!build/rules/**/*.d.ts"
"!dist/rules/**/*.d.ts"
],
"scripts": {
"build": "tsc",
......
......@@ -204,7 +204,7 @@ Multiple formatters can be specified with a comma-separated list,
e.g. "json,checkstyle" to enable both.
To capture output to a file use "formatter=/path/to/file",
e.g. "checkstyle=build/html-validate.xml"
e.g. "checkstyle=dist/html-validate.xml"
`);
}
......
......@@ -7,7 +7,7 @@
"lib": ["es2017"],
"module": "commonjs",
"noImplicitAny": true,
"outDir": "build",
"outDir": "dist",
"resolveJsonModule": true,
"sourceMap": false,
"target": "es2017",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment