Skip to content

Commit

Permalink
Chore: update development setup (#54)
Browse files Browse the repository at this point in the history
* chore: update pckages.json

* chore: setup github workflows

* chore: add editor config

* chore: setup assets

* fix: load assets from dist directory

* chore: update .distignore

* chore: ignore language directory except .gitkeep

* doc: add unreleased tag

* chore: update WP and PHP dependency version

* chore: remove unused gulpfile

Co-authored-by: Jon Waldstein <[email protected]>
  • Loading branch information
ravinderk and jonwaldstein authored Jul 6, 2022
1 parent 5156878 commit f855771
Show file tree
Hide file tree
Showing 19 changed files with 20,152 additions and 2,364 deletions.
28 changes: 28 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/.git
.gitignore

/.idea
/.github

/tests
/node_modules
/assets/src
/assets/dist/**/*.map
/vendor/bin
/vendor/composer/installers
/vendor/**/*.phar

.editorconfig
composer.json
composer.lock
package.json
package-lock.json
CHANGELOG.md
README.md
readme.md
webpack.mix.js

# GH Action files
DOCKER_ENV
docker_tag
output.log
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# http://editorconfig.org
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
tab_width = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.txt]
trim_trailing_whitespace = false
69 changes: 0 additions & 69 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

28 changes: 0 additions & 28 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

12 changes: 12 additions & 0 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Build Plugin Pre-Release

on:
release:
types: [ prereleased ]

jobs:
build:
uses: impress-org/givewp-github-actions/.github/workflows/pre-release.yml@master
with:
plugin_slug: give-google-analytics
zip_name: give-google-analytics
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Release to GiveWP.com

on:
release:
types: [ released ]

jobs:
build:
uses: impress-org/givewp-github-actions/.github/workflows/givewp-release.yml@master
with:
plugin_slug: give-google-analytics
zip_name: give-google-analytics
secrets:
GIVEWP_DOWNLOADS_PATH: ${{ secrets.GIVEWP_DOWNLOADS_PATH }}
GIVEWP_DOWNLOADS_URI: ${{ secrets.GIVEWP_DOWNLOADS_URI }}
GIVEWP_CLOUDFLARE_TOKEN: ${{ secrets.GIVEWP_CLOUDFLARE_TOKEN }}
GIVEWP_CLOUDFLARE_ZONE: ${{ secrets.GIVEWP_CLOUDFLARE_ZONE }}
WEBSITE_DEPLOY_HOST: ${{ secrets.WEBSITE_DEPLOY_HOST }}
WEBSITE_DEPLOY_USER: ${{ secrets.WEBSITE_DEPLOY_USER }}
WEBSITE_DEPLOY_PRIVATE_KEY: ${{ secrets.WEBSITE_DEPLOY_PRIVATE_KEY }}
EDD_PRODUCT_ID: ${{ secrets.EDD_PRODUCT_ID }}
SLACK_ANNOUNCEMENT_WEBHOOK: ${{ secrets.SLACK_ANNOUNCEMENT_WEBHOOK }}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
node_modules

assets/dist

languages/*
!languages/.gitkeep

File renamed without changes.
File renamed without changes
File renamed without changes.
2 changes: 2 additions & 0 deletions give-google-analytics.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
* Version: 1.2.5
* Author: GiveWP
* Author URI: https://givewp.com
* Requires at least: 5.0
* Requires PHP: 7.0
* Text Domain: give-google-analytics
*/

Expand Down
75 changes: 0 additions & 75 deletions gulpfile.js

This file was deleted.

10 changes: 7 additions & 3 deletions includes/class-give-google-analytics-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,19 @@ public function setup() {

/**
* Add scripts.
*
* @unreleased Load assets from dist directory
*/
public function add_scripts( $hook ) {

// Load only on settings pages.
if ( $hook !== 'give_forms_page_give-settings' ) {
return;
}
wp_register_style( 'give-ga-settings-css', GIVE_GOOGLE_ANALYTICS_URL . 'assets/css/give-ga-settings.css' );
wp_register_style( 'give-ga-settings-css', GIVE_GOOGLE_ANALYTICS_URL . 'assets/dist/css/give-ga-settings.css' );
wp_enqueue_style( 'give-ga-settings-css' );

wp_register_script( 'give-ga-settings-js', GIVE_GOOGLE_ANALYTICS_URL . 'assets/js/give-ga-settings.js', array( 'jquery' ), GIVE_GOOGLE_ANALYTICS_VERSION, false );
wp_register_script( 'give-ga-settings-js', GIVE_GOOGLE_ANALYTICS_URL . 'assets/dist/js/give-ga-settings.js', array( 'jquery' ), GIVE_GOOGLE_ANALYTICS_VERSION, false );
wp_enqueue_script( 'give-ga-settings-js' );

}
Expand Down Expand Up @@ -217,13 +219,15 @@ public function add_settings( $settings ) {

/**
* Description Field.
*
* @unreleased Load images from dist directory.
*/
function description_field() {
?>

<div class="give-ga-settings-description">
<p style="margin:20px 0 0;">
<img src="<?php echo GIVE_GOOGLE_ANALYTICS_URL . 'assets/img/ga-logo-small.png'; ?>"></p>
<img src="<?php echo GIVE_GOOGLE_ANALYTICS_URL . 'assets/dist/img/ga-logo-small.png'; ?>"></p>
</div>

<?php
Expand Down
Empty file added languages/.gitkeep
Empty file.
Loading

0 comments on commit f855771

Please sign in to comment.