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

Remove wordpress/scripts dependency, update dev tooling #90

Merged
merged 2 commits into from
Jul 24, 2024
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
25 changes: 25 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
extends: [
'plugin:import/recommended',
'plugin:jsdoc/recommended',
'plugin:jsx-a11y/recommended',
'plugin:prettier/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
],
env: {
browser: true,
},
ignorePatterns: ['build/**/*.js', 'vendor/**/*.js'],
rules: {
'no-console': ['warn', { allow: ['error'] }],
'import/no-unresolved': [2, { ignore: ['^@wordpress/'] }],
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
},
settings: {
react: {
version: '18',
},
},
};
22 changes: 22 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const config = {
useTabs: true,
tabWidth: 4,
printWidth: 80,
singleQuote: true,
trailingComma: 'es5',
bracketSameLine: false,
bracketSpacing: true,
semi: true,
arrowParens: 'always',
parenSpacing: true,
overrides: [
{
files: '*.{css,sass,scss}',
options: {
singleQuote: false,
},
},
],
};

module.exports = config;
90 changes: 45 additions & 45 deletions build/show-hide-group/block.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
{
"$schema": "https://json.schemastore.org/block.json",
"apiVersion": 2,
"name": "happyprime/show-hide-group",
"title": "Show Hide Group",
"textdomain": "show-hide-section-block",
"category": "widgets",
"description": "A group of accessible summaries that can be toggled to show or hide additional details.",
"icon": "hidden",
"attributes": {
"hasToggle": {
"type": "boolean",
"default": false
}
},
"supports": {
"align": true,
"alignWide": true,
"anchor": true,
"color": {
"background": true,
"enableContrastChecker": true,
"text": true,
"link": true,
"gradients": true
},
"defaultStylePicker": true,
"dimensions": {
"minHeight": true
},
"html": false,
"position": {
"sticky": false
},
"spacing": {
"margin": true,
"padding": true
},
"typography": {
"fontSize": true,
"lineHeight": true
}
},
"editorScript": "file:index.js",
"viewScript": "file:view.js"
}
"$schema": "https://json.schemastore.org/block.json",
"apiVersion": 2,
"name": "happyprime/show-hide-group",
"title": "Show Hide Group",
"textdomain": "show-hide-section-block",
"category": "widgets",
"description": "A group of accessible summaries that can be toggled to show or hide additional details.",
"icon": "hidden",
"attributes": {
"hasToggle": {
"type": "boolean",
"default": false
}
},
"supports": {
"align": true,
"alignWide": true,
"anchor": true,
"color": {
"background": true,
"enableContrastChecker": true,
"text": true,
"link": true,
"gradients": true
},
"defaultStylePicker": true,
"dimensions": {
"minHeight": true
},
"html": false,
"position": {
"sticky": false
},
"spacing": {
"margin": true,
"padding": true
},
"typography": {
"fontSize": true,
"lineHeight": true
}
},
"editorScript": "file:index.js",
"viewScript": "file:view.js"
}
2 changes: 1 addition & 1 deletion build/show-hide-group/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '9821368a8f1930a9690c');
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-i18n'), 'version' => '9eadd2a33a88729b380f');
2 changes: 1 addition & 1 deletion build/show-hide-group/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/show-hide-group/view.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array(), 'version' => 'c1c493ae492c636904dd');
<?php return array('dependencies' => array(), 'version' => 'fbf381460e85f307651f');
2 changes: 1 addition & 1 deletion build/show-hide-group/view.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

104 changes: 51 additions & 53 deletions build/show-hide-section/block.json
Original file line number Diff line number Diff line change
@@ -1,54 +1,52 @@
{
"$schema": "https://json.schemastore.org/block.json",
"apiVersion": 2,
"name": "happyprime/show-hide-section",
"title": "Show Hide Section",
"textdomain": "show-hide-section-block",
"category": "widgets",
"description": "A section of collapsible content contained in a details element with a summary.",
"icon": "media-document",
"parent": [
"happyprime/show-hide-group"
],
"attributes": {
"isOpen": {
"type": "boolean",
"default": false
},
"summary": {
"type": "string",
"source": "html",
"selector": "summary"
}
},
"supports": {
"anchor": true,
"align": true,
"alignWide": true,
"color": {
"background": true,
"enableContrastChecker": true,
"text": true,
"link": true,
"gradients": true
},
"defaultStylePicker": true,
"dimensions": {
"minHeight": true
},
"html": false,
"multiple": true,
"position": {
"sticky": false
},
"spacing": {
"margin": true,
"padding": true
},
"typography": {
"fontSize": true,
"lineHeight": true
}
},
"editorScript": "file:index.js"
}
"$schema": "https://json.schemastore.org/block.json",
"apiVersion": 2,
"name": "happyprime/show-hide-section",
"title": "Show Hide Section",
"textdomain": "show-hide-section-block",
"category": "widgets",
"description": "A section of collapsible content contained in a details element with a summary.",
"icon": "media-document",
"parent": [ "happyprime/show-hide-group" ],
"attributes": {
"isOpen": {
"type": "boolean",
"default": false
},
"summary": {
"type": "string",
"source": "html",
"selector": "summary"
}
},
"supports": {
"anchor": true,
"align": true,
"alignWide": true,
"color": {
"background": true,
"enableContrastChecker": true,
"text": true,
"link": true,
"gradients": true
},
"defaultStylePicker": true,
"dimensions": {
"minHeight": true
},
"html": false,
"multiple": true,
"position": {
"sticky": false
},
"spacing": {
"margin": true,
"padding": true
},
"typography": {
"fontSize": true,
"lineHeight": true
}
},
"editorScript": "file:index.js"
}
2 changes: 1 addition & 1 deletion build/show-hide-section/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-element', 'wp-i18n'), 'version' => 'b7962f8806702068f778');
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-i18n'), 'version' => '0edc701a59a283b3c2e5');
2 changes: 1 addition & 1 deletion build/show-hide-section/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 16 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
{
"name": "happyprime/show-hide-section-block",
"version": "1.3.2",
"type": "wordpress-plugin",
"minimum-stability": "stable",
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "*",
"phpcompatibility/phpcompatibility-wp": "*",
"sirbrillig/phpcs-variable-analysis": "^2.11",
"squizlabs/php_codesniffer": "3.*",
"wp-coding-standards/wpcs": "*"
},
"scripts": {
"lint": "vendor/bin/phpcs",
"fix": "vendor/bin/phpcbf"
},
"license": "GPLv2+",
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"composer/installers": true,
"dealerdirect/phpcodesniffer-composer-installer": true
"phpstan/extension-installer": true
},
"platform": {
"php": "7.4"
}
},
"require-dev": {
"happyprime/coding-standards": "*",
"phpcompatibility/php-compatibility": "dev-develop as 9.99.99"
},
"scripts": {
"phpcs": "vendor/bin/phpcs",
"phpcbf": "vendor/bin/phpcbf",
"phpstan": "vendor/bin/phpstan analyse --memory-limit=2048M"
}
}
Loading