Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/cleanup #42

Merged
merged 20 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules โ€ฆ
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Code Owners

## <https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners>

* @khleomix
46 changes: 46 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
65 changes: 65 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Closes

<!--
Please do not leave this blank, use this format to link issue numbers:
[#WDS-123](https://webdevstudios.atlassian.net/browse/TICKET-NUMBER)
-->

## What type of PR is this? (put an x to all applicable)

- [ ] ๐Ÿ• Feature
- [ ] ๐Ÿ› Bug Fix
- [ ] ๐Ÿ“ Documentation Update
- [ ] ๐ŸŽจ Style
- [ ] ๐Ÿง‘โ€๐Ÿ’ป Code Refactor
- [ ] ๐Ÿ”ฅ Performance Improvements
- [ ] โœ… Test
- [ ] ๐Ÿค– Build
- [ ] ๐Ÿ” CI
- [ ] ๐Ÿ“ฆ Chore (Release)
- [ ] โฉ Revert

## Link to test

<!--
Please do not leave this blank, use this format to link to testing environment:
[Develop](https://wds.wdslab.com/)
-->

## Description

<!--
Please do not leave this blank
This PR [adds/removes/fixes/replaces] the [feature/bug/etc].
-->

## Related Tickets & Documents

<!--
Please use this format link issue numbers: Fixes #WDS-123
https://docs.github.com/en/free-pro-team@latest/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
-->

## Mobile & Desktop Screenshots/Recordings

<!-- Visual changes require screenshots -->


## Added tests?

- [ ] ๐Ÿ‘ yes
- [ ] ๐Ÿ™… no, because they aren't needed
- [ ] ๐Ÿ™‹ no, because I need help

## Added to documentation?

- [ ] ๐Ÿ“œ README.md
- [ ] ๐Ÿ““ [Confluence](https://webdevstudios.atlassian.net/wiki/spaces/wds1/pages/2988474566/Feature+Documentation)
- [ ] ๐Ÿ™… no documentation needed

## Others

- [ ] ๐Ÿฆฎ Is this issue accessible? (Section 508/WCAG 2.0AA)
- [ ] ๐Ÿ™Œ Does this issue pass all the linting? (PHPCS, ESLint, SassLint)

## [optional] Are there any post-deployment tasks we need to perform?
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'weekly'
73 changes: 73 additions & 0 deletions .github/workflows/assertions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Assertions

on:
pull_request:
branches: main

workflow_dispatch:

jobs:
lint:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]
php-versions: ['8.0']

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
token: ${{ github.token }}

- name: Setup PHP ${{ matrix.php-versions }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
tools: composer:v2, phpcs

- name: Setup Node ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Use NPM 9
run: npm i -g npm@9

- name: Cache Node dependencies
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.OS }}-node-

- name: Cache Composer dependencies
uses: actions/cache@v2
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.OS }}-composer-

- name: Authorize Composer with WDS packagist server
run: echo '${{ secrets.COMPOSER_AUTH }}' > $GITHUB_WORKSPACE/auth.json

- name: Install dependencies
run: |
composer install --quiet
npm ci --legacy-peer-deps --ignore-scripts --no-fund --no-audit --quiet

- name: Lint PHP
run: npm run lint:php

- name: Lint scripts
run: npm run lint:js

- name: Lint styles
run: npm run lint:css

- name: Lint markdown
run: npm run lint:md

- name: Lint package.json
run: npm run lint:pkg-json
72 changes: 72 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: 'CodeQL'

on:
push:
branches: [main]
pull_request:
# The branches below must be a subset of the branches above
branches: [main]
schedule:
- cron: '29 23 * * 3'
workflow_dispatch:

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ['javascript']
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# โ„น๏ธ Command-line programs to run using the OS shell.
# ๐Ÿ“š https://git.io/JvXDl

# โœ๏ธ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
83 changes: 83 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Deploy to wdunderscores.com

on:
push:
branches:
- main

workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]
php-versions: ['9.0']

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
token: ${{ github.token }}

- name: Setup PHP ${{ matrix.php-versions }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
tools: composer:v2

- name: Setup Node ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Use NPM 9
run: npm i -g npm@latest

- name: Cache Node dependencies
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.OS }}-node-

- name: Cache Composer dependencies
uses: actions/cache@v2
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.OS }}-composer-

- name: Authorize Composer with WDS packagist
run: echo '${{ secrets.COMPOSER_AUTH }}' > $GITHUB_WORKSPACE/auth.json

- name: Install and build
run: |
composer install --quiet
npm ci --legacy-peer-deps --ignore-scripts --no-fund --no-audit --quiet

- name: Create downloadable zip
run: zip -r wd_f.zip * -x node_modules/\* -x vendor/\* -x .git/\*

- name: Rsync to wdunderscores.com
uses: easingthemes/ssh-deploy@v2
env:
SSH_PRIVATE_KEY: ${{ secrets.SERVER_SSH_KEY }}
ARGS: '-v -a -z --delete'
SOURCE: './'
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
TARGET: ${{ secrets.REMOTE_PATH }}
EXCLUDE: '.git/,node_modules/,vendor/,auth.json,wd_f.zip'

- name: Notify Slack
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: wd_s-firehose
SLACK_COLOR: ${{ job.status }}
SLACK_ICON: https://avatars.slack-edge.com/2020-11-25/1527503386626_319578f21381f9641cd8_192.png
SLACK_USERNAME: Github
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_FOOTER: ${{ github.repository }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ In order to build a block, run the following wpcli script.
Note: If you're using Local, you can open the shell from within Local to do this. `Sitename -> Open site shell`.

```bash
wp abs create_portable_block myblock --title="This is myblock" --desc="This block is used for wds." --keyword="myblock" --icon="table-row-before" --namespace="wds"
wp wds create_portable_block myblock --title="This is myblock" --desc="This block is used for wds." --keyword="myblock" --icon="table-row-before" --namespace="wds"
```

This will scaffold out a block inside of the `blocks` folder in the theme. Replace `myblock` with the name of your block and update the other items `title`, `desc`, `keyword`, `icon`, `namespace` with the appropriate information.
Expand Down
Loading
Loading