Skip to content

Commit b89a640

Browse files
authored
Merge pull request #83 from atom-community/bump
2 parents 151153d + 7a705bf commit b89a640

File tree

8 files changed

+3691
-1982
lines changed

8 files changed

+3691
-1982
lines changed

.github/workflows/CI.yml

Lines changed: 84 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,29 @@ on:
66
- master
77

88
jobs:
9-
Build:
9+
JS_BUILD:
10+
if: "!contains(github.event.head_commit.message, '[skip ci]')"
11+
runs-on: ubuntu-latest
12+
env:
13+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14+
steps:
15+
- uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Install dependencies and build JS
20+
run: |
21+
npm install
22+
npm run build.js
23+
24+
- name: Upload artifacts
25+
uses: actions/upload-artifact@v2
26+
with:
27+
path: |
28+
./*.js
29+
./*.d.ts
30+
31+
NATIVE_Build:
1032
if: "!contains(github.event.head_commit.message, '[skip ci]')"
1133
runs-on: ${{ matrix.os }}
1234
strategy:
@@ -16,17 +38,31 @@ jobs:
1638
- ubuntu-20.04
1739
- macos-11.0
1840
- windows-latest
19-
node_version:
41+
node:
2042
- 12
21-
node_arch:
43+
arch:
2244
- x64
45+
prebuild_cmd:
46+
- npm run prebuild.native
47+
docker:
48+
- ""
2349
include:
2450
- os: windows-2016
25-
node_version: 12
26-
node_arch: x86
51+
node: 12
52+
arch: x86
53+
prebuild_cmd: npm run prebuild.native.ia32
54+
- os: ubuntu-20.04
55+
docker: node:12-alpine
56+
arch: x64
57+
apk: python3 make gcc g++ musl-dev
58+
node: 12
59+
prebuild_cmd: npm run prebuild.native
2760
# - os: macos-11.0
28-
# node_version: 15
29-
# node_arch: arm64
61+
# node: 15
62+
# arch: arm64
63+
# prebuild_cmd: npm run prebuild.native-arm64
64+
65+
name: ${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.docker }}-${{ matrix.node }}
3066
steps:
3167
- uses: actions/checkout@v2
3268

@@ -36,7 +72,14 @@ jobs:
3672
cache-name: node_modules
3773
with:
3874
path: node_modules
39-
key: ${{ runner.os }}-${{ matrix.node_version }}-${{ matrix.node_arch }}-${{ hashFiles('package.json') }}
75+
key: ${{ runner.os }}-${{ matrix.node }}-${{ matrix.arch }}-${{ hashFiles('package.json') }}
76+
77+
- name: Install Docker
78+
if: ${{ matrix.docker }}
79+
run: |
80+
docker login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} ghcr.io
81+
docker pull ${{ matrix.docker }}
82+
docker tag ${{ matrix.docker }} builder
4083
4184
# - name: Install Compiler for Ubuntu 16.04
4285
# if: ${{ contains(matrix.os, 'ubuntu-16.04') }}
@@ -53,33 +96,34 @@ jobs:
5396
# echo "CXX=clang++" >> $GITHUB_ENV
5497

5598
- name: Install Node
56-
uses: actions/setup-node@v2.1.3
99+
if: ${{ !matrix.docker }}
100+
uses: actions/setup-node@v2
57101
with:
58-
node-version: ${{ matrix.node_version }}
59-
architecture: ${{ matrix.node_arch }}
102+
node-version: ${{ matrix.node }}
103+
architecture: ${{ matrix.arch }}
60104

61-
- name: Install dependencies and build
62-
run: npm install
105+
- name: Install dependencies
106+
run: npm install --ignore-scripts
63107

64-
- name: Prebuildify x64
65-
if: ${{ contains(matrix.node_version, '12') && contains(matrix.node_arch, 'x64') }}
66-
run: npm run native.prebuild
108+
- name: Build native
109+
if: ${{ !matrix.docker }}
110+
run: npm run build.native
67111

68-
- name: Prebuildify x86
69-
if: ${{ contains(matrix.node_version, '12') && contains(matrix.node_arch, 'x86') }}
70-
run: npm run native.prebuild-ia32
112+
- name: Prebuildify
113+
if: ${{ !matrix.docker }}
114+
run: ${{ matrix.prebuild_cmd }}
71115

72-
# - name: Prebuildify arm64
73-
# if: ${{ contains(matrix.node_version, '15') && contains(matrix.node_arch, 'arm64') }}
74-
# run: npm run native.prebuild-arm64
116+
- name: Prebuildify Docker
117+
if: ${{ matrix.docker }}
118+
run: docker run --volume ${{ github.workspace }}:/projectdir --workdir /projectdir --privileged builder sh -c "apk add --no-cache ${{ matrix.apk }} && ${{ matrix.prebuild_cmd }}"
75119

76120
- name: Upload artifacts
77-
uses: actions/upload-artifact@v2.0.1
121+
uses: actions/upload-artifact@v2
78122
with:
79123
path: ./prebuilds
80124

81125
Test:
82-
needs: Build
126+
needs: [NATIVE_Build, JS_BUILD]
83127
if: "!contains(github.event.head_commit.message, '[skip ci]')"
84128
runs-on: ${{ matrix.os }}
85129
strategy:
@@ -89,24 +133,24 @@ jobs:
89133
- ubuntu-20.04
90134
- macos-11.0
91135
- windows-latest
92-
node_version:
136+
node:
93137
- 10
94138
- 12
95139
- 14
96-
node_arch:
140+
arch:
97141
- x64
98142
include:
99143
- os: windows-2016
100-
node_version: 12
101-
node_arch: x86
144+
node: 12
145+
arch: x86
102146
- os: ubuntu-16.04
103-
node_version: 12
147+
node: 12
104148
- os: macos-10.15
105-
node_version: 12
149+
node: 12
106150
# Node arm64 doesn't exist yet
107151
# - os: macos-11.0
108-
# node_version: 15
109-
# node_arch: arm64
152+
# node: 15
153+
# arch: arm64
110154
steps:
111155
- uses: actions/checkout@v2
112156

@@ -116,18 +160,17 @@ jobs:
116160
cache-name: node_modules
117161
with:
118162
path: node_modules
119-
key: ${{ runner.os }}-${{ matrix.node_version }}-${{ matrix.node_arch }}-${{ hashFiles('package.json') }}
163+
key: ${{ runner.os }}-${{ matrix.node }}-${{ matrix.arch }}-${{ hashFiles('package.json') }}
120164

121165
- name: Install Node
122-
uses: actions/setup-node@v2.1.3
166+
uses: actions/setup-node@v2
123167
with:
124-
node-version: ${{ matrix.node_version }}
125-
architecture: ${{ matrix.node_arch }}
168+
node-version: ${{ matrix.node }}
169+
architecture: ${{ matrix.arch }}
126170

127171
- name: Install dependencies only
128172
run: |
129173
npm install --ignore-scripts
130-
npm run js.build
131174
132175
- name: Download articats
133176
uses: actions/download-artifact@v2
@@ -137,14 +180,15 @@ jobs:
137180
run: |
138181
rm -rf build
139182
mkdir prebuilds
183+
mv ./artifact/*.js .
184+
mv ./artifact/*.d.ts .
140185
mv artifact/* prebuilds/
141-
ls prebuilds
142186
143187
- name: Run tests
144188
run: npm run test
145189

146190
- name: Run benchmarks
147-
if: ${{ !contains(matrix.node_arch, 'x86') }} # https://github.com/npm/npm-lifecycle/issues/54
191+
if: ${{ !contains(matrix.arch, 'x86') }} # https://github.com/npm/npm-lifecycle/issues/54
148192
run: npm run benchmark
149193

150194
Lint:
@@ -156,6 +200,7 @@ jobs:
156200
- uses: actions/checkout@v2
157201
with:
158202
fetch-depth: 0
203+
159204
- name: Commit lint ✨
160205
uses: wagoid/commitlint-github-action@v2
161206

@@ -167,10 +212,3 @@ jobs:
167212

168213
- name: Lint ✨
169214
run: npm run test.lint
170-
171-
Skip:
172-
if: contains(github.event.head_commit.message, '[skip ci]')
173-
runs-on: ubuntu-latest
174-
steps:
175-
- name: Skip CI 🚫
176-
run: echo skip ci

.terserrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require("terser-config-atomic")

binding.gyp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
'GCC_OPTIMIZATION_LEVEL': '3', # stop gyp from defaulting to -Os
2424
"CLANG_CXX_LIBRARY": "libc++",
2525
"CLANG_CXX_LANGUAGE_STANDARD":"c++17",
26-
'MACOSX_DEPLOYMENT_TARGET': '10.15',
26+
'MACOSX_DEPLOYMENT_TARGET': '10.13',
2727
'OTHER_CFLAGS': [
2828
'-arch x86_64',
2929
'-arch arm64'
@@ -141,7 +141,7 @@
141141
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
142142
"CLANG_CXX_LIBRARY": "libc++",
143143
"CLANG_CXX_LANGUAGE_STANDARD":"c++17",
144-
'MACOSX_DEPLOYMENT_TARGET': '10.15',
144+
'MACOSX_DEPLOYMENT_TARGET': '10.13',
145145
'OTHER_CFLAGS': [
146146
'-arch x86_64',
147147
'-arch arm64'

package.json

Lines changed: 38 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,40 @@
11
{
22
"name": "zadeh",
3+
"author": "Amin Yahyaabadi, Rajendran T",
4+
"homepage": "https://github.com/atom-ide-community/zadeh",
35
"version": "3.0.0-beta.3",
46
"description": "Blazing fast library for fuzzy filtering, matching, and other fuzzy things!",
57
"main": "./index.js",
68
"node": "./index.js",
9+
"source": "./src/binding/index.ts",
710
"scripts": {
811
"format": "prettier --write . && clang-format -i src/*.h src/binding/*.cc src/binding/*.h",
912
"test.format": "prettier . --check",
1013
"lint": "eslint . --fix",
1114
"test.lint": "eslint .",
1215
"tidy": "clang-tidy src/*.cc src/*.h",
1316
"tidy.fix": "clang-tidy src/*.cc src/*.h --fix --fix-errors",
14-
"native.clean": "shx rm -rf build prebuilds",
15-
"native.build": "node-gyp configure --release && node-gyp build --release",
16-
"native.build:debug": "node-gyp configure --debug && node-gyp build --debug",
17-
"native.prebuild": "prebuildify --napi -t 12.0.0 -t electron@6.0.0 -t electron@9.3.5 --strip",
18-
"native.prebuild-ia32": "prebuildify --napi --arch=ia32 -t 12.0.0 -t electron@6.0.0 -t electron@9.3.5 --strip",
19-
"js.clean": "shx rm -rf dist dist-test .rollup.cache .parcel-cache **/tsconfig.tsbuildinfo ./index.* ./*.d.ts",
20-
"js.dev": "npm run js.types && cross-env NODE_ENV=development rollup -c -w",
21-
"js.build": "npm run js.types && cross-env NODE_ENV=production rollup -c",
22-
"js.types": "tsc -p ./src/binding/tsconfig.json --emitDeclarationOnly && shx mv ./src/binding/*.d.ts .",
23-
"clean": "npm run native.clean && npm run js.clean",
17+
"clean.native": "shx rm -rf build prebuilds",
18+
"build.native": "node-gyp configure --release && node-gyp build --release",
19+
"build.native.debug": "node-gyp configure --debug && node-gyp build --debug",
20+
"prebuild.native": "prebuildify --napi -t 12.0.0 -t electron@6.0.0 -t electron@9.3.5 --strip --tag-libc",
21+
"prebuild.native.ia32": "prebuildify --napi --arch=ia32 -t 12.0.0 -t electron@6.0.0 -t electron@9.3.5 --strip --tag-libc",
22+
"clean.js": "shx rm -rf dist dist-test .rollup.cache .parcel-cache **/tsconfig.tsbuildinfo ./index.* ./*.d.ts",
23+
"dev.js": "npm run types.js && cross-env NODE_ENV=development parcel watch --target main ./src/binding/index.ts",
24+
"build.js": "npm run types.js && cross-env NODE_ENV=production parcel build --target main ./src/binding/index.ts",
25+
"types.js": "tsc -p ./src/binding/tsconfig.json --emitDeclarationOnly && shx mv ./src/binding/*.d.ts .",
26+
"clean": "npm run clean.native && npm run clean.js",
2427
"install": "node-gyp-build",
25-
"build": "npm run native.build && npm run js.build",
28+
"build": "npm run build.native && npm run build.js",
2629
"test": "shx rm -rf dist-test && shx cp -r test dist-test && coffee --compile dist-test && shx rm -rf dist-test/*.coffee && jasmine dist-test/*-spec.js",
2730
"benchmark.regular": "node benchmark/benchmark.js",
2831
"benchmark.large": "node benchmark/benchmark-large.js",
2932
"benchmark.small": "node benchmark/benchmark-small.js",
3033
"benchmark.tree": "node benchmark/benchmark-tree.js",
3134
"benchmark": "npm run benchmark.small && npm run benchmark.regular && npm run benchmark.large && npm run benchmark.tree",
3235
"examples.cpp": "cmake -S . -B ./build && cmake --build ./build --config Debug",
33-
"bump": "ncu -u --greatest",
34-
"prepare": "npm run js.clean && npm run build"
36+
"bump": "ncu -u && ncu -u /parcel/ --greatest",
37+
"prepare": "npm run clean.js && npm run build"
3538
},
3639
"prettier": "prettier-config-atomic",
3740
"files": [
@@ -43,36 +46,44 @@
4346
],
4447
"gypfile": true,
4548
"dependencies": {
46-
"bindings": "~1.5.0",
47-
"node-addon-api": "~3.2.1",
49+
"node-addon-api": "~4.0.0",
4850
"node-gyp-build": "^4.2.3"
4951
},
5052
"devDependencies": {
5153
"coffeescript": "^2.5.1",
5254
"cross-env": "^7.0.3",
53-
"eslint": "^7.28.0",
54-
"eslint-config-atomic": "^1.15.3",
55-
"fast-deep-equal": "^3.1.3",
55+
"eslint-config-atomic": "^1.16.1",
56+
"fast-equals": "^2.0.3",
5657
"fuzzaldrin-plus": "^0.6.0",
57-
"growl": ">=1.10.5",
5858
"jasmine": "^3.7.0",
59-
"jasmine-node": "^3.0.0",
60-
"npm-check-updates": "11.6.0",
59+
"parcel": "2.0.0-nightly.733",
6160
"prebuildify": "^4.1.2",
6261
"prettier-config-atomic": "^2.0.5",
63-
"rollup": "^2.51.1",
64-
"rollup-plugin-atomic": "^2.3.2",
6562
"shx": "^0.3.3",
66-
"typescript": "^4.3.2"
63+
"terser-config-atomic": "^0.1.1",
64+
"typescript": "^4.3.4"
65+
},
66+
"targets": {
67+
"main": {
68+
"context": "node",
69+
"includeNodeModules": {
70+
"node-gyp-build": false
71+
},
72+
"outputFormat": "commonjs",
73+
"isLibrary": true
74+
}
75+
},
76+
"engines": {
77+
"atom": ">=1.52.0 <2.0.0",
78+
"electron": ">=6.0.0",
79+
"node": ">=12.0.0"
6780
},
6881
"repository": {
6982
"type": "git",
7083
"url": "https://github.com/atom-ide-community/zadeh.git"
7184
},
72-
"author": "Amin Yahyaabadi, Rajendran T",
7385
"license": "MIT",
7486
"bugs": {
7587
"url": "https://github.com/atom-ide-community/zadeh/issues"
76-
},
77-
"homepage": "https://github.com/atom-ide-community/zadeh"
88+
}
7889
}

0 commit comments

Comments
 (0)