Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Commit 85cdc4b

Browse files
author
Ives van Hoorne
committed
Add build script
1 parent 7041665 commit 85cdc4b

24 files changed

+17
-11
lines changed

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
"author": "Ives van Hoorne",
99
"license": "MIT",
1010
"scripts": {
11-
"test": "jest",
12-
"test:watch": "jest --watch"
11+
"test": "yarn build && jest",
12+
"test:watch": "jest --watch",
13+
"build": "rimraf dist && tsc -p tsconfig.json"
1314
},
1415
"dependencies": {
1516
"axios": "^0.16.2",
@@ -44,6 +45,7 @@
4445
"@types/sockjs-node": "^0.3.28",
4546
"@types/update-notifier": "^1.0.1",
4647
"jest": "^20.0.4",
48+
"rimraf": "^2.6.1",
4749
"ts-jest": "^20.0.6",
4850
"tslint": "^5.4.3",
4951
"tslint-config-prettier": "^1.1.0",

lib/cfg.ts renamed to src/cfg.ts

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

lib/utils/api.ts renamed to src/utils/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import axios, { AxiosRequestConfig } from 'axios';
2-
import * as values from 'lodash.values';
2+
import { values } from 'lodash';
33

44
import { getToken } from '../cfg';
55
import { CREATE_SANDBOX_URL, GET_USER_URL } from './url';
File renamed without changes.
File renamed without changes.

lib/utils/parse-sandbox/html-parser.ts renamed to src/utils/parse-sandbox/html-parser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function getJsResource(line: string): string | undefined {
5050
*
5151
* @param {string} html
5252
*/
53-
function getExternalResources(html: string): string[] {
53+
function getExternalResources(html: string) {
5454
return html
5555
.split('\n')
5656
.map(line => getCssResource(line) || getJsResource(line))
@@ -79,7 +79,7 @@ function getBodyContent(html: string): string | undefined {
7979
* @param {string} html
8080
*/
8181
export default function parseHTML(html: string) {
82-
const externalResources = getExternalResources(html);
82+
const externalResources = getExternalResources(html) as string[];
8383
const bodyContent = getBodyContent(html);
8484

8585
return {
File renamed without changes.
File renamed without changes.

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"compilerOptions": {
33
/* Basic Options */
4-
"target": "es2016", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */
4+
"target": "es3", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */
55
"module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */
66
"lib": [
77
"es2015"
@@ -48,7 +48,7 @@
4848
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
4949
},
5050
"include": [
51-
"lib/**/*.ts",
51+
"src/**/*.ts",
5252
"typings/**/*.ts"
5353
],
5454
"exclude": [

typings/deps/detect-port.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ declare module 'detect-port' {
66
_port: number,
77
) => void): void;
88
}
9-
declare const detectPort: DetectPort;
9+
const detectPort: DetectPort;
1010
export = detectPort;
1111
}

typings/deps/pacote.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
declare module 'pacote' {
2-
export declare function manifest(
2+
export function manifest(
33
dependency: string,
44
): Promise<{ [key: string]: string }>;
55
}

typings/deps/sockjs.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ declare module 'sockjs' {
1212
disconnect_delay?: number;
1313
}
1414

15-
export declare function createServer(options?: ServerOptions): Server;
15+
export function createServer(options?: ServerOptions): Server;
1616

1717
export interface Server extends NodeJS.EventEmitter {
1818
installHandlers(server: http.Server, options?: ServerOptions): any;

typings/extensions/json.d.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
declare module '*.json' {
2-
export = any;
2+
const package: {
3+
name: string;
4+
version: string;
5+
};
6+
export = package;
37
}

0 commit comments

Comments
 (0)