Skip to content
This repository has been archived by the owner on May 9, 2021. It is now read-only.

Commit

Permalink
Merge pull request #4 from ClickTrap-Media/develop
Browse files Browse the repository at this point in the history
First release of gatsby-plugin-klaro
  • Loading branch information
Pascal Zarrad committed Jan 5, 2021
2 parents b81fcf8 + 975c4c3 commit 6b435a3
Show file tree
Hide file tree
Showing 33 changed files with 12,413 additions and 119 deletions.
5 changes: 5 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"presets": [
["babel-preset-gatsby-package", { "browser": true }]
]
}
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# editorconfig.org
root = true

[*]
indent_style = space
indent_size = 4

end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
70 changes: 70 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
module.exports = {
parser: "babel-eslint",
extends: [
"google",
"eslint:recommended",
"plugin:flowtype/recommended",
"plugin:react/recommended",
"prettier",
"prettier/flowtype",
"prettier/react",
],
plugins: ["flowtype", "prettier", "react", "filenames"],
parserOptions: {
ecmaVersion: 2016,
sourceType: "module",
ecmaFeatures: {
jsx: true,
},
},
env: {
browser: true,
es6: true,
node: true,
jest: true,
},
globals: {
before: true,
after: true,
spyOn: true,
__PATH_PREFIX__: true,
__BASE_PATH__: true,
__ASSET_PREFIX__: true,
},
rules: {
"arrow-body-style": [
"error",
"as-needed",
{ requireReturnForObjectLiteral: true },
],
"no-unused-expressions": [
"error",
{
allowTaggedTemplates: true,
},
],
"no-unused-vars": [
"warn",
{
varsIgnorePattern: "^_"
}
],
"consistent-return": ["error"],
"filenames/match-regex": ["error", "^[a-z-\\d\\.]+$", true],
"no-console": "off",
"no-inner-declarations": "off",
"prettier/prettier": "error",
quotes: ["error", "double"],
"react/display-name": "off",
"react/jsx-key": "warn",
"react/no-unescaped-entities": "off",
"react/prop-types": "off",
"require-jsdoc": "off",
"valid-jsdoc": "off",
},
settings: {
react: {
version: "16.4.2",
},
},
}
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @ClickTrap-Media/oss-maintainer
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATES/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: 'C2 - bug'
assignees: pascal-zarrad

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Execute command "..."
2. Type "..."
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Environment:**
- OS: [e.g. Linux]
- Dist: [e.g. Ubuntu]
- Shell: [e.g. Bash]

**Additional context**
Add any other context about the problem here.

**Don't forget to add labels!**
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATES/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: 'C1 - enhancement'
assignees: pascal-zarrad

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
11 changes: 11 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Description
What does your PR solve? If new features where added by your PR, what are the features?

### Issue relations
To which issue(s) is your PR related? Use keywords (for example "Closes #1") to link your issues properly.

### Test Scenarios
Describe how reviewers can verify that your changes do work from a functional perspective.

### Additional information
Add here additional information if applicable or remove this section.
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Run build on every push & pr to run qa checks
name: CI

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.15.4]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm ci
- name: Run tests
run: npm run buildCoverage

- name: Remove node_modules
run: |
rm -rf node_modules
- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: output
path: ./
- name: Upload coverage report
uses: actions/upload-artifact@v2
with:
name: code-coverage-report
path: coverage
94 changes: 94 additions & 0 deletions .github/workflows/deploy_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Deploy a release to npmjs.com when a push to main occurs
name: Deploy Release

# Run job on push to main
on:
push:
branches:
- 'main'

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.15.4]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm ci
- name: Run tests
run: npm run buildCoverage

- name: Publish on npmjs.com
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_PUBLISH_TOKEN }}

- name: Prepare version for tag
run: node -p -e '`PACKAGE_VERSION=${require("./package.json").version}`' >> $GITHUB_ENV

- name: Push git tag to
uses: pkgdeps/git-tag-action@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_repo: ${{ github.repository }}
version: ${{ env.PACKAGE_VERSION }}
git_commit_sha: ${{ github.sha }}
git_tag_prefix: "v"

- name: Changelog
uses: scottbrenner/generate-changelog-action@master
id: Changelog
env:
REPO: ${{ github.repository }}

- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.PACKAGE_VERSION }}
release_name: Release v${{ env.PACKAGE_VERSION }}
body: |
${{ steps.Changelog.outputs.changelog }}
draft: false
prerelease: false

- name: Remove node_modules
run: rm -rf node_modules

- name: Remove coverage
run: rm -rf coverage

- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: output
path: ./
- name: Upload coverage report
uses: actions/upload-artifact@v2
with:
name: code-coverage-report
path: coverage

- name: Package artifact
run: zip -r gatsby-plugin-klaro-v${{ env.PACKAGE_VERSION }}.zip .

- name: Upload artifact
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./gatsby-plugin-klaro-v${{ env.PACKAGE_VERSION }}.zip
asset_name: gatsby-plugin-klaro-v${{ env.PACKAGE_VERSION }}.zip
asset_content_type: application/zip
26 changes: 26 additions & 0 deletions .github/workflows/git.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Checks for Git branches and commit messages to keep consistency on the repo
name: Git

on: ['pull_request']

jobs:
# Verify that the branch name matches the format expected for contributions
verify_branch_name:
runs-on: ubuntu-latest
steps:
- name: Check branch name
uses: deepakputhraya/action-branch-name@master
with:
regex: '([a-z])+\/([a-z])+'
allowed_prefixes: 'feature,bug,release'
ignore: master,develop
verify_commit_messages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v2
with:
configFile: commitlint.config.js

22 changes: 22 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Mark and close stale issues to keep issues clean
name: Close stale issues and pull requests

on:
schedule:
- cron: '0 0 * * *'

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3.0.5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue did not have any activity in the last 60 days. It has been marked as stale and will be closed soon.'
stale-pr-message: 'This pull request did not have any activity in the last 60 days. It has been marked as stale and will be closed soon.'
stale-issue-label: 'S2 - stale - no activity'
stale-pr-label: 'S2 - stale - no activity'
exempt-issue-labels: 'S6 - in progress'
exempt-pr-labels: 'S6 - in progress'
days-before-stale: 60
days-before-close: 7
12 changes: 9 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ build/Release
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

Expand Down Expand Up @@ -67,3 +64,12 @@ yarn-error.log
.pnp.js
# Yarn Integrity file
.yarn-integrity

# Ignore files
/*.js
!/commitlint.config.js
!/gulpfile.js
!/.eslintrc.js
!/.prettierrc.js
!/jest.config.js
coverage/
12 changes: 12 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.github
.editorconfig
CODE_OF_CONDUCT.md
commitlint.config.js
CONTRIBUTING.md
SECURITY.md
tasks
gulpfile.js
.babelrc
src
jest.config.js
coverage/
4 changes: 4 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
arrowParens: "avoid",
semi: true,
}
Loading

0 comments on commit 6b435a3

Please sign in to comment.