diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..040ea5c --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,94 @@ +version: 2 + +defaults: &defaults + working_directory: ~/qlik-smart-pivot + docker: + - image: circleci/node:stretch + environment: + GITHUB_ORG: "qlik-oss" + GITHUB_REPO: "PLSmartPivot" + PACKAGE_NAME: "qlik-smart-pivot" + +jobs: + test: + docker: + - image: circleci/node:stretch-browsers + steps: + - checkout + - run: + name: Install dependencies + command: npm install + - run: + name: Run tests + command: npm run test-once + + bump-version: + <<: *defaults + steps: + - checkout + - run: + name: Bump version + command: scripts/bump-version.sh $GITHUB_ORG $GITHUB_REPO + - persist_to_workspace: + root: ~/qlik-smart-pivot + paths: + - BUMPED_VERSION + + build: + <<: *defaults + steps: + - checkout + - attach_workspace: + at: ~/qlik-smart-pivot + - run: + name: Install dependencies + command: npm install + - run: + name: Build and package + command: | + export VERSION=$(scripts/get-bumped-version.sh) + echo "Version: ${VERSION}" + npm run build + environment: + NODE_ENV: production + - persist_to_workspace: + root: ~/qlik-smart-pivot + paths: + - build + - store_artifacts: + path: build + destination: build + deploy: + <<: *defaults + steps: + - checkout + - attach_workspace: + at: ~/qlik-smart-pivot + - run: + name: Install ghr + command: scripts/install-ghr.sh + - run: + name: Create GitHub Release + command: | + export VERSION=$(scripts/get-bumped-version.sh) + echo "Version: ${VERSION}" + scripts/create-release.sh $GITHUB_ORG $GITHUB_REPO $PACKAGE_NAME $VERSION + +workflows: + version: 2 + master_flow: + jobs: + - test + - bump-version: + requires: + - test + - build: + requires: + - bump-version + - deploy: + requires: + - build + filters: + branches: + only: + - master diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..0f09989 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,10 @@ +# editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..8df4ab0 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,65 @@ +module.exports = { + parserOptions: { + ecmaVersion: 6, + ecmaFeatures: { + jsx: true, + modules: true + }, + sourceType: "module" + }, + parser: "babel-eslint", + env: { + browser: true, + es6: true, + node: true + }, + globals: { + angular: false, + define: false, + describe: false, + document: false, + expect: false, + it: false, + require: false + }, + rules: { + "indent": ["error", 2, { "SwitchCase": 1 }], + "linebreak-style": ["error", "unix"], + "object-curly-spacing": ["error", "always"], + "max-lines": ["warn", 300], + "max-len": ["warn", { "code": 120, "ignoreComments": true, "ignoreTrailingComments": false }], + "no-console": ["warn"], + "no-mixed-operators": ["warn", { + "groups": [ + ["==", "!=", "===", "!==", ">", ">=", "<", "<="], + ["&&", "||"], + ["in", "instanceof"] + ], + "allowSamePrecedence": true + }], + "no-multi-spaces": ["error"], + "no-cond-assign": ["warn"], + "no-fallthrough": ["warn"], + "no-undef": ["error"], + "no-unused-vars": ["warn"], + "no-use-before-define": ["warn", { "functions": false, "classes": false, "variables": false }], + "no-useless-escape": ["warn"], + "no-useless-return": ["warn"], + "no-underscore-dangle": ["warn", { "allow": ["_id"] }], + "no-redeclare": ["warn"], + "no-restricted-syntax": ["warn"], + "operator-linebreak": ["warn", "before"], + "prefer-promise-reject-errors": ["warn"], + "padded-blocks": ["warn", { "blocks": "never", "switches": "never", "classes": "never" }], + "semi": ["error", "always"], + "valid-typeof": ["warn"], + "no-eval": ["error"], + "no-implied-eval": ["error"], + "no-debugger": ["warn"], + "no-unreachable": ["warn"], + "quotes": ["warn", "single", { "avoidEscape": true }] + }, + extends: [ + "eslint:recommended" + ] +} diff --git a/.gitattributes b/.gitattributes index bdb0cab..99b2250 100644 --- a/.gitattributes +++ b/.gitattributes @@ -15,3 +15,15 @@ *.PDF diff=astextplain *.rtf diff=astextplain *.RTF diff=astextplain + +* text=auto +.* text eol=lf +*.css text eol=lf +*.scss text eol=lf +*.html text eol=lf +*.js text eol=lf +*.json text eol=lf +*.md text eol=lf +*.sh text eol=lf +*.txt text eol=lf +*.svg text eol=lf diff --git a/.gitignore b/.gitignore index 4a280d0..93bc251 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,11 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk +# Temporary build files +node_modules/ +build/ +BUMPED_VERSION + # ========================= # Operating System Files # ========================= @@ -41,4 +46,3 @@ $RECYCLE.BIN/ Network Trash Folder Temporary Items .apdisk -dist/ diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..cffe8cd --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +save-exact=true diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..bedfada --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ +The MIT License + +Copyright (c) 2018-present QlikTech International AB +Copyright (c) 2016-2018 Ivan Felipe Asensio + +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. \ No newline at end of file diff --git a/PLSmartPivot.js b/PLSmartPivot.js deleted file mode 100644 index bf4e39d..0000000 --- a/PLSmartPivot.js +++ /dev/null @@ -1,2221 +0,0 @@ -define(["jquery","text!./PLSmartPivot.css"], function(e,t) {'use strict'; - return e("