Skip to content

Commit

Permalink
Changed wpeg to wp-scripts (#201)
Browse files Browse the repository at this point in the history
* moved src to root folder and added based wp scripts config

* replaced the call to wp components with import constructions

* added vendor assets

* updated package

* fixed ToolsPanelItem module build failed

* build

* replaced @@plugin_name to ghostkit

* replaced @@text_domain to ghostkit

* replaced @@plugin_version to number

* fixed include composer vendor for background processing

* added enqueue and register methods to simplify work with build assets

* changed enqueue and register assets to new methods

* fixed svg import for work with new builder

* fixed wp-scripts config for style chunks

* build

* replaced @@plugin_version to variable

* build

* added support for file change time when enqueue asset without .asset.php file

* fixed phpcs configuration

* phpcs

* added prettier configurations

* removed wpeg

* replaced stylelint and eslint to wp scripts linters

* added wp-env configurations

* added gulp tasks

* added inex.php

* added translate pot and json files

* updated dependencies

* updated linters and packages

* added tests

* lint

* build

* added vscode exclude config for prettier

* added yml github hooks

* fixed package from test

* fixed fallback CSS block margins for form fields

* Update settings.json

* fixed typo

* deleted comments from js dependencies and lintered

* lintered tests

* removed google maps react library

use google maps api directly
added support for custom markers and info window text

* removed react lazyload and masonry, as no longer used

* updated some deps

* fixed migration to new Ghost Kit attributes from deprecated blocks

* changed Spring transition defaults

* changed ProNote component in Reveal effect to collapsed version to not overwhelm effect settings panel

* Update class-breakpoints.php

* added git ignored files

* added gitkeep

* eslinted

* added test for plugin path and url

* updated number of minimum expected tests to run in actions

* updated lock files

* fixed video block

* build

* fixed version number

---------

Co-authored-by: Nikita <[email protected]>
  • Loading branch information
Fellan-91 and nk-o authored Feb 7, 2024
1 parent d4f263e commit 8e5e84c
Show file tree
Hide file tree
Showing 1,839 changed files with 105,150 additions and 92,099 deletions.
1 change: 0 additions & 1 deletion .browserslistrc

This file was deleted.

File renamed without changes.
28 changes: 28 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Directories to ignore
/.git
/.cache
/.github
/.husky
/.vscode
/.wordpress-org
/artifacts
/dist-zip
/node_modules
/tests
/vendor

# Files to ignore
/.*
/composer.json
/composer.lock
/gulpfile.js
/LICENSE.txt
/lint-staged.config.js
/package-lock.json
/package.json
/phpcs.xml
/phpcs.xml.dist
/phpunit.xml
/phpunit.xml.dist
/README.md
/webpack.config.js
8 changes: 4 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_style = tab

[*.php]
indent_size = 4
[*.yml]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
assets/vendor/**
18 changes: 0 additions & 18 deletions .eslintrc

This file was deleted.

40 changes: 40 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
const groups = {
// The default grouping, but with no blank lines.
groups: [
// Side effect imports.
['^\\u0000'],
// Node.js builtins prefixed with `node:`.
['^node:'],
// Packages.
// Things that start with a letter (or digit or underscore), or `@` followed by a letter.
['^@?\\w'],
// WordPress imports
['^@wordpress'],
// Absolute imports and other imports such as Vue-style `@/foo`.
// Anything not matched in another group.
['^'],
// Relative imports.
// Anything that starts with a dot.
['^\\.'],
],
};

module.exports = {
extends: ['plugin:@wordpress/eslint-plugin/recommended'],
rules: {
'@wordpress/no-unsafe-wp-apis': 0,
'@wordpress/i18n-translator-comments': 0,
'jsdoc/no-undefined-types': 0,
'jsdoc/require-param-type': 0,
'jsdoc/require-returns-description': 0,
'jsdoc/check-tag-names': 0,
'react-hooks/rules-of-hooks': 0,
'jsdoc/check-param-names': 0,
'simple-import-sort/imports': ['error', groups],
'simple-import-sort/exports': 'error',
},
settings: {
'import/core-modules': ['jquery', 'lodash'],
},
plugins: ['simple-import-sort'],
};
44 changes: 44 additions & 0 deletions .github/setup-node/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: 'Setup Node.js and install npm dependencies'
description: 'Configure Node.js and install npm dependencies while managing all aspects of caching.'
inputs:
node-version:
description: 'Optional. The Node.js version to use. When not specified, the version specified in .nvmrc will be used.'
required: false
type: string

runs:
using: 'composite'
steps:
- name: Use desired version of Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
node-version: ${{ inputs.node-version }}
cache: npm

- name: Get Node.js and npm version
id: node-version
run: |
echo "NODE_VERSION=$(node -v)" >> $GITHUB_OUTPUT
shell: bash

- name: Cache node_modules
id: cache-node_modules
uses: actions/cache@v3
with:
path: '**/node_modules'
key: node_modules-${{ runner.os }}-${{ steps.node-version.outputs.NODE_VERSION }}-${{ hashFiles('package-lock.json') }}

- name: Install npm dependencies
if: ${{ steps.cache-node_modules.outputs.cache-hit != 'true' }}
run: npm ci
shell: bash

# On cache hit, we run the post-install script to match the native `npm ci` behavior.
# An example of this is to patch `node_modules` using patch-package.
- name: Post-install
if: ${{ steps.cache-node_modules.outputs.cache-hit == 'true' }}
run: |
# Run the post-install script for the root project.
npm run postinstall
shell: bash
33 changes: 0 additions & 33 deletions .github/workflows/deploy.yml

This file was deleted.

22 changes: 22 additions & 0 deletions .github/workflows/push-asset-readme-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Plugin Asset/Readme Update

on:
workflow_dispatch:
push:
branches:
- master

jobs:
trunk:
name: Push to trunk
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: WordPress.org plugin asset/readme update
uses: 10up/action-wordpress-plugin-asset-update@stable
env:
SLUG: ghostkit
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
22 changes: 22 additions & 0 deletions .github/workflows/push-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Deploy to WordPress.org

on:
workflow_dispatch:
push:
tags:
- 'v*'

jobs:
tag:
name: New release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: WordPress Plugin Deploy
uses: 10up/action-wordpress-plugin-deploy@stable
env:
SLUG: ghostkit
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
48 changes: 48 additions & 0 deletions .github/workflows/tests-e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: End-to-End Tests

on:
pull_request:
push:
branches:
- master
# Allow manually triggering the workflow.
workflow_dispatch:

# 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:
playwright:
name: Playwright - ${{ matrix.part }}
runs-on: ubuntu-latest
if: ${{ github.repository == 'nk-crew/ghostkit' || github.event_name == 'pull_request' }}
strategy:
fail-fast: false
matrix:
part: [1, 2, 3, 4]
totalParts: [4]

steps:
- uses: actions/checkout@v3

- name: Setup Node.js and install dependencies
uses: ./.github/setup-node

- name: Npm build
run: npm run build

- name: Install Playwright dependencies
run: |
npx playwright install chromium firefox webkit --with-deps
- name: Install WordPress and start the server
run: |
npm run wp-env start
- name: Run the tests
run: |
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test:e2e -- --shard=${{ matrix.part }}/${{ matrix.totalParts }}
Loading

0 comments on commit 8e5e84c

Please sign in to comment.