Skip to content

Commit

Permalink
Merge pull request #38 from oat-sa/fix/TRN-720/update-stack
Browse files Browse the repository at this point in the history
Move to github actions and update dependencies
  • Loading branch information
oatymart authored May 12, 2021
2 parents ac8873d + c59985f commit a40eeed
Show file tree
Hide file tree
Showing 11 changed files with 1,261 additions and 1,148 deletions.
34 changes: 0 additions & 34 deletions .Jenkinsfile

This file was deleted.

1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"root": true,
"extends": "@oat-sa/eslint-config-tao/amd"
}
48 changes: 48 additions & 0 deletions .github/workflows/continous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Continous integration

on:
pull_request:
branches: [ develop ]

jobs:
code-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: git fetch --unshallow --tags
- name: Check commit
if: always()
uses: oat-sa/conventional-commit-action@v0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v1
with:
node-version: 10.x
registry-url: https://registry.npmjs.org
- name: Install packages
run: npm ci
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- name: Running tests
run: npm run test:cov && npm run coverage:clover
- name: Report coverage
if: always()
uses: slavcodev/coverage-monitor-action@1.1.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
clover_file: coverage/clover.xml
threshold_alert: 75
threshold_warning: 90
comment_mode: update
- name: Save Code Linting Report JSON
if: always()
run: npm run lint:report
- name: Annotate Code Linting Results
if: always()
uses: ataylorme/eslint-annotate-action@1.2.0
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
report-json: "eslint_report.json"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,6 @@ dist
# IDEs
.vscode/
.idea/

# eslint report
eslint_report.json
2,157 changes: 1,134 additions & 1,023 deletions package-lock.json

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@
"test:keepAlive": "npx qunit-testrunner --keepalive",
"test:cov": "npm run build:cov && npx qunit-testrunner --cov",
"coverage": "nyc report",
"coverage:clover": "nyc report --reporter clover",
"coverage:html": "nyc report --reporter=lcov && open-cli coverage/lcov-report/index.html",
"build": "rollup --config ./build/rollup.config.js",
"build:watch": "rollup --config ./build/rollup.config.js --watch",
"build:cov": "rollup --config ./build/rollup.config.js --environment COVERAGE",
"lint": "eslint src test",
"lint:report": "eslint --output-file eslint_report.json --format json src test",
"prepare": "npm run build"
},
"repository": {
Expand All @@ -39,22 +41,20 @@
},
"homepage": "https://github.com/oat-sa/tao-item-runner-fe#readme",
"devDependencies": {
"@oat-sa/eslint-config-tao": "^0.1.0",
"@oat-sa/eslint-config-tao": "^1.1.1",
"@oat-sa/expr-eval": "1.3.0",
"@oat-sa/prettier-config": "^0.1.1",
"@oat-sa/rollup-plugin-wildcard-external": "^0.1.0",
"@oat-sa/tao-core-libs": "^0.4.3",
"@oat-sa/tao-core-sdk": "^1.8.1",
"@oat-sa/tao-core-libs": "^0.4.4",
"@oat-sa/tao-core-sdk": "^1.12.0",
"@oat-sa/tao-qunit-testrunner": "^1.0.3",
"@rollup/plugin-alias": "^3.1.1",
"@rollup/plugin-alias": "^3.1.2",
"async": "0.2.10",
"decimal.js": "10.1.1",
"dompurify": "1.0.11",
"eslint": "^7.5.0",
"eslint-plugin-es": "^3.0.0",
"eslint-plugin-jsdoc": "^20.3.0",
"eslint": "^7.25.0",
"gamp": "0.2.1",
"glob": "^7.1.6",
"glob": "^7.1.7",
"handlebars": "1.3.0",
"interactjs": "1.3.4",
"jquery": "1.9.1",
Expand All @@ -64,13 +64,13 @@
"nyc": "^15.1.0",
"open-cli": "^6.0.1",
"popper.js": "1.15.0",
"prettier": "^2.0.5",
"prettier": "^2.2.1",
"promise-limit": "^2.7.0",
"qunit": "^2.10.1",
"qunit": "^2.15.0",
"raphael": "2.1.4",
"require-css": "^0.1.10",
"rollup": "^2.22.2",
"rollup-plugin-istanbul": "^2.0.1",
"rollup": "^2.47.0",
"rollup-plugin-istanbul": "^3.0.0",
"select2": "3.5.1",
"tooltip.js": "1.3.2"
},
Expand Down
6 changes: 3 additions & 3 deletions src/assets/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ var assetManagerFactory = function assetManagerFactory(strategies, data, options

/**
* Change the strategies
* @param {AssetStrategy[]} strategies - the strategies
* @param {AssetStrategy[]} newStrategies - the strategies
* @throws {TypeError} if the strategy isn't defined correctly
*/
setStrategies: function setStrategies(newStrategies) {
Expand All @@ -148,7 +148,7 @@ var assetManagerFactory = function assetManagerFactory(strategies, data, options
//if it's a function, we create the strategy with a generated name
} else if (_.isFunction(strategy)) {
self.addStrategy({
name: 'strategy_' + (self._strategies.length + 1),
name: `strategy_${self._strategies.length + 1}`,
handle: strategy
});
}
Expand Down Expand Up @@ -190,7 +190,7 @@ var assetManagerFactory = function assetManagerFactory(strategies, data, options
var inputUrl;

//if caching try to load the value from the cache
if (options.cache && cache.hasOwnProperty(url)) {
if (options.cache && typeof cache[url] !== 'undefined') {
return cache[url];
}

Expand Down
7 changes: 1 addition & 6 deletions src/assets/strategies.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@ import _ from 'lodash';
var prependToUrl = function prependToUrl(url, base, slashcat) {
//is slashcat we manage slash concact
if (slashcat === true) {
return (
base.replace(/\/$/, '') +
'/' +
url.directory.replace(/^\.\//, '').replace(/^\//, '') +
encodeURIComponent(url.file.replace(/^\.\//, '').replace(/^\//, ''))
);
return `${base.replace(/\/$/, '')}/${url.directory.replace(/^\.\//, '').replace(/^\//, '')}${encodeURIComponent(url.file.replace(/^\.\//, '').replace(/^\//, ''))}`;
}

return base + url.directory.replace(/^\.?\//, '') + encodeURIComponent(url.file.replace(/^\.?\//, ''));
Expand Down
3 changes: 2 additions & 1 deletion src/scoring/api/scorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ var scorerFactory = function scorerFactory(providerName, options) {
//optional params based on type
if (_.isPlainObject(providerName)) {
options = providerName;
providerName = undefined;
providerName = void 0;
}
//eslint-disable-next-line
options = options || {};

/*
Expand Down
Loading

0 comments on commit a40eeed

Please sign in to comment.