Skip to content
This repository has been archived by the owner on Jan 8, 2023. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Nov 4, 2020
2 parents 1bcd69a + 4eae200 commit 5e40365
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 5 deletions.
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
transform: {
'^.+\\.(t|j)sx?$': 'ts-jest',
},
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(tsx?)$',
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.((j|t)sx?)$',
moduleFileExtensions: ['js', 'ts', 'tsx', 'json', 'node'],
globals: {
'ts-jest': {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "html2sketch-browserless",
"version": "0.5.4",
"version": "0.5.5",
"description": "Convert any website into sketch json",
"scripts": {
"dev": "npm run prebuild && tsc --watch",
Expand Down Expand Up @@ -28,6 +28,7 @@
"np": "^6.5.0",
"prettier": "^1.18.2",
"ts-jest": "^24.0.2",
"ts-loader": "^8.0.8",
"tslint": "^5.18.0",
"tslint-config-prettier": "^1.18.0",
"typescript": "^3.9.6",
Expand Down
18 changes: 18 additions & 0 deletions test/node2SketchSymbol.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const { resolve } = require('path');
const x = require(resolve(__dirname, '../lib'));

const fn = async () => {
const node2SketchSymbol = x.initNode2SketchSymbol(
resolve(__dirname, './html/doc'),
'/_embed_demos/eddb3b71',
{ headless: false }
);

function func(document) {
return document.getElementsByTagName('button')[0];
}
const json = await node2SketchSymbol(func);
console.log(json);
};

fn();
File renamed without changes.
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"include": ["src"],
"exclude": ["node_modules", "src/node2Symbol.ts"],
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"target": "ES5",
"module": "CommonJS",
"outDir": "./lib",
"sourceMap": true,
"declaration": true,
Expand Down
8 changes: 7 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
const { resolve } = require('path');
module.exports = {
entry: './src/node2Symbol.ts',
mode: 'production',

module: {
rules: [
{ test: /\.ts$/, loader: 'ts-loader' },
],
},
output: {
path: resolve(__dirname, './resources'),
filename: 'node2Symbol.bundle.js',
library: 'node2Symbol',
},
Expand Down

0 comments on commit 5e40365

Please sign in to comment.