Skip to content

Commit

Permalink
Bug #2, streamline less and uglify build - Travis-CI [iet:8585323]
Browse files Browse the repository at this point in the history
  • Loading branch information
nfreear committed Apr 5, 2017
1 parent e5928e3 commit 2fcb8cc
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
!login.css
/style/less/
*.csv
*.dist.js

#/bin

Expand Down
9 changes: 6 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@ before_install:

install:
- composer install
- composer npm-install
- composer npm-install-dev
- composer eslint-config
- composer write-ignore-xml

script:
- composer less
- composer build
- composer test
- composer validate
- composer ci-test
- composer validate

after_script:
- ls -al

#End.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ composer eslint
```

## Site-wide Javascript and styles
### Admin / Additional HTML
### Additional HTML - development

To embed the plugin's Javascript and stylesheet on every page:

Expand All @@ -71,6 +71,14 @@ To embed the plugin's Javascript and stylesheet on every page:
```


### Additional HTML - live

```html
<link href="/auth/ouopenid/style/ouop-styles.css" rel="stylesheet" />
<script src="/auth/ouopenid/ouop.dist.js"></script>
```


Developed for the [TeSLA project][].

---
Expand Down
11 changes: 8 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,16 @@
"sym-links": [
"cd ../moodle-auth-openid && ln -s ../moodle-auth-ouopenid/event.php"
],
"npm-install": [
"npm install eslint less semistandard",
"npm-install": "npm install uglify-js && npm i less",
"npm-install-dev": [
"composer npm-install",
"npm install eslint semistandard",
"npm i -g csslint && npm i -g jshint"
],
"build": [
"node_modules/.bin/uglifyjs user/*.js --comments=/^!/ --preamble='/*eslint-disable*/' -bo ouop.dist.js",
"node_modules/.bin/lessc style/*.less style/ouop-styles.css"
],
"jshint-config": "echo '{ \"laxcomma\": true }' > .jshintrc",
"eslint-config": [
"echo '---\n extends: eslint:recommended\n globals:\n window: false\n root: true\n' > .eslintrc.yaml",
Expand All @@ -60,7 +66,6 @@
"node_modules/.bin/eslint js/ user/*.js && echo eslint OK!"
],
"semistandard": "node_modules/.bin/semistandard",
"less": "node_modules/.bin/lessc style/*.less style/ouop-styles.css && echo less OK!",
"test": [
"vendor/bin/parallel-lint --exclude vendor .",
"vendor/bin/phpcs --standard=PSR2 -n db/*.php",
Expand Down

0 comments on commit 2fcb8cc

Please sign in to comment.