Skip to content

Commit

Permalink
Merge 2331ec4 into 4d12abb
Browse files Browse the repository at this point in the history
  • Loading branch information
remarkablemark committed Dec 24, 2020
2 parents 4d12abb + 2331ec4 commit f083679
Show file tree
Hide file tree
Showing 17 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// TypeScript Version: 4.1

export { default } from './lib/html-to-dom-server';
export { default } from './lib/server/html-to-dom';
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
*
* @see {@link https://github.com/substack/node-browserify#browser-field}
*/
module.exports = require('./lib/html-to-dom-server');
module.exports = require('./lib/server/html-to-dom');
4 changes: 2 additions & 2 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ module.exports = config => {
// list of files / patterns to load in the browser
files: [
'dist/htmlparser2.js',
'lib/*.js',
'lib/**/*.js',
'node_modules/domhandler/lib/node.js',
'test/cases/html.js',
'test/client/*.js',
'test/helpers/*.js'
],

// list of files / patterns to exclude
exclude: ['lib/html-to-dom-server.js'],
exclude: ['lib/server/**/*.js'],

// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
Expand Down
2 changes: 1 addition & 1 deletion lib/constants.d.ts → lib/client/constants.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
/**
* SVG elements, unlike HTML elements, are case-sensitive.
*
* @see {@link https://developer.mozilla.org/docs/Web/SVG/Element#SVG_elements_A_to_Z}
* {@link https://developer.mozilla.org/docs/Web/SVG/Element#SVG_elements_A_to_Z}
*/
export const CASE_SENSITIVE_TAG_NAMES: string[];
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"/lib"
],
"browser": {
"./index.js": "./lib/html-to-dom-client.js"
"./index.js": "./lib/client/html-to-dom.js"
},
"license": "MIT"
}
2 changes: 1 addition & 1 deletion test/client/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var assert = window.chai.assert;
var htmlCases = require('../cases/html');
var serverParser = require('../../dist/htmlparser2').parseDOM;
var clientParser = require('../../lib/html-to-dom-client');
var clientParser = require('../../lib/client/html-to-dom');
var helpers = require('../helpers');

describe('client parser', function () {
Expand Down
4 changes: 2 additions & 2 deletions test/server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { assert } = require('chai');
const htmlparser = require('htmlparser2');
const cases = require('../cases');
const { runTests, throwErrors } = require('../helpers');
const { CASE_SENSITIVE_TAG_NAMES } = require('../../lib/constants');
const { CASE_SENSITIVE_TAG_NAMES } = require('../../lib/client/constants');

/**
* Tests case-sensitive tags (SVG) to make sure their case is preserved.
Expand Down Expand Up @@ -32,7 +32,7 @@ describe('client parser in jsdom', () => {
// before
const jsdomify = require('jsdomify').default;
jsdomify.create();
const clientParser = require('../../lib/html-to-dom-client');
const clientParser = require('../../lib/client/html-to-dom');

// tests
throwErrors(assert, clientParser);
Expand Down
14 changes: 9 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@
"baseUrl": ".",
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"paths": { "html-dom-parser": ["."], "html-dom-parser/lib/*": ["./lib/*"] }
"paths": {
"html-dom-parser": ["."],
"html-dom-parser/lib/*": ["./lib/*"]
}
},
"files": [
"index.d.ts",
"lib/domparser.d.ts",
"lib/html-to-dom-client.d.ts",
"lib/html-to-dom-server.d.ts",
"lib/utilities.d.ts",
"lib/client/constants.d.ts",
"lib/client/domparser.d.ts",
"lib/client/html-to-dom.d.ts",
"lib/client/utilities.d.ts",
"lib/server/html-to-dom.d.ts",
"test/types/index.test.ts"
]
}

0 comments on commit f083679

Please sign in to comment.