Skip to content

Commit 989a122

Browse files
bertschneiderkyakdan
authored andcommitted
Build fuzzer package with TypeScript
This prepares a switch from the fuzzer package to TypeScript to provide types of the native plugin to other packages.
1 parent a3acfba commit 989a122

File tree

9 files changed

+19
-87
lines changed

9 files changed

+19
-87
lines changed

.eslintignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dist
2+
build
23
coverage
34
node_modules
4-
packages/fuzzer/build
55
.idea

.gitignore

+5-64
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
.idea
2+
3+
# Build dir
4+
dist
5+
26
# Logs
37
logs
48
*.log
59
npm-debug.log*
6-
yarn-debug.log*
7-
yarn-error.log*
8-
lerna-debug.log*
910

1011
# Diagnostic reports (https://nodejs.org/api/report.html)
1112
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
@@ -16,34 +17,18 @@ pids
1617
*.seed
1718
*.pid.lock
1819

19-
# Directory for instrumented libs generated by jscoverage/JSCover
20-
lib-cov
21-
2220
# Coverage directory used by tools like istanbul
2321
coverage
2422
*.lcov
2523

2624
# nyc test coverage
2725
.nyc_output
2826

29-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
30-
.grunt
31-
32-
# Bower dependency directory (https://bower.io/)
33-
bower_components
34-
35-
# node-waf configuration
36-
.lock-wscript
37-
3827
# Compiled binary addons (https://nodejs.org/api/addons.html)
39-
build/Release
28+
build
4029

4130
# Dependency directories
4231
node_modules/
43-
jspm_packages/
44-
45-
# TypeScript v1 declaration files
46-
typings/
4732

4833
# TypeScript cache
4934
*.tsbuildinfo
@@ -54,52 +39,8 @@ typings/
5439
# Optional eslint cache
5540
.eslintcache
5641

57-
# Microbundle cache
58-
.rpt2_cache/
59-
.rts2_cache_cjs/
60-
.rts2_cache_es/
61-
.rts2_cache_umd/
62-
6342
# Optional REPL history
6443
.node_repl_history
6544

6645
# Output of 'npm pack'
6746
*.tgz
68-
69-
# Yarn Integrity file
70-
.yarn-integrity
71-
72-
# dotenv environment variables file
73-
.env
74-
.env.test
75-
76-
# parcel-bundler cache (https://parceljs.org/)
77-
.cache
78-
79-
# Next.js build output
80-
.next
81-
82-
# Nuxt.js build / generate output
83-
.nuxt
84-
dist
85-
86-
# Gatsby files
87-
.cache/
88-
# Comment in the public line in if your project uses Gatsby and *not* Next.js
89-
# https://nextjs.org/blog/next-9-1#public-directory-support
90-
# public
91-
92-
# vuepress build output
93-
.vuepress/dist
94-
95-
# Serverless directories
96-
.serverless/
97-
98-
# FuseBox cache
99-
.fusebox/
100-
101-
# DynamoDB Local files
102-
.dynamodb/
103-
104-
# TernJS port file
105-
.tern-port

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v14
1+
v16

.prettierignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dist
2+
build
23
coverage
34
node_modules
4-
packages/fuzzer/build
55
.idea

packages/fuzzer/.dir-locals.el

-4
This file was deleted.

packages/fuzzer/.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
build
2-
prebuilds
2+
prebuilds

packages/fuzzer/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
"license": "Apache-2.0",
77
"main": "fuzzer.js",
88
"scripts": {
9-
"test": "node test_fuzzer.js",
9+
"test": "node ../../dist/fuzzer/test_fuzzer.js",
1010
"prebuild": "prebuild --runtime napi --backend cmake-js --all --strip --verbose",
1111
"upload": "prebuild --runtime napi --backend cmake-js --all --strip --upload ${GITHUB_TOKEN}",
12-
"install": "prebuild-install --runtime napi || cmake-js rebuild",
13-
"compile": "cmake-js compile"
12+
"install": "prebuild-install --runtime napi || cmake-js rebuild --out ../../build",
13+
"compile": "cmake-js compile --out ../../build"
1414
},
1515
"dependencies": {
1616
"bindings": "^1.5.0",

scripts/test.sh

+5-6
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@ set -e
44
echo "Running jest tests"
55
npm run test
66

7-
echo "Building the native fuzzer addon"
8-
#npm run compile --workspace=packages/fuzzer
9-
cd packages/fuzzer
10-
npm install
7+
echo "Transpile TypeScript files"
118
npm run compile
129

10+
echo "Building the native fuzzer addon"
11+
npm run compile --workspace=packages/fuzzer
12+
1313
echo "Running addon tests"
14-
#npm run test --workspace=packages/fuzzer
15-
npm run test
14+
npm run test --workspace=packages/fuzzer

tsconfig.json

+2-6
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@
1717
"@fuzzy-eagle/instrumentor": ["./packages/instrumentor"]
1818
}
1919
},
20-
"include": [
21-
"packages/cli/**/*.ts",
22-
"packages/instrumentor/**/*.ts",
23-
"packages/fuzzer/**/*.ts"
24-
],
25-
"exclude": ["node_modules", "packages/fuzzer/build"]
20+
"include": ["packages/**/*.ts"],
21+
"exclude": ["node_modules"]
2622
}

0 commit comments

Comments
 (0)