Skip to content

Commit

Permalink
Merge pull request #1 from biigle/es6
Browse files Browse the repository at this point in the history
ES6
  • Loading branch information
mzur authored Jul 3, 2020
2 parents 654773a + 57fbd16 commit d6624f2
Show file tree
Hide file tree
Showing 14 changed files with 10,776 additions and 77 deletions.
27 changes: 27 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"env": {
"browser": true,
"es2020": true
},
"extends": [
"eslint:recommended",
"plugin:vue/essential"
],
"parserOptions": {
"ecmaVersion": 11,
"sourceType": "module"
},
"plugins": [
"vue"
],
"rules": {
"no-prototype-builtins": "off",
"no-console": ["error", {"allow": ["warn", "error"]}],
"vue/require-v-for-key": "off"
},
"globals": {
"biigle": "readonly",
"Vue": "readonly",
"VueStrap": "readonly"
}
}
23 changes: 23 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Lint

on:
push:
branches:
- master
pull_request:

jobs:
lint:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1

- name: Install dependencies
run: npm install

- name: Run ESLint
run: npm run lint
87 changes: 87 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Tests

on:
push:
branches:
- master
pull_request:

jobs:

test-module:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1

- uses: actions/checkout@v1
with:
repository: biigle/core
ref: dev-modules
fetch-depth: 1
path: core

- name: Validate composer.json and composer.lock
run: composer validate
working-directory: ../core

- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
working-directory: ../core

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer
restore-keys: |
${{ runner.os }}-composer
- name: Install Dependencies
run: composer install --no-ansi --no-interaction --no-scripts --no-suggest --prefer-dist --ignore-platform-reqs
working-directory: ../core

- name: Remove BIIGLE modules
run: rm -r vendor/biigle
working-directory: ../core

- name: Update BIIGLE modules from source
run: composer update --no-ansi --no-interaction --no-scripts --no-suggest --prefer-source --ignore-platform-reqs biigle/*
working-directory: ../core

- name: Remove installed package
run: rm -r vendor/${GITHUB_REPOSITORY}
working-directory: ../core

- name: Copy current repository
run: cp -r ${GITHUB_WORKSPACE} vendor/biigle
working-directory: ../core

- name: Generate key
run: php artisan key:generate
working-directory: ../core

- name: Docker login
run: docker login docker.pkg.github.com -u $GITHUB_ACTOR -p $GITHUB_TOKEN
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Fetch base images
run: |
docker pull docker.pkg.github.com/biigle/core/app:latest
docker pull docker.pkg.github.com/biigle/core/worker:latest
- name: Start test database
run: docker-compose up -d --no-build database_testing
working-directory: ../core

- name: Run tests
run: docker-compose run --rm -u 1001 worker php -d memory_limit=1G vendor/bin/phpunit --random-order --filter 'Biigle\\Tests\\Modules\\'${GITHUB_REPOSITORY##*/}
working-directory: ../core
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ First, [create a new repository](https://github.com/biigle/module/generate) base
6. [`ModuleServiceProvider.php#L42`](src/ModuleServiceProvider.php#L42)
7. [`composer.json#L2`](composer.json#L2)

Next, update the namespace of all PHP classes (`Biigle\Modules\Module`) and replace `Module` with the name of your module. Do this in [`gulpfile.js`](gulpfile.js#L5), too. Now you can install the module and start developing.
Next, update the namespace of all PHP classes (`Biigle\Modules\Module`) and replace `Module` with the name of your module. Do this in [`webpack.mix.js`](webpack.mix.js#L23), too. Now you can install the module and start developing.

In addition to the code of the [tutorials](https://biigle.de/manual#developer-tutorials) this repository already contains the configuration for [gulp.js](https://gulpjs.com/) as build system. To install the build system, run `npm install -g gulp-cli` and then run `npm install`. Now you can use the following build commands:
In addition to the code of the [tutorials](https://biigle.de/manual#developer-tutorials) this repository already contains the configuration for [Laravel Mix](https://laravel.com/docs/6.x/mix) as build system. To install the build system, run and then run `npm install`. Now you can use the following commands:

- `gulp`: Builds and publishes the assets once.
- `gulp --production`: Builds, minifies and publishes the assets once. Always do this before you commit new code.
- `gulp watch`: Continuously builds and publishes the assets whenever an asset file is changed.
- `npm run dev`: Builds and publishes the assets once.
- `npm run prod`: Builds, minifies and publishes the assets once. Always do this before you commit new code.
- `npm run watch`: Continuously builds and publishes the assets whenever an asset file is changed.
- `npm run lint`: Run static analysis to check for errors.

## How wo install this module

Expand Down
25 changes: 0 additions & 25 deletions gulpfile.js

This file was deleted.

Loading

0 comments on commit d6624f2

Please sign in to comment.