Skip to content

Commit

Permalink
NEW Various updates to modernise the module skeleton for 2019
Browse files Browse the repository at this point in the history
  • Loading branch information
ScopeyNZ committed Apr 8, 2019
1 parent 593ff0f commit 4fb1208
Show file tree
Hide file tree
Showing 6 changed files with 1,091 additions and 702 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6
10
19 changes: 9 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
language: php

dist: trusty

env:
global:
- TRAVIS_NODE_VERSION="6"
- TRAVIS_NODE_VERSION="10"

matrix:
include:
- php: 5.6
env: DB=MYSQL RECIPE_VERSION=1.0.x-dev PHPCS_TEST=1 PHPUNIT_TEST=1
- php: 7.0
env: DB=MYSQL RECIPE_VERSION=1.1.x-dev PHPUNIT_COVERAGE_TEST=1
- php: 7.1
- php: 7.0
env: DB=PGSQL RECIPE_VERSION=4.2.x-dev PHPUNIT_TEST=1
- php: 7.2
- php: 7.1
env: DB=MYSQL RECIPE_VERSION=4.3.x-dev NPM_TEST=1
- php: 7.2
env: DB=PGSQL RECIPE_VERSION=4.4.x-dev PHPUNIT_TEST=1
- php: 7.3
env: DB=MYSQL RECIPE_VERSION=4.x-dev PHPUNIT_TEST=1

Expand All @@ -37,8 +35,9 @@ script:
- if [[ $PHPCS_TEST ]]; then vendor/bin/phpcs src/ tests/ *.php; fi
- if [[ $NPM_TEST ]]; then git diff-files --quiet -w --relative=client; fi
- if [[ $NPM_TEST ]]; then git diff --name-status --relative=client; fi
- if [[ $NPM_TEST ]]; then yarn run test; fi
- if [[ $NPM_TEST ]]; then yarn run lint; fi
- if [[ $NPM_TEST ]]; then yarn coverage; fi
- if [[ $NPM_TEST ]]; then yarn lint; fi

after_success:
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml; fi
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml -F php; fi
- if [[ $NPM_TEST ]]; then bash <(curl -s https://codecov.io/bash) -F js; fi
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2015, Cam Findlay
Copyright (c)
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Expand Down
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,18 @@ other places where you need to customise it
Below is a template of the sections of your readme.md you should ideally include to met the Module Standard
and help others make use of your modules.

**Please note:** This module is designed to be a "vendor module". If you need to use it as a non-vendor module,
you will need to adjust the import paths for silverstripe/admin JS and SCSS loaders.
### Steps to prepare this module for your own use:

- Add your name/organisation to `LICENSE.md`
- Update this readme with information about your module. Ensure sections that aren't relevant are deleted and
placeholders are edited where relevant
- Review the README files in the various provided directories. You should replace these with `.gitkeep` or delete the
directories
- Update `composer.json` with your requirements and package name
- Update (or remove) `package.json` with your requirements and package name. Run `yarn` (or remove `yarn.lock`) to
ensure dependencies resolve correctly
- Clear the git history by running `rm -rf .git && git init`
- Add a push to a new remote!

## Requirements

Expand Down
27 changes: 17 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"main": "./client/src/boot/index.js",
"author": "You",
"engines": {
"node": ">=6.x"
"node": ">=10.x"
},
"scripts": {
"build": "yarn && yarn lint && NODE_ENV=production webpack -p --bail --progress",
Expand All @@ -21,18 +21,15 @@
},
"dependencies": {
"babel-polyfill": "6.7.4",
"jquery": "^3.1.1",
"mime": "^1.4.1",
"react": "15.3.1"
"react": "^16.8.3"
},
"devDependencies": {
"@silverstripe/eslint-config": "^0.0.4",
"@silverstripe/webpack-config": "^0.8.0",
"babel-jest": "^20.0.3",
"@silverstripe/eslint-config": "^0.0.5",
"@silverstripe/webpack-config": "^1.0.0",
"babel-jest": "^23.6.0",
"enzyme": "^3.3.0",
"enzyme-adapter-react-15.4": "^1.0.5",
"jest-cli": "^19.0.2",
"webpack": "^2"
"enzyme-adapter-react-16": "^1.10.0",
"jest-cli": "^23.6.0"
},
"babel": {
"presets": [
Expand All @@ -56,6 +53,16 @@
"../../silverstripe/admin/client/src",
"../../silverstripe/admin/node_modules"
],
"collectCoverageFrom": [
"**/*.{js,jsx}",
"!**/node_modules/**",
"!**/boot/**",
"!**/bundles/**",
"!**/legacy/**",
"!**/vendor/**",
"!**/*-test.{js,jsx}",
"!**/*-story.{js,jsx}"
],
"testMatch": [
"**/tests/**/*-test.js?(x)"
],
Expand Down
Loading

0 comments on commit 4fb1208

Please sign in to comment.