Skip to content

Commit

Permalink
build: Plugin skeleton
Browse files Browse the repository at this point in the history
package json, ci config, and so on, to get things going.
  • Loading branch information
jezhiggins committed May 28, 2020
0 parents commit 772d5d5
Show file tree
Hide file tree
Showing 8 changed files with 371 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
version: 2
jobs:
test:
docker:
# use node:lts
- image: circleci/node:lts
environment:
TZ: "Europe/London"
working_directory: ~/repo
steps:
- checkout
- run:
name: install
command: npm install
- run:
name: test
command: npm test
- run:
name: codecov
command: npm run coverage
release:
docker:
# use node:lts
- image: circleci/node:lts
environment:
TZ: "Europe/London"
working_directory: ~/repo
steps:
- checkout
- run:
name: install
command: npm install
- run:
name: release
command: |
chmod +x version_plugin
npx semantic-release
workflows:
version: 2
test_and_release:
jobs:
- test:
context: tymly_global
- release:
context: tymly_global
requires:
- test
filters:
branches:
only: master
182 changes: 182 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so

# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip

# Logs and databases #
######################
*.log

*.sqlite

## Node ###
~*
.~*
\#*

# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
jspm_packages

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity


## IDE things ##

# Webstorm
.idea

# VS Code
.vscode

# Eclipse:

.project
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.recommenders


scratch.txt
package-lock.json

output/

# Ignore Rush temporary files
/common/temp/**

package-deps.json

.yo-rc.json

lerna-debug.log

TEST-result.xml
.gradle/
.embedpostgresql/
build/

# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
38 changes: 38 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"branch": "master",
"analyzeCommits": {
"preset": "angular",
"releaseRules": [
{"type": "build", "scope":"deps", "release": "minor"}
]
},
"verifyConditions": [
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/git"
],
"generateNotes": {
"preset": "metahub"
},
"prepare": [
{
"path": "@semantic-release/exec",
"cmd": "echo 'VERSION=${nextRelease.version}' > .version && ./version_plugin"
},
{
"path": "@semantic-release/changelog",
"changelogFile": "CHANGELOG.md"
},
{
"path": "@semantic-release/git",
"assets": ["CHANGELOG.md"]
},
"@semantic-release/npm"
],
"publish": [
"@semantic-release/npm",
"@semantic-release/github"
],
"success": ["@semantic-release/github"],
"fail": ["@semantic-release/github"]
}
Empty file added CHANGELOG.md
Empty file.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 West Midlands Fire Service

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.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# tymly-localfilestorage-plugin
[![Tymly Package](https://img.shields.io/badge/tymly-package-blue.svg)](https://tymly.io/)
[![npm (scoped)](https://img.shields.io/npm/v/@wmfs/tymly-localfilestorage-plugin.svg)](https://www.npmjs.com/package/@wmfs/tymly-localfilestorage-plugin)
[![CircleCI](https://circleci.com/gh/wmfs/tymly-localfilestorage-plugin.svg?style=svg)](https://circleci.com/gh/wmfs/tymly-localfilestorage-plugin)
[![Dependabot badge](https://img.shields.io/badge/Dependabot-active-brightgreen.svg)](https://dependabot.com/)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
[![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/wmfs/tymly-localfilestorage-plugin/blob/master/LICENSE)

Local file storage provider for [@wmfs/tymly-cloudstorage-plugin](https://www.npmjs.com/package/@wmfs/tymly-cloudstorage-plugin)

## Usage

Simply include this plugin in the Tymly path, and it will register automatically with the cloudservice plugin.

51 changes: 51 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"name": "@wmfs/tymly-localfilestorage-plugin",
"version": "0.0.0-semantically-released",
"description": "Implements a local filestorage provider for Tymly's cloudstorage plugin.",
"homepage": "https://github.com/wmfs/tymly-localfilestorage-plugin#readme",
"author": "West Midlands Fire Service",
"keywords": [
"tymly",
"plugin",
"upload",
"cloudstorage"
],
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/wmfs/tymly-localfilestorage-plugin.git"
},
"bugs": {
"url": "https://github.com/wmfs/tymly-localfilestorage-plugin/issues"
},
"dependencies": {
},
"devDependencies": {
"@semantic-release/changelog": "5.0.1",
"@semantic-release/git": "9.0.0",
"@semantic-release/exec": "5.0.0",
"chai": "4.2.0",
"codecov": "3.7.0",
"conventional-changelog-metahub": "4.0.1",
"cz-conventional-changelog": "3.2.0",
"mocha": "7.1.2",
"nyc": "15.0.1",
"semantic-release": "17.0.7",
"standard": "14.3.4",
"@wmfs/tymly": "1.140.0"
},
"scripts": {
"lint": "standard",
"test": "nyc mocha && standard",
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
"semantic-release": "semantic-release"
},
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
}
},
"publishConfig": {
"access": "public"
}
}
14 changes: 14 additions & 0 deletions version_plugin
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

. .version
echo $VERSION
version=$VERSION
sudo apt-get install jq
sudo jq --arg version "$version" '.version=$version' plugin.json > plugin_edit.json && mv plugin_edit.json plugin.json
git config --global user.name "$GIT_COMMITTER_NAME"
git config --global user.email "$GIT_COMMITTER_EMAIL"
git remote set-url origin https://${GIT_COMMITTER_NAME}:${GH_TOKEN}@github.com/wmfs/tymly-cloudstorage-plugin.git
git checkout master
git add plugin.json
git commit -m "chore(version): plugin $version [skip ci]"
git push

0 comments on commit 772d5d5

Please sign in to comment.