Skip to content

Commit b23c3b2

Browse files
authored
Refactor (#2)
refactor
1 parent 1769627 commit b23c3b2

124 files changed

Lines changed: 3065 additions & 1308 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 41 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,61 +2,67 @@ version: 2.1
22
executors:
33
base:
44
docker:
5-
- image: circleci/golang:1.11
5+
- image: circleci/golang:1.12-node
66
working_directory: /go/src/github.com/spatialcurrent/go-reader-writer
77
jobs:
88
pre_deps_golang:
99
executor: base
1010
steps:
1111
- checkout
12-
- run: go get -d ./...
12+
- run: make deps_go
1313
- run: sudo chown -R circleci /go/src
1414
- save_cache:
1515
key: v1-go-src-{{ .Branch }}-{{ .Revision }}
1616
paths:
1717
- /go/src
18-
test:
18+
test_go:
1919
executor: base
2020
steps:
2121
- run: sudo chown -R circleci /go/src
2222
- restore_cache:
2323
keys:
2424
- v1-go-src-{{ .Branch }}-{{ .Revision }}
25-
- run:
26-
name: Install gometalinter
27-
command: |
28-
go get -u github.com/alecthomas/gometalinter
29-
gometalinter --install
30-
- run:
31-
name: Test
32-
command: bash scripts/test.sh
33-
validate:
25+
- run: make deps_go_test
26+
- run: make test_go
27+
- run: make imports
28+
- run: git diff --exit-code
29+
test_javascript:
3430
executor: base
3531
steps:
3632
- run: sudo chown -R circleci /go/src
3733
- restore_cache:
3834
keys:
3935
- v1-go-src-{{ .Branch }}-{{ .Revision }}
40-
- run:
41-
name: Install Dig
42-
command: sudo apt update && sudo apt install dnsutils
43-
- run:
44-
name: "Update ~/.ssh/known_hosts"
45-
command: |
46-
mkdir ~/.ssh/
47-
touch ~/.ssh/known_hosts
48-
for ip in $(dig @8.8.8.8 github.com +short); do ssh-keyscan github.com,$ip; ssh-keyscan $ip; done 2>/dev/null >> ~/.ssh/known_hosts
49-
- run: go get github.com/spatialcurrent/go-header/...
50-
- run: go install github.com/spatialcurrent/go-header/cmd/goheader
51-
- run: goheader fix --fix-year 2019 --exit-code-on-changes 1 --verbose
36+
- run: sudo npm install -g n
37+
- run: sudo n v11.15.0
38+
- run: sudo npm install --global source-map-support
39+
- run: make deps_gopherjs
40+
- run: make deps_javascript
41+
#- run: npm run test:clean
42+
examples:
43+
executor: base
44+
steps:
45+
- run: sudo chown -R circleci /go/src
46+
- restore_cache:
47+
keys:
48+
- v1-go-src-{{ .Branch }}-{{ .Revision }}
49+
- run: sudo npm install -g n
50+
- run: make deps_gopherjs
51+
- run: make deps_javascript
52+
- run: npm run build:clean
53+
- run: make run_example_c
54+
- run: make run_example_cpp
55+
#- run: make run_example_javascript
56+
- run: make run_example_python
5257
build_cli:
5358
executor: base
5459
steps:
5560
- run: sudo chown -R circleci /go/src
5661
- restore_cache:
5762
keys:
5863
- v1-go-src-{{ .Branch }}-{{ .Revision }}
59-
- run: bash scripts/build_cli.sh
64+
- run: go get github.com/inconshreveable/mousetrap # for windows CLI builds
65+
- run: make build_cli
6066
- store_artifacts:
6167
path: bin
6268
destination: /
@@ -67,12 +73,10 @@ jobs:
6773
- restore_cache:
6874
keys:
6975
- v1-go-src-{{ .Branch }}-{{ .Revision }}
70-
- run:
71-
name: Install GopherJS
72-
command: go get -u github.com/gopherjs/gopherjs
73-
- run: bash scripts/build_javascript.sh
76+
- run: make deps_gopherjs
77+
- run: make build_javascript
7478
- store_artifacts:
75-
path: bin
79+
path: dist
7680
destination: /
7781
build_so:
7882
executor: base
@@ -81,18 +85,22 @@ jobs:
8185
- restore_cache:
8286
keys:
8387
- v1-go-src-{{ .Branch }}-{{ .Revision }}
84-
- run: bash scripts/build_so.sh
88+
- run: sudo make deps_arm
89+
- run: make build_so
8590
- store_artifacts:
8691
path: bin
8792
destination: /
8893
workflows:
8994
main:
9095
jobs:
9196
- pre_deps_golang
92-
- test:
97+
- test_go:
98+
requires:
99+
- pre_deps_golang
100+
- test_javascript:
93101
requires:
94102
- pre_deps_golang
95-
- validate:
103+
- examples:
96104
requires:
97105
- pre_deps_golang
98106
- build_cli:

.eslintignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
__mocks__/
2+
dist/
3+
bin/
4+
node_modules/
5+
webpack/
6+
.DS_Store
7+
.npm
8+
node_modules
9+
npm-debug.*
10+
package-lock.json

.eslintrc

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"parser": "babel-eslint",
3+
"extends": "eslint-config-airbnb",
4+
"rules": {
5+
"arrow-parens": ["error", "as-needed"],
6+
"class-methods-use-this": "off",
7+
"comma-dangle": ["error", { "objects": "always-multiline" }],
8+
"import/no-named-as-default": "off",
9+
"import/no-unresolved": "off",
10+
"no-use-before-define": "off",
11+
"object-curly-newline": "off",
12+
"prefer-destructuring": "off",
13+
"react/destructuring-assignment": "off",
14+
"react/forbid-prop-types": "off",
15+
"react/jsx-filename-extension": "off",
16+
"react/jsx-no-bind": "off",
17+
"react/no-access-state-in-setstate": "off",
18+
"react/prefer-stateless-function": "off",
19+
"react/require-default-props": "off",
20+
"react/sort-comp": ["error", { // Team Preference
21+
"order": [
22+
"static-methods",
23+
"/constructor/",
24+
"/state/",
25+
"instance-variables",
26+
"lifecycle",
27+
"getters",
28+
"everything-else",
29+
"render"
30+
]
31+
}],
32+
"sort-keys": "error",
33+
"space-before-function-paren": ["error", "always"]
34+
}
35+
}

.gitignore

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
secret/
2-
bin/
1+
bin
2+
dist
3+
vendor
4+
Gopkg.lock
35
*.so
46
*.h
7+
.DS_Store
8+
.npm
9+
node_modules
10+
npm-debug.*
11+
package-lock.json

AUTHORS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
go-reader is maintained by Spatial Current, Inc.
1+
go-reader-writer is maintained by Spatial Current, Inc.
22

33
Authors:
44

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Contributing to go-reader
1+
# Contributing to go-reader-writer
22

33
## Contributor License Agreement
44

5-
Thank you for your interest in contributing. You will first need to agree to the license. Simply post the following paragraph, with "your name" and "your github account" substituted as needed, to the first issue [#1](https://github.com/spatialcurrent/go-reader/issues/1). Otherwise, you can email us [here](mailto:opensource@spatialcurrent.io?subject=CLA).
5+
Thank you for your interest in contributing. You will first need to agree to the license. Simply post the following paragraph, with "your name" and "your github account" substituted as needed, to the first issue [#1](https://github.com/spatialcurrent/go-reader-writer/issues/1). Otherwise, you can email us [here](mailto:opensource@spatialcurrent.io?subject=CLA).
66

77
I, **< YOUR NAME > (< YOUR GITHUB ACCOUNT >)**, agree to the license terms. My contributions to this repo are granted to **Spatial Current, Inc.** under a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable license and/or copyright is transferred.
88

@@ -12,4 +12,4 @@ This library is still in alpha (0.x.x), so versioning is not semantic yet.
1212

1313
## Authors
1414

15-
See [AUTHORS](https://github.com/spatialcurrent/go-reader/blob/master/AUTHORS) for a list of contributors.
15+
See [AUTHORS](https://github.com/spatialcurrent/go-reader-writer/blob/master/AUTHORS) for a list of contributors.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018 Spatial Current, Inc.
3+
Copyright (c) 2019 Spatial Current, Inc.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)