Skip to content

Commit

Permalink
Merge pull request #27 from brainstormforce/main-build
Browse files Browse the repository at this point in the history
STAR-174 - Merge to master - v1.0.0
  • Loading branch information
vrundakansara authored Jul 11, 2023
2 parents 14b811f + 8d29527 commit b786764
Show file tree
Hide file tree
Showing 39 changed files with 27,184 additions and 1,944 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["@babel/preset-react", "@babel/preset-env"]
}
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build
58 changes: 58 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"root": true,
"extends": [
"plugin:@wordpress/eslint-plugin/recommended"
],
"env": {
"browser": true
},
"parserOptions": {
"requireConfigFile": false,
"babelOptions": {
"presets": [
"@wordpress/babel-preset-default"
]
}
},
"globals": {
"starterTemplates": true,
"astraSitesVars": true,
"ajaxurl": true,
"starterTemplatesPreview":true,
"jQuery": true
},
"rules": {
"jsdoc/require-param": "off",
"jsdoc/valid-types": "error",
"jsx-a11y/no-static-element-interactions": "off", // Should be enabled.
"jsx-a11y/click-events-have-key-events": "off", // Should be enabled.
"jsx-a11y/alt-text": "error",
"eqeqeq": "error",
"jsx-a11y/iframe-has-title": "error",
"jsdoc/check-param-names": "error",
"jsx-a11y/no-noninteractive-element-interactions": "off", // Should be enabled.
"@wordpress/i18n-no-variables": "error",
"no-template-curly-in-string": "error",
"no-throw-literal": "error",
"no-unmodified-loop-condition": "error",
"no-useless-call": "error",
"no-useless-concat": "error",
"prefer-object-spread": "off", // Should be enabled.
"prefer-promise-reject-errors": "error",
"prefer-rest-params": "error",
"prefer-spread": "error",
"radix": [ "error", "as-needed" ],
"require-await": "error",
"rest-spread-spacing": [ "error", "never" ],
"react/prop-types": "off", // Should be enabled.
"react-hooks/exhaustive-deps": [ "off", { "additionalHooks": "useSelect" } ],
"react/jsx-closing-tag-location": "error",
"react/jsx-fragments": "error",
"react/self-closing-comp": "error",
"react/jsx-first-prop-new-line": "error",
"react/jsx-no-literals": "off", // Should be enabled.
"react/jsx-no-useless-fragment": "off", // Should be enabled.
"import/order": [ "error", { "groups": [ "builtin", [ "external", "unknown" ], "internal", "parent", "sibling", "index" ] } ],
"func-style": ["error", "expression"]
}
}
22 changes: 22 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
### Description
<!-- Please describe what you have changed or added -->

### Screenshots
<!-- if applicable -->

### Types of changes
<!-- What types of changes does your code introduce? -->
<!-- Bug fix (non-breaking change which fixes an issue) -->
<!-- New feature (non-breaking change which adds functionality) -->
<!-- Breaking change -->

### How has this been tested?
<!-- Please describe in detail how you tested your changes. -->

### Checklist:
- [ ] My code is tested
- [ ] My code follows accessibility standards <!-- Guidelines: https://make.wordpress.org/core/handbook/best-practices/coding-standards/accessibility-coding-standards/ -->
- [ ] My code has proper inline documentation <!-- Guidelines: https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/javascript/ -->
- [ ] I've included any necessary tests <!-- if applicable -->
- [ ] I've included developer documentation <!-- if applicable -->
- [ ] I've added proper labels to this pull request <!-- if applicable -->
65 changes: 65 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: CI

# Run the deployment only when code is committed to the branch.
on: pull_request

# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

jobs:
lint-and-audit:

runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
token: ${{ secrets.PRIVATE_ACCESS_TOKEN }}
ref: ${{ github.event.pull_request.head.ref }}

- name: Use Node.js 12.x
uses: actions/[email protected]
with:
node-version: 12.x
cache: 'npm'

- name: Set composer token
run: composer config github-oauth.github.com ${{ secrets.PRIVATE_ACCESS_TOKEN }}

- name: Composer Install
uses: ramsey/composer-install@v1

- name: NPM Dependencies
if: always()
run: npm install

- name: PHPCS check
if: always()
uses: chekalsky/phpcs-action@v1
with:
phpcs_bin_path: './vendor/bin/phpcs'

- name: PHP Syntax Errors
if: always()
run: if find . -name "*.php" ! -path "./vendor/*" ! -path "./admin/bsf-core/*" -exec php -l {} \; | grep "Errors parsing"; then exit 1; fi

- name: Lint JS
if: always()
run: npm run lint:js:fix

- name: Commit ESLint fixes
if: always()
uses: EndBug/[email protected]
with:
add: 'src/*.js'
default_author: github_actor
message: 'Commit ESLint auto fixes'
pathspec_error_handling: exitAtEnd
push: true


36 changes: 36 additions & 0 deletions .github/workflows/release-pr-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: PR update

on:
pull_request:
types: [ labeled ]

jobs:
update_pr:
name: PR update
if: ${{ github.event.label.name == 'Release PR checklist' }}
runs-on: ubuntu-latest
steps:
- name: Check Branch
id: check-branch
run: |
if [[ ${{ github.base_ref }} == master || ${{ github.base_ref }} == release-candidate || ${{ github.base_ref }} == next-release ]]; then
echo ::set-output name=match::true
fi
- uses: tzkhan/pr-update-action@v2
if: steps.check-branch.outputs.match == 'true'
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
base-branch-regex: '[A-Za-z\d-_.\\/]+'
head-branch-regex: '[A-Za-z\d-_.\\/]+'
title-template: 'Build: Release PR'
body-template: |
### Description
- Final release PR. Please check all the checklist below before merging.
---
### Checklist:
- [ ] Run to update packages : `npm audit fix`
- [ ] PHPCS - vendor/bin/phpcs
---
body-update-action: 'prefix'
title-update-action: 'prefix'
body-uppercase-base-match: false
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
node_modules
/node_modules

build
/vendor/
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/src
.babelrc
webpack.config.js
1 change: 1 addition & 0 deletions build/index.js

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "brainstormforce/starter-templates-components",
"description": "Starter Templates Component Library.",
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "0.7.1",
"phpcompatibility/phpcompatibility-wp": "*",
"wp-coding-standards/wpcs": "dev-master"
},
"scripts": {
"format": "phpcbf --standard=phpcs.xml.dist --report-summary --report-source",
"lint": "phpcs --standard=phpcs.xml.dist --report-summary --report-source"
}
}

Loading

0 comments on commit b786764

Please sign in to comment.