Skip to content

Commit

Permalink
Freshened up configuration and boilerplate
Browse files Browse the repository at this point in the history
Signed-off-by: Jaid <[email protected]>
  • Loading branch information
Jaid committed Mar 8, 2019
1 parent 6e26bce commit 9ae8e93
Show file tree
Hide file tree
Showing 23 changed files with 12,440 additions and 6,297 deletions.
36 changes: 3 additions & 33 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,3 @@
const isDevelopment = process.env.NODE_ENV !== "production"

const config = {}

const presets = [
[
"@babel/env",
{
"targets": {
"node": "7"
}
}
],
"@babel/stage-1"
]

const plugins = [
"@babel/transform-runtime"
]

if (!isDevelopment) {
plugins.push("lodash")
presets.push(["minify", {
mangle: false // Duplicate declaration "a" (This is an error on an internal node. Probably an internal error.)
}])
config.comments = false
}

if (isDevelopment) {
}

Object.assign(config, {plugins, presets})
module.exports = config
module.exports = {
presets: ["jaid"]
}
3 changes: 3 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node 10
node 11
not dead
31 changes: 12 additions & 19 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
max_line_length = 0
trim_trailing_whitespace = false

[*.json]
indent_size = 4

[COMMIT_EDITMSG]
max_line_length = 0
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = false
trim_trailing_whitespace = true

[/package.json]
insert_final_newline = true # npm install rewrites the JSON file with a final newline, so we manually keep them to prevent unneeded stashes
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
dist/
test/fixtures/
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: "jaid"
}
32 changes: 23 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,29 @@
.env

# Node packages
/node_modules/
/package-lock.json # Removing because we use yarn.lock
/yarn-error.log
node_modules

# Build folder
/build/
# npm
package-lock.json
!/package-lock.json
npm-debug.log
npm-debug.log.*
.npmrc

# JSDoc
/out/
# pnpm
shrinkwrap.yaml
!/shrinkwrap.yaml
pnpm-debug.log

# Jest
/coverage/
# Yarn
yarn.lock
!/yarn.lock
yarn-error.log

# Generated or temporary content
dist
temp

# IDEs
/.vscode/
/.idea/
15 changes: 0 additions & 15 deletions .jsdoc.config.js

This file was deleted.

55 changes: 43 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,44 @@
language: node_js
node_js:
- '8'
cache: yarn
before_install:
- yarn global add codecov
script: # && instead of YAML array, see: https://github.com/travis-ci/travis-ci/issues/1066
- yarn build-prod && yarn jest --coverage && codecov && yarn jsdoc && mkdir -p surge-docs && mv out/*/*/** surge-docs
deploy:
provider: surge
project: ./surge-docs
domain: parse-numberings.docs.j4id.com
skip_cleanup: true
node_js: [node, lts/*]
cache:
npm: true
before_script:
- npm add --global pover
script:
- pover install
- pover build:dev
- pover build:prod
- pover test
jobs:
include:
- stage: Deploy
before_deploy:
- npm run build:prod
- export PKG_NAME=$(node -e "console.log(require('./dist/package/production/package').name)")
- export PKG_VERSION=$(node -e "console.log(require('./dist/package/production/package').version)")
- "[[ -d dist/homepage/$PKG_NAME/$PKG_VERSION ]] && npm run test:coverage && cp -r dist/homepage/$PKG_NAME/$PKG_VERSION page && cp -r dist/jest/coverage/lcov-report page/coverage || true"
- cd dist/package/production
- zip -9 --recurse-paths ../../${PKG_NAME}_v$PKG_VERSION.zip **
- zip -9 --recurse-paths ../../${PKG_NAME}_v${PKG_VERSION}_min.zip ** --exclude \*.d.ts --exclude readme.* --exclude \*.map
- cd ../../..
deploy:
- provider: pages
local_dir: page
fqdn: $PKG_NAME.jaid.codes
skip_cleanup: true
github_token: $GITHUB_TOKEN # Permissions: public_repo, repo:status, repo_deployment
on: { condition: -d pages }
- provider: releases
file_glob: true
file:
- license.*
- dist/package/production/package.json
- dist/package/production/*.d.ts
- "dist/*.zip"
skip_cleanup: true
api_key: $GITHUB_TOKEN # Permissions: public_repo, repo:status, repo_deployment
on: { tags: true }
- provider: script
script: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc && npm publish dist/package/production
skip_cleanup: true
on: { tags: true }
16 changes: 0 additions & 16 deletions gulpfile.babel.js

This file was deleted.

17 changes: 13 additions & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
module.exports = {
transform:{
".*": "./jest.transform.js"
}
}
testEnvironment: "node",
coverageDirectory: "dist/jest/coverage",
collectCoverageFrom: ["src/**"],
testPathIgnorePatterns: [
"/node_modules/",
"/dist/",
],
moduleNameMapper: {
"^root": "<rootDir>",
"^src": "<rootDir>/src",
"^lib": "<rootDir>/src/lib",
},
}
88 changes: 0 additions & 88 deletions jest.transform.js

This file was deleted.

42 changes: 21 additions & 21 deletions license.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
MIT License

Copyright (c) 2017-2018 Jaid <[email protected]> (github.com/jaid)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
MIT License
Copyright © 2019, Jaid <[email protected]> (github.com/jaid)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit 9ae8e93

Please sign in to comment.