├── .github └── workflows │ └── deploy.yml ├── .gitignore ├── .gitlab-ci.ts ├── .gitlab-ci.yml ├── .idea ├── .gitignore ├── .name ├── codeStyles │ ├── Project.xml │ └── codeStyleConfig.xml ├── inspectionProfiles │ └── Project_Default.xml ├── misc.xml ├── modules.xml ├── php-test-framework.xml ├── php.xml └── tatum.iml ├── .prettierignore ├── .vscode ├── extensions.json ├── launch.json ├── settings.json └── tasks.json ├── README.md ├── SUMMARY.md ├── common ├── .env-default ├── .eslintrc ├── Gruntfile.plugin.ts ├── Gruntfile.ts ├── create-wp-react-app │ ├── README.md │ ├── grunt-index-php.tmpl │ ├── grunt-readme-txt.tmpl │ ├── template-package │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── LICENSE_3RD_PARTY_JS.md │ │ ├── LICENSE_3RD_PARTY_PHP.md │ │ ├── README.md │ │ ├── composer.json │ │ ├── composer.lock │ │ ├── devops │ │ │ └── .gitlab │ │ │ │ ├── .gitlab-ci.ts │ │ │ │ ├── stage-build.ts │ │ │ │ ├── stage-test.ts │ │ │ │ └── stage-validate.ts │ │ ├── languages │ │ │ ├── backend │ │ │ │ ├── utils-de_DE.mo │ │ │ │ ├── utils-de_DE.po │ │ │ │ └── utils.pot │ │ │ └── frontend │ │ │ │ └── utils.pot │ │ ├── package.json │ │ ├── scripts │ │ │ ├── Gruntfile.ts │ │ │ └── webpack.config.ts │ │ ├── test │ │ │ ├── jest.config.js │ │ │ ├── patchwork.json │ │ │ ├── phpunit.bootstrap.php │ │ │ ├── phpunit.xdebug.php │ │ │ └── phpunit.xml │ │ └── tsconfig.json │ └── template │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── LICENSE_3RD_PARTY_JS.md │ │ ├── LICENSE_3RD_PARTY_PHP.md │ │ ├── composer.json │ │ ├── composer.lock │ │ ├── cypress.json │ │ ├── devops │ │ ├── .gitlab │ │ │ ├── .gitlab-ci.ts │ │ │ ├── stage-build-production.ts │ │ │ ├── stage-build.ts │ │ │ ├── stage-deploy.ts │ │ │ ├── stage-test.ts │ │ │ └── stage-validate.ts │ │ ├── docker-compose │ │ │ ├── docker-compose.e2e.yml │ │ │ ├── docker-compose.local.yml │ │ │ ├── docker-compose.traefik.yml │ │ │ └── docker-compose.yml │ │ └── scripts │ │ │ └── wordpress-startup.sh │ │ ├── package.json │ │ ├── scripts │ │ ├── Gruntfile.ts │ │ └── webpack.config.ts │ │ ├── src │ │ ├── inc │ │ │ ├── Activator.php │ │ │ ├── Assets.php │ │ │ ├── Core.php │ │ │ ├── Localization.php │ │ │ ├── base │ │ │ │ ├── Core.php │ │ │ │ ├── UtilsProvider.php │ │ │ │ ├── index.php │ │ │ │ └── others │ │ │ │ │ ├── fallback-php-version.php │ │ │ │ │ ├── fallback-rest-api.php │ │ │ │ │ ├── fallback-wp-version.php │ │ │ │ │ ├── index.php │ │ │ │ │ └── start.php │ │ │ ├── index.php │ │ │ ├── rest │ │ │ │ ├── HelloWorld.php │ │ │ │ └── index.php │ │ │ └── view │ │ │ │ ├── index.php │ │ │ │ ├── menu │ │ │ │ ├── Page.php │ │ │ │ └── index.php │ │ │ │ └── widget │ │ │ │ ├── Widget.php │ │ │ │ └── index.php │ │ ├── index.php │ │ ├── languages │ │ │ ├── wp-reactjs-starter-de_DE.mo │ │ │ ├── wp-reactjs-starter-de_DE.po │ │ │ └── wp-reactjs-starter.pot │ │ ├── public │ │ │ ├── languages │ │ │ │ ├── json │ │ │ │ │ ├── wp-reactjs-starter-de_DE-1458bc3eb855dd3b40a27bc171a5aed9.json │ │ │ │ │ └── wp-reactjs-starter-de_DE-d6c7c71371fa4fbe7cc75f0a20f23d0e.json │ │ │ │ ├── wp-reactjs-starter-de_DE.mo │ │ │ │ ├── wp-reactjs-starter-de_DE.po │ │ │ │ └── wp-reactjs-starter.pot │ │ │ └── ts │ │ │ │ ├── admin.tsx │ │ │ │ ├── components │ │ │ │ ├── index.tsx │ │ │ │ ├── page.tsx │ │ │ │ ├── todo.tsx │ │ │ │ └── todoItem.tsx │ │ │ │ ├── models │ │ │ │ ├── index.tsx │ │ │ │ └── todoModel.tsx │ │ │ │ ├── store │ │ │ │ ├── index.tsx │ │ │ │ ├── option.tsx │ │ │ │ ├── stores.tsx │ │ │ │ └── todo.tsx │ │ │ │ ├── style │ │ │ │ ├── admin.scss │ │ │ │ └── widget.scss │ │ │ │ ├── types │ │ │ │ └── global.d.ts │ │ │ │ ├── utils │ │ │ │ └── index.tsx │ │ │ │ ├── widget.tsx │ │ │ │ ├── widget │ │ │ │ └── index.tsx │ │ │ │ └── wp-api │ │ │ │ ├── hello.get.tsx │ │ │ │ └── index.tsx │ │ └── uninstall.php │ │ ├── test │ │ ├── cypress │ │ │ ├── integration │ │ │ │ └── adminPage.feature │ │ │ ├── plugins │ │ │ │ └── index.ts │ │ │ ├── step-definitions │ │ │ │ ├── adminPage │ │ │ │ │ ├── AdminPageObject.ts │ │ │ │ │ └── adminPage.ts │ │ │ │ └── common │ │ │ │ │ ├── common.ts │ │ │ │ │ └── index.ts │ │ │ ├── support │ │ │ │ ├── commands.ts │ │ │ │ └── index.ts │ │ │ └── tsconfig.json │ │ ├── jest.config.js │ │ ├── jest │ │ │ └── store │ │ │ │ ├── __mocks__ │ │ │ │ └── wp.tsx │ │ │ │ ├── option.test.tsx │ │ │ │ └── stores.test.tsx │ │ ├── patchwork.json │ │ ├── phpunit.bootstrap.php │ │ ├── phpunit.xdebug.php │ │ ├── phpunit.xml │ │ └── phpunit │ │ │ ├── ActivatorTest.php │ │ │ ├── AssetsTest.php │ │ │ ├── CoreTest.php │ │ │ ├── LocalizationTest.php │ │ │ └── base │ │ │ └── CoreTest.php │ │ ├── tsconfig.json │ │ └── wordpress.org │ │ ├── README.wporg.txt │ │ └── assets │ │ ├── banner-1544x500.png │ │ ├── banner-772x250.png │ │ ├── icon-128x128.png │ │ ├── icon-256x256.png │ │ └── screenshot-1.png ├── generate-launch-json.ts ├── hookdoc.json ├── jest.base.js ├── jest.setupAfterEnv.js ├── patch-package │ ├── @lerna+conventional-commits+3.22.0.patch │ ├── @lerna+version+3.22.1.patch │ └── README.md ├── php-scope-stub.ts ├── php-scoper.php ├── phpcs.xml ├── phpunit.base.php ├── postcss-plugin-clean.ts ├── stubs.php ├── tsconfig.json ├── webpack-loader-noop.js ├── webpack.factory.ts └── webpack.multi.ts ├── composer.json ├── devops ├── .gitlab │ ├── stage-build.ts │ ├── stage-containerize.ts │ ├── stage-release.ts │ ├── stage-test.ts │ └── stage-validate.ts ├── docker-compose │ ├── docker-compose.e2e.yml │ ├── docker-compose.local.yml │ ├── docker-compose.traefik.yml │ └── docker-compose.yml ├── docker │ └── gitlab-ci │ │ └── Dockerfile └── scripts │ ├── container-wordpress-cli-entrypoint.sh │ ├── container-wordpress-command.sh │ ├── custom-php.ini │ ├── e2e-tests-autologin-plugin.php │ ├── lerna-ready-ci.sh │ ├── purge-ci.sh │ ├── task-xdebug-start.sh │ ├── task-xdebug-stop.sh │ └── wordpress-startup.sh ├── docs ├── advanced │ ├── build-production-plugin.md │ ├── create-add-on.md │ ├── create-package.md │ ├── extend-compose-webpack.md │ ├── how-cachebuster-works.md │ ├── license-checker.md │ ├── persistent-database-snapshot.md │ ├── showcase.md │ └── tests.md ├── gitlab-integration │ ├── deploy-wp-org.md │ ├── extend-gitlab-ci-pipeline.md │ ├── predefined-pipeline.md │ ├── review-applications.md │ └── use-own-runner.md ├── php-development │ ├── add-classes-hooks-libraries.md │ ├── debugging.md │ ├── example-implementations.md │ ├── localization.md │ ├── predefined-classes.md │ └── predefined-constants.md ├── typescript-development │ ├── add-external-library.md │ ├── consume-php-variable.md │ ├── example-implementations.md │ ├── localization.md │ ├── using-entrypoints.md │ └── utils-package.md └── usage │ ├── available-commands │ ├── index.md │ ├── package.md │ ├── plugin.md │ └── root.md │ ├── folder-structure │ ├── index.md │ ├── plugin.md │ └── root.md │ └── getting-started.md ├── package.json ├── packages ├── nft-maker │ ├── CHANGELOG.md │ ├── LICENSE │ ├── LICENSE_3RD_PARTY_JS.md │ ├── LICENSE_3RD_PARTY_PHP.md │ ├── README.md │ ├── composer.json │ ├── composer.lock │ ├── devops │ │ └── .gitlab │ │ │ ├── .gitlab-ci.ts │ │ │ ├── stage-build.ts │ │ │ ├── stage-test.ts │ │ │ └── stage-validate.ts │ ├── lib │ │ └── index.tsx │ ├── package.json │ ├── scripts │ │ ├── Gruntfile.ts │ │ └── webpack.config.ts │ ├── src │ │ ├── Connectors │ │ │ ├── DbConnector.php │ │ │ ├── IpfsConnector.php │ │ │ └── TatumConnector.php │ │ ├── Hooks │ │ │ ├── AdminHooks.php │ │ │ └── PublicHooks.php │ │ ├── Services │ │ │ ├── EstimateService.php │ │ │ ├── MintService.php │ │ │ ├── NftService.php │ │ │ └── SetupService.php │ │ └── Utils │ │ │ ├── AddressValidator.php │ │ │ ├── BlockchainLink.php │ │ │ ├── Constants.php │ │ │ ├── Utils │ │ │ ├── Activator.php │ │ │ ├── Assets.php │ │ │ ├── Base.php │ │ │ ├── Core.php │ │ │ ├── Localization.php │ │ │ ├── PackageLocalization.php │ │ │ ├── PluginReceiver.php │ │ │ └── Service.php │ │ │ └── UtilsProvider.php │ ├── test │ │ ├── jest.config.js │ │ ├── patchwork.json │ │ ├── phpunit.bootstrap.php │ │ ├── phpunit.xdebug.php │ │ ├── phpunit.xml │ │ └── phpunit │ │ │ ├── MintServiceTest.php │ │ │ └── TatumConnectorTest.php │ └── tsconfig.json └── utils │ ├── CHANGELOG.md │ ├── LICENSE │ ├── LICENSE_3RD_PARTY_JS.md │ ├── LICENSE_3RD_PARTY_PHP.md │ ├── README.md │ ├── composer.json │ ├── composer.lock │ ├── devops │ └── .gitlab │ │ ├── .gitlab-ci.ts │ │ ├── stage-build.ts │ │ ├── stage-test.ts │ │ └── stage-validate.ts │ ├── languages │ ├── backend │ │ ├── utils-de_DE.mo │ │ ├── utils-de_DE.po │ │ └── utils.pot │ └── frontend │ │ └── utils.pot │ ├── lib │ ├── components │ │ ├── button.tsx │ │ ├── index.tsx │ │ └── notice.tsx │ ├── factory │ │ ├── ajax │ │ │ ├── commonRequest.tsx │ │ │ ├── commonUrlBuilder.tsx │ │ │ ├── corruptRestApi.tsx │ │ │ ├── createRequestFactory.tsx │ │ │ ├── index.tsx │ │ │ ├── parseResult.tsx │ │ │ └── routeHttpVerbEnum.tsx │ │ ├── context.tsx │ │ ├── i18n.tsx │ │ └── index.tsx │ ├── helpers.tsx │ ├── index.tsx │ ├── options.tsx │ ├── types │ │ └── global.d.ts │ └── wp-api │ │ ├── index.tsx │ │ └── rest.plugin.get.tsx │ ├── package.json │ ├── scripts │ ├── Gruntfile.ts │ └── webpack.config.ts │ ├── src │ ├── Activator.php │ ├── Assets.php │ ├── Base.php │ ├── Core.php │ ├── Localization.php │ ├── PackageLocalization.php │ ├── PluginReceiver.php │ └── Service.php │ ├── test │ ├── jest.config.js │ ├── jest │ │ ├── __mocks__ │ │ │ └── wp.tsx │ │ ├── components │ │ │ ├── __snapshots__ │ │ │ │ ├── button.test.tsx.snap │ │ │ │ └── notice.test.tsx.snap │ │ │ ├── button.test.tsx │ │ │ └── notice.test.tsx │ │ ├── factory │ │ │ ├── ajax │ │ │ │ ├── commonRequest.test.tsx │ │ │ │ ├── commonUrlBuilder.test.tsx │ │ │ │ ├── corrupRestApi.test.tsx │ │ │ │ ├── createRequestFactory.test.tsx │ │ │ │ └── parseResult.test.tsx │ │ │ └── i18n.test.tsx │ │ ├── helpers.test.tsx │ │ ├── helpers │ │ │ ├── index.tsx │ │ │ └── provider.tsx │ │ └── options.test.tsx │ ├── patchwork.json │ ├── phpunit.bootstrap.php │ ├── phpunit.xdebug.php │ ├── phpunit.xml │ └── phpunit │ │ ├── ActivatorTest.php │ │ ├── AssetsTest.php │ │ ├── BaseTest.php │ │ ├── CoreTest.php │ │ ├── LocalizationTest.php │ │ ├── PackageLocalizationTest.php │ │ ├── PluginReceiverTest.php │ │ └── ServiceTest.php │ └── tsconfig.json ├── plugins └── tatum │ ├── CHANGELOG.md │ ├── LICENSE │ ├── LICENSE_3RD_PARTY_JS.md │ ├── LICENSE_3RD_PARTY_PHP.md │ ├── composer.json │ ├── composer.lock │ ├── cypress.json │ ├── devops │ ├── .gitlab │ │ ├── .gitlab-ci.ts │ │ ├── stage-build-production.ts │ │ ├── stage-build.ts │ │ ├── stage-deploy.ts │ │ ├── stage-test.ts │ │ └── stage-validate.ts │ ├── docker-compose │ │ ├── docker-compose.e2e.yml │ │ ├── docker-compose.local.yml │ │ ├── docker-compose.traefik.yml │ │ └── docker-compose.yml │ └── scripts │ │ └── wordpress-startup.sh │ ├── package.json │ ├── scripts │ ├── Gruntfile.ts │ └── webpack.config.ts │ ├── src │ ├── inc │ │ ├── Activator.php │ │ ├── Assets.php │ │ ├── Core.php │ │ ├── Localization.php │ │ ├── base │ │ │ ├── Core.php │ │ │ ├── UtilsProvider.php │ │ │ ├── index.php │ │ │ └── others │ │ │ │ ├── fallback-php-version.php │ │ │ │ ├── fallback-rest-api.php │ │ │ │ ├── fallback-wp-version.php │ │ │ │ ├── index.php │ │ │ │ └── start.php │ │ ├── index.php │ │ ├── rest │ │ │ ├── SetupRest.php │ │ │ └── index.php │ │ └── view │ │ │ ├── index.php │ │ │ ├── menu │ │ │ ├── Page.php │ │ │ └── index.php │ │ │ └── widget │ │ │ ├── Widget.php │ │ │ └── index.php │ ├── index.php │ ├── languages │ │ └── tatum.pot │ ├── public │ │ ├── assets │ │ │ ├── header-overview.png │ │ │ ├── nft-maker-icon-blue.svg │ │ │ ├── nft-maker-icon-gray.svg │ │ │ ├── tatum-logo.svg │ │ │ └── tatum.png │ │ ├── languages │ │ │ └── tatum.pot │ │ └── ts │ │ │ ├── admin.tsx │ │ │ ├── assets │ │ │ ├── BSC.svg │ │ │ ├── CELO.svg │ │ │ ├── ETH.svg │ │ │ ├── MATIC.svg │ │ │ ├── ONE.svg │ │ │ └── arrow.svg │ │ │ ├── components │ │ │ ├── CardGridCheckboxInput │ │ │ │ ├── index.scss │ │ │ │ └── index.tsx │ │ │ ├── CardGridItem │ │ │ │ ├── index.scss │ │ │ │ └── index.tsx │ │ │ ├── CardGridNumberInput │ │ │ │ ├── index.scss │ │ │ │ └── index.tsx │ │ │ ├── CardItemText │ │ │ │ ├── index.scss │ │ │ │ └── index.tsx │ │ │ ├── Container │ │ │ │ ├── index.scss │ │ │ │ └── index.tsx │ │ │ ├── NftsOverview │ │ │ │ ├── index.scss │ │ │ │ └── index.tsx │ │ │ ├── Page │ │ │ │ ├── index.scss │ │ │ │ └── index.tsx │ │ │ ├── Paragraph │ │ │ │ ├── index.scss │ │ │ │ └── index.tsx │ │ │ ├── ParagraphHeader │ │ │ │ ├── index.scss │ │ │ │ └── index.tsx │ │ │ ├── Spinner │ │ │ │ ├── index.scss │ │ │ │ └── index.tsx │ │ │ └── index.tsx │ │ │ ├── hooks │ │ │ ├── useGet.tsx │ │ │ └── useMutate.tsx │ │ │ ├── models │ │ │ ├── apiKey.tsx │ │ │ ├── error.tsx │ │ │ ├── estimates.tsx │ │ │ ├── index.tsx │ │ │ ├── nft.tsx │ │ │ └── page.tsx │ │ │ ├── pages │ │ │ ├── apiKeyDetail │ │ │ │ ├── apiKeyOverview │ │ │ │ │ ├── index.scss │ │ │ │ │ └── index.tsx │ │ │ │ ├── index.tsx │ │ │ │ ├── needHelp │ │ │ │ │ ├── index.scss │ │ │ │ │ └── index.tsx │ │ │ │ ├── testnetWarning │ │ │ │ │ └── index.tsx │ │ │ │ └── tutorial │ │ │ │ │ └── index.tsx │ │ │ ├── getApiKey │ │ │ │ ├── getTatumApiKey │ │ │ │ │ └── index.tsx │ │ │ │ ├── index.tsx │ │ │ │ ├── moreTatum │ │ │ │ │ ├── index.scss │ │ │ │ │ └── index.tsx │ │ │ │ ├── pasteApiKey │ │ │ │ │ ├── index.scss │ │ │ │ │ └── index.tsx │ │ │ │ ├── priceOverview │ │ │ │ │ ├── index.scss │ │ │ │ │ └── index.tsx │ │ │ │ └── whyApiKey │ │ │ │ │ ├── index.scss │ │ │ │ │ └── index.tsx │ │ │ ├── help │ │ │ │ ├── faq │ │ │ │ │ └── index.tsx │ │ │ │ └── index.tsx │ │ │ ├── landingPage │ │ │ │ ├── about │ │ │ │ │ ├── index.scss │ │ │ │ │ └── index.tsx │ │ │ │ ├── guideline │ │ │ │ │ ├── index.scss │ │ │ │ │ └── index.tsx │ │ │ │ ├── index.tsx │ │ │ │ └── videoTutorials │ │ │ │ │ └── index.tsx │ │ │ ├── nftsOverviewLazy │ │ │ │ ├── index.scss │ │ │ │ └── index.tsx │ │ │ ├── nftsOverviewMinted │ │ │ │ ├── index.scss │ │ │ │ └── index.tsx │ │ │ └── preferences │ │ │ │ ├── defaultChains │ │ │ │ └── index.tsx │ │ │ │ ├── fees │ │ │ │ ├── index.scss │ │ │ │ └── index.tsx │ │ │ │ ├── index.scss │ │ │ │ └── index.tsx │ │ │ ├── store │ │ │ ├── apiKey.tsx │ │ │ ├── index.tsx │ │ │ ├── option.tsx │ │ │ ├── page.tsx │ │ │ └── stores.tsx │ │ │ ├── style │ │ │ ├── admin.scss │ │ │ └── widget.scss │ │ │ ├── types │ │ │ └── global.d.ts │ │ │ ├── utils │ │ │ ├── image.tsx │ │ │ ├── index.tsx │ │ │ └── message.tsx │ │ │ ├── widget.tsx │ │ │ └── widget │ │ │ └── index.tsx │ └── uninstall.php │ ├── test │ ├── cypress │ │ ├── integration │ │ │ └── adminPage.feature │ │ ├── plugins │ │ │ └── index.ts │ │ ├── step-definitions │ │ │ ├── adminPage │ │ │ │ ├── AdminPageObject.ts │ │ │ │ └── adminPage.ts │ │ │ └── common │ │ │ │ ├── common.ts │ │ │ │ └── index.ts │ │ ├── support │ │ │ ├── commands.ts │ │ │ └── index.ts │ │ └── tsconfig.json │ ├── jest.config.js │ ├── jest │ │ └── store │ │ │ ├── __mocks__ │ │ │ └── wp.tsx │ │ │ ├── option.test.tsx │ │ │ └── stores.test.tsx │ ├── patchwork.json │ ├── phpunit.bootstrap.php │ ├── phpunit.xdebug.php │ ├── phpunit.xml │ └── phpunit │ │ ├── ActivatorTest.php │ │ ├── AssetsTest.php │ │ ├── CoreTest.php │ │ ├── LocalizationTest.php │ │ └── base │ │ └── CoreTest.php │ ├── tsconfig.json │ └── wordpress.org │ ├── README.wporg.txt │ ├── assets │ ├── banner-1544x500.png │ ├── banner-772x250.png │ ├── icon-128x128.png │ ├── icon-256x256.png │ ├── screenshot-1.png │ ├── screenshot-10.png │ ├── screenshot-11.png │ ├── screenshot-2.png │ ├── screenshot-3.png │ ├── screenshot-4.png │ ├── screenshot-5.png │ ├── screenshot-6.png │ ├── screenshot-7.png │ ├── screenshot-8.png │ └── screenshot-9.png │ └── main.yml └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | # WordPress plugin 2 | plugins/*/src/public/dist 3 | plugins/*/src/public/dev 4 | plugins/*/src/public/lib 5 | plugins/*/src/inc/base/others/cachebuster* 6 | plugins/*/build 7 | plugins/*/docs 8 | plugins/*/wporg 9 | 10 | # Packages 11 | packages/*/dist 12 | packages/*/dev 13 | 14 | # Tests 15 | packages/*/coverage 16 | packages/*/test/junit 17 | plugins/*/coverage 18 | plugins/*/test/junit 19 | plugins/*/test/cypress/videos 20 | plugins/*/test/cypress/screenshots 21 | 22 | # Misc 23 | .publish 24 | 25 | # Logs 26 | logs 27 | *.log 28 | npm-debug.log* 29 | yarn-debug.log* 30 | yarn-error.log* 31 | 32 | # Runtime data 33 | pids 34 | *.pid 35 | *.seed 36 | *.pid.lock 37 | 38 | # Dependency directories 39 | node_modules 40 | vendor 41 | vendor-temp 42 | 43 | # Cache directories 44 | .npm 45 | .eslintcache 46 | .yarn-integrity 47 | 48 | # dotenv environment variables file 49 | .env -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | # CI pipeline is dynamically created through `node-gitlab-ci`, please checkout `.gitlab-ci.ts`! 2 | 3 | ts config: 4 | image: devowliode/node-gitlab-ci:latest 5 | stage: build 6 | script: node-gitlab-ci create-yml 7 | artifacts: 8 | paths: 9 | - .gitlab-ci.ts.yml 10 | 11 | build production: 12 | stage: deploy 13 | trigger: 14 | strategy: depend 15 | include: 16 | - artifact: .gitlab-ci.ts.yml 17 | job: ts config 18 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | tatum-wp-plugin-v2 -------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/php-test-framework.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /.idea/php.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 12 | -------------------------------------------------------------------------------- /.idea/tatum.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | common/create-wp-react-app 2 | **/CHANGELOG.md 3 | **/*.lock 4 | plugins/*/languages 5 | plugins/*/public/languages 6 | plugins/*/build 7 | **/LICENSE* -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "valeryanm.vscode-phpsab", 4 | "felixfbecker.php-debug", 5 | "esbenp.prettier-vscode", 6 | "dbaeumer.vscode-eslint", 7 | "bmewburn.vscode-intelephense-client", 8 | "mrorz.language-gettext", 9 | "steoates.autoimport", 10 | "ms-azuretools.vscode-docker", 11 | "stringham.move-ts", 12 | "streetsidesoftware.code-spell-checker", 13 | "alexkrechik.cucumberautocomplete" 14 | ], 15 | "unwantedRecommendations": ["vscode.php-language-features"] 16 | } 17 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Listen for XDebug", 9 | "type": "php", 10 | "request": "launch", 11 | "port": 9000, 12 | "preLaunchTask": "Start xdebug in WordPress container", 13 | "postDebugTask": "Stop xdebug in WordPress container", 14 | "pathMappings": { 15 | // Do not remove that because it is used in `../common/generate-launch-json.js` 16 | // create-wp-react-app --> 17 | "/var/www/html/wp-content/plugins/tatum": "${workspaceFolder}/plugins/tatum/src", 18 | "/var/www/html/wp-content/packages/utils/src": "${workspaceFolder}/packages/utils/src" 19 | // <-- create-wp-react-app 20 | }, 21 | "xdebugSettings": { 22 | "max_data": 65535, 23 | "show_hidden": 1, 24 | "max_children": 100, 25 | "max_depth": 5 26 | } 27 | } 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "label": "Start xdebug in WordPress container", 8 | "command": "${workspaceFolder}/devops/scripts/task-xdebug-start.sh", 9 | "presentation": { 10 | "reveal": "never", 11 | "showReuseMessage": false 12 | } 13 | }, 14 | { 15 | "label": "Stop xdebug in WordPress container", 16 | "command": "${workspaceFolder}/devops/scripts/task-xdebug-stop.sh", 17 | "presentation": { 18 | "reveal": "never", 19 | "showReuseMessage": false 20 | } 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /common/.env-default: -------------------------------------------------------------------------------- 1 | WP_LOCAL_INSTALL_URL= 2 | -------------------------------------------------------------------------------- /common/create-wp-react-app/README.md: -------------------------------------------------------------------------------- 1 | # create-wp-react-app folder 2 | 3 | This folder is required and should be committed to your git repository. It is used for further cli commands like create-wp-react-app create-plugin. 4 | -------------------------------------------------------------------------------- /common/create-wp-react-app/grunt-readme-txt.tmpl: -------------------------------------------------------------------------------- 1 | === ${pluginName} === 2 | Contributors: ${author} 3 | Tags: 4 | Donate link: 5 | Stable tag: trunk 6 | Requires at least: ${minWp} 7 | Requires PHP: ${minPhp} 8 | Tested up to: 5.2 9 | License: GPLv2 10 | License: 11 | License URI: 12 | 13 | ${pluginDesc} 14 | 15 | == Description == 16 | 17 | Put your long description here. 18 | 19 | == Installation == 20 | 21 | 1. Goto your wordpress backend 22 | 2. Navigate to Plugins > Add new 23 | 3. Search for "${pluginName}" 24 | 4. "Install" 25 | 26 | OR 27 | 28 | 1. Download the plugin from this site (wordpress.org) 29 | 2. Copy the extracted folder into your `wp-content/plugins` folder 30 | 3. Activate the "${pluginName}" plugin via the plugins admin page 31 | 32 | == Frequently Asked Questions == 33 | 34 | 35 | == Screenshots == 36 | 37 | 38 | == Changelog == 39 | [include:CHANGELOG.md] 40 | 41 | == Upgrade Notice == 42 | 43 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template-package/CHANGELOG.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tatumio/wordpress-plugin/d9160a8f2f50d9fc6b7ce8f5ad47732af34138b0/common/create-wp-react-app/template-package/CHANGELOG.md -------------------------------------------------------------------------------- /common/create-wp-react-app/template-package/LICENSE: -------------------------------------------------------------------------------- 1 | Utility functionality for all your WordPress plugins. 2 | Copyright (C) 2020 devowl.io GmbH 3 | 4 | This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version. 5 | 6 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 7 | 8 | You should have received a copy of the GNU General Public License along with this program. If not, see . -------------------------------------------------------------------------------- /common/create-wp-react-app/template-package/LICENSE_3RD_PARTY_PHP.md: -------------------------------------------------------------------------------- 1 | # Project Licenses 2 | This file was generated by the [PHP Legal Licenses](https://github.com/Comcast/php-legal-licenses) utility. It contains the name, version and commit sha, description, homepage, and license information for every dependency in this project. 3 | 4 | ## Dependencies 5 | 6 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template-package/README.md: -------------------------------------------------------------------------------- 1 | # `@wp-reactjs-multi-starter/utils` 2 | 3 | Some utility functionality for your WordPress plugins. 4 | 5 | ## TypeScript 6 | 7 | TypeScript coding should be placed in `lib`. It is not compiled from TS to ES6 code because it is directly consumed through the `babel-loader` in your webpack configuration. If you want to add functionality to this module be sure that this is needed for all your plugins - otherwise put it directly to the plugin. 8 | 9 | ## PHP 10 | 11 | PHP coding should be placed in `src`. 12 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template-package/devops/.gitlab/.gitlab-ci.ts: -------------------------------------------------------------------------------- 1 | import { ExtendConfigFunction } from "node-gitlab-ci"; 2 | import { createPackageJobs } from "../../../../.gitlab-ci"; 3 | 4 | const extendConfig: ExtendConfigFunction = async (config) => { 5 | createPackageJobs(config, __dirname, "packages"); 6 | 7 | await config.include(__dirname, ["./stage-*.ts"]); 8 | }; 9 | 10 | export { extendConfig }; 11 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template-package/devops/.gitlab/stage-build.ts: -------------------------------------------------------------------------------- 1 | import { ExtendConfigFunction } from "node-gitlab-ci"; 2 | import { createPackageJobs } from "../../../../.gitlab-ci"; 3 | import { EsLintMacroArgs, PhpCsMacroArgs } from "../../../../devops/.gitlab/stage-build"; 4 | 5 | const extendConfig: ExtendConfigFunction = async (config) => { 6 | const { prefix } = createPackageJobs(config, __dirname, "packages"); 7 | 8 | // Lint JavaScript/TypeScript coding 9 | config.from("lint eslint", { prefix }); 10 | 11 | // Lint PHP coding 12 | config.from("lint phpcs", { prefix }); 13 | }; 14 | 15 | export { extendConfig }; 16 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template-package/devops/.gitlab/stage-test.ts: -------------------------------------------------------------------------------- 1 | import { ExtendConfigFunction } from "node-gitlab-ci"; 2 | import { createPackageJobs } from "../../../../.gitlab-ci"; 3 | import { PhpUnitMacroArgs, JestMacroArgs } from "../../../../devops/.gitlab/stage-test"; 4 | 5 | const extendConfig: ExtendConfigFunction = async (config) => { 6 | const { prefix } = createPackageJobs(config, __dirname, "packages"); 7 | 8 | // Test PHPUnit 9 | config.from("phpunit", { prefix }); 10 | 11 | // Test Jest 12 | config.from("jest", { prefix }); 13 | }; 14 | 15 | export { extendConfig }; 16 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template-package/devops/.gitlab/stage-validate.ts: -------------------------------------------------------------------------------- 1 | import { ExtendConfigFunction } from "node-gitlab-ci"; 2 | import { createPackageJobs } from "../../../../.gitlab-ci"; 3 | import { YarnLicensesMacroArgs, ComposerLicensesMacroArgs } from "../../../../devops/.gitlab/stage-validate"; 4 | 5 | const extendConfig: ExtendConfigFunction = async (config) => { 6 | const { prefix } = createPackageJobs(config, __dirname, "packages"); 7 | 8 | // Validate licenses for yarn packages 9 | config.from("yarn licenses", { prefix }); 10 | 11 | // Validate licenses for composer packages 12 | config.from("composer licenses", { prefix }); 13 | }; 14 | 15 | export { extendConfig }; 16 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template-package/languages/backend/utils-de_DE.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tatumio/wordpress-plugin/d9160a8f2f50d9fc6b7ce8f5ad47732af34138b0/common/create-wp-react-app/template-package/languages/backend/utils-de_DE.mo -------------------------------------------------------------------------------- /common/create-wp-react-app/template-package/languages/backend/utils.pot: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: \n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "Last-Translator: FULL NAME \n" 6 | "Language-Team: LANGUAGE \n" 7 | "MIME-Version: 1.0\n" 8 | "Content-Type: text/plain; charset=UTF-8\n" 9 | "Content-Transfer-Encoding: 8bit\n" 10 | "POT-Creation-Date: n/a\n" 11 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 | "X-Generator: WP-CLI 2.4.0\n" 13 | 14 | #. translators: 15 | #: Service.php:81 16 | msgid "One or more WordPress plugins tried to call the WordPress REST API, which failed. Most likely a security plugin%s or a web server configuration disabled the REST API. Please make sure that the following REST API namespaces are reachable to use your plugin without problems:" 17 | msgstr "" 18 | 19 | #. translators: 20 | #: Service.php:89 21 | msgid "What is the WordPress REST API and how to enable it? %1$sLearn more%2$s." 22 | msgstr "" 23 | 24 | #: Service.php:92 25 | msgid "https://devowl.io/knowledge-base/i-only-see-a-loading-spinner-what-can-i-do/" 26 | msgstr "" 27 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template-package/languages/frontend/utils.pot: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: \n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "Last-Translator: FULL NAME \n" 6 | "Language-Team: LANGUAGE \n" 7 | "MIME-Version: 1.0\n" 8 | "Content-Type: text/plain; charset=UTF-8\n" 9 | "Content-Transfer-Encoding: 8bit\n" 10 | "POT-Creation-Date: n/a\n" 11 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 | "X-Generator: WP-CLI 2.4.0\n" 13 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template-package/scripts/Gruntfile.ts: -------------------------------------------------------------------------------- 1 | import { applyDefaultRunnerConfiguration } from "../../../common/Gruntfile"; 2 | 3 | function setupGrunt(grunt: IGrunt) { 4 | // Project configuration (the base path is set to the projects root, so ../ level up) 5 | grunt.initConfig({}); 6 | 7 | // Load WP ReactJS Starter initial tasks 8 | applyDefaultRunnerConfiguration(grunt); 9 | } 10 | 11 | // See https://github.com/samuelneff/grunt-script-template/blob/2864d3cb1cf424d9ab83fdd2ed5a6c24917cf19b/Gruntfile.ts#L54 12 | export = setupGrunt; 13 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template-package/scripts/webpack.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/no-default-export */ 2 | import { createDefaultSettings } from "../../../common/webpack.factory"; 3 | 4 | export default createDefaultSettings("package"); 5 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template-package/test/jest.config.js: -------------------------------------------------------------------------------- 1 | // Unfortunately the jest config can not be placed directly to package.json 2 | // because then it does not support inheritance. 3 | 4 | const base = require("../../../common/jest.base"); 5 | 6 | module.exports = base; 7 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template-package/test/patchwork.json: -------------------------------------------------------------------------------- 1 | { 2 | "redefinable-internals": [ 3 | "call_user_func", 4 | "error_log", 5 | "error_reporting", 6 | "file_exists", 7 | "include", 8 | "defined", 9 | "constant", 10 | "is_readable", 11 | "realpath", 12 | "glob", 13 | "basename", 14 | "filemtime", 15 | "file_get_contents", 16 | "is_dir" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template-package/test/phpunit.bootstrap.php: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | phpunit 15 | 16 | 17 | 18 | 19 | ../src 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template-package/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../common/tsconfig.json", 3 | "include": ["lib/**/*", "scripts/**/*.ts", "test/jest/**/*"], 4 | "compilerOptions": { 5 | "outDir": "types/" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/CHANGELOG.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tatumio/wordpress-plugin/d9160a8f2f50d9fc6b7ce8f5ad47732af34138b0/common/create-wp-react-app/template/CHANGELOG.md -------------------------------------------------------------------------------- /common/create-wp-react-app/template/LICENSE: -------------------------------------------------------------------------------- 1 | WordPress Plugin Boilerplate using new web technologies. 2 | Copyright (C) 2020 devowl.io GmbH 3 | 4 | This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version. 5 | 6 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 7 | 8 | You should have received a copy of the GNU General Public License along with this program. If not, see . -------------------------------------------------------------------------------- /common/create-wp-react-app/template/LICENSE_3RD_PARTY_PHP.md: -------------------------------------------------------------------------------- 1 | # Project Licenses 2 | This file was generated by the [PHP Legal Licenses](https://github.com/Comcast/php-legal-licenses) utility. It contains the name, version and commit sha, description, homepage, and license information for every dependency in this project. 3 | 4 | ## Dependencies 5 | 6 | ### wp-reactjs-multi-starter/utils (Version dev-feat/multipackage | no sha) 7 | Utility functionality for all your WordPress plugins 8 | Homepage: Not configured. 9 | Licenses Used: MIT 10 | Utility functionality for all your WordPress plugins. 11 | Copyright (C) 2020 devowl.io GmbH 12 | 13 | This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version. 14 | 15 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License along with this program. If not, see . 18 | 19 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/cypress.json: -------------------------------------------------------------------------------- 1 | { 2 | "integrationFolder": "test/cypress/integration", 3 | "pluginsFile": "test/cypress/plugins/index.ts", 4 | "//": "// The cypress configuration is dynamically created through a plugin, see ./test/cypress/plugins/index" 5 | } 6 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/devops/.gitlab/.gitlab-ci.ts: -------------------------------------------------------------------------------- 1 | import { ExtendConfigFunction } from "node-gitlab-ci"; 2 | import { createPackageJobs } from "../../../../.gitlab-ci"; 3 | 4 | const extendConfig: ExtendConfigFunction = async (config) => { 5 | createPackageJobs(config, __dirname, "plugins"); 6 | 7 | await config.include(__dirname, ["./stage-*.ts"]); 8 | }; 9 | 10 | export { extendConfig }; 11 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/devops/.gitlab/stage-build-production.ts: -------------------------------------------------------------------------------- 1 | import { ExtendConfigFunction } from "node-gitlab-ci"; 2 | import { createPackageJobs } from "../../../../.gitlab-ci"; 3 | 4 | const extendConfig: ExtendConfigFunction = async (config) => { 5 | const { prefix } = createPackageJobs(config, __dirname, "plugins"); 6 | 7 | // Build production ready WP plugin 8 | config.extends([`.${prefix} jobs`, `.only production`, `.build plugin`], `${prefix} build production`, { 9 | stage: "build production", 10 | // Always rely on "release" so ".lerna changes" works correctly 11 | dependencies: [`${prefix} yarn licenses`, `${prefix} composer licenses`, "release", "semver"] 12 | }); 13 | }; 14 | 15 | export { extendConfig }; 16 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/devops/.gitlab/stage-build.ts: -------------------------------------------------------------------------------- 1 | import { ExtendConfigFunction } from "node-gitlab-ci"; 2 | import { createPackageJobs } from "../../../../.gitlab-ci"; 3 | import { EsLintMacroArgs, PhpCsMacroArgs, BuildPluginMacroArgs } from "../../../../devops/.gitlab/stage-build"; 4 | 5 | const extendConfig: ExtendConfigFunction = async (config) => { 6 | const { prefix } = createPackageJobs(config, __dirname, "plugins"); 7 | 8 | // Generate technical documents 9 | config.extends([`.${prefix} jobs`, `.${prefix} only changes`, `.docs`], `${prefix} docs`, {}); 10 | 11 | // Lint JavaScript/TypeScript coding 12 | config.from("lint eslint", { prefix }); 13 | 14 | // Lint PHP coding 15 | config.from("lint phpcs", { prefix }); 16 | 17 | // Create build files and run it through docker 18 | config.from("build plugin", { 19 | prefix 20 | }); 21 | }; 22 | 23 | export { extendConfig }; 24 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/devops/.gitlab/stage-test.ts: -------------------------------------------------------------------------------- 1 | import { ExtendConfigFunction } from "node-gitlab-ci"; 2 | import { createPackageJobs } from "../../../../.gitlab-ci"; 3 | import { PhpUnitMacroArgs, JestMacroArgs } from "../../../../devops/.gitlab/stage-test"; 4 | 5 | const extendConfig: ExtendConfigFunction = async (config) => { 6 | const { prefix } = createPackageJobs(config, __dirname, "plugins"); 7 | 8 | // Start the cypress e2e test 9 | config.extends( 10 | [`.${prefix} jobs`, `.${prefix} only changes`, `.docker e2e cypress`], 11 | `${prefix} docker e2e cypress`, 12 | { 13 | // only: # Add dependent plugins so you run also the test if another plugin changes 14 | // changes: ["plugins/{dependent-plugin1,dependent-plugin2}/**/*"] 15 | } 16 | ); 17 | 18 | // Test PHPUnit 19 | config.from("phpunit", { prefix }); 20 | 21 | // Test Jest 22 | config.from("jest", { prefix }); 23 | }; 24 | 25 | export { extendConfig }; 26 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/devops/.gitlab/stage-validate.ts: -------------------------------------------------------------------------------- 1 | import { ExtendConfigFunction } from "node-gitlab-ci"; 2 | import { createPackageJobs } from "../../../../.gitlab-ci"; 3 | import { YarnLicensesMacroArgs, ComposerLicensesMacroArgs } from "../../../../devops/.gitlab/stage-validate"; 4 | 5 | const extendConfig: ExtendConfigFunction = async (config) => { 6 | const { prefix } = createPackageJobs(config, __dirname, "plugins"); 7 | 8 | // Validate licenses for yarn packages 9 | config.from("yarn licenses", { prefix }); 10 | 11 | // Validate licenses for composer packages 12 | config.from("composer licenses", { prefix }); 13 | }; 14 | 15 | export { extendConfig }; 16 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/devops/docker-compose/docker-compose.e2e.yml: -------------------------------------------------------------------------------- 1 | # This file overrides the file from docker-compose.yml 2 | 3 | version: "3" 4 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/devops/docker-compose/docker-compose.local.yml: -------------------------------------------------------------------------------- 1 | # This file overrides the file from docker-compose.yml 2 | 3 | version: "3" 4 | 5 | services: 6 | wordpress: 7 | volumes: 8 | # Composer PHP files 9 | - ../../plugins/wp-reactjs-starter/vendor:/var/www/html/wp-content/plugins/wp-reactjs-starter/vendor 10 | # The main plugin source 11 | - ../../plugins/wp-reactjs-starter/src:/var/www/html/wp-content/plugins/wp-reactjs-starter 12 | # Devops scripts 13 | - ../../plugins/wp-reactjs-starter/devops/scripts:/scripts/plugins/wp-reactjs-starter 14 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/devops/docker-compose/docker-compose.traefik.yml: -------------------------------------------------------------------------------- 1 | # This file overrides the file from docker-compose.yml 2 | 3 | version: "3" 4 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/devops/docker-compose/docker-compose.yml: -------------------------------------------------------------------------------- 1 | # This file overrides all available configurations (local, traefik, e2e) 2 | # and should only be used for plugin relevant configuration. 3 | 4 | version: "3" 5 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/devops/scripts/wordpress-startup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Run your commands for startup of WordPress for this specific plugin in the main docker environment. 4 | 5 | PLUGIN_SLUG="wp-reactjs-starter" 6 | echo "Initiate $PLUGIN_SLUG..." -------------------------------------------------------------------------------- /common/create-wp-react-app/template/scripts/webpack.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/no-default-export */ 2 | import { createDefaultSettings } from "../../../common/webpack.factory"; 3 | 4 | export default createDefaultSettings("plugin"); 5 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/src/inc/Localization.php: -------------------------------------------------------------------------------- 1 | getPluginData('TextDomain')); 26 | define('WPRJSS_VERSION', $this->getPluginData('Version')); 27 | $this->construct(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/src/inc/base/UtilsProvider.php: -------------------------------------------------------------------------------- 1 | 13 |

' . 14 | $data['Name'] . 15 | ' could not be initialized because you need minimum PHP version ' . 16 | WPRJSS_MIN_PHP . 17 | ' ... you are running: ' . 18 | phpversion() . 19 | '. 20 | '; 21 | } 22 | } 23 | } 24 | add_action('admin_notices', 'wprjss_skip_php_admin_notice'); 25 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/src/inc/base/others/fallback-rest-api.php: -------------------------------------------------------------------------------- 1 | 14 |

' . 15 | $data['Name'] . 16 | ' could not be initialized because you are running WordPress < 4.7 (' . 17 | $wp_version . 18 | '). If WordPress < 4.7 the plugin needs another plugin WordPress REST API (Version 2) to provide needed functionality. 19 | Show in plugin finder or 22 | install plugin directly. 25 | '; 26 | } 27 | } 28 | } 29 | add_action('admin_notices', 'wprjss_skip_rest_admin_notice'); 30 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/src/inc/base/others/fallback-wp-version.php: -------------------------------------------------------------------------------- 1 | 14 |

' . 15 | $data['Name'] . 16 | ' could not be initialized because you need minimum WordPress version ' . 17 | WPRJSS_MIN_WP . 18 | ' ... you are running: ' . 19 | $wp_version . 20 | '. 21 | Update WordPress now. 24 | '; 25 | } 26 | } 27 | } 28 | add_action('admin_notices', 'wprjss_skip_wp_admin_notice'); 29 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/src/inc/base/others/index.php: -------------------------------------------------------------------------------- 1 | getCore()->getPluginData()['Name']; 31 | add_menu_page($pluginName, $pluginName, 'manage_options', self::COMPONENT_ID, [ 32 | $this, 33 | 'render_component_library' 34 | ]); 35 | } 36 | 37 | /** 38 | * Render the content of the menu page. 39 | */ 40 | public function render_component_library() { 41 | echo '

'; 42 | } 43 | 44 | /** 45 | * New instance. 46 | */ 47 | public static function instance() { 48 | return new Page(); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/src/inc/view/menu/index.php: -------------------------------------------------------------------------------- 1 | \n" 8 | "Language-Team: LANGUAGE \n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "POT-Creation-Date: n/a\n" 13 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 | "X-Generator: WP-CLI 2.4.0\n" 15 | 16 | #. Plugin Name of the plugin 17 | msgid "WP ReactJS Starter" 18 | msgstr "" 19 | 20 | #. Plugin URI of the plugin 21 | msgid "https://matthias-web.com/wordpress" 22 | msgstr "" 23 | 24 | #. Description of the plugin 25 | msgid "This WordPress plugin demonstrates how to setup a plugin that uses React and ES6 in a WordPress plugin." 26 | msgstr "" 27 | 28 | #. Author of the plugin 29 | msgid "Matthias Guenter" 30 | msgstr "" 31 | 32 | #. Author URI of the plugin 33 | msgid "https://matthias-web.com" 34 | msgstr "" 35 | 36 | #: inc/view/widget/Widget.php:24 37 | msgid "A widget that demonstrates using React." 38 | msgid_plural "Widgets that demonstrates using React." 39 | msgstr[0] "" 40 | msgstr[1] "" 41 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/src/public/languages/json/wp-reactjs-starter-de_DE-1458bc3eb855dd3b40a27bc171a5aed9.json: -------------------------------------------------------------------------------- 1 | {"translation-revision-date":"2020-01-15 16:30+0100","generator":"WP-CLI\/2.4.0","source":"widget.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"de_DE","plural-forms":"nplurals=2; plural=(n != 1);"},"Hello, World!":["Hallo Welt!"],"I got generated from your new plugin!":["Ich wurde von Ihrem neuen Plugin generiert!"]}}} -------------------------------------------------------------------------------- /common/create-wp-react-app/template/src/public/languages/json/wp-reactjs-starter-de_DE-d6c7c71371fa4fbe7cc75f0a20f23d0e.json: -------------------------------------------------------------------------------- 1 | {"translation-revision-date":"2020-01-15 16:30+0100","generator":"WP-CLI\/2.4.0","source":"admin.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"de_DE","plural-forms":"nplurals=2; plural=(n != 1);"},"The text domain of the plugin is: %(textDomain)s (localized variable)":["Die Textdom\u00e4ne des Plugins ist: %(textDomain)s (lokalisierte Variable)"],"The WP REST API URL of the plugin is: {{a}}%(restUrl)s{{\/a}} (localized variable, click for hello world example)":["Die WP REST API URL des Plugins lautet: {{a}}%(restUrl)s{{\/a}} (lokalisierte Variable, klicken Sie f\u00fcr Hallo Welt Beispiel)"],"The is an informative notice":["Das ist eine informative Mitteilung"],"Your action was successful":["Ihre Aktion war erfolgreich"],"An unexpected error has occurred":["Ein unerwarteter Fehler ist aufgetreten"],"Todo list":["Todo-Liste"],"This section demonstrates a MobX Todo list (no peristence to server).":["Dieser Abschnitt demonstriert eine MobX Todo-Liste (keine Persistenz zum Server)."],"What needs to be done?":["Was muss getan werden?"],"Add":["Hinzuf\u00fcgen"],"Remove":["Entfernen"]}}} -------------------------------------------------------------------------------- /common/create-wp-react-app/template/src/public/languages/wp-reactjs-starter-de_DE.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tatumio/wordpress-plugin/d9160a8f2f50d9fc6b7ce8f5ad47732af34138b0/common/create-wp-react-app/template/src/public/languages/wp-reactjs-starter-de_DE.mo -------------------------------------------------------------------------------- /common/create-wp-react-app/template/src/public/languages/wp-reactjs-starter.pot: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: \n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "Last-Translator: FULL NAME \n" 6 | "Language-Team: LANGUAGE \n" 7 | "MIME-Version: 1.0\n" 8 | "Content-Type: text/plain; charset=UTF-8\n" 9 | "Content-Transfer-Encoding: 8bit\n" 10 | "POT-Creation-Date: n/a\n" 11 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 | "X-Generator: WP-CLI 2.4.0\n" 13 | 14 | #: admin.js:300 15 | msgid "The text domain of the plugin is: %(textDomain)s (localized variable)" 16 | msgstr "" 17 | 18 | #: admin.js:304 19 | msgid "The WP REST API URL of the plugin is: {{a}}%(restUrl)s{{/a}} (localized variable, click for hello world example)" 20 | msgstr "" 21 | 22 | #: admin.js:313 23 | msgid "The is an informative notice" 24 | msgstr "" 25 | 26 | #: admin.js:315 27 | msgid "Your action was successful" 28 | msgstr "" 29 | 30 | #: admin.js:317 31 | msgid "An unexpected error has occurred" 32 | msgstr "" 33 | 34 | #: admin.js:372 35 | msgid "Todo list" 36 | msgstr "" 37 | 38 | #: admin.js:372 39 | msgid "This section demonstrates a MobX Todo list (no peristence to server)." 40 | msgstr "" 41 | 42 | #: admin.js:379 43 | msgid "What needs to be done?" 44 | msgstr "" 45 | 46 | #: admin.js:386 47 | msgid "Add" 48 | msgstr "" 49 | 50 | #: admin.js:450 51 | msgid "Remove" 52 | msgstr "" 53 | 54 | #: widget.js:654 55 | msgid "Hello, World!" 56 | msgstr "" 57 | 58 | #: widget.js:654 59 | msgid "I got generated from your new plugin!" 60 | msgstr "" 61 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/src/public/ts/admin.tsx: -------------------------------------------------------------------------------- 1 | /* istanbul ignore file: we do not need to care about the entry point file as errors are detected through integration tests (E2E) */ 2 | 3 | /** 4 | * The entry point for the admin side wp-admin resource. 5 | */ 6 | import "@wp-reactjs-multi-starter/utils"; // Import once for startup polyfilling (e. g. setimmediate) 7 | import { render } from "react-dom"; 8 | import { ComponentLibrary } from "./components"; 9 | import { RootStore } from "./store"; 10 | import "./style/admin.scss"; 11 | 12 | const node = document.getElementById(`${RootStore.get.optionStore.slug}-component`); 13 | 14 | if (node) { 15 | render( 16 | 17 | 18 | , 19 | node 20 | ); 21 | } 22 | 23 | // Expose this functionalities to add-ons, but you need to activate the library functionality 24 | // in your webpack configuration, see also https://webpack.js.org/guides/author-libraries/ 25 | export * from "@wp-reactjs-multi-starter/utils"; 26 | export * from "./wp-api"; 27 | export * from "./store"; 28 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/src/public/ts/components/index.tsx: -------------------------------------------------------------------------------- 1 | export * from "./todo"; 2 | export * from "./todoItem"; 3 | export * from "./page"; 4 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/src/public/ts/components/todoItem.tsx: -------------------------------------------------------------------------------- 1 | import classNames from "classnames"; 2 | import { useState } from "react"; 3 | import { observer } from "mobx-react"; 4 | import { TodoModel } from "../models"; 5 | import { __ } from "../utils"; 6 | 7 | /* istanbul ignore next: Example implementations gets deleted the most time after plugin creation! */ 8 | /** 9 | * Removable todo item. 10 | */ 11 | const TodoItem = observer(({ todo }: { todo: TodoModel }) => { 12 | const [isBold, setBold] = useState(false); 13 | return ( 14 |
  • setBold(true)} onMouseLeave={() => setBold(false)}> 15 | 19 |   20 | todo.destroy()}> 21 | {__("Remove")} 22 | 23 |
  • 24 | ); 25 | }); 26 | 27 | export { TodoItem }; 28 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/src/public/ts/models/index.tsx: -------------------------------------------------------------------------------- 1 | export * from "./todoModel"; 2 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/src/public/ts/models/todoModel.tsx: -------------------------------------------------------------------------------- 1 | import { observable, action } from "mobx"; 2 | import { TodoStore } from "../store"; 3 | 4 | /* istanbul ignore next: Example implementations gets deleted the most time after plugin creation! */ 5 | class TodoModel { 6 | @observable 7 | public title: string; 8 | 9 | @observable 10 | public completed = false; 11 | 12 | @observable 13 | public id: number; 14 | 15 | private store: TodoStore; 16 | 17 | constructor(store: TodoModel["store"], title: TodoModel["title"]) { 18 | this.id = store.todos.length + 1; 19 | this.store = store; 20 | this.title = title; 21 | } 22 | 23 | @action 24 | public toggle() { 25 | this.completed = !this.completed; 26 | } 27 | 28 | @action 29 | public destroy() { 30 | this.store.todos.splice(this.store.todos.indexOf(this), 1); 31 | } 32 | 33 | @action 34 | public setTitle(title: TodoModel["title"]) { 35 | this.title = title; 36 | } 37 | } 38 | 39 | export { TodoModel }; 40 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/src/public/ts/store/index.tsx: -------------------------------------------------------------------------------- 1 | export * from "./todo"; 2 | export * from "./stores"; 3 | export * from "./option"; 4 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/src/public/ts/store/option.tsx: -------------------------------------------------------------------------------- 1 | import { observable, runInAction } from "mobx"; 2 | import { BaseOptions } from "@wp-reactjs-multi-starter/utils"; 3 | import { RootStore } from "./stores"; 4 | 5 | class OptionStore extends BaseOptions { 6 | // Implement "others" property in your Assets.php; 7 | @observable 8 | public others: {} = {}; 9 | 10 | public readonly pureSlug: ReturnType; 11 | 12 | public readonly pureSlugCamelCased: ReturnType; 13 | 14 | public readonly rootStore: RootStore; 15 | 16 | constructor(rootStore: RootStore) { 17 | super(); 18 | this.rootStore = rootStore; 19 | this.pureSlug = BaseOptions.getPureSlug(process.env); 20 | this.pureSlugCamelCased = BaseOptions.getPureSlug(process.env, true); 21 | 22 | // Use the localized WP object to fill this object values. 23 | runInAction(() => Object.assign(this, (window as any)[this.pureSlugCamelCased])); 24 | } 25 | } 26 | 27 | export { OptionStore }; 28 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/src/public/ts/store/todo.tsx: -------------------------------------------------------------------------------- 1 | import { observable, action } from "mobx"; 2 | import { TodoModel } from "../models"; 3 | import { RootStore } from "./stores"; 4 | 5 | /* istanbul ignore next: Example implementations gets deleted the most time after plugin creation! */ 6 | class TodoStore { 7 | @observable 8 | public todos: TodoModel[] = []; 9 | 10 | public readonly rootStore: RootStore; 11 | 12 | constructor(rootStore: RootStore) { 13 | this.rootStore = rootStore; 14 | } 15 | 16 | @action 17 | public add(title: TodoModel["title"]) { 18 | this.todos.push(new TodoModel(this, title)); 19 | } 20 | } 21 | 22 | export { TodoStore }; 23 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/src/public/ts/style/admin.scss: -------------------------------------------------------------------------------- 1 | .wp-styleguide--buttons { 2 | background-color: #fff; 3 | padding: 10px; 4 | } 5 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/src/public/ts/style/widget.scss: -------------------------------------------------------------------------------- 1 | .react-boilerplate-widget { 2 | background-color: red; 3 | } 4 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/src/public/ts/types/global.d.ts: -------------------------------------------------------------------------------- 1 | // @see https://github.com/microsoft/TypeScript/issues/15031#issuecomment-407131785 2 | declare module "*"; 3 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/src/public/ts/widget.tsx: -------------------------------------------------------------------------------- 1 | /* istanbul ignore file: we do not need to care about the entry point file as errors are detected through E2E */ 2 | 3 | /** 4 | * The entrypoint for the WordPress frontend widget. 5 | */ 6 | 7 | import "@wp-reactjs-multi-starter/utils"; // Import once for startup polyfilling (e. g. setimmediate) 8 | import { render } from "react-dom"; 9 | import { Widget } from "./widget/"; 10 | import "./style/widget.scss"; 11 | 12 | // Query DOM for all widget wrapper divs 13 | const widgets = document.querySelectorAll("div.react-demo-wrapper"); 14 | 15 | // Iterate over the DOM nodes and render a React component into each node 16 | widgets.forEach((item) => render(, item)); 17 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/src/public/ts/widget/index.tsx: -------------------------------------------------------------------------------- 1 | import { FC } from "react"; 2 | import { __ } from "../utils"; 3 | 4 | /* istanbul ignore next: Example implementations gets deleted the most time after plugin creation! */ 5 | const Widget: FC<{}> = () => ( 6 |
    7 |

    {__("Hello, World!")}

    8 |

    {__("I got generated from your new plugin!")}

    9 |
    10 | ); 11 | 12 | export { Widget }; 13 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/src/public/ts/wp-api/hello.get.tsx: -------------------------------------------------------------------------------- 1 | import { 2 | RouteLocationInterface, 3 | RouteHttpVerb, 4 | RouteResponseInterface, 5 | RouteRequestInterface, 6 | RouteParamsInterface 7 | } from "@wp-reactjs-multi-starter/utils"; 8 | 9 | export const locationRestHelloGet: RouteLocationInterface = { 10 | path: "/hello", 11 | method: RouteHttpVerb.GET 12 | }; 13 | 14 | export type RequestRouteHelloGet = RouteRequestInterface; 15 | 16 | export type ParamsRouteHelloGet = RouteParamsInterface; 17 | 18 | export interface ResponseRouteHelloGet extends RouteResponseInterface { 19 | hello: string; 20 | } 21 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/src/public/ts/wp-api/index.tsx: -------------------------------------------------------------------------------- 1 | export * from "./hello.get"; 2 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/src/uninstall.php: -------------------------------------------------------------------------------- 1 | div > div.wp-styleguide--buttons`); 8 | } 9 | 10 | static todoItem(eq: number) { 11 | return this.todoContainer.find(`> ul > li:eq(${eq})`); 12 | } 13 | 14 | static todoItemRemoveLink(eq: number) { 15 | return this.todoItem(eq).find("a"); 16 | } 17 | 18 | static get todoInput() { 19 | return this.todoContainer.children("input"); 20 | } 21 | 22 | static get todoAddButton() { 23 | return this.todoInput.next(); 24 | } 25 | 26 | static get menuPageLink() { 27 | return cy.get(`#toplevel_page_${PAGE_ID} > a`); 28 | } 29 | 30 | static get restApiLink() { 31 | return cy.get(`#${PAGE_ID} > div > div:nth-child(3) > p > a`); 32 | } 33 | } 34 | 35 | export { PAGE_ID, AdminPageObject }; 36 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/test/cypress/step-definitions/adminPage/adminPage.ts: -------------------------------------------------------------------------------- 1 | import { Then } from "cypress-cucumber-preprocessor/steps"; 2 | import { AdminPageObject } from "./AdminPageObject"; 3 | 4 | Then("I open admin page", () => { 5 | AdminPageObject.menuPageLink.click(); 6 | }); 7 | 8 | Then("I click on REST API link in the admin notice and alert contains {string}", (alertText: string) => { 9 | const stub = cy.stub(); 10 | cy.on("window:alert", stub); 11 | 12 | AdminPageObject.restApiLink 13 | .click() 14 | .wait(1000) 15 | .then(() => { 16 | expect(stub.getCall(0)).to.be.calledWith(Cypress.sinon.match(new RegExp(alertText))); 17 | }); 18 | }); 19 | 20 | Then("I type {string} and add todo, check it, afterwards delete it", (todo: string) => { 21 | AdminPageObject.todoInput.type(todo); 22 | AdminPageObject.todoAddButton.click(); 23 | AdminPageObject.todoItem(0).should("contain.text", "Test Todo Item").find(":checkbox").check().should("be.checked"); 24 | AdminPageObject.todoItemRemoveLink(0).click(); 25 | AdminPageObject.todoItem(0).should("have.text", "No entries"); 26 | }); 27 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/test/cypress/step-definitions/common/common.ts: -------------------------------------------------------------------------------- 1 | import { Given } from "cypress-cucumber-preprocessor/steps"; 2 | 3 | Given("I am logged in WP admin dashboard", () => { 4 | cy.visit("/wp-login.php?autologin=wordpress"); 5 | cy.url().should("contain", "wp-admin"); 6 | }); 7 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/test/cypress/step-definitions/common/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./common"; 2 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/test/cypress/support/commands.ts: -------------------------------------------------------------------------------- 1 | // *********************************************** 2 | // This example commands.js shows you how to 3 | // create various custom commands and overwrite 4 | // existing commands. 5 | // 6 | // For more comprehensive examples of custom 7 | // commands please read more here: 8 | // https://on.cypress.io/custom-commands 9 | // *********************************************** 10 | // 11 | // 12 | // -- This is a parent command -- 13 | // Cypress.Commands.add("login", (email, password) => { ... }) 14 | // 15 | // 16 | // -- This is a child command -- 17 | // Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) 18 | // 19 | // 20 | // -- This is a dual command -- 21 | // Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) 22 | // 23 | // 24 | // -- This is will overwrite an existing command -- 25 | // Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) 26 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/test/cypress/support/index.ts: -------------------------------------------------------------------------------- 1 | // *********************************************************** 2 | // This example support/index.js is processed and 3 | // loaded automatically before your test files. 4 | // 5 | // This is a great place to put global configuration and 6 | // behavior that modifies Cypress. 7 | // 8 | // You can change the location of this file or turn off 9 | // automatically serving support files with the 10 | // 'supportFile' configuration option. 11 | // 12 | // You can read more here: 13 | // https://on.cypress.io/configuration 14 | // *********************************************************** 15 | 16 | // Import commands.js using ES2015 syntax: 17 | import "./commands"; 18 | import "cypress-plugin-retries"; 19 | 20 | // Alternatively you can use CommonJS syntax: 21 | // require('./commands') 22 | 23 | // See https://docs.cypress.io/api/cypress-api/cookies.html#Whitelist-accepts 24 | Cypress.Cookies.defaults({ 25 | whitelist: /wordpress_/ 26 | }); 27 | 28 | // `window.fetch` does not work yet with cypress (https://git.io/JfFdL) 29 | Cypress.on("window:before:load", (win: Window) => { 30 | win.fetch = null; 31 | }); 32 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/test/cypress/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowJs": true, 4 | "target": "ES5", 5 | "esModuleInterop": true, 6 | "baseUrl": "../node_modules", 7 | "types": ["cypress", "node"], 8 | "resolveJsonModule": true 9 | }, 10 | "include": ["**/*.*"] 11 | } 12 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/test/jest.config.js: -------------------------------------------------------------------------------- 1 | // Unfortunately the jest config can not be placed directly to package.json 2 | // because then it does not support inheritance. 3 | 4 | const base = require("../../../common/jest.base"); 5 | 6 | module.exports = base; 7 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/test/jest/store/__mocks__/wp.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/no-default-export */ 2 | export default {}; 3 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/test/jest/store/option.test.tsx: -------------------------------------------------------------------------------- 1 | import { OptionStore } from "../../../src/public/ts/store/option"; 2 | import { RootStore } from "../../../src/public/ts/store"; 3 | 4 | jest.mock(`${process.env.PACKAGE_SCOPE}/utils`); 5 | jest.mock("../../../src/public/ts/store/stores"); 6 | jest.mock("mobx", () => ({ 7 | observable: jest.fn(), 8 | runInAction: jest.fn().mockImplementation((callback) => callback()) 9 | })); 10 | 11 | const mobx = require("mobx"); 12 | const { BaseOptions } = require(`${process.env.PACKAGE_SCOPE}/utils`); 13 | 14 | describe("OptionStore", () => { 15 | it("should call the constructor correctly", () => { 16 | const slug = "jest"; 17 | 18 | BaseOptions.getPureSlug.mockImplementation(() => slug); 19 | 20 | const actual = new OptionStore({} as RootStore); 21 | 22 | expect(actual.pureSlug).toEqual(slug); 23 | expect(actual.pureSlugCamelCased).toEqual(slug); 24 | expect(actual.rootStore).toEqual({}); 25 | expect(mobx.runInAction).toHaveBeenCalledWith(expect.any(Function)); 26 | }); 27 | }); 28 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/test/patchwork.json: -------------------------------------------------------------------------------- 1 | { 2 | "redefinable-internals": ["define"] 3 | } 4 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/test/phpunit.bootstrap.php: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | phpunit 15 | 16 | 17 | 18 | 19 | ../src/inc/ 20 | 21 | ../src/inc/base/others 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/test/phpunit/ActivatorTest.php: -------------------------------------------------------------------------------- 1 | activator = Mockery::mock(Activator::class); 17 | } 18 | 19 | public function testActivate() { 20 | $this->activator->shouldReceive('activate')->passthru(); 21 | 22 | $this->activator->activate(); 23 | 24 | $this->addToAssertionCount(1); 25 | } 26 | 27 | public function testDeactivate() { 28 | $this->activator->shouldReceive('deactivate')->passthru(); 29 | 30 | $this->activator->deactivate(); 31 | 32 | $this->addToAssertionCount(1); 33 | } 34 | 35 | public function testDbDelta() { 36 | $this->activator->shouldReceive('dbDelta')->passthru(); 37 | 38 | $this->activator->dbDelta(false); 39 | 40 | $this->addToAssertionCount(1); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../common/tsconfig.json", 3 | "include": ["src/public/ts/**/*", "scripts/**/*.ts", "test/jest/**/*"], 4 | "compilerOptions": { 5 | "outDir": "types/" 6 | }, 7 | "typedocOptions": { 8 | "mode": "modules", 9 | "out": "docs/js" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/wordpress.org/README.wporg.txt: -------------------------------------------------------------------------------- 1 | === WP ReactJS Starter === 2 | Contributors: mguenter 3 | Tags: 4 | Donate link: 5 | Stable tag: trunk 6 | Requires at least: 5.2.0 7 | Requires PHP: 7.0.0 8 | Tested up to: 5.2 9 | License: GPLv2 10 | License: 11 | License URI: 12 | 13 | This WordPress plugin demonstrates how to setup a plugin that uses React and ES6 in a WordPress plugin. 14 | 15 | == Description == 16 | 17 | A complete plugin generated by [create-wp-react-app](https://github.com/devowlio/create-wp-react-app) and the boilerplate [wp-reactjs-starter](https://github.com/devowlio/wp-react-starter). It comes with a complete local development environment and the newest technologies to build your WordPress plugin: ES6, TypeScript, Docker, GitLab CI, ... Note: This plugin has no functionality, it simply demonstrates how the plugin gets deployed to wordpress.org plugin directory when using the starter plugin. 18 | 19 | == Installation == 20 | 21 | 1. Goto your wordpress backend 22 | 2. Navigate to Plugins > Add new 23 | 3. Search for "WP ReactJS Starter" 24 | 4. "Install" 25 | 26 | OR 27 | 28 | 1. Download the plugin from this site (wordpress.org) 29 | 2. Copy the extracted folder into your `wp-content/plugins` folder 30 | 3. Activate the "WP ReactJS Starter" plugin via the plugins admin page 31 | 32 | == Frequently Asked Questions == 33 | 34 | 35 | == Screenshots == 36 | 37 | 38 | == Changelog == 39 | [include:CHANGELOG.md] 40 | 41 | == Upgrade Notice == 42 | 43 | -------------------------------------------------------------------------------- /common/create-wp-react-app/template/wordpress.org/assets/banner-1544x500.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tatumio/wordpress-plugin/d9160a8f2f50d9fc6b7ce8f5ad47732af34138b0/common/create-wp-react-app/template/wordpress.org/assets/banner-1544x500.png -------------------------------------------------------------------------------- /common/create-wp-react-app/template/wordpress.org/assets/banner-772x250.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tatumio/wordpress-plugin/d9160a8f2f50d9fc6b7ce8f5ad47732af34138b0/common/create-wp-react-app/template/wordpress.org/assets/banner-772x250.png -------------------------------------------------------------------------------- /common/create-wp-react-app/template/wordpress.org/assets/icon-128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tatumio/wordpress-plugin/d9160a8f2f50d9fc6b7ce8f5ad47732af34138b0/common/create-wp-react-app/template/wordpress.org/assets/icon-128x128.png -------------------------------------------------------------------------------- /common/create-wp-react-app/template/wordpress.org/assets/icon-256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tatumio/wordpress-plugin/d9160a8f2f50d9fc6b7ce8f5ad47732af34138b0/common/create-wp-react-app/template/wordpress.org/assets/icon-256x256.png -------------------------------------------------------------------------------- /common/create-wp-react-app/template/wordpress.org/assets/screenshot-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tatumio/wordpress-plugin/d9160a8f2f50d9fc6b7ce8f5ad47732af34138b0/common/create-wp-react-app/template/wordpress.org/assets/screenshot-1.png -------------------------------------------------------------------------------- /common/hookdoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "opts": { 3 | "destination": "docs/hooks", 4 | "template": "../node_modules/wp-hookdoc/template", 5 | "recurse": true 6 | }, 7 | "source": { 8 | "includePattern": ".+\\.(php|inc)?$" 9 | }, 10 | "plugins": ["wp-hookdoc/plugin"], 11 | "templates": { 12 | "cleverLinks": false, 13 | "monospaceLinks": false, 14 | "default": { 15 | "outputSourceFiles": true, 16 | "outputSourcePath": true 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /common/jest.setupAfterEnv.js: -------------------------------------------------------------------------------- 1 | /* global afterEach jest */ 2 | 3 | // Make current executing package available as environment variable 4 | process.env.PACKAGE_SCOPE = process.env.npm_package_name.split("/")[0]; 5 | 6 | // Clear all mocks after each test 7 | afterEach(() => { 8 | jest.clearAllMocks(); 9 | }); 10 | -------------------------------------------------------------------------------- /common/patch-package/@lerna+version+3.22.1.patch: -------------------------------------------------------------------------------- 1 | diff --git a/node_modules/@lerna/version/index.js b/node_modules/@lerna/version/index.js 2 | index 30836fe..dc8e232 100644 3 | --- a/node_modules/@lerna/version/index.js 4 | +++ b/node_modules/@lerna/version/index.js 5 | @@ -493,7 +493,7 @@ class VersionCommand extends Command { 6 | } 7 | 8 | updatePackageVersions() { 9 | - const { conventionalCommits, changelogPreset, changelog = true } = this.options; 10 | + const { conventionalCommits, changelogPreset, conventionalChangelog, changelog = true } = this.options; 11 | const independentVersions = this.project.isIndependent(); 12 | const rootPath = this.project.manifest.location; 13 | const changedFiles = new Set(); 14 | @@ -551,6 +551,7 @@ class VersionCommand extends Command { 15 | actions.push(pkg => 16 | ConventionalCommitUtilities.updateChangelog(pkg, type, { 17 | changelogPreset, 18 | + conventionalChangelog, 19 | rootPath, 20 | tagPrefix: this.tagPrefix, 21 | }).then(({ logPath, newEntry }) => { 22 | @@ -586,6 +587,7 @@ class VersionCommand extends Command { 23 | chain = chain.then(() => 24 | ConventionalCommitUtilities.updateChangelog(this.project.manifest, "root", { 25 | changelogPreset, 26 | + conventionalChangelog, 27 | rootPath, 28 | tagPrefix: this.tagPrefix, 29 | version: this.globalVersion, 30 | -------------------------------------------------------------------------------- /common/patch-package/README.md: -------------------------------------------------------------------------------- 1 | # Patches 2 | 3 | The tool [`patch-package`](https://github.com/ds300/patch-package) allows to override coding in dependencies. 4 | 5 | ## `@lerna/version` and `@lerna/conventional-commits` 6 | 7 | This patch allows to pass a `conventionalChangelog` object in `lerna.json`. See also this: https://github.com/lerna/lerna/pull/2343 8 | 9 | You can customize the changelog generation ([reference](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-core#conventionalchangelogcoreoptions-context-gitrawcommitsopts-parseropts-writeropts)) in your `lerna.json`: 10 | 11 | ```json 12 | { 13 | "command": { 14 | "version": { 15 | "conventionalCommits": true, 16 | "conventionalChangelog": { 17 | "options": {}, 18 | "context": {}, 19 | "gitRawCommitsOpts": {}, 20 | "parserOpts": {}, 21 | "writerOpts": {} 22 | } 23 | } 24 | } 25 | }, 26 | ``` 27 | -------------------------------------------------------------------------------- /common/postcss-plugin-clean.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/no-extraneous-dependencies */ 2 | /** 3 | * Additional PostCSS plugin for clean-css. 4 | */ 5 | 6 | import postcss from "postcss"; 7 | import CleanCss from "clean-css"; 8 | 9 | // Inspired by postcss-clean, use CJS export way because the other one does not work as expected 10 | module.exports = postcss.plugin("clean-css", (options = {}) => { 11 | const cleaner = new CleanCss(options); 12 | return (css, res) => 13 | new Promise((resolve, reject) => 14 | cleaner.minify(css.toString(), (error, result) => { 15 | if (error) { 16 | return reject(new Error(error)); 17 | } 18 | 19 | for (const w of result.warnings) { 20 | res.warn(w); 21 | } 22 | 23 | res.root = postcss.parse(result.styles); 24 | resolve(); 25 | }) 26 | ); 27 | }); 28 | -------------------------------------------------------------------------------- /common/stubs.php: -------------------------------------------------------------------------------- 1 | 'wordpress', 16 | 'user_password' => 'wordpress', 17 | 'remember' => true 18 | ], 19 | false 20 | ); 21 | 22 | if (!is_wp_error($autologin_user)) { 23 | header('Location: wp-admin'); 24 | } 25 | } 26 | } 27 | add_action('after_setup_theme', 'autologin'); 28 | -------------------------------------------------------------------------------- /devops/scripts/lerna-ready-ci.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Make the `lerna` command possible in GitLab CI environment 4 | 5 | # Unshallow to make git-describe.sync work https://app.clickup.com/t/a6qmdj 6 | git fetch --unshallow 7 | 8 | # Use unsafe-perm so lerna lifecycle events work. Why: https://git.io/JeQdu 9 | yarn config set unsafe-perm true 10 | 11 | # lerna needs to detect the branch name without detached HEAD, Why: https://gitlab.com/gitlab-org/gitlab/issues/15409#note_214809980 12 | [ ! "$CI_BUILD_TAG" ] && git checkout -B "$CI_COMMIT_REF_NAME" "$CI_COMMIT_SHA" 13 | 14 | # Allow NPM publishing if enabled 15 | [ $NPM_TOKEN ] && npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN -q 16 | 17 | # Make `origin` in current repository work again, so push back to repo is possible. See https://gitlab.com/gitlab-org/gitlab/issues/14101#note_261684708 18 | git remote set-url origin "https://gitlab-ci-token:$GITLAB_TOKEN@$CI_SERVER_HOST/$CI_PROJECT_PATH.git" -------------------------------------------------------------------------------- /devops/scripts/purge-ci.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Purge a given composition of docker containers with volumes and networks. Useful for review applications and E2E tests. 4 | 5 | # Remove running containers 6 | echo "[CONTAINERS]" 7 | # docker ps -a 8 | export CURRENT_CONTAINERS="$(docker ps -a --format "{{.ID}} {{.Names}}" | awk '$2~/'"$COMPOSE_PROJECT_NAME$COMPOSE_PROJECT_NAME_SUFFIX-$CI_COMMIT_REF_SLUG"'/{print $1}')" 9 | test "$CURRENT_CONTAINERS" && echo "Removing..." && docker rm -f -v $CURRENT_CONTAINERS 10 | 11 | # Remove available volumes 12 | echo 13 | echo "[VOLUMES]" 14 | # docker volume ls 15 | export CURRENT_VOLUMES="$(docker volume ls --format "{{.Name}}" | awk '$1~/'"$COMPOSE_PROJECT_NAME$COMPOSE_PROJECT_NAME_SUFFIX-$CI_COMMIT_REF_SLUG"'/{print $1}')" 16 | test "$CURRENT_VOLUMES" && echo "Removing..." && docker volume remove -f $CURRENT_VOLUMES 17 | 18 | # Remove available networks 19 | echo 20 | echo "[NETWORKS]" 21 | # docker network ls 22 | export CURRENT_NETWORKS="$(docker network list --format "{{.Name}}" | awk '$1~/'"$COMPOSE_PROJECT_NAME$COMPOSE_PROJECT_NAME_SUFFIX-$CI_COMMIT_REF_SLUG"'/{print $1}')" 23 | test "$CURRENT_NETWORKS" && echo "Removing..." && docker network remove $CURRENT_NETWORKS 24 | 25 | echo 26 | echo "Purged" -------------------------------------------------------------------------------- /devops/scripts/task-xdebug-start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | yarn debug:php:start -------------------------------------------------------------------------------- /devops/scripts/task-xdebug-stop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | yarn debug:php:stop -------------------------------------------------------------------------------- /devops/scripts/wordpress-startup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Run your commands for startup of WordPress in the docker environment. 4 | # If you want to do more customizations you should have a look at container-wordpress-command.sh 5 | 6 | # Activate all the plugins 7 | for slug in $PLUGIN_SLUGS 8 | do 9 | wp --allow-root plugin activate $slug 10 | 11 | # Note: Before putting plugin-specific commands here, have a look at plugins/your-plugin/devops/scripts/wordpress-startup.sh! 12 | done 13 | 14 | # Delete unnecessery plugins 15 | rm -rf wp-content/plugins/akismet 16 | rm -rf wp-content/plugins/hello.php -------------------------------------------------------------------------------- /docs/advanced/build-production-plugin.md: -------------------------------------------------------------------------------- 1 | # Build production plugin 2 | 3 | {% hint style="warning" %} 4 | Never adjust `package.json`'s `version` and `CHANGELOG.md` **manually**! 5 | {% endhint %} 6 | 7 | Building a production plugin is **completely covered by the GitLab CI**. That means if you push changes to the `master` branch the pipeline automatically generates the installable `.zip` file and syncs it to wordpress.org (if configured). The plugin itself can be downloaded through [GitLab Releases](https://docs.gitlab.com/ee/user/project/releases/) or Job artifacts. ` package.json``index.php ` and `CHANGELOG.md` is automatically generated by `yarn lerna publish` and [`yarn build`](../usage/available-commands/plugin.md#build). 8 | 9 | {% page-ref page="../gitlab-integration/predefined-pipeline.md" %} 10 | 11 | {% page-ref page="../gitlab-integration/deploy-wp-org.md" %} 12 | 13 | {% hint style="info" %} 14 | Ensure `GITLAB_TOKEN` is set with a [personal token](https://docs.gitlab.com/ce/user/profile/personal_access_tokens.html) in your GitLab CI variables. Learn more [here](../gitlab-integration/extend-gitlab-ci-pipeline.md#available-variables). 15 | {% endhint %} 16 | 17 | {% hint style="success" %} 18 | Nothing more to say, simply follow the Git flow and automate the release management! 19 | {% endhint %} 20 | 21 | If you really want to build the plugin locally, you can run [`yarn build`](../usage/available-commands/plugin.md#build) in your plugin folder. 22 | -------------------------------------------------------------------------------- /docs/advanced/extend-compose-webpack.md: -------------------------------------------------------------------------------- 1 | # Extend Compose and Webpack 2 | 3 | You are an advanced Docker Compose and Webpack user? Then heads up, read on how to extend the boilerplate. 4 | 5 | ## Docker Compose 6 | 7 | The `docker-compose.yml` file from [`devops/docker-compose/`](../usage/folder-structure/root.md#folder-structure) is deep merged with all found `{plugins/packages}/*/devops/docker-compose/docker-compose.yml` files. So, it is pretty easy to add a plugin specific container. 8 | 9 | To see which `docker-compose.yml` files are merged, run the root command [`yarn workspace:compose-files`](../usage/available-commands/root.md#workspace). 10 | 11 | To see the result of the merged `docker-compose.yml` file, you can run [`yarn docker-compose config`](../usage/available-commands/root.md#misc). 12 | 13 | ## Webpack 14 | 15 | Webpack provides a lot of [configurations](https://webpack.js.org/configuration/). We do not prevent you from using them together with [`webpack.factory.ts`](../usage/folder-structure/root.md#folder-structure). Simply pass a callback to the factory and do what you want in [`plugins/your-plugin/scripts/webpack.config.ts`](../usage/folder-structure/plugin.md#folder-structure): 16 | 17 | ```typescript 18 | import { createDefaultSettings } from "../../../common/webpack.factory"; 19 | 20 | export default createDefaultSettings("plugin", { 21 | override: (settings) => { 22 | // Do something with settings. 23 | } 24 | }); 25 | ``` 26 | -------------------------------------------------------------------------------- /docs/advanced/persistent-database-snapshot.md: -------------------------------------------------------------------------------- 1 | # Persistent database snapshot 2 | 3 | Sometimes it can be useful and necessery to import initial database entries to the WordPress database. The boilerplate comes with a mechanism that allows you to define tables, they get dumped into a single file and are imported automatically with the next WordPress installation. 4 | 5 | {% hint style="info" %} 6 | It can be extremely helpful using initial imports for [E2E tests](tests.md#E2E). 7 | {% endhint %} 8 | 9 | Here is a simple scenario you can adopt to your use case: 10 | 11 | 1. [`yarn docker:start`](../usage/available-commands/root.md#development) to start your WordPress installation 12 | 1. [Login](../usage/getting-started#open-wordpress) to your WordPress instance and create a new post 13 | 1. Define tables you want to snapshot for the startup in [`package.json#db:snapshot`](../usage/folder-structure/root.md#folder-structure) like this `"db:snapshot": ["wp_posts", "wp_postmeta"]` 14 | 1. [`yarn db:snapshot-import-on-startup`](../usage/available-commands/root.md#database) to export the defined database tables into a file in [`devops/scripts/startup.sql`](../usage/folder-structure/root.md#folder-structure) 15 | 1. [`yarn docker:purge`](../usage/available-commands/root.md#development) removes your current WordPress installation completely 16 | 1. [`yarn docker:start`](../usage/available-commands/root.md#development) again and you will see that post is immediatly available 17 | -------------------------------------------------------------------------------- /docs/advanced/showcase.md: -------------------------------------------------------------------------------- 1 | # Showcase 2 | 3 | Who is using this boilerplate? That's a valid question! 4 | 5 | - [WP Real Media Library](https://matthias-web.com/go/codecanyon/13155134) 6 | - [WP Real Physical Media](https://matthias-web.com/go/codecanyon/23104206) 7 | - [WP Real Thumbnail Generator](https://matthias-web.com/go/codecanyon/18937507) 8 | - [WP Real Categories Management](https://matthias-web.com/go/codecanyon/13580393) 9 | 10 | {% hint style="info" %} 11 | You are using it? Let us know and we will add your plugin to the list! Just contribute to that file or contact us directly. 12 | {% endhint %} 13 | -------------------------------------------------------------------------------- /docs/php-development/localization.md: -------------------------------------------------------------------------------- 1 | # Localization 2 | 3 | There are two types of localization (i18n) coming with this boilerplate. In this part we explain the PHP localization. Just have a look at [`src/languages/your-plugin.pot`](../usage/folder-structure/plugin.md#folder-structure) - that's the main PHP i18n file. 4 | 5 | To localize your plugin use the i18n functions coming with [**WordPress core**](https://developer.wordpress.org/plugins/internationalization/localization/): `__`, `_n` and so on ([difference](https://wpengineer.com/2237/whats-the-difference-between-__-_e-_x-and-_ex/)). The `.pot` file is automatically generated while using [`yarn docker:start`](../usage/available-commands/root.md#development). To generate the file manually you can use the command [`yarn i18n:generate:backend`](../usage/available-commands/plugin.md#localization) in your plugin folder. 6 | 7 | {% hint style="info" %} 8 | When using the above functions always use your own text domain constant `WPRJSS_TD` as context parameter. 9 | {% endhint %} 10 | 11 | {% page-ref page="../typescript-development/localization.md" %} 12 | -------------------------------------------------------------------------------- /docs/usage/available-commands/index.md: -------------------------------------------------------------------------------- 1 | # Available commands 2 | 3 | `wp-react-starter` comes with many commands (implemented as NPM scripts), which simplifies how you can control and use all the functions this boilerplate provides. 4 | 5 | Here is a complete list of all available commands with a short description, separated into commands for the root project (applies to the compleat monorepo) and single plugins. 6 | 7 | {% page-ref page="root.md" %} 8 | 9 | {% page-ref page="plugin.md" %} 10 | 11 | {% page-ref page="package.md" %} 12 | -------------------------------------------------------------------------------- /packages/nft-maker/CHANGELOG.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tatumio/wordpress-plugin/d9160a8f2f50d9fc6b7ce8f5ad47732af34138b0/packages/nft-maker/CHANGELOG.md -------------------------------------------------------------------------------- /packages/nft-maker/LICENSE: -------------------------------------------------------------------------------- 1 | Core functions for the NFT Maker plugin 2 | Copyright (C) 2022 Hathoriel 3 | 4 | This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version. 5 | 6 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 7 | 8 | You should have received a copy of the GNU General Public License along with this program. If not, see . -------------------------------------------------------------------------------- /packages/nft-maker/LICENSE_3RD_PARTY_PHP.md: -------------------------------------------------------------------------------- 1 | # Project Licenses 2 | This file was generated by the [PHP Legal Licenses](https://github.com/Comcast/php-legal-licenses) utility. It contains the name, version and commit sha, description, homepage, and license information for every dependency in this project. 3 | 4 | ## Dependencies 5 | 6 | -------------------------------------------------------------------------------- /packages/nft-maker/README.md: -------------------------------------------------------------------------------- 1 | # `@tatum/nft-maker` 2 | 3 | Some utility functionality for your WordPress plugins. 4 | 5 | ## TypeScript 6 | 7 | TypeScript coding should be placed in `lib`. It is not compiled from TS to ES6 code because it is directly consumed through the `babel-loader` in your webpack configuration. If you want to add functionality to this module be sure that this is needed for all your plugins - otherwise put it directly to the plugin. 8 | 9 | ## PHP 10 | 11 | PHP coding should be placed in `src`. 12 | -------------------------------------------------------------------------------- /packages/nft-maker/devops/.gitlab/.gitlab-ci.ts: -------------------------------------------------------------------------------- 1 | import { ExtendConfigFunction } from "node-gitlab-ci"; 2 | import { createPackageJobs } from "../../../../.gitlab-ci"; 3 | 4 | const extendConfig: ExtendConfigFunction = async (config) => { 5 | createPackageJobs(config, __dirname, "packages"); 6 | 7 | await config.include(__dirname, ["./stage-*.ts"]); 8 | }; 9 | 10 | export { extendConfig }; 11 | -------------------------------------------------------------------------------- /packages/nft-maker/devops/.gitlab/stage-build.ts: -------------------------------------------------------------------------------- 1 | import { ExtendConfigFunction } from "node-gitlab-ci"; 2 | import { createPackageJobs } from "../../../../.gitlab-ci"; 3 | import { EsLintMacroArgs, PhpCsMacroArgs } from "../../../../devops/.gitlab/stage-build"; 4 | 5 | const extendConfig: ExtendConfigFunction = async (config) => { 6 | const { prefix } = createPackageJobs(config, __dirname, "packages"); 7 | 8 | // Lint JavaScript/TypeScript coding 9 | config.from("lint eslint", { prefix }); 10 | 11 | // Lint PHP coding 12 | config.from("lint phpcs", { prefix }); 13 | }; 14 | 15 | export { extendConfig }; 16 | -------------------------------------------------------------------------------- /packages/nft-maker/devops/.gitlab/stage-test.ts: -------------------------------------------------------------------------------- 1 | import { ExtendConfigFunction } from "node-gitlab-ci"; 2 | import { createPackageJobs } from "../../../../.gitlab-ci"; 3 | import { PhpUnitMacroArgs, JestMacroArgs } from "../../../../devops/.gitlab/stage-test"; 4 | 5 | const extendConfig: ExtendConfigFunction = async (config) => { 6 | const { prefix } = createPackageJobs(config, __dirname, "packages"); 7 | 8 | // Test PHPUnit 9 | config.from("phpunit", { prefix }); 10 | 11 | // Test Jest 12 | config.from("jest", { prefix }); 13 | }; 14 | 15 | export { extendConfig }; 16 | -------------------------------------------------------------------------------- /packages/nft-maker/devops/.gitlab/stage-validate.ts: -------------------------------------------------------------------------------- 1 | import { ExtendConfigFunction } from "node-gitlab-ci"; 2 | import { createPackageJobs } from "../../../../.gitlab-ci"; 3 | import { YarnLicensesMacroArgs, ComposerLicensesMacroArgs } from "../../../../devops/.gitlab/stage-validate"; 4 | 5 | const extendConfig: ExtendConfigFunction = async (config) => { 6 | const { prefix } = createPackageJobs(config, __dirname, "packages"); 7 | 8 | // Validate licenses for yarn packages 9 | config.from("yarn licenses", { prefix }); 10 | 11 | // Validate licenses for composer packages 12 | config.from("composer licenses", { prefix }); 13 | }; 14 | 15 | export { extendConfig }; 16 | -------------------------------------------------------------------------------- /packages/nft-maker/lib/index.tsx: -------------------------------------------------------------------------------- 1 | import "setimmediate"; // Polyfill for yielding 2 | 3 | function sayHello() { 4 | console.log("Hello from nft-maker"); 5 | } 6 | 7 | export { sayHello }; 8 | -------------------------------------------------------------------------------- /packages/nft-maker/scripts/Gruntfile.ts: -------------------------------------------------------------------------------- 1 | import { applyDefaultRunnerConfiguration } from "../../../common/Gruntfile"; 2 | 3 | function setupGrunt(grunt: IGrunt) { 4 | // Project configuration (the base path is set to the projects root, so ../ level up) 5 | grunt.initConfig({}); 6 | 7 | // Load WP ReactJS Starter initial tasks 8 | applyDefaultRunnerConfiguration(grunt); 9 | } 10 | 11 | // See https://github.com/samuelneff/grunt-script-template/blob/2864d3cb1cf424d9ab83fdd2ed5a6c24917cf19b/Gruntfile.ts#L54 12 | export = setupGrunt; 13 | -------------------------------------------------------------------------------- /packages/nft-maker/scripts/webpack.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/no-default-export */ 2 | import { createDefaultSettings } from "../../../common/webpack.factory"; 3 | 4 | export default createDefaultSettings("package"); 5 | -------------------------------------------------------------------------------- /packages/nft-maker/src/Services/EstimateService.php: -------------------------------------------------------------------------------- 1 | tatumConnector = new TatumConnector(); 14 | } 15 | 16 | public function estimateMintFeeInCredit($chain) { 17 | $gasEstimate = $this->tatumConnector->estimate(['chain' => $chain, 'type' => 'MINT_NFT']); 18 | $rate = $this->tatumConnector->getRate($chain, 'USD'); 19 | return $gasEstimate['gasPrice'] / 1000000000 * $gasEstimate['gasLimit'] * $rate['value'] * 111111; 20 | } 21 | 22 | public function estimateMintPerMonthInCredits($chain) { 23 | $credits = $this->estimateMintFeeInCredit($chain); 24 | return [ 25 | 'starter' => round(1000000 / $credits), 26 | 'basic' => round(5000000 / $credits), 27 | 'advanced' => round(25000000 / $credits), 28 | 'chain' => $chain, 29 | 'label' => Constants::CHAIN_LABELS[$chain] 30 | ]; 31 | } 32 | 33 | public function estimateCountOfMintAllSupportedBlockchain() { 34 | $chains = Constants::CHAIN_CODES; 35 | $estimates = []; 36 | foreach ($chains as $chain) { 37 | $estimates[] = $this->estimateMintPerMonthInCredits($chain); 38 | } 39 | return $estimates; 40 | } 41 | } -------------------------------------------------------------------------------- /packages/nft-maker/src/Utils/BlockchainLink.php: -------------------------------------------------------------------------------- 1 | $text"; 19 | } 20 | 21 | private static function getExplorerPrefixes($testnet) { 22 | return Constants::EXPLORER[$testnet ? 'TESTNET' : 'MAINNET']; 23 | } 24 | } -------------------------------------------------------------------------------- /packages/nft-maker/src/Utils/UtilsProvider.php: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | phpunit 15 | 16 | 17 | 18 | 19 | ../src 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /packages/nft-maker/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../common/tsconfig.json", 3 | "include": ["lib/**/*", "scripts/**/*.ts", "test/jest/**/*"], 4 | "compilerOptions": { 5 | "outDir": "types/" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/utils/CHANGELOG.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tatumio/wordpress-plugin/d9160a8f2f50d9fc6b7ce8f5ad47732af34138b0/packages/utils/CHANGELOG.md -------------------------------------------------------------------------------- /packages/utils/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Copyright (C) 2021 Hathoriel 3 | 4 | This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version. 5 | 6 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 7 | 8 | You should have received a copy of the GNU General Public License along with this program. If not, see . -------------------------------------------------------------------------------- /packages/utils/LICENSE_3RD_PARTY_PHP.md: -------------------------------------------------------------------------------- 1 | # Project Licenses 2 | This file was generated by the [PHP Legal Licenses](https://github.com/Comcast/php-legal-licenses) utility. It contains the name, version and commit sha, description, homepage, and license information for every dependency in this project. 3 | 4 | ## Dependencies 5 | 6 | -------------------------------------------------------------------------------- /packages/utils/README.md: -------------------------------------------------------------------------------- 1 | # `@tatum/utils` 2 | 3 | Some utility functionality for your WordPress plugins. 4 | 5 | ## TypeScript 6 | 7 | TypeScript coding should be placed in `lib`. It is not compiled from TS to ES6 code because it is directly consumed through the `babel-loader` in your webpack configuration. If you want to add functionality to this module be sure that this is needed for all your plugins - otherwise put it directly to the plugin. 8 | 9 | ## PHP 10 | 11 | PHP coding should be placed in `src`. 12 | -------------------------------------------------------------------------------- /packages/utils/devops/.gitlab/.gitlab-ci.ts: -------------------------------------------------------------------------------- 1 | import { ExtendConfigFunction } from "node-gitlab-ci"; 2 | import { createPackageJobs } from "../../../../.gitlab-ci"; 3 | 4 | const extendConfig: ExtendConfigFunction = async (config) => { 5 | createPackageJobs(config, __dirname, "packages"); 6 | 7 | await config.include(__dirname, ["./stage-*.ts"]); 8 | }; 9 | 10 | export { extendConfig }; 11 | -------------------------------------------------------------------------------- /packages/utils/devops/.gitlab/stage-build.ts: -------------------------------------------------------------------------------- 1 | import { ExtendConfigFunction } from "node-gitlab-ci"; 2 | import { createPackageJobs } from "../../../../.gitlab-ci"; 3 | import { EsLintMacroArgs, PhpCsMacroArgs } from "../../../../devops/.gitlab/stage-build"; 4 | 5 | const extendConfig: ExtendConfigFunction = async (config) => { 6 | const { prefix } = createPackageJobs(config, __dirname, "packages"); 7 | 8 | // Lint JavaScript/TypeScript coding 9 | config.from("lint eslint", { prefix }); 10 | 11 | // Lint PHP coding 12 | config.from("lint phpcs", { prefix }); 13 | }; 14 | 15 | export { extendConfig }; 16 | -------------------------------------------------------------------------------- /packages/utils/devops/.gitlab/stage-test.ts: -------------------------------------------------------------------------------- 1 | import { ExtendConfigFunction } from "node-gitlab-ci"; 2 | import { createPackageJobs } from "../../../../.gitlab-ci"; 3 | import { PhpUnitMacroArgs, JestMacroArgs } from "../../../../devops/.gitlab/stage-test"; 4 | 5 | const extendConfig: ExtendConfigFunction = async (config) => { 6 | const { prefix } = createPackageJobs(config, __dirname, "packages"); 7 | 8 | // Test PHPUnit 9 | config.from("phpunit", { prefix }); 10 | 11 | // Test Jest 12 | config.from("jest", { prefix }); 13 | }; 14 | 15 | export { extendConfig }; 16 | -------------------------------------------------------------------------------- /packages/utils/devops/.gitlab/stage-validate.ts: -------------------------------------------------------------------------------- 1 | import { ExtendConfigFunction } from "node-gitlab-ci"; 2 | import { createPackageJobs } from "../../../../.gitlab-ci"; 3 | import { YarnLicensesMacroArgs, ComposerLicensesMacroArgs } from "../../../../devops/.gitlab/stage-validate"; 4 | 5 | const extendConfig: ExtendConfigFunction = async (config) => { 6 | const { prefix } = createPackageJobs(config, __dirname, "packages"); 7 | 8 | // Validate licenses for yarn packages 9 | config.from("yarn licenses", { prefix }); 10 | 11 | // Validate licenses for composer packages 12 | config.from("composer licenses", { prefix }); 13 | }; 14 | 15 | export { extendConfig }; 16 | -------------------------------------------------------------------------------- /packages/utils/languages/backend/utils-de_DE.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tatumio/wordpress-plugin/d9160a8f2f50d9fc6b7ce8f5ad47732af34138b0/packages/utils/languages/backend/utils-de_DE.mo -------------------------------------------------------------------------------- /packages/utils/languages/backend/utils.pot: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: \n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "Last-Translator: FULL NAME \n" 6 | "Language-Team: LANGUAGE \n" 7 | "MIME-Version: 1.0\n" 8 | "Content-Type: text/plain; charset=UTF-8\n" 9 | "Content-Transfer-Encoding: 8bit\n" 10 | "POT-Creation-Date: n/a\n" 11 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 | "X-Generator: WP-CLI 2.5.0\n" 13 | 14 | #. translators: 15 | #: Service.php:85 16 | msgid "One or more WordPress plugins tried to call the WordPress REST API, which failed. Most likely a security plugin%s or a web server configuration disabled the REST API. Please make sure that the following REST API namespaces are reachable to use your plugin without problems:" 17 | msgstr "" 18 | 19 | #. translators: 20 | #: Service.php:93 21 | msgid "What is the WordPress REST API and how to enable it? %1$sLearn more%2$s." 22 | msgstr "" 23 | 24 | #: Service.php:96 25 | msgid "https://devowl.io/knowledge-base/i-see-only-a-loading-animation-wordpress-rest-api-not-responding/" 26 | msgstr "" 27 | -------------------------------------------------------------------------------- /packages/utils/languages/frontend/utils.pot: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: \n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "Last-Translator: FULL NAME \n" 6 | "Language-Team: LANGUAGE \n" 7 | "MIME-Version: 1.0\n" 8 | "Content-Type: text/plain; charset=UTF-8\n" 9 | "Content-Transfer-Encoding: 8bit\n" 10 | "POT-Creation-Date: n/a\n" 11 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 | "X-Generator: WP-CLI 2.6.0\n" 13 | -------------------------------------------------------------------------------- /packages/utils/lib/components/button.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { FC, ReactNode } from "react"; 3 | import classNames from "classnames"; 4 | 5 | enum ButtonType { 6 | Primary, 7 | Secondary 8 | } 9 | 10 | interface ButtonProps { 11 | [key: string]: any; 12 | className?: string; 13 | type?: ButtonType; 14 | children: ReactNode; 15 | } 16 | 17 | const Button: FC = ({ className, type, children, ...rest }) => { 18 | const buttonClassName = classNames(className, { 19 | "button-primary": type === ButtonType.Primary, 20 | "button-secondary": type === ButtonType.Secondary || !type 21 | }); 22 | return ( 23 | 26 | ); 27 | }; 28 | 29 | export { Button, ButtonType }; 30 | -------------------------------------------------------------------------------- /packages/utils/lib/components/index.tsx: -------------------------------------------------------------------------------- 1 | export * from "./button"; 2 | export * from "./notice"; 3 | -------------------------------------------------------------------------------- /packages/utils/lib/components/notice.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { ReactNode, FC } from "react"; 3 | import classNames from "classnames"; 4 | 5 | enum NoticeType { 6 | Error = "Error", 7 | Info = "Info", 8 | Success = "Success" 9 | } 10 | 11 | interface NoticeProps { 12 | type?: NoticeType; 13 | children: ReactNode; 14 | } 15 | 16 | const Notice: FC = ({ type, children }) => { 17 | const classes = classNames({ 18 | notice: true, 19 | "notice-error": type === NoticeType.Error, 20 | "notice-info": type === NoticeType.Info, 21 | "notice-success": type === NoticeType.Success 22 | }); 23 | 24 | return ( 25 |
    26 |

    {children}

    27 |
    28 | ); 29 | }; 30 | 31 | export { Notice, NoticeType }; 32 | -------------------------------------------------------------------------------- /packages/utils/lib/factory/ajax/index.tsx: -------------------------------------------------------------------------------- 1 | export * from "./commonUrlBuilder"; 2 | export * from "./commonRequest"; 3 | export * from "./createRequestFactory"; 4 | export * from "./routeHttpVerbEnum"; 5 | export * from "./parseResult"; 6 | export * from "./corruptRestApi"; 7 | -------------------------------------------------------------------------------- /packages/utils/lib/factory/ajax/parseResult.tsx: -------------------------------------------------------------------------------- 1 | import { RouteResponseInterface } from "."; 2 | 3 | /** 4 | * Get the result of the `Response`. It also handles multiline responses, e. g. 5 | * a PHP `Notice:` message is output through a conflicting plugin: 6 | */ 7 | async function parseResult(url: string, result: Response) { 8 | const cloneForFallback = result.clone(); 9 | try { 10 | return (await result.json()) as TResponse; 11 | } catch (e) { 12 | // Something went wrong, try each line as result of a JSON string 13 | const body = await cloneForFallback.text(); 14 | console.warn(`The response of ${url} contains unexpected JSON, try to resolve the JSON line by line...`, { 15 | body 16 | }); 17 | let lastError: any; 18 | for (const line of body.split("\n")) { 19 | if (line.startsWith("[") || line.startsWith("{")) { 20 | try { 21 | return JSON.parse(line) as TResponse; 22 | } catch (e) { 23 | lastError = e; 24 | } 25 | } 26 | } 27 | throw lastError; 28 | } 29 | } 30 | 31 | export { parseResult }; 32 | -------------------------------------------------------------------------------- /packages/utils/lib/factory/ajax/routeHttpVerbEnum.tsx: -------------------------------------------------------------------------------- 1 | enum RouteHttpVerb { 2 | GET = "GET", 3 | POST = "POST", 4 | PUT = "PUT", 5 | DELETE = "DELETE", 6 | PATCH = "PATCH" 7 | } 8 | 9 | export { RouteHttpVerb }; 10 | -------------------------------------------------------------------------------- /packages/utils/lib/factory/context.tsx: -------------------------------------------------------------------------------- 1 | import { createContext, FC, useContext } from "react"; 2 | 3 | /* istanbul ignore next: no logic in this factory! */ 4 | /** 5 | * Create context relevant objects to use within React. 6 | * 7 | * @param object 8 | * @returns 9 | */ 10 | function createContextFactory(object: T) { 11 | /** 12 | * MobX stores collection 13 | */ 14 | const StoreContext = createContext(object); 15 | 16 | /** 17 | * MobX HOC to get the context via hook. 18 | * 19 | * @param children 20 | */ 21 | const StoreProvider: FC<{}> = ({ children }) => ( 22 | {children} 23 | ); 24 | 25 | /** 26 | * Get all the MobX stores via a single hook. 27 | */ 28 | const useStores = () => useContext(StoreContext); 29 | 30 | return { StoreContext, StoreProvider, useStores }; 31 | } 32 | 33 | export { createContextFactory }; 34 | -------------------------------------------------------------------------------- /packages/utils/lib/factory/index.tsx: -------------------------------------------------------------------------------- 1 | export * from "./context"; 2 | export * from "./ajax"; 3 | export * from "./i18n"; 4 | -------------------------------------------------------------------------------- /packages/utils/lib/helpers.tsx: -------------------------------------------------------------------------------- 1 | const untrailingslashit = (str: string): string => 2 | str.endsWith("/") || str.endsWith("\\") ? untrailingslashit(str.slice(0, -1)) : str; 3 | const trailingslashit = (str: string): string => `${untrailingslashit(str)}/`; 4 | 5 | // Allows to make an interface extension and make some properties optional (https://git.io/JeK6J) 6 | type AllKeyOf = T extends never ? never : keyof T; 7 | type Optional = { [P in Extract]?: T[P] }; 8 | type WithOptional> = T extends never ? never : Omit & Optional; 9 | 10 | export { untrailingslashit, trailingslashit, AllKeyOf, Optional, WithOptional }; 11 | -------------------------------------------------------------------------------- /packages/utils/lib/index.tsx: -------------------------------------------------------------------------------- 1 | import "setimmediate"; // Polyfill for yielding 2 | 3 | export * from "./options"; 4 | export * from "./helpers"; 5 | export * from "./factory"; 6 | export * from "./wp-api"; 7 | export * from "./components"; 8 | -------------------------------------------------------------------------------- /packages/utils/lib/options.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * See PHP file inc/Assets.php. 3 | */ 4 | abstract class BaseOptions { 5 | public slug: string; 6 | public textDomain: string; 7 | public version: string; 8 | public restUrl?: string; 9 | public restNamespace?: string; 10 | public restRoot?: string; 11 | public restQuery?: {}; 12 | public restNonce?: string; 13 | public publicUrl?: string; 14 | 15 | /** 16 | * Convert a slug like "my-plugin" to "myPlugin". This can 17 | * be useful for library naming (window[""] is bad because the hyphens). 18 | * 19 | * @param slug 20 | * @returns 21 | */ 22 | public static slugCamelCase(slug: string) { 23 | return slug.replace(/-([a-z])/g, (g) => g[1].toUpperCase()); 24 | } 25 | 26 | /** 27 | * Get the slug from the current process (webpack) instead of the PHP plugin output. 28 | * For some cases you need to use that. 29 | * 30 | * @param env 31 | * @param camelCase 32 | */ 33 | public static getPureSlug(env: typeof process.env, camelCase = false) { 34 | return camelCase ? BaseOptions.slugCamelCase(env.slug) : env.slug; 35 | } 36 | } 37 | 38 | export { BaseOptions }; 39 | -------------------------------------------------------------------------------- /packages/utils/lib/types/global.d.ts: -------------------------------------------------------------------------------- 1 | // @see https://github.com/microsoft/TypeScript/issues/15031#issuecomment-407131785 2 | declare module "*"; 3 | -------------------------------------------------------------------------------- /packages/utils/lib/wp-api/index.tsx: -------------------------------------------------------------------------------- 1 | export * from "./rest.plugin.get"; 2 | -------------------------------------------------------------------------------- /packages/utils/lib/wp-api/rest.plugin.get.tsx: -------------------------------------------------------------------------------- 1 | import { 2 | RouteLocationInterface, 3 | RouteHttpVerb, 4 | RouteResponseInterface, 5 | RouteRequestInterface, 6 | RouteParamsInterface 7 | } from "../factory"; 8 | 9 | export const locationRestPluginGet: RouteLocationInterface = { 10 | path: "/plugin", 11 | method: RouteHttpVerb.GET 12 | }; 13 | 14 | export type RequestRoutePluginGet = RouteRequestInterface; 15 | 16 | export type ParamsRoutePluginGet = RouteParamsInterface; 17 | 18 | export interface ResponseRoutePluginGet extends RouteResponseInterface { 19 | Name: string; 20 | PluginURI: string; 21 | Version: string; 22 | Description: string; 23 | Author: string; 24 | AuthorURI: string; 25 | TextDomain: string; 26 | DomainPath: string; 27 | Network: boolean; 28 | Title: string; 29 | AuthorName: string; 30 | } 31 | -------------------------------------------------------------------------------- /packages/utils/scripts/Gruntfile.ts: -------------------------------------------------------------------------------- 1 | import { applyDefaultRunnerConfiguration } from "../../../common/Gruntfile"; 2 | 3 | function setupGrunt(grunt: IGrunt) { 4 | // Project configuration (the base path is set to the projects root, so ../ level up) 5 | grunt.initConfig({}); 6 | 7 | // Load WP ReactJS Starter initial tasks 8 | applyDefaultRunnerConfiguration(grunt); 9 | } 10 | 11 | // See https://github.com/samuelneff/grunt-script-template/blob/2864d3cb1cf424d9ab83fdd2ed5a6c24917cf19b/Gruntfile.ts#L54 12 | export = setupGrunt; 13 | -------------------------------------------------------------------------------- /packages/utils/scripts/webpack.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/no-default-export */ 2 | import { createDefaultSettings } from "../../../common/webpack.factory"; 3 | 4 | export default createDefaultSettings("package"); 5 | -------------------------------------------------------------------------------- /packages/utils/test/jest.config.js: -------------------------------------------------------------------------------- 1 | // Unfortunately the jest config can not be placed directly to package.json 2 | // because then it does not support inheritance. 3 | 4 | const base = require("../../../common/jest.base"); 5 | 6 | module.exports = base; 7 | -------------------------------------------------------------------------------- /packages/utils/test/jest/__mocks__/wp.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/no-default-export */ 2 | export default { 3 | i18n: { 4 | setLocaleData: jest.fn() 5 | } 6 | }; 7 | -------------------------------------------------------------------------------- /packages/utils/test/jest/components/__snapshots__/button.test.tsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`button should render button with default arguments 1`] = ` 4 | 9 | `; 10 | 11 | exports[`button should render button with primary type 1`] = ` 12 | 17 | `; 18 | 19 | exports[`button should render button with title attribute 1`] = ` 20 | 26 | `; 27 | -------------------------------------------------------------------------------- /packages/utils/test/jest/components/__snapshots__/notice.test.tsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`notice should render notice with default arguments 1`] = ` 4 |
    7 |

    8 | Test 9 |

    10 |
    11 | `; 12 | 13 | exports[`notice should render notice with error type 1`] = ` 14 |
    17 |

    18 | Test 19 |

    20 |
    21 | `; 22 | 23 | exports[`notice should render notice with info type 1`] = ` 24 |
    27 |

    28 | Test 29 |

    30 |
    31 | `; 32 | 33 | exports[`notice should render notice with success type 1`] = ` 34 |
    37 |

    38 | Test 39 |

    40 |
    41 | `; 42 | -------------------------------------------------------------------------------- /packages/utils/test/jest/components/button.test.tsx: -------------------------------------------------------------------------------- 1 | import renderer from "react-test-renderer"; 2 | import React from "react"; 3 | import { Button, ButtonType } from "../../../lib"; 4 | import { Provider } from "../helpers"; 5 | 6 | describe("button", () => { 7 | it("should render button with default arguments", () => { 8 | const tree = renderer 9 | .create( 10 | 11 | 12 | 13 | ) 14 | .toJSON(); 15 | expect(tree).toMatchSnapshot(); 16 | }); 17 | 18 | it("should render button with primary type", () => { 19 | const tree = renderer 20 | .create( 21 | 22 | 23 | 24 | ) 25 | .toJSON(); 26 | expect(tree).toMatchSnapshot(); 27 | }); 28 | 29 | it("should render button with title attribute", () => { 30 | const tree = renderer 31 | .create( 32 | 33 | 34 | 35 | ) 36 | .toJSON(); 37 | expect(tree).toMatchSnapshot(); 38 | }); 39 | }); 40 | -------------------------------------------------------------------------------- /packages/utils/test/jest/helpers.test.tsx: -------------------------------------------------------------------------------- 1 | import { untrailingslashit, trailingslashit } from "../../lib"; 2 | 3 | describe("helpers", () => { 4 | describe("untrailingslashit", () => { 5 | const should = "/home/foo/bar"; 6 | it("should remove last slash", () => { 7 | const path = "/home/foo/bar/"; 8 | 9 | const actual = untrailingslashit(path); 10 | 11 | expect(actual).toBe(should); 12 | }); 13 | 14 | it("should remove double slash", () => { 15 | const path = "/home/foo/bar//"; 16 | 17 | const actual = untrailingslashit(path); 18 | 19 | expect(actual).toBe(should); 20 | }); 21 | 22 | it("should do nothing", () => { 23 | const path = "/home/foo/bar"; 24 | 25 | const actual = untrailingslashit(path); 26 | 27 | expect(actual).toBe(should); 28 | }); 29 | }); 30 | 31 | describe("trailingslashit", () => { 32 | const should = "/home/foo/bar/"; 33 | 34 | it("should add slash", () => { 35 | const path = "/home/foo/bar"; 36 | 37 | const actual = trailingslashit(path); 38 | 39 | expect(actual).toBe(should); 40 | }); 41 | 42 | it("should do nothing", () => { 43 | const path = "/home/foo/bar/"; 44 | 45 | const actual = trailingslashit(path); 46 | 47 | expect(actual).toBe(should); 48 | }); 49 | }); 50 | }); 51 | -------------------------------------------------------------------------------- /packages/utils/test/jest/helpers/index.tsx: -------------------------------------------------------------------------------- 1 | export * from "./provider"; 2 | -------------------------------------------------------------------------------- /packages/utils/test/jest/helpers/provider.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | /** 4 | * Use this common Provider in all your snapshot tests with all 5 | * your available providers. Currently there is no provider for the utils package. 6 | * 7 | * @param children 8 | */ 9 | const Provider: React.FC = ({ children }) => <>{children}; 10 | 11 | export { Provider }; 12 | -------------------------------------------------------------------------------- /packages/utils/test/jest/options.test.tsx: -------------------------------------------------------------------------------- 1 | import { BaseOptions } from "../../lib"; 2 | 3 | describe("BaseOptions", () => { 4 | describe("slugCamelCase", () => { 5 | it("should convert slug to camel case with hyphen", () => { 6 | const slug = "my-plugin"; 7 | const should = "myPlugin"; 8 | 9 | const actual = BaseOptions.slugCamelCase(slug); 10 | 11 | expect(actual).toBe(should); 12 | }); 13 | 14 | it("should convert slug to camel case without hyphen", () => { 15 | const slug = "myplugin"; 16 | const should = "myplugin"; 17 | 18 | const actual = BaseOptions.slugCamelCase(slug); 19 | 20 | expect(actual).toBe(should); 21 | }); 22 | }); 23 | 24 | describe("getPureSlug", () => { 25 | const env = { slug: "my-plugin" }; 26 | 27 | it("should return slug from current process", () => { 28 | const should = String(env.slug); 29 | 30 | const actual = BaseOptions.getPureSlug(env); 31 | 32 | expect(actual).toBe(should); 33 | }); 34 | 35 | it("should return slug from current process with camel case", () => { 36 | const should = "myPlugin"; 37 | 38 | const actual = BaseOptions.getPureSlug(env, true); 39 | 40 | expect(actual).toBe(should); 41 | }); 42 | }); 43 | }); 44 | -------------------------------------------------------------------------------- /packages/utils/test/patchwork.json: -------------------------------------------------------------------------------- 1 | { 2 | "redefinable-internals": [ 3 | "call_user_func", 4 | "error_log", 5 | "error_reporting", 6 | "file_exists", 7 | "include", 8 | "defined", 9 | "constant", 10 | "is_readable", 11 | "realpath", 12 | "glob", 13 | "basename", 14 | "filemtime", 15 | "file_get_contents", 16 | "is_dir" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /packages/utils/test/phpunit.bootstrap.php: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | phpunit 15 | 16 | 17 | 18 | 19 | ../src 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /packages/utils/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../common/tsconfig.json", 3 | "include": ["lib/**/*", "scripts/**/*.ts", "test/jest/**/*"], 4 | "compilerOptions": { 5 | "outDir": "types/" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /plugins/tatum/CHANGELOG.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tatumio/wordpress-plugin/d9160a8f2f50d9fc6b7ce8f5ad47732af34138b0/plugins/tatum/CHANGELOG.md -------------------------------------------------------------------------------- /plugins/tatum/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Copyright (C) 2021 Hathoriel 3 | 4 | This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version. 5 | 6 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 7 | 8 | You should have received a copy of the GNU General Public License along with this program. If not, see . -------------------------------------------------------------------------------- /plugins/tatum/cypress.json: -------------------------------------------------------------------------------- 1 | { 2 | "integrationFolder": "test/cypress/integration", 3 | "pluginsFile": "test/cypress/plugins/index.ts", 4 | "//": "// The cypress configuration is dynamically created through a plugin, see ./test/cypress/plugins/index" 5 | } 6 | -------------------------------------------------------------------------------- /plugins/tatum/devops/.gitlab/.gitlab-ci.ts: -------------------------------------------------------------------------------- 1 | import { ExtendConfigFunction } from "node-gitlab-ci"; 2 | import { createPackageJobs } from "../../../../.gitlab-ci"; 3 | 4 | const extendConfig: ExtendConfigFunction = async (config) => { 5 | createPackageJobs(config, __dirname, "plugins"); 6 | 7 | await config.include(__dirname, ["./stage-*.ts"]); 8 | }; 9 | 10 | export { extendConfig }; 11 | -------------------------------------------------------------------------------- /plugins/tatum/devops/.gitlab/stage-build-production.ts: -------------------------------------------------------------------------------- 1 | import { ExtendConfigFunction } from "node-gitlab-ci"; 2 | import { createPackageJobs } from "../../../../.gitlab-ci"; 3 | 4 | const extendConfig: ExtendConfigFunction = async (config) => { 5 | const { prefix } = createPackageJobs(config, __dirname, "plugins"); 6 | 7 | // Build production ready WP plugin 8 | config.extends([`.${prefix} jobs`, `.only production`, `.build plugin`], `${prefix} build production`, { 9 | stage: "build production", 10 | // Always rely on "release" so ".lerna changes" works correctly 11 | dependencies: [`${prefix} yarn licenses`, `${prefix} composer licenses`, "release", "semver"] 12 | }); 13 | }; 14 | 15 | export { extendConfig }; 16 | -------------------------------------------------------------------------------- /plugins/tatum/devops/.gitlab/stage-build.ts: -------------------------------------------------------------------------------- 1 | import { ExtendConfigFunction } from "node-gitlab-ci"; 2 | import { createPackageJobs } from "../../../../.gitlab-ci"; 3 | import { EsLintMacroArgs, PhpCsMacroArgs, BuildPluginMacroArgs } from "../../../../devops/.gitlab/stage-build"; 4 | 5 | const extendConfig: ExtendConfigFunction = async (config) => { 6 | const { prefix } = createPackageJobs(config, __dirname, "plugins"); 7 | 8 | // Generate technical documents 9 | config.extends([`.${prefix} jobs`, `.${prefix} only changes`, `.docs`], `${prefix} docs`, {}); 10 | 11 | // Lint JavaScript/TypeScript coding 12 | config.from("lint eslint", { prefix }); 13 | 14 | // Lint PHP coding 15 | config.from("lint phpcs", { prefix }); 16 | 17 | // Create build files and run it through docker 18 | config.from("build plugin", { 19 | prefix 20 | }); 21 | }; 22 | 23 | export { extendConfig }; 24 | -------------------------------------------------------------------------------- /plugins/tatum/devops/.gitlab/stage-test.ts: -------------------------------------------------------------------------------- 1 | import { ExtendConfigFunction } from "node-gitlab-ci"; 2 | import { createPackageJobs } from "../../../../.gitlab-ci"; 3 | import { PhpUnitMacroArgs, JestMacroArgs } from "../../../../devops/.gitlab/stage-test"; 4 | 5 | const extendConfig: ExtendConfigFunction = async (config) => { 6 | const { prefix } = createPackageJobs(config, __dirname, "plugins"); 7 | 8 | // Start the cypress e2e test 9 | config.extends( 10 | [`.${prefix} jobs`, `.${prefix} only changes`, `.docker e2e cypress`], 11 | `${prefix} docker e2e cypress`, 12 | { 13 | // only: # Add dependent plugins so you run also the test if another plugin changes 14 | // changes: ["plugins/{dependent-plugin1,dependent-plugin2}/**/*"] 15 | } 16 | ); 17 | 18 | // Test PHPUnit 19 | config.from("phpunit", { prefix }); 20 | 21 | // Test Jest 22 | config.from("jest", { prefix }); 23 | }; 24 | 25 | export { extendConfig }; 26 | -------------------------------------------------------------------------------- /plugins/tatum/devops/.gitlab/stage-validate.ts: -------------------------------------------------------------------------------- 1 | import { ExtendConfigFunction } from "node-gitlab-ci"; 2 | import { createPackageJobs } from "../../../../.gitlab-ci"; 3 | import { YarnLicensesMacroArgs, ComposerLicensesMacroArgs } from "../../../../devops/.gitlab/stage-validate"; 4 | 5 | const extendConfig: ExtendConfigFunction = async (config) => { 6 | const { prefix } = createPackageJobs(config, __dirname, "plugins"); 7 | 8 | // Validate licenses for yarn packages 9 | config.from("yarn licenses", { prefix }); 10 | 11 | // Validate licenses for composer packages 12 | config.from("composer licenses", { prefix }); 13 | }; 14 | 15 | export { extendConfig }; 16 | -------------------------------------------------------------------------------- /plugins/tatum/devops/docker-compose/docker-compose.e2e.yml: -------------------------------------------------------------------------------- 1 | # This file overrides the file from docker-compose.yml 2 | 3 | version: "3" 4 | -------------------------------------------------------------------------------- /plugins/tatum/devops/docker-compose/docker-compose.local.yml: -------------------------------------------------------------------------------- 1 | # This file overrides the file from docker-compose.yml 2 | 3 | version: "3" 4 | 5 | services: 6 | wordpress: 7 | volumes: 8 | # Composer PHP files 9 | - ../../plugins/tatum/vendor:/var/www/html/wp-content/plugins/tatum/vendor 10 | # The main plugin source 11 | - ../../plugins/tatum/src:/var/www/html/wp-content/plugins/tatum 12 | # Devops scripts 13 | - ../../plugins/tatum/devops/scripts:/scripts/plugins/tatum 14 | -------------------------------------------------------------------------------- /plugins/tatum/devops/docker-compose/docker-compose.traefik.yml: -------------------------------------------------------------------------------- 1 | # This file overrides the file from docker-compose.yml 2 | 3 | version: "3" 4 | -------------------------------------------------------------------------------- /plugins/tatum/devops/docker-compose/docker-compose.yml: -------------------------------------------------------------------------------- 1 | # This file overrides all available configurations (local, traefik, e2e) 2 | # and should only be used for plugin relevant configuration. 3 | 4 | version: "3" 5 | -------------------------------------------------------------------------------- /plugins/tatum/devops/scripts/wordpress-startup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Run your commands for startup of WordPress for this specific plugin in the main docker environment. 4 | 5 | PLUGIN_SLUG="tatum" 6 | echo "Initiate $PLUGIN_SLUG..." -------------------------------------------------------------------------------- /plugins/tatum/scripts/webpack.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/no-default-export */ 2 | import { createDefaultSettings } from "../../../common/webpack.factory"; 3 | 4 | export default createDefaultSettings("plugin"); 5 | -------------------------------------------------------------------------------- /plugins/tatum/src/inc/Localization.php: -------------------------------------------------------------------------------- 1 | getPluginData('TextDomain')); 26 | define('TATUM_VERSION', $this->getPluginData('Version')); 27 | $this->construct(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /plugins/tatum/src/inc/base/UtilsProvider.php: -------------------------------------------------------------------------------- 1 | 13 |

    ' . 14 | $data['Name'] . 15 | ' could not be initialized because you need minimum PHP version ' . 16 | TATUM_MIN_PHP . 17 | ' ... you are running: ' . 18 | phpversion() . 19 | '. 20 | '; 21 | } 22 | } 23 | } 24 | add_action('admin_notices', 'tatum_skip_php_admin_notice'); 25 | -------------------------------------------------------------------------------- /plugins/tatum/src/inc/base/others/fallback-rest-api.php: -------------------------------------------------------------------------------- 1 | 14 |

    ' . 15 | $data['Name'] . 16 | ' could not be initialized because you are running WordPress < 4.7 (' . 17 | $wp_version . 18 | '). If WordPress < 4.7 the plugin needs another plugin WordPress REST API (Version 2) to provide needed functionality. 19 | Show in plugin finder or 22 | install plugin directly. 25 | '; 26 | } 27 | } 28 | } 29 | add_action('admin_notices', 'tatum_skip_rest_admin_notice'); 30 | -------------------------------------------------------------------------------- /plugins/tatum/src/inc/base/others/fallback-wp-version.php: -------------------------------------------------------------------------------- 1 | 14 |

    ' . 15 | $data['Name'] . 16 | ' could not be initialized because you need minimum WordPress version ' . 17 | TATUM_MIN_WP . 18 | ' ... you are running: ' . 19 | $wp_version . 20 | '. 21 | Update WordPress now. 24 | '; 25 | } 26 | } 27 | } 28 | add_action('admin_notices', 'tatum_skip_wp_admin_notice'); 29 | -------------------------------------------------------------------------------- /plugins/tatum/src/inc/base/others/index.php: -------------------------------------------------------------------------------- 1 | \n" 8 | "Language-Team: LANGUAGE \n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "POT-Creation-Date: n/a\n" 13 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 | "X-Generator: WP-CLI 2.6.0\n" 15 | 16 | #. Plugin Name of the plugin 17 | msgid "NFT Maker" 18 | msgstr "" 19 | 20 | #. Plugin URI of the plugin 21 | msgid "https://wordpress.org/plugins/tatum" 22 | msgstr "" 23 | 24 | #. Description of the plugin 25 | msgid "NFT Maker is the easiest and fastest free plugin to work with NFTs without any blockchain development experience." 26 | msgstr "" 27 | 28 | #. Author of the plugin 29 | msgid "Lukas Kotol" 30 | msgstr "" 31 | 32 | #. Author URI of the plugin 33 | msgid "https://t.me/LukasKotol" 34 | msgstr "" 35 | 36 | #: inc/view/widget/Widget.php:24 37 | msgid "A widget that demonstrates using React." 38 | msgid_plural "Widgets that demonstrates using React." 39 | msgstr[0] "" 40 | msgstr[1] "" 41 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/assets/header-overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tatumio/wordpress-plugin/d9160a8f2f50d9fc6b7ce8f5ad47732af34138b0/plugins/tatum/src/public/assets/header-overview.png -------------------------------------------------------------------------------- /plugins/tatum/src/public/assets/nft-maker-icon-blue.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | NFT Maker Icon 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/assets/nft-maker-icon-gray.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | NFT Maker Icon 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/assets/tatum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tatumio/wordpress-plugin/d9160a8f2f50d9fc6b7ce8f5ad47732af34138b0/plugins/tatum/src/public/assets/tatum.png -------------------------------------------------------------------------------- /plugins/tatum/src/public/languages/tatum.pot: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: \n" 4 | "Report-Msgid-Bugs-To: \n" 5 | "Last-Translator: FULL NAME \n" 6 | "Language-Team: LANGUAGE \n" 7 | "MIME-Version: 1.0\n" 8 | "Content-Type: text/plain; charset=UTF-8\n" 9 | "Content-Transfer-Encoding: 8bit\n" 10 | "POT-Creation-Date: n/a\n" 11 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 | "X-Generator: WP-CLI 2.6.0\n" 13 | 14 | #: widget.js:653 15 | msgid "Hello, World!" 16 | msgstr "" 17 | 18 | #: widget.js:653 19 | msgid "I got generated from your new plugin!" 20 | msgstr "" 21 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/admin.tsx: -------------------------------------------------------------------------------- 1 | /* istanbul ignore file: we do not need to care about the entry point file as errors are detected through integration tests (E2E) */ 2 | 3 | /** 4 | * The entry point for the admin side wp-admin resource. 5 | */ 6 | import "antd/dist/antd.css"; 7 | import "./style/admin.scss"; 8 | import "@tatum/utils"; // Import once for startup polyfilling (e. g. setimmediate) 9 | import { render } from "react-dom"; 10 | import { RootStore } from "./store"; 11 | import { Layout } from "./components"; 12 | 13 | const node = document.getElementById(`${RootStore.get.optionStore.slug}-component`); 14 | const wpContent = node?.parentNode?.parentNode?.parentNode as HTMLElement; 15 | if (wpContent) { 16 | wpContent.style.paddingLeft = "0"; 17 | } 18 | 19 | if (node) { 20 | render( 21 | 22 | 23 | , 24 | node 25 | ); 26 | } 27 | 28 | // Expose this functionalities to add-ons, but you need to activate the library functionality 29 | // in your webpack configuration, see also https://webpack.js.org/guides/author-libraries/ 30 | export * from "@tatum/utils"; 31 | export * from "./store"; 32 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/assets/arrow.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | noun_Arrow_3771846 Copy 2 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/components/CardGridCheckboxInput/index.scss: -------------------------------------------------------------------------------- 1 | .card-item-grid-content { 2 | display: flex; 3 | justify-content: space-between; 4 | align-items: center; 5 | 6 | .fee-input { 7 | width: 200px; 8 | } 9 | } -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/components/CardGridCheckboxInput/index.tsx: -------------------------------------------------------------------------------- 1 | import { Button, Card, Input } from "antd"; 2 | import { CardItemText } from "../CardItemText"; 3 | import React from "react"; 4 | import "./index.scss"; 5 | import { useFormContext, Controller } from "react-hook-form"; 6 | 7 | export const CardGridCheckboxInput = ({ 8 | hoverable = false, 9 | title, 10 | description, 11 | inputValue 12 | }: { 13 | hoverable?: boolean; 14 | title: string; 15 | description?: string; 16 | inputValue?: string; 17 | }) => { 18 | const gridStyle = { 19 | width: "100%", 20 | align: "center" 21 | }; 22 | const { register } = useFormContext(); 23 | return ( 24 | 25 |

    26 | 27 | 28 | {/**/} 29 |
    30 | 31 | ); 32 | }; 33 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/components/CardGridItem/index.scss: -------------------------------------------------------------------------------- 1 | .card-item-grid-content { 2 | display: flex; 3 | justify-content: space-between; 4 | align-items: center; 5 | } -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/components/CardGridNumberInput/index.scss: -------------------------------------------------------------------------------- 1 | .card-item-grid-content { 2 | display: flex; 3 | justify-content: space-between; 4 | align-items: center; 5 | 6 | .fee-input { 7 | width: 200px; 8 | } 9 | } -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/components/CardGridNumberInput/index.tsx: -------------------------------------------------------------------------------- 1 | import { Button, Card, Input } from "antd"; 2 | import { CardItemText } from "../CardItemText"; 3 | import React from "react"; 4 | import "./index.scss"; 5 | import { useFormContext, Controller } from "react-hook-form"; 6 | 7 | export const CardGridNumberInput = ({ 8 | hoverable = false, 9 | title, 10 | description, 11 | inputValue 12 | }: { 13 | hoverable?: boolean; 14 | title: string; 15 | description?: string; 16 | inputValue?: string; 17 | }) => { 18 | const gridStyle = { 19 | width: "100%", 20 | align: "center" 21 | }; 22 | const { register } = useFormContext(); 23 | return ( 24 | 25 |
    26 | 27 | {/**/} 28 |
    29 |
    30 | ); 31 | }; 32 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/components/CardItemText/index.scss: -------------------------------------------------------------------------------- 1 | .tatum-card-description-text { 2 | font-weight: 400; 3 | font-size: 14px; 4 | color: #757575; 5 | } 6 | 7 | .tatum–card-title { 8 | font-size: 14px; 9 | font-weight: 600; 10 | color: #000000; 11 | } 12 | 13 | .tatum-sigle–card-title { 14 | font-size: 14px; 15 | font-weight: 400; 16 | color: #757575; 17 | } -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/components/CardItemText/index.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import "./index.scss"; 3 | 4 | export const CardItemText = ({ 5 | title, 6 | description, 7 | secondDescription 8 | }: { 9 | title: string; 10 | description?: string; 11 | secondDescription?: string; 12 | }) => ( 13 | <> 14 | {description ? ( 15 |
    16 |
    {title}
    17 |
    {description}
    18 |
    {secondDescription}
    19 |
    20 | ) : ( 21 |
    {title}
    22 | )} 23 | 24 | ); 25 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/components/Container/index.scss: -------------------------------------------------------------------------------- 1 | .container { 2 | margin-top: 20px; 3 | margin-bottom: 20px; 4 | } 5 | 6 | .gridTable { 7 | .ant-card-body { 8 | padding: 0; 9 | } 10 | } -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/components/Container/index.tsx: -------------------------------------------------------------------------------- 1 | import "./index.scss"; 2 | 3 | export const Container = ({ children, isGridCard = false }: { children: React.ReactNode; isGridCard?: boolean }) => { 4 | const className = `container ${isGridCard ? "gridTable" : ""}`; 5 | return
    {children}
    ; 6 | }; 7 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/components/NftsOverview/index.scss: -------------------------------------------------------------------------------- 1 | .no-nfts { 2 | text-align: center; 3 | margin-top: 30px; 4 | margin-bottom: 30px; 5 | } -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/components/Page/index.scss: -------------------------------------------------------------------------------- 1 | .back-to-landing-page-container { 2 | display: flex; 3 | justify-content: left; 4 | align-items: center; 5 | cursor: pointer; 6 | 7 | .title { 8 | margin-left: 40px; 9 | } 10 | } -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/components/Paragraph/index.scss: -------------------------------------------------------------------------------- 1 | .paragraph { 2 | margin-bottom: 30px; 3 | font-size: 16px; 4 | font-weight: 400; 5 | color: #5C5C5C; 6 | } 7 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/components/Paragraph/index.tsx: -------------------------------------------------------------------------------- 1 | import { ReactNode } from "react"; 2 | import "./index.scss"; 3 | 4 | export const Paragraph = ({ children }: { children: ReactNode }) =>
    {children}
    ; 5 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/components/ParagraphHeader/index.scss: -------------------------------------------------------------------------------- 1 | .paragraphHeader { 2 | font-weight: 500; 3 | font-size: 15px; 4 | } -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/components/ParagraphHeader/index.tsx: -------------------------------------------------------------------------------- 1 | import { ReactNode } from "react"; 2 | import "./index.scss"; 3 | 4 | export const ParagraphHeader = ({ children }: { children: ReactNode }) => ( 5 |
    {children}
    6 | ); 7 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/components/Spinner/index.scss: -------------------------------------------------------------------------------- 1 | .spinner-container { 2 | width: 100%; 3 | display: flex; 4 | justify-content: center; 5 | align-items: center; 6 | } -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/components/Spinner/index.tsx: -------------------------------------------------------------------------------- 1 | import { Spin } from "antd"; 2 | import React from "react"; 3 | import "./index.scss"; 4 | 5 | export const Spinner = () => { 6 | return ( 7 |
    8 | 9 |
    10 | ); 11 | }; 12 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/components/index.tsx: -------------------------------------------------------------------------------- 1 | export * from "./Page"; 2 | export * from "./Spinner"; 3 | export * from "./CardGridItem"; 4 | export * from "./CardItemText"; 5 | export * from "./Container"; 6 | export * from "./Paragraph"; 7 | export * from "./ParagraphHeader"; 8 | export * from "./NftsOverview"; 9 | export * from "./CardGridNumberInput"; 10 | export * from "./CardGridCheckboxInput"; 11 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/hooks/useGet.tsx: -------------------------------------------------------------------------------- 1 | import { useEffect, useState } from "react"; 2 | import { request } from "../utils"; 3 | import { RouteHttpVerb, RouteParamsInterface, RouteRequestInterface } from "@tatum/utils"; 4 | import { showError } from "../utils/message"; 5 | import { Error } from "../models/error"; 6 | 7 | export const useGet = (path: string) => { 8 | const [data, setData] = useState(null); 9 | useEffect(() => { 10 | async function fetchMyAPI() { 11 | try { 12 | const result = await request({ 13 | location: { 14 | path, 15 | method: RouteHttpVerb.GET 16 | } 17 | }); 18 | 19 | if (result?.status === "error" && result.message) { 20 | showError(result); 21 | } 22 | 23 | setData(result); 24 | } catch (e) { 25 | showError({ message: "An error occurred. Please contact support." }); 26 | } 27 | } 28 | 29 | fetchMyAPI(); 30 | }, []); 31 | return { data }; 32 | }; 33 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/hooks/useMutate.tsx: -------------------------------------------------------------------------------- 1 | import { useState } from "react"; 2 | import { request } from "../utils"; 3 | import { RouteLocationInterface, RouteParamsInterface, RouteRequestInterface } from "@tatum/utils"; 4 | import { showError } from "../utils/message"; 5 | import { Error } from "../models/error"; 6 | 7 | export const useMutate = (location: RouteLocationInterface, body?: Record) => { 8 | const [data, setData] = useState(null); 9 | const [loading, setLoading] = useState(false); 10 | 11 | const mutate = async (mutateBody?: Record) => { 12 | try { 13 | setLoading(true); 14 | const result = await request({ 15 | location, 16 | request: { 17 | ...body, 18 | ...mutateBody 19 | } 20 | }); 21 | if (result?.status === "error") { 22 | showError(result); 23 | } 24 | 25 | setData(result); 26 | } catch (e) { 27 | showError({ message: "An error occurred. Please contact support." }); 28 | } finally { 29 | setLoading(false); 30 | } 31 | }; 32 | return { data, mutate, loading }; 33 | }; 34 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/models/apiKey.tsx: -------------------------------------------------------------------------------- 1 | import { Error } from "./error"; 2 | 3 | export interface ApiKey extends Error { 4 | apiKey: string; 5 | plan: string; 6 | remainingCredits: number; 7 | usedCredits: number; 8 | creditLimit: number; 9 | nftCreated: number; 10 | nftSold: number; 11 | isTutorialDismissed: boolean; 12 | version: string; 13 | testnet: boolean; 14 | } 15 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/models/error.tsx: -------------------------------------------------------------------------------- 1 | export interface Error { 2 | message?: string; 3 | errorCode?: string; 4 | status?: string; 5 | } 6 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/models/estimates.tsx: -------------------------------------------------------------------------------- 1 | import { Error } from "./error"; 2 | 3 | export interface Estimates extends Error { 4 | estimates: Estimate[]; 5 | } 6 | 7 | export interface Estimate { 8 | starter: number; 9 | basic: number; 10 | advanced: number; 11 | chain: string; 12 | label: string; 13 | } 14 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/models/index.tsx: -------------------------------------------------------------------------------- 1 | export * from "./page"; 2 | export * from "./apiKey"; 3 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/models/nft.tsx: -------------------------------------------------------------------------------- 1 | import { Error } from "./error"; 2 | 3 | export interface Nfts extends Error { 4 | nfts: Nft[]; 5 | } 6 | 7 | export interface Nft { 8 | name: string; 9 | transactionId: string | null; 10 | transactionLink: string | null; 11 | errorCause: string | null; 12 | imageUrl: string | null; 13 | tokenId: string | null; 14 | chain: string; 15 | productId: string; 16 | sold: Date; 17 | created: Date; 18 | } 19 | 20 | interface Date { 21 | date: string; 22 | } 23 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/models/page.tsx: -------------------------------------------------------------------------------- 1 | export enum Page { 2 | LANDING = "LANDING", 3 | GET_API_KEY = "GET_API_KEY", 4 | API_KEY_DETAIL = "API_KEY_DETAIL", 5 | HELP = "HELP", 6 | NFTS_MINTED = "NFTS_MINTED", 7 | NFTS_LAZY = "NFTS_LAZY", 8 | PREFERENCES = "PREFERENCES" 9 | } 10 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/pages/apiKeyDetail/apiKeyOverview/index.scss: -------------------------------------------------------------------------------- 1 | .header-overview { 2 | width: 100%; 3 | margin-bottom: 32px; 4 | } -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/pages/apiKeyDetail/index.tsx: -------------------------------------------------------------------------------- 1 | import { ApiKeyOverview } from "./apiKeyOverview"; 2 | import { NeedHelp } from "./needHelp"; 3 | 4 | export const ApiKeyDetail = () => { 5 | return ( 6 | <> 7 | 8 | 9 | 10 | ); 11 | }; 12 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/pages/apiKeyDetail/needHelp/index.scss: -------------------------------------------------------------------------------- 1 | .needHelpContainer { 2 | display: flex; 3 | justify-content: right; 4 | margin-top: 20px; 5 | 6 | .needHelp { 7 | color: #9a9a9a; 8 | cursor: pointer; 9 | } 10 | } -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/pages/apiKeyDetail/needHelp/index.tsx: -------------------------------------------------------------------------------- 1 | import { useStores } from "../../../store"; 2 | import { Page } from "../../../models"; 3 | import React from "react"; 4 | import "./index.scss"; 5 | 6 | export const NeedHelp = () => { 7 | const { pageStore } = useStores(); 8 | return ( 9 |
    10 |
    pageStore.setPage(Page.HELP)}> 11 | Need Help? 12 |
    13 |
    14 | ); 15 | }; -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/pages/apiKeyDetail/testnetWarning/index.tsx: -------------------------------------------------------------------------------- 1 | import { Container } from "../../../components"; 2 | import { Alert, Card } from "antd"; 3 | import React from "react"; 4 | 5 | export const TestnetWarning = () => { 6 | const gridStyle = { 7 | width: "100%", 8 | align: "center" 9 | }; 10 | return ( 11 | 12 | 13 | 14 | 18 | Your Tatum API key is the Testnet network type. It should be used only for testing 19 | purposes and NFT minted with this API key dont have any value. If want work with the 20 | real Mainnet NFTs buy paid API key plan at{" "} 21 | 22 | Tatum dashboard. 23 | 24 | 25 | } 26 | type="warning" 27 | showIcon 28 | /> 29 | 30 | 31 | 32 | ); 33 | }; 34 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/pages/apiKeyDetail/tutorial/index.tsx: -------------------------------------------------------------------------------- 1 | import { CardGridItem, Container } from "../../../components"; 2 | import { Button, Card } from "antd"; 3 | import React from "react"; 4 | 5 | export const Tutorial = ({ dismissTutorial }: { dismissTutorial: () => void }) => { 6 | const gridStyle = { 7 | width: "100%", 8 | align: "center" 9 | }; 10 | 11 | return ( 12 | 13 | 14 | 20 | 21 | 22 | 23 | 24 | 25 | ); 26 | }; 27 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/pages/getApiKey/index.tsx: -------------------------------------------------------------------------------- 1 | import { GetTatumApiKey } from "./getTatumApiKey"; 2 | import { PasteApiKey } from "./pasteApiKey"; 3 | import { WhyApiKey } from "./whyApiKey"; 4 | import { PriceOverview } from "./priceOverview"; 5 | import { MoreTatum } from "./moreTatum"; 6 | 7 | export const GetApiKey = () => { 8 | return ( 9 | <> 10 | 11 | 12 | 13 | 14 | 15 | 16 | ); 17 | }; 18 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/pages/getApiKey/moreTatum/index.scss: -------------------------------------------------------------------------------- 1 | .more-tatum-container { 2 | color: #757575; 3 | font-size: 16px; 4 | 5 | .social-links { 6 | font-weight: 600; 7 | font-size: 16px; 8 | color: #111111; 9 | margin-top: 16px; 10 | } 11 | 12 | .soc-link { 13 | font-size: 16px; 14 | color: #757575; 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/pages/getApiKey/pasteApiKey/index.scss: -------------------------------------------------------------------------------- 1 | .ant-input { 2 | padding: 4px 11px !important; 3 | line-height: 1.5715 !important; 4 | min-height: 0 !important; 5 | box-shadow: none !important; 6 | box-sizing: border-box !important; 7 | margin: 0 !important; 8 | font-variant: tabular-nums !important; 9 | list-style: none !important; 10 | font-feature-settings: "tnum" !important; 11 | position: relative !important; 12 | display: inline-block !important; 13 | width: 100% !important; 14 | min-width: 0 !important; 15 | color: #000000d9 !important; 16 | font-size: 14px !important; 17 | background-color: #fff !important; 18 | background-image: none !important; 19 | border: 1px solid #d9d9d9 !important; 20 | border-radius: 2px !important; 21 | transition: all .3s !important; 22 | 23 | &:focus { 24 | border-color: #40a9ff !important; 25 | border-right-width: 1px !important; 26 | outline: 0 !important; 27 | box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2) !important; 28 | } 29 | } 30 | 31 | .input-container { 32 | margin-top: 10px; 33 | margin-bottom: 20px; 34 | } 35 | 36 | .paste-api-key { 37 | font-weight: 600; 38 | color: #000000; 39 | } -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/pages/getApiKey/priceOverview/index.scss: -------------------------------------------------------------------------------- 1 | .chainImage { 2 | margin-right: 15px; 3 | } 4 | 5 | .table-column { 6 | color: #757575; 7 | font-size: 16px; 8 | } -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/pages/getApiKey/whyApiKey/index.scss: -------------------------------------------------------------------------------- 1 | .whyApiKey { 2 | font-weight: 600; 3 | font-size: 16px; 4 | color: #111111; 5 | } 6 | 7 | .description { 8 | color: #5C5C5C; 9 | font-size: 16px; 10 | font-weight: 400; 11 | } 12 | 13 | .header-logo { 14 | width: 125px; 15 | height: 26px; 16 | } -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/pages/getApiKey/whyApiKey/index.tsx: -------------------------------------------------------------------------------- 1 | import { Card } from "antd"; 2 | import "./index.scss"; 3 | import { Container } from "../../../components"; 4 | import { getImageUrl } from "../../../utils/image"; 5 | import React from "react"; 6 | 7 | export const WhyApiKey = () => { 8 | return ( 9 | 10 | }> 11 |
    Why do I need an API key to sell NFTs?
    12 |
    13 | Normally, to create NFTs on different blockchains, you would need to have access to blockchain nodes 14 | and create wallets on each blockchain. With NFT Maker, you can simply use an API key to connect to 15 | different blockchains through Tatum, and everything else is taken care of for you. 16 |
    17 |
    18 |
    19 | ); 20 | }; 21 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/pages/help/index.tsx: -------------------------------------------------------------------------------- 1 | import { Faq } from "./faq"; 2 | import { VideoTutorials } from "../landingPage/videoTutorials"; 3 | 4 | export const Help = () => { 5 | return ( 6 | <> 7 | 8 | 9 | ); 10 | }; 11 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/pages/landingPage/about/index.scss: -------------------------------------------------------------------------------- 1 | .title-container { 2 | white-space: normal; 3 | 4 | .title { 5 | font-size: 16px; 6 | margin-bottom: 13px; 7 | margin-top: 13px; 8 | 9 | .title-tatum { 10 | color: #5C5C5C; 11 | } 12 | } 13 | 14 | .title-description { 15 | color: #5C5C5C; 16 | font-weight: 400; 17 | font-size: 16px; 18 | 19 | } 20 | } -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/pages/landingPage/about/index.tsx: -------------------------------------------------------------------------------- 1 | import { Card } from "antd"; 2 | import { Container } from "../../../components/Container"; 3 | import { getImageUrl } from "../../../utils/image"; 4 | import React from "react"; 5 | import "./index.scss"; 6 | 7 | export const About = () => ( 8 | 9 | 10 | 11 | </Card> 12 | </Container> 13 | ); 14 | 15 | const Title = () => { 16 | return ( 17 | <div className="title-container"> 18 | <img className="header-overview" src={getImageUrl("header-overview.png")} /> 19 | <div className="title-description"> 20 | If you want to sell NFTs but don’t want to build an entire NFT marketplace from scratch, then NFT Maker 21 | is the plugin you’ve been waiting for. 22 | <br /> 23 | <br /> 24 | Lazy Minting. Free IPFS Storage, forever. Supports Ethereum, Polygon, Binance Smart Chain, Celo, and 25 | Harmony. 26 | <br /> 27 | <br /> 28 | NFT Maker by Tatum allows you to turn your Woocommerce store into an NFT store with a simple plugin. 29 | Install our plugin, follow your usual WordPress product publishing flow, and just tick which blockchain 30 | you’d like to mint your NFTs on. 31 | </div> 32 | </div> 33 | ); 34 | }; 35 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/pages/landingPage/guideline/index.scss: -------------------------------------------------------------------------------- 1 | .tatum-card-item { 2 | display: flex; 3 | align-items: center; 4 | } 5 | 6 | .ant-card-head { 7 | width: 100%; 8 | } 9 | 10 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/pages/landingPage/index.tsx: -------------------------------------------------------------------------------- 1 | import { Guideline } from "./guideline"; 2 | import { About } from "./about"; 3 | import { VideoTutorials } from "./videoTutorials"; 4 | 5 | export const LandingPage = () => { 6 | return ( 7 | <> 8 | <Guideline /> 9 | <About /> 10 | <VideoTutorials /> 11 | </> 12 | ); 13 | }; 14 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/pages/landingPage/videoTutorials/index.tsx: -------------------------------------------------------------------------------- 1 | import { Card } from "antd"; 2 | import React from "react"; 3 | import { CardGridItem } from "../../../components/CardGridItem"; 4 | import { Container } from "../../../components/Container"; 5 | 6 | export const VideoTutorials = () => { 7 | return ( 8 | <Container isGridCard={true}> 9 | <Card title="Tutorials"> 10 | <CardGridItem 11 | buttonText="Watch Tutorial" 12 | title="How to create a product as an NFT in your Woocommerce Store?" 13 | description="Learn how to use your product upload flow and create NFTs" 14 | buttonLink="https://www.youtube.com/watch?v=QHl7NoFY7ts" 15 | /> 16 | <CardGridItem 17 | buttonText="Watch Tutorial" 18 | title="How to get your Tatum API key?" 19 | description="Learn how to use your product upload flow and create NFTs" 20 | buttonLink="https://youtube.com/watch?v=V830p6DwnIw" 21 | /> 22 | </Card> 23 | </Container> 24 | ); 25 | }; 26 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/pages/nftsOverviewLazy/index.scss: -------------------------------------------------------------------------------- 1 | .nftItem { 2 | display: flex; 3 | flex-direction: row; 4 | justify-content: flex-start; 5 | 6 | .nftImage { 7 | width: 100px; 8 | height: 100px; 9 | padding-right: 20px; 10 | } 11 | 12 | .nftName { 13 | font-weight: 500; 14 | } 15 | } -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/pages/nftsOverviewLazy/index.tsx: -------------------------------------------------------------------------------- 1 | import { useGet } from "../../hooks/useGet"; 2 | import { Nfts } from "../../models/nft"; 3 | import { NftsOverview, Spinner } from "../../components"; 4 | import React from "react"; 5 | import "./index.scss"; 6 | 7 | export const NftsOverviewLazy = () => { 8 | const { data } = useGet<Nfts>("/nfts/lazy"); 9 | return data?.nfts ? <NftsOverview nfts={data.nfts} lazy={true} title="NFTs Created" /> : <Spinner />; 10 | }; 11 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/pages/nftsOverviewMinted/index.scss: -------------------------------------------------------------------------------- 1 | .nftItem { 2 | display: flex; 3 | flex-direction: row; 4 | justify-content: flex-start; 5 | 6 | .nftImage { 7 | width: 100px; 8 | height: 100px; 9 | padding-right: 20px; 10 | } 11 | 12 | .nftName { 13 | font-weight: 500; 14 | } 15 | } -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/pages/nftsOverviewMinted/index.tsx: -------------------------------------------------------------------------------- 1 | import { useGet } from "../../hooks/useGet"; 2 | import { Nfts } from "../../models/nft"; 3 | import { NftsOverview, Spinner } from "../../components"; 4 | import React from "react"; 5 | import "./index.scss"; 6 | 7 | export const NftsOverviewMinted = () => { 8 | const { data } = useGet<Nfts>("/nfts/minted"); 9 | return data?.nfts ? <NftsOverview nfts={data.nfts} lazy={false} title="Sold NFTs" /> : <Spinner />; 10 | }; 11 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/pages/preferences/fees/index.scss: -------------------------------------------------------------------------------- 1 | .description { 2 | color: #9a9a9a 3 | } -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/pages/preferences/fees/index.tsx: -------------------------------------------------------------------------------- 1 | import { CardGridNumberInput, Container } from "../../../components"; 2 | import { Card } from "antd"; 3 | import React from "react"; 4 | import "./index.scss"; 5 | 6 | export const Fees = () => { 7 | const gridStyle = { 8 | width: "100%", 9 | align: "center" 10 | }; 11 | return ( 12 | <Container isGridCard={true}> 13 | <Card title="Bill your customers transactions fees"> 14 | <Card.Grid className="description" hoverable={false} style={gridStyle}> 15 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ac dui arcu. Sed sed neque libero. 16 | Aliquam consequat urna non bibendum pellentesque. Proin vitae turpis eleifend, placerat justo vitae, 17 | congue lectus. Morbi molestie mi convallis condimentum convallis. Aliquam nec fermentum enim. Donec 18 | sagittis lacus efficitur massa fringilla, in porttitor lorem iaculis. Nunc varius eu libero in 19 | semper. Nulla feugiat sem vitae neque ornare auctor. Fusce posuere faucibus aliquet. Donec quis arcu 20 | tristique, faucibus erat at, consectetur massa. 21 | </Card.Grid> 22 | <CardGridNumberInput title="Ethereum (ETH)" description="We recommend $30" /> 23 | </Card> 24 | </Container> 25 | ); 26 | }; 27 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/pages/preferences/index.scss: -------------------------------------------------------------------------------- 1 | .button-container { 2 | display: flex; 3 | justify-content: center; 4 | 5 | .save-button { 6 | width: 300px; 7 | } 8 | } -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/pages/preferences/index.tsx: -------------------------------------------------------------------------------- 1 | import { Fees } from "./fees"; 2 | import { Button, Input, Modal } from "antd"; 3 | import "./index.scss"; 4 | import { useMutate } from "../../hooks/useMutate"; 5 | import { Error } from "../../models/error"; 6 | import { RouteHttpVerb } from "@tatum/utils"; 7 | import { useForm, useFormContext, FormProvider } from "react-hook-form"; 8 | import { useGet } from "../../hooks/useGet"; 9 | import { DefaultChains } from "./defaultChains"; 10 | import { Page } from "../../models"; 11 | import { useStores } from "../../store"; 12 | 13 | export const Preferences = () => { 14 | const { data } = useGet<Error>("/preferences"); 15 | const { mutate } = useMutate<Error>({ path: "/preferences", method: RouteHttpVerb.POST }); 16 | const { pageStore } = useStores(); 17 | const form = useForm(); 18 | const onSubmit = (data: unknown) => { 19 | console.log(data); 20 | Modal.success({ 21 | title: "Preferences updated.", 22 | onOk: () => { 23 | pageStore.setPage(Page.API_KEY_DETAIL); 24 | } 25 | }); 26 | }; 27 | return ( 28 | <FormProvider {...form}> 29 | <form onSubmit={form.handleSubmit(onSubmit)}> 30 | <Fees /> 31 | <DefaultChains /> 32 | <div className="button-container"> 33 | <Input className="save-button" type="submit" value="Save" /> 34 | </div> 35 | </form> 36 | </FormProvider> 37 | ); 38 | }; 39 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/store/apiKey.tsx: -------------------------------------------------------------------------------- 1 | import { action, observable } from "mobx"; 2 | import { RootStore } from "./stores"; 3 | import { ApiKey } from "../models"; 4 | 5 | /* istanbul ignore next: Example implementations gets deleted the most time after plugin creation! */ 6 | class ApiKeyStore { 7 | @observable 8 | public apiKey: ApiKey; 9 | 10 | public readonly rootStore: RootStore; 11 | 12 | constructor(rootStore: RootStore) { 13 | this.rootStore = rootStore; 14 | } 15 | 16 | @action 17 | public setApiKey(apiKey: ApiKey) { 18 | this.apiKey = apiKey; 19 | } 20 | } 21 | 22 | export { ApiKeyStore }; 23 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/store/index.tsx: -------------------------------------------------------------------------------- 1 | export * from "./stores"; 2 | export * from "./option"; 3 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/store/option.tsx: -------------------------------------------------------------------------------- 1 | import { observable, runInAction } from "mobx"; 2 | import { BaseOptions } from "@tatum/utils"; 3 | import { RootStore } from "./stores"; 4 | 5 | class OptionStore extends BaseOptions { 6 | // Implement "others" property in your Assets.php; 7 | @observable 8 | public others: {} = {}; 9 | 10 | public readonly pureSlug: ReturnType<typeof BaseOptions.getPureSlug>; 11 | 12 | public readonly pureSlugCamelCased: ReturnType<typeof BaseOptions.getPureSlug>; 13 | 14 | public readonly rootStore: RootStore; 15 | 16 | constructor(rootStore: RootStore) { 17 | super(); 18 | this.rootStore = rootStore; 19 | this.pureSlug = BaseOptions.getPureSlug(process.env); 20 | this.pureSlugCamelCased = BaseOptions.getPureSlug(process.env, true); 21 | 22 | // Use the localized WP object to fill this object values. 23 | runInAction(() => Object.assign(this, (window as any)[this.pureSlugCamelCased])); 24 | } 25 | } 26 | 27 | export { OptionStore }; 28 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/store/page.tsx: -------------------------------------------------------------------------------- 1 | import { action, observable } from "mobx"; 2 | import { RootStore } from "./stores"; 3 | import { Page } from "../models/page"; 4 | 5 | /* istanbul ignore next: Example implementations gets deleted the most time after plugin creation! */ 6 | class PageStore { 7 | @observable 8 | public page: Page = Page.LANDING; 9 | 10 | public readonly rootStore: RootStore; 11 | 12 | constructor(rootStore: RootStore) { 13 | this.rootStore = rootStore; 14 | } 15 | 16 | @action 17 | public setPage(page: Page) { 18 | this.page = page; 19 | } 20 | } 21 | 22 | export { PageStore }; 23 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/style/admin.scss: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #f9f9f9; 3 | } 4 | 5 | .ant-message { 6 | z-index: 101000000; 7 | } 8 | 9 | .ant-card-grid { 10 | box-shadow: none; 11 | border-bottom: 1px solid #f0f0f0; 12 | 13 | &:last-child { 14 | border-bottom: none; 15 | } 16 | } 17 | 18 | .wrap { 19 | margin: 0; 20 | } 21 | 22 | #wpfooter { 23 | display: none; 24 | } 25 | 26 | #wpbody-content { 27 | height: 100vh; 28 | padding: 0; 29 | } 30 | 31 | #tatum-component { 32 | height: 100vh; 33 | } 34 | 35 | .ant-layout-content { 36 | height: 100vh; 37 | } 38 | 39 | .ant-card-grid-hoverable { 40 | cursor: pointer; 41 | } 42 | 43 | .ant-card-bordered { 44 | border: 1px solid #DDDEDE; 45 | } 46 | 47 | .ant-card-grid { 48 | box-shadow: none; 49 | border-bottom: 1px solid #DDDEDE; 50 | } 51 | 52 | .ant-card-head-title { 53 | font-size: 20px; 54 | color: #111111; 55 | font-weight: 400; 56 | } 57 | 58 | .ant-btn-primary { 59 | border-color: #4D37FD; 60 | background: #4D37FD; 61 | } -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/style/widget.scss: -------------------------------------------------------------------------------- 1 | .react-boilerplate-widget { 2 | background-color: red; 3 | } 4 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/types/global.d.ts: -------------------------------------------------------------------------------- 1 | // @see https://github.com/microsoft/TypeScript/issues/15031#issuecomment-407131785 2 | declare module "*"; 3 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/utils/image.tsx: -------------------------------------------------------------------------------- 1 | export const getImageUrl = (name: string) => `${window.location.origin}/wp-content/plugins/tatum/public/assets/${name}`; 2 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/utils/message.tsx: -------------------------------------------------------------------------------- 1 | import { message } from "antd"; 2 | import { Error } from "../models/error"; 3 | import { ReactNode } from "react"; 4 | 5 | export const showError = (error: Error) => message.error({ content: getErrorMsg(error), duration: 5 }); 6 | export const showSuccess = (content: string) => message.success({ content }); 7 | 8 | type ErrorMessagesType = { 9 | [key: string]: string | ReactNode; 10 | }; 11 | 12 | const getErrorMsg = (error: Error) => { 13 | const errorMessages: ErrorMessagesType = { 14 | "tatum.not.active.api.key": ( 15 | <div> 16 | If you want to work with the Mainnet network you need to have paid API key. If you dont have one, you 17 | can buy paid subscription at{" "} 18 | <a href="https://dashboard.tatum.io" target="_blank" rel="noreferrer"> 19 | Tatum dashboard 20 | </a> 21 | . 22 | </div> 23 | ) 24 | }; 25 | 26 | const message = errorMessages[error.errorCode]; 27 | return message ?? error.message; 28 | }; 29 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/widget.tsx: -------------------------------------------------------------------------------- 1 | /* istanbul ignore file: we do not need to care about the entry point file as errors are detected through E2E */ 2 | 3 | /** 4 | * The entrypoint for the WordPress frontend widget. 5 | */ 6 | 7 | import "@tatum/utils"; // Import once for startup polyfilling (e. g. setimmediate) 8 | import { render } from "react-dom"; 9 | import { Widget } from "./widget/"; 10 | import "./style/widget.scss"; 11 | 12 | // Query DOM for all widget wrapper divs 13 | const widgets = document.querySelectorAll("div.react-demo-wrapper"); 14 | 15 | // Iterate over the DOM nodes and render a React component into each node 16 | widgets.forEach((item) => render(<Widget />, item)); 17 | -------------------------------------------------------------------------------- /plugins/tatum/src/public/ts/widget/index.tsx: -------------------------------------------------------------------------------- 1 | import { FC } from "react"; 2 | import { __ } from "../utils"; 3 | 4 | /* istanbul ignore next: Example implementations gets deleted the most time after plugin creation! */ 5 | const Widget: FC<{}> = () => ( 6 | <div className="react-boilerplate-widget"> 7 | <h3>{__("Hello, World!")}</h3> 8 | <p>{__("I got generated from your new plugin!")}</p> 9 | </div> 10 | ); 11 | 12 | export { Widget }; 13 | -------------------------------------------------------------------------------- /plugins/tatum/src/uninstall.php: -------------------------------------------------------------------------------- 1 | <?php 2 | /** 3 | * This file is automatically requested when the uninstalls the plugin. 4 | * 5 | * @see https://developer.wordpress.org/plugins/the-basics/uninstall-methods/ 6 | */ 7 | 8 | if (!defined('WP_UNINSTALL_PLUGIN')) { 9 | exit(); 10 | } 11 | 12 | global $wpdb; 13 | $wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE 'tatum\_%';"); 14 | $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "tatum_lazy_nft;"); 15 | $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "tatum_prepared_nft;"); 16 | wp_cache_flush(); -------------------------------------------------------------------------------- /plugins/tatum/test/cypress/integration/adminPage.feature: -------------------------------------------------------------------------------- 1 | Feature: Admin page 2 | 3 | Test all functionality available in the registered WP admin page 4 | 5 | # Temporarely deactivate this test as not supported in cypress@4 6 | # Scenario: Click REST API link 7 | # Given I am logged in WP admin dashboard 8 | # Then I open admin page 9 | # Then I click on REST API link in the admin notice and alert contains "hello" 10 | 11 | Scenario: Add and remove todo list item 12 | Given I am logged in WP admin dashboard 13 | Then I open admin page 14 | Then I type "Test Todo Item" and add todo, check it, afterwards delete it -------------------------------------------------------------------------------- /plugins/tatum/test/cypress/step-definitions/adminPage/AdminPageObject.ts: -------------------------------------------------------------------------------- 1 | import * as pkg from "../../../../package.json"; 2 | 3 | const PAGE_ID = `${pkg.slug}-component`; 4 | 5 | class AdminPageObject { 6 | static get todoContainer() { 7 | return cy.get(`#${PAGE_ID} > div > div.wp-styleguide--buttons`); 8 | } 9 | 10 | static todoItem(eq: number) { 11 | return this.todoContainer.find(`> ul > li:eq(${eq})`); 12 | } 13 | 14 | static todoItemRemoveLink(eq: number) { 15 | return this.todoItem(eq).find("a"); 16 | } 17 | 18 | static get todoInput() { 19 | return this.todoContainer.children("input"); 20 | } 21 | 22 | static get todoAddButton() { 23 | return this.todoInput.next(); 24 | } 25 | 26 | static get menuPageLink() { 27 | return cy.get(`#toplevel_page_${PAGE_ID} > a`); 28 | } 29 | 30 | static get restApiLink() { 31 | return cy.get(`#${PAGE_ID} > div > div:nth-child(3) > p > a`); 32 | } 33 | } 34 | 35 | export { PAGE_ID, AdminPageObject }; 36 | -------------------------------------------------------------------------------- /plugins/tatum/test/cypress/step-definitions/adminPage/adminPage.ts: -------------------------------------------------------------------------------- 1 | import { Then } from "cypress-cucumber-preprocessor/steps"; 2 | import { AdminPageObject } from "./AdminPageObject"; 3 | 4 | Then("I open admin page", () => { 5 | AdminPageObject.menuPageLink.click(); 6 | }); 7 | 8 | Then("I click on REST API link in the admin notice and alert contains {string}", (alertText: string) => { 9 | const stub = cy.stub(); 10 | cy.on("window:alert", stub); 11 | 12 | AdminPageObject.restApiLink 13 | .click() 14 | .wait(1000) 15 | .then(() => { 16 | expect(stub.getCall(0)).to.be.calledWith(Cypress.sinon.match(new RegExp(alertText))); 17 | }); 18 | }); 19 | 20 | Then("I type {string} and add todo, check it, afterwards delete it", (todo: string) => { 21 | AdminPageObject.todoInput.type(todo); 22 | AdminPageObject.todoAddButton.click(); 23 | AdminPageObject.todoItem(0).should("contain.text", "Test Todo Item").find(":checkbox").check().should("be.checked"); 24 | AdminPageObject.todoItemRemoveLink(0).click(); 25 | AdminPageObject.todoItem(0).should("have.text", "No entries"); 26 | }); 27 | -------------------------------------------------------------------------------- /plugins/tatum/test/cypress/step-definitions/common/common.ts: -------------------------------------------------------------------------------- 1 | import { Given } from "cypress-cucumber-preprocessor/steps"; 2 | 3 | Given("I am logged in WP admin dashboard", () => { 4 | cy.visit("/wp-login.php?autologin=wordpress"); 5 | cy.url().should("contain", "wp-admin"); 6 | }); 7 | -------------------------------------------------------------------------------- /plugins/tatum/test/cypress/step-definitions/common/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./common"; 2 | -------------------------------------------------------------------------------- /plugins/tatum/test/cypress/support/commands.ts: -------------------------------------------------------------------------------- 1 | // *********************************************** 2 | // This example commands.js shows you how to 3 | // create various custom commands and overwrite 4 | // existing commands. 5 | // 6 | // For more comprehensive examples of custom 7 | // commands please read more here: 8 | // https://on.cypress.io/custom-commands 9 | // *********************************************** 10 | // 11 | // 12 | // -- This is a parent command -- 13 | // Cypress.Commands.add("login", (email, password) => { ... }) 14 | // 15 | // 16 | // -- This is a child command -- 17 | // Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) 18 | // 19 | // 20 | // -- This is a dual command -- 21 | // Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) 22 | // 23 | // 24 | // -- This is will overwrite an existing command -- 25 | // Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) 26 | -------------------------------------------------------------------------------- /plugins/tatum/test/cypress/support/index.ts: -------------------------------------------------------------------------------- 1 | // *********************************************************** 2 | // This example support/index.js is processed and 3 | // loaded automatically before your test files. 4 | // 5 | // This is a great place to put global configuration and 6 | // behavior that modifies Cypress. 7 | // 8 | // You can change the location of this file or turn off 9 | // automatically serving support files with the 10 | // 'supportFile' configuration option. 11 | // 12 | // You can read more here: 13 | // https://on.cypress.io/configuration 14 | // *********************************************************** 15 | 16 | // Import commands.js using ES2015 syntax: 17 | import "./commands"; 18 | import "cypress-plugin-retries"; 19 | 20 | // Alternatively you can use CommonJS syntax: 21 | // require('./commands') 22 | 23 | // See https://docs.cypress.io/api/cypress-api/cookies.html#Whitelist-accepts 24 | Cypress.Cookies.defaults({ 25 | whitelist: /wordpress_/ 26 | }); 27 | 28 | // `window.fetch` does not work yet with cypress (https://git.io/JfFdL) 29 | Cypress.on("window:before:load", (win: Window) => { 30 | win.fetch = null; 31 | }); 32 | -------------------------------------------------------------------------------- /plugins/tatum/test/cypress/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowJs": true, 4 | "target": "ES5", 5 | "esModuleInterop": true, 6 | "baseUrl": "../node_modules", 7 | "types": ["cypress", "node"], 8 | "resolveJsonModule": true 9 | }, 10 | "include": ["**/*.*"] 11 | } 12 | -------------------------------------------------------------------------------- /plugins/tatum/test/jest.config.js: -------------------------------------------------------------------------------- 1 | // Unfortunately the jest config can not be placed directly to package.json 2 | // because then it does not support inheritance. 3 | 4 | const base = require("../../../common/jest.base"); 5 | 6 | module.exports = base; 7 | -------------------------------------------------------------------------------- /plugins/tatum/test/jest/store/__mocks__/wp.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/no-default-export */ 2 | export default {}; 3 | -------------------------------------------------------------------------------- /plugins/tatum/test/jest/store/option.test.tsx: -------------------------------------------------------------------------------- 1 | import { OptionStore } from "../../../src/public/ts/store/option"; 2 | import { RootStore } from "../../../src/public/ts/store"; 3 | 4 | jest.mock(`${process.env.PACKAGE_SCOPE}/utils`); 5 | jest.mock("../../../src/public/ts/store/stores"); 6 | jest.mock("mobx", () => ({ 7 | observable: jest.fn(), 8 | runInAction: jest.fn().mockImplementation((callback) => callback()) 9 | })); 10 | 11 | const mobx = require("mobx"); 12 | const { BaseOptions } = require(`${process.env.PACKAGE_SCOPE}/utils`); 13 | 14 | describe("OptionStore", () => { 15 | it("should call the constructor correctly", () => { 16 | const slug = "jest"; 17 | 18 | BaseOptions.getPureSlug.mockImplementation(() => slug); 19 | 20 | const actual = new OptionStore({} as RootStore); 21 | 22 | expect(actual.pureSlug).toEqual(slug); 23 | expect(actual.pureSlugCamelCased).toEqual(slug); 24 | expect(actual.rootStore).toEqual({}); 25 | expect(mobx.runInAction).toHaveBeenCalledWith(expect.any(Function)); 26 | }); 27 | }); 28 | -------------------------------------------------------------------------------- /plugins/tatum/test/patchwork.json: -------------------------------------------------------------------------------- 1 | { 2 | "redefinable-internals": ["define"] 3 | } 4 | -------------------------------------------------------------------------------- /plugins/tatum/test/phpunit.bootstrap.php: -------------------------------------------------------------------------------- 1 | <?php 2 | // Bootstrap PHPUnit 3 | 4 | define('PHPUNIT_FILE', __FILE__); 5 | define('CONSTANT_PREFIX_PLUGIN_FILE', __FILE__); 6 | require_once __DIR__ . '/../../../common/phpunit.base.php'; 7 | 8 | Mockery::mock('WP_Widget'); 9 | -------------------------------------------------------------------------------- /plugins/tatum/test/phpunit.xdebug.php: -------------------------------------------------------------------------------- 1 | <?php declare(strict_types=1); 2 | if (!\function_exists('xdebug_set_filter')) { 3 | return; 4 | } 5 | 6 | \xdebug_set_filter(256, 1, [realpath(__DIR__ . '/../src')]); 7 | -------------------------------------------------------------------------------- /plugins/tatum/test/phpunit.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8" ?> 2 | <phpunit 3 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 4 | xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/7.5/phpunit.xsd" 5 | bootstrap="phpunit.bootstrap.php" 6 | forceCoversAnnotation="false" 7 | beStrictAboutCoversAnnotation="false" 8 | beStrictAboutOutputDuringTests="true" 9 | beStrictAboutTodoAnnotatedTests="true" 10 | verbose="true" 11 | > 12 | <testsuites> 13 | <testsuite name="default"> 14 | <directory suffix="Test.php">phpunit</directory> 15 | <exclude>./phpunit/ActivatorTest.php</exclude> 16 | <exclude>./phpunit/AssetsTest.php</exclude> 17 | <exclude>./phpunit/CoreTest.php</exclude> 18 | </testsuite> 19 | </testsuites> 20 | <filter> 21 | <whitelist processUncoveredFilesFromWhitelist="true"> 22 | <directory suffix=".php">../src/inc/</directory> 23 | <exclude> 24 | <directory suffix=".php">../src/inc/base/others</directory> 25 | </exclude> 26 | </whitelist> 27 | </filter> 28 | 29 | <logging> 30 | <log type="junit" target="./junit/phpunit.xml" /> 31 | </logging> 32 | </phpunit> 33 | -------------------------------------------------------------------------------- /plugins/tatum/test/phpunit/ActivatorTest.php: -------------------------------------------------------------------------------- 1 | <?php 2 | declare(strict_types=1); 3 | namespace Hathoriel\Tatum\Test; 4 | 5 | use Hathoriel\Tatum\Activator; 6 | use Mockery; 7 | use Mockery\MockInterface; 8 | use WP_Mock\Tools\TestCase; 9 | 10 | final class ActivatorTest extends TestCase { 11 | /** @var MockInterface|Activator */ 12 | private $activator; 13 | 14 | public function setUp(): void { 15 | parent::setUp(); 16 | $this->activator = Mockery::mock(Activator::class); 17 | } 18 | 19 | public function testActivate() { 20 | $this->activator->shouldReceive('activate')->passthru(); 21 | 22 | $this->activator->activate(); 23 | 24 | $this->addToAssertionCount(1); 25 | } 26 | 27 | public function testDeactivate() { 28 | $this->activator->shouldReceive('deactivate')->passthru(); 29 | 30 | $this->activator->deactivate(); 31 | 32 | $this->addToAssertionCount(1); 33 | } 34 | 35 | public function testDbDelta() { 36 | $this->activator->shouldReceive('dbDelta')->passthru(); 37 | 38 | $this->activator->dbDelta(false); 39 | 40 | $this->addToAssertionCount(1); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /plugins/tatum/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../common/tsconfig.json", 3 | "include": ["src/public/ts/**/*", "scripts/**/*.ts", "test/jest/**/*"], 4 | "compilerOptions": { 5 | "outDir": "types/" 6 | }, 7 | "typedocOptions": { 8 | "mode": "modules", 9 | "out": "docs/js" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /plugins/tatum/wordpress.org/assets/banner-1544x500.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tatumio/wordpress-plugin/d9160a8f2f50d9fc6b7ce8f5ad47732af34138b0/plugins/tatum/wordpress.org/assets/banner-1544x500.png -------------------------------------------------------------------------------- /plugins/tatum/wordpress.org/assets/banner-772x250.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tatumio/wordpress-plugin/d9160a8f2f50d9fc6b7ce8f5ad47732af34138b0/plugins/tatum/wordpress.org/assets/banner-772x250.png -------------------------------------------------------------------------------- /plugins/tatum/wordpress.org/assets/icon-128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tatumio/wordpress-plugin/d9160a8f2f50d9fc6b7ce8f5ad47732af34138b0/plugins/tatum/wordpress.org/assets/icon-128x128.png -------------------------------------------------------------------------------- /plugins/tatum/wordpress.org/assets/icon-256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tatumio/wordpress-plugin/d9160a8f2f50d9fc6b7ce8f5ad47732af34138b0/plugins/tatum/wordpress.org/assets/icon-256x256.png -------------------------------------------------------------------------------- /plugins/tatum/wordpress.org/assets/screenshot-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tatumio/wordpress-plugin/d9160a8f2f50d9fc6b7ce8f5ad47732af34138b0/plugins/tatum/wordpress.org/assets/screenshot-1.png -------------------------------------------------------------------------------- /plugins/tatum/wordpress.org/assets/screenshot-10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tatumio/wordpress-plugin/d9160a8f2f50d9fc6b7ce8f5ad47732af34138b0/plugins/tatum/wordpress.org/assets/screenshot-10.png -------------------------------------------------------------------------------- /plugins/tatum/wordpress.org/assets/screenshot-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tatumio/wordpress-plugin/d9160a8f2f50d9fc6b7ce8f5ad47732af34138b0/plugins/tatum/wordpress.org/assets/screenshot-11.png -------------------------------------------------------------------------------- /plugins/tatum/wordpress.org/assets/screenshot-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tatumio/wordpress-plugin/d9160a8f2f50d9fc6b7ce8f5ad47732af34138b0/plugins/tatum/wordpress.org/assets/screenshot-2.png -------------------------------------------------------------------------------- /plugins/tatum/wordpress.org/assets/screenshot-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tatumio/wordpress-plugin/d9160a8f2f50d9fc6b7ce8f5ad47732af34138b0/plugins/tatum/wordpress.org/assets/screenshot-3.png -------------------------------------------------------------------------------- /plugins/tatum/wordpress.org/assets/screenshot-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tatumio/wordpress-plugin/d9160a8f2f50d9fc6b7ce8f5ad47732af34138b0/plugins/tatum/wordpress.org/assets/screenshot-4.png -------------------------------------------------------------------------------- /plugins/tatum/wordpress.org/assets/screenshot-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tatumio/wordpress-plugin/d9160a8f2f50d9fc6b7ce8f5ad47732af34138b0/plugins/tatum/wordpress.org/assets/screenshot-5.png -------------------------------------------------------------------------------- /plugins/tatum/wordpress.org/assets/screenshot-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tatumio/wordpress-plugin/d9160a8f2f50d9fc6b7ce8f5ad47732af34138b0/plugins/tatum/wordpress.org/assets/screenshot-6.png -------------------------------------------------------------------------------- /plugins/tatum/wordpress.org/assets/screenshot-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tatumio/wordpress-plugin/d9160a8f2f50d9fc6b7ce8f5ad47732af34138b0/plugins/tatum/wordpress.org/assets/screenshot-7.png -------------------------------------------------------------------------------- /plugins/tatum/wordpress.org/assets/screenshot-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tatumio/wordpress-plugin/d9160a8f2f50d9fc6b7ce8f5ad47732af34138b0/plugins/tatum/wordpress.org/assets/screenshot-8.png -------------------------------------------------------------------------------- /plugins/tatum/wordpress.org/assets/screenshot-9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tatumio/wordpress-plugin/d9160a8f2f50d9fc6b7ce8f5ad47732af34138b0/plugins/tatum/wordpress.org/assets/screenshot-9.png -------------------------------------------------------------------------------- /plugins/tatum/wordpress.org/main.yml: -------------------------------------------------------------------------------- 1 | # This is a basic workflow to help you get started with Actions 2 | 3 | name: WordPress Plugin Deploy 4 | 5 | # Controls when the workflow will run 6 | on: 7 | push: 8 | tags: 9 | - "*" 10 | 11 | # Allows you to run this workflow manually from the Actions tab 12 | workflow_dispatch: 13 | 14 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 15 | jobs: 16 | tag: 17 | name: Deploy to SVN 18 | runs-on: ubuntu-latest 19 | steps: 20 | - uses: actions/checkout@master 21 | - name: WordPress Plugin Deploy 22 | uses: 10up/action-wordpress-plugin-deploy@stable 23 | env: 24 | SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} 25 | SVN_USERNAME: ${{ secrets.SVN_USERNAME }} 26 | SLUG: tatum --------------------------------------------------------------------------------