Update build script to minimize js

This commit is contained in:
Pijus Kamandulis 2020-01-20 21:12:25 +02:00
parent 4e7093250f
commit 3ac05993af
4 changed files with 72 additions and 8 deletions

View File

@ -15,30 +15,35 @@ jobs:
go-version: 1.13 go-version: 1.13
id: go id: go
- name: Set up node 10
uses: actions/setup-node@v1
with:
node-version: '10.x'
- name: Check out code into the Go module directory - name: Check out code into the Go module directory
uses: actions/checkout@v1 uses: actions/checkout@v1
- name: Get dependencies - name: Get dependencies
run: | run: |
go get -v -t -d ./... npm install
npm run install-dependencies
- name: Run unit tests
run: npm run test
- name: Build - name: Build
run: go build -v . run: npm run build:dist
- name: Run tests
run: |
go test -v ./models
- name: Upload Unix Artifacts - name: Upload Unix Artifacts
if: startsWith(matrix.os, 'ubuntu-') if: startsWith(matrix.os, 'ubuntu-')
uses: actions/upload-artifact@v1 uses: actions/upload-artifact@v1
with: with:
name: tiktok-dl_linux name: tiktok-dl_linux
path: tiktok-dl path: out
- name: Upload Windows Artifacts - name: Upload Windows Artifacts
if: startsWith(matrix.os, 'windows-') if: startsWith(matrix.os, 'windows-')
uses: actions/upload-artifact@v1 uses: actions/upload-artifact@v1
with: with:
name: tiktok-dl_win64 name: tiktok-dl_win64
path: tiktok-dl.exe path: out

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
.vscode .vscode
node_modules
__debug_bin __debug_bin
downloads downloads
*.exe *.exe

42
package-lock.json generated Normal file
View File

@ -0,0 +1,42 @@
{
"name": "tiktok-dl",
"version": "0.0.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"buffer-from": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A=="
},
"commander": {
"version": "2.20.3",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="
},
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
},
"source-map-support": {
"version": "0.5.16",
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.16.tgz",
"integrity": "sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ==",
"requires": {
"buffer-from": "^1.0.0",
"source-map": "^0.6.0"
}
},
"terser": {
"version": "4.6.3",
"resolved": "https://registry.npmjs.org/terser/-/terser-4.6.3.tgz",
"integrity": "sha512-Lw+ieAXmY69d09IIc/yqeBqXpEQIpDGZqT34ui1QWXIUpR2RjbqEkT8X7Lgex19hslSqcWM5iMN2kM11eMsESQ==",
"requires": {
"commander": "^2.20.0",
"source-map": "~0.6.1",
"source-map-support": "~0.5.12"
}
}
}
}

16
package.json Normal file
View File

@ -0,0 +1,16 @@
{
"name": "tiktok-dl",
"version": "0.0.1",
"scripts": {
"install-dependencies": "go get -v -t -d ./...",
"test": "go test -v ./models",
"clean": "rm -rf out",
"build:scraper": "node node_modules/terser/bin/terser -c -m -- scraper.js > out/scraper.js",
"build:app": "go build -o out/ -v .",
"build:dist": "mkdir out && npm run build:app && npm run build:scraper",
"build": "go build -v ."
},
"dependencies": {
"terser": "^4.6.3"
}
}