Skip to content

Commit 3182c44

Browse files
authored
Merge pull request #4 from sbillig/master
WIP: simplify and speed up build process
2 parents 4143fda + 340e984 commit 3182c44

File tree

4 files changed

+31
-111
lines changed

4 files changed

+31
-111
lines changed

package.json

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,29 @@
66
"source": "src/index.ts",
77
"main": "dist/index.js",
88
"module": "dist/index.esm.js",
9-
"types": "decl/index.d.ts",
9+
"types": "dist/index.d.ts",
1010
"repository": {
1111
"type": "git",
1212
"url": "https://github.com/hyperhyperspace/hyperhyperspace-core.git"
1313
},
1414
"scripts": {
15-
"build": "npx microbundle-crl --tsconfig tsconfig.build.json && npx tsc --project tsconfig.build.json --declaration --outDir ./decl",
16-
"build-test": "npx microbundle-crl --tsconfig tsconfig.json --output dist-test",
17-
"build-examples": "npx tsc --module CommonJs --project tsconfig.json --outDir ./dist-examples",
18-
"example-chat": "NODE_PATH=\"dist-examples/src:dist-examples/examples/chat\" node ./dist-examples/examples/chat/index.js",
19-
"example-chat-win": "./scripts/chat.bat",
20-
"example-beacon": "NODE_PATH=\"dist-examples/src:dist-examples/examples/chat\" node ./dist-examples/examples/randomness-beacon/index.js",
21-
"example-beacon-win": "./scripts/beacon.bat",
22-
"clean": "rm -rf ./decl/* ./dist/* ./dist-test/* ./dist-examples/*",
23-
"winclean": "if exist decl (rmdir decl /s /q) && mkdir decl && if exist dist (rmdir dist /s /q) && mkdir dist && if exist dist-test (rmdir dist-test /s /q) && mkdir dist-test && if exist dist-examples (rmdir dist-examples /s /q) && mkdir dist-examples",
15+
"build": "ttsc",
16+
"clean": "rm -rf ./dist/*",
2417
"test": "npx jest"
2518
},
2619
"devDependencies": {
2720
"@hyper-hyper-space/node-env": "^0.8.0",
2821
"@subspace/vdf": "^0.1.0",
2922
"@types/jest": "^26.0.19",
23+
"@types/node": "^14.0.13",
3024
"@types/ws": "^7.2.6",
31-
"dts-generator": "^3.0.0",
25+
"@zerollup/ts-transform-paths": "^1.7.18",
3226
"jest": "^26.6.3",
33-
"microbundle-crl": "^0.13.11",
3427
"ts-jest": "^26.4.4",
28+
"ttypescript": "^1.5.12",
3529
"typescript": "^4.1.2"
3630
},
3731
"dependencies": {
38-
"@types/node": "^14.0.13",
3932
"chacha-js": "^2.1.1",
4033
"get-random-values": "^1.2.0",
4134
"idb": "^5.0.4",
@@ -58,7 +51,7 @@
5851
],
5952
"globals": {
6053
"ts-jest": {
61-
"tsconfig": "tsconfig.json"
54+
"tsconfig": "tsconfig.test.json"
6255
}
6356
}
6457
}

tsconfig.build.json

Lines changed: 0 additions & 80 deletions
This file was deleted.

tsconfig.json

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
/* Visit https://aka.ms/tsconfig.json to read more about this file */
44

55
/* Basic Options */
6-
// "incremental": true, /* Enable incremental compilation */
7-
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
6+
"incremental": true, /* Enable incremental compilation */
7+
"target": "es2015", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
88
"module": "ESNext", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
99
"lib": ["dom", "esnext"], /* Specify library files to be included in the compilation. */
1010
// "allowJs": true, /* Allow javascript files to be compiled. */
1111
// "checkJs": true, /* Report errors in .js files. */
1212
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
1313
"declaration": true, /* Generates corresponding '.d.ts' file. */
14-
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
15-
// "sourceMap": true, /* Generates corresponding '.map' file. */
14+
"declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
15+
"sourceMap": true, /* Generates corresponding '.map' file. */
1616
// "outFile": "./", /* Concatenate and emit output to single file. */
17-
"outDir": "./dist-test", /* Redirect output structure to the directory. */
17+
"outDir": "./dist", /* Redirect output structure to the directory. */
1818
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
1919
// "composite": true, /* Enable project compilation */
2020
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
@@ -42,12 +42,11 @@
4242

4343
/* Module Resolution Options */
4444
"moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
45-
"baseUrl": "./", /* Base directory to resolve non-absolute module names. */
46-
"paths": {
47-
"*" : ["src/*", "node_modules/*", "test/*", "examples/*"]
48-
/* "target/node/*", */
49-
}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
50-
//"rootDirs": ["src", "test"], /* List of root folders whose combined content represents the structure of the project at runtime. */
45+
"baseUrl": "./", /* Base directory to resolve non-absolute module names. */
46+
"paths": {
47+
"*": ["./src/*"]
48+
}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
49+
//"rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
5150
// "typeRoots": [ "./types", "./node_modules/@types" ], /* List of folders to include type definitions from. */
5251
// "types": [], /* Type declaration files to be included in compilation. */
5352
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
@@ -67,11 +66,11 @@
6766

6867
/* Advanced Options */
6968
"skipLibCheck": true, /* Skip type checking of declaration files. */
70-
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
69+
"forceConsistentCasingInFileNames": true, /* Disallow inconsistently-cased references to the same file. */
70+
"plugins": [
71+
{ "transform": "@zerollup/ts-transform-paths" }
72+
]
7173
},
72-
"files": [ "examples/chat/index.ts" ],
73-
//"files": [ "src/index.ts" ],
74-
//"include": [ "./types/*" ]
75-
"include": [ "./types/*", "./src/**/*", "./test/**/*", "./examples/**/*" ]
76-
/* "./target/node/*", */
74+
"files": [ "src/index.ts" ],
75+
"include": [ "./types/*" ]
7776
}

tsconfig.test.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"paths": {
5+
"*": ["./src/*", "./test/*", "./examples/*"]
6+
},
7+
},
8+
}

0 commit comments

Comments
 (0)