Skip to content

Commit b7035f5

Browse files
committed
build!: add build scripts
1 parent da58327 commit b7035f5

File tree

8 files changed

+1329
-9
lines changed

8 files changed

+1329
-9
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
npm
12
*.exe
2-
node_modules
3+
node_modules
4+
tsconfig.tsbuildinfo

core/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const foo = 1

main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,4 @@ func main() {
3030
}
3131
print(bytefmt.ByteSize(uint64(size)))
3232
}
33-
3433
}

npm/index.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

package.json

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,32 @@
22
"name": "go-get-folder-size",
33
"version": "0.0.2",
44
"description": "Get the size of a folder by recursively iterating through all its sub(files && folders). Use go, so high-speed",
5-
"main": "npm/index.js",
5+
"main": "./npm/index.cjs",
6+
"module": "./npm/index.mjs",
7+
"types": "./npm/index.d.ts",
8+
"files": [
9+
"npm"
10+
],
11+
"repository": {
12+
"type": "git",
13+
"url": "git+https://github.com/markthree/go-get-folder-size.git"
14+
},
15+
"exports": {
16+
".": {
17+
"require": "./npm/index.cjs",
18+
"import": "./npm/index.mjs",
19+
"types": "./npm/index.d.ts"
20+
}
21+
},
622
"scripts": {
7-
"test": "TODO",
8-
"build": "TODO",
9-
"release": "bumpp --push --tag --all"
23+
"play-go": "go run",
24+
"build-types": "tsc",
25+
"build-go": "go build",
26+
"build-ts": "vite build",
27+
"play-ts": "tsx core/index.ts",
28+
"release": "bumpp --push --tag --all",
29+
"build": "rimraf -rf npm && run-p build-ts build-go-wasm build-types",
30+
"build-go-wasm": "cross-env GOOS=js GOARCH=wasm && go build -o ./npm/core.wasm ./core/index.go"
1031
},
1132
"keywords": [
1233
"go",
@@ -22,6 +43,12 @@
2243
},
2344
"license": "MIT",
2445
"devDependencies": {
25-
"bumpp": "^8.2.1"
46+
"bumpp": "^8.2.1",
47+
"cross-env": "^7.0.3",
48+
"npm-run-all": "^4.1.5",
49+
"rimraf": "^4.1.2",
50+
"tsx": "^3.12.2",
51+
"typescript": "^4.9.4",
52+
"vite": "^4.0.4"
2653
}
27-
}
54+
}

0 commit comments

Comments
 (0)