remove coffeescript dependency and use vanilla .js files (#349)
* run shell command:
```sh
# revert individual .coffee files to .js
npm install coffeescript@1.12.7
for LIB in api-data api exports worker
do
cat "src/$LIB.coffee" | npx coffee --bare --compile --stdio > "src/$LIB.js"
done
# restore package-lock.json
git checkout package-lock.json
```
* update Makefile to use vanilla src/*.js files instead of src/*.coffee
* remove references and dependencies to coffeescript in files:
```
$ git grep -i coffee
.github/workflows/CI.yml: - name: install coffee
.github/workflows/CI.yml: run: npm install --global coffeescript@1
.github/workflows/release.yml: - name: install coffee
.github/workflows/release.yml: run: npm install --global coffeescript@1
.npmignore:coffee/
package-lock.json: "coffeescript": {
package-lock.json: "resolved": "https://registry.npmjs.org/coffeescript/-/coffeescript-1.12.7.tgz",
package.json: "coffeescript": "^1.12.7",
```
* remove .coffee files:
deleted: src/api-data.coffee
deleted: src/api.coffee
deleted: src/exports.coffee
deleted: src/worker.coffee
* simplify ci-build and vanilla-js cleanup by merging following files into api.js, respectively:
src/output-pre.js
src/api.js
src/exports.js
src/api-data.js
src/output-post.js
* rename OUTPUT_API_FILES to SOURCE_API_FILES in Makefile
* add file test/jslint.js and npm-command "npm run test-jslint"
todo - allow test-jslint to fail after we finish refactoring src/api.js (test-jslint currently always pass)
* lint src/api.js - resolve conversation - we need only 1 variable
lint src/api.js - resolve conversation - Object.values()
lint src/api.js - resolve conversation - we can iterate in increasing order
lint src/api.js - resolve conversation - the var could be directly in front of the variables
lint src/api.js - resolve conversation - remove merge-comments
lint src/api.js - unindent case-statement
lint src/api.js - use jslint-style-guide of quoting strings with double-quote instead of single-quote
lint src/api.js - hoist constant vars to top of file
lint src/api.js - rename property SQlite.xxx to var SQLITE_xxx
lint src/api.js - remove var runCompiledCode
lint src/api.js - use 4-space indent
* jslint src/api.js - replace expression "xxx == null" with "isNullOrUndefined(xxx)"
jslint src/api.js - replace expression "void 0" with "undefined"
jslint src/api.js - fix warning "Line is longer than 80 characters."
jslint src/api.js - fix warning "Undeclared xxx."
jslint src/api.js - fix miscellaneous jslint warnings in src/api.js
jslint - allow jslint to print all warnings
jslint - ignore warning subscript_a
* jslint src/api.js - fixed all warnings
jslint - "npm test" will now fail if src/api.js fails jslint-check
jslint src/api.js - fix whitespace warnings
* Add kaizhu256 to the authors
* Add more intermediary files to gitignore
* Create a single "clean" target
* Remove compiled files from the repository
* Keep an empty dist/ folder
* Switch from jslint to eslint
...and fix all warning and errors
* fix a bug I introduced in db.create_function
* Finally fix the webworker tests
Fixes #180
Co-authored-by: Ophir LOJKINE <ophir.lojkine@auto-grid.com> K
kai zhu committed
ca115e1d67e9c3d20afde499ff6cdd69969639b2
Parent: e902ec2
Committed by GitHub <noreply@github.com>
on 2/29/2020, 8:08:03 PM