Skip to content

Commit

Permalink
adds wp-env setup
Browse files Browse the repository at this point in the history
  • Loading branch information
mohanrajpac committed Feb 17, 2024
1 parent b9e4744 commit f83ddd2
Show file tree
Hide file tree
Showing 4 changed files with 453 additions and 58 deletions.
6 changes: 6 additions & 0 deletions .wp-env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"core": "latest",
"plugins": {
"feature-flag": {}
}
}
96 changes: 49 additions & 47 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,49 +1,51 @@
{
"name": "mr-feature-flags",
"version": "1.0.0",
"description": "Allows developers to enable / disable features based on flags.",
"scripts": {
"start": "wp-scripts start",
"build": "wp-scripts build",
"lint:js": "wp-scripts lint-js",
"test:js": "wp-scripts test-unit-js",
"test:watch": "wp-scripts test-unit-js --watch",
"prepare": "husky install"
},
"devDependencies": {
"@playwright/test": "^1.41.2",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "14.2.1",
"@types/jest": "^29.5.12",
"@types/node": "^20.11.17",
"@types/react-syntax-highlighter": "^15.5.11",
"@types/wordpress__components": "^23.0.11",
"@wordpress/e2e-test-utils-playwright": "^0.19.0",
"@wordpress/eslint-plugin": "^17.8.0",
"@wordpress/scripts": "^27.2.0",
"eslint": "^8.56.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-cypress": "^2.15.1",
"eslint-plugin-import": "^2.29.1",
"husky": "^9.0.11",
"jest-environment-jsdom": "^29.7.0",
"prettier": "^3.2.5"
},
"keywords": [],
"author": "Mohan Raj <https://mohanraj.dev>",
"license": "ISC",
"dependencies": {
"@wordpress/api-fetch": "^6.48.0",
"@wordpress/components": "^26.0.1",
"@wordpress/data": "^9.21.0",
"@wordpress/i18n": "^4.51.0",
"@wordpress/notices": "^4.19.0",
"dotenv": "^16.4.4",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-syntax-highlighter": "^15.5.0",
"react-test-renderer": "^18.2.0",
"ts-loader": "^9.5.1",
"typescript": "^5.3.3"
}
"name": "mr-feature-flags",
"version": "1.0.0",
"description": "Allows developers to enable / disable features based on flags.",
"scripts": {
"start": "wp-scripts start",
"build": "wp-scripts build",
"lint:js": "wp-scripts lint-js",
"test:js": "wp-scripts test-unit-js",
"test:watch": "wp-scripts test-unit-js --watch",
"prepare": "husky install",
"wp-env": "wp-env start"
},
"devDependencies": {
"@playwright/test": "^1.41.2",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "14.2.1",
"@types/jest": "^29.5.12",
"@types/node": "^20.11.17",
"@types/react-syntax-highlighter": "^15.5.11",
"@types/wordpress__components": "^23.0.11",
"@wordpress/e2e-test-utils-playwright": "^0.19.0",
"@wordpress/env": "^9.3.0",
"@wordpress/eslint-plugin": "^17.8.0",
"@wordpress/scripts": "^27.2.0",
"eslint": "^8.56.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-cypress": "^2.15.1",
"eslint-plugin-import": "^2.29.1",
"husky": "^9.0.11",
"jest-environment-jsdom": "^29.7.0",
"prettier": "^3.2.5"
},
"keywords": [],
"author": "Mohan Raj <https://mohanraj.dev>",
"license": "ISC",
"dependencies": {
"@wordpress/api-fetch": "^6.48.0",
"@wordpress/components": "^26.0.1",
"@wordpress/data": "^9.21.0",
"@wordpress/i18n": "^4.51.0",
"@wordpress/notices": "^4.19.0",
"dotenv": "^16.4.4",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-syntax-highlighter": "^15.5.0",
"react-test-renderer": "^18.2.0",
"ts-loader": "^9.5.1",
"typescript": "^5.3.3"
}
}
6 changes: 4 additions & 2 deletions src/settings.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { render } from '@wordpress/element';
import { createRoot } from '@wordpress/element';
import Flags from './components/Flags';
import './styles/settings.scss';
render(<Flags />, document.getElementById('mr_feature_flags_settings_screen'));
const container = document.getElementById('mr_feature_flags_settings_screen');
const root = container && createRoot(container);
root?.render(<Flags />);
Loading

0 comments on commit f83ddd2

Please sign in to comment.