diff --git a/.gitignore b/.gitignore index ea67295014..4887893825 100644 --- a/.gitignore +++ b/.gitignore @@ -130,6 +130,10 @@ Caddyfile /ghost/sodo-search/public/main.css /ghost/sodo-search/umd +# Signup Form and local environments +/ghost/signup-form/umd +/ghost/signup-form/.env*.local + # Announcement-Bar /ghost/announcement-bar/umd diff --git a/ghost/core/core/shared/config/defaults.json b/ghost/core/core/shared/config/defaults.json index 76d7cd139e..510b2311b5 100644 --- a/ghost/core/core/shared/config/defaults.json +++ b/ghost/core/core/shared/config/defaults.json @@ -200,6 +200,10 @@ "url": "https://cdn.jsdelivr.net/ghost/admin-x-settings@~{version}/dist/admin-x-settings.umd.js", "version": "0.0" }, + "signupForm": { + "url": "https://cdn.jsdelivr.net/ghost/signup-form@~{version}/umd/signup-form.min.js", + "version": "0.0" + }, "tenor": { "googleApiKey": null, "contentFilter": "off" diff --git a/ghost/signup-form/.env.development b/ghost/signup-form/.env.development new file mode 100644 index 0000000000..78483124be --- /dev/null +++ b/ghost/signup-form/.env.development @@ -0,0 +1,2 @@ +# Override this in .env.development.local if needed +VITE_SITE_URL=https://127.0.0.1:2368 diff --git a/ghost/signup-form/.eslintrc.cjs b/ghost/signup-form/.eslintrc.cjs new file mode 100644 index 0000000000..5e6629063e --- /dev/null +++ b/ghost/signup-form/.eslintrc.cjs @@ -0,0 +1,42 @@ +/* eslint-env node */ +module.exports = { + root: true, + extends: [ + 'react-app', + 'plugin:ghost/browser', + 'plugin:react/recommended' + ], + plugins: [ + 'ghost', + 'tailwindcss' + ], + rules: { + // sort multiple import lines into alphabetical groups + 'ghost/sort-imports-es6-autofix/sort-imports-es6': ['error', { + memberSyntaxSortOrder: ['none', 'all', 'single', 'multiple'] + }], + + // suppress errors for missing 'import React' in JSX files, as we don't need it + 'react/react-in-jsx-scope': 'off', + // ignore prop-types for now + 'react/prop-types': 'off', + + // custom react rules + 'react/jsx-sort-props': ['error', { + reservedFirst: true, + callbacksLast: true, + shorthandLast: true, + locale: 'en' + }], + 'react/button-has-type': 'error', + 'react/no-array-index-key': 'error', + + 'tailwindcss/classnames-order': ['error', {config: 'tailwind.config.cjs'}], + 'tailwindcss/enforces-negative-arbitrary-values': ['warn', {config: 'tailwind.config.cjs'}], + 'tailwindcss/enforces-shorthand': ['warn', {config: 'tailwind.config.cjs'}], + 'tailwindcss/migration-from-tailwind-2': ['warn', {config: 'tailwind.config.cjs'}], + 'tailwindcss/no-arbitrary-value': 'off', + 'tailwindcss/no-custom-classname': 'off', + 'tailwindcss/no-contradicting-classname': ['error', {config: 'tailwind.config.cjs'}] + } +}; diff --git a/ghost/signup-form/.storybook/main.tsx b/ghost/signup-form/.storybook/main.tsx new file mode 100644 index 0000000000..23facc7c95 --- /dev/null +++ b/ghost/signup-form/.storybook/main.tsx @@ -0,0 +1,27 @@ +import type { StorybookConfig } from "@storybook/react-vite"; +const config: StorybookConfig = { + stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"], + addons: [ + "@storybook/addon-links", + "@storybook/addon-essentials", + "@storybook/addon-interactions", + { + name: '@storybook/addon-styling', + }, + ], + framework: { + name: "@storybook/react-vite", + options: {}, + }, + docs: { + autodocs: "tag", + }, + // staticDirs: ['../public/fonts'], + async viteFinal(config, options) { + config.resolve.alias = { + crypto: require.resolve('rollup-plugin-node-builtins'), + } + return config; + }, +}; +export default config; diff --git a/ghost/signup-form/.storybook/preview.tsx b/ghost/signup-form/.storybook/preview.tsx new file mode 100644 index 0000000000..7540781ccd --- /dev/null +++ b/ghost/signup-form/.storybook/preview.tsx @@ -0,0 +1,31 @@ +import React from 'react'; + +import '../src/styles/demo.css'; +import type { Preview } from "@storybook/react"; + +const preview: Preview = { + parameters: { + actions: { argTypesRegex: "^on[A-Z].*" }, + controls: { + matchers: { + color: /(background|color)$/i, + date: /Date$/, + }, + }, + options: { + storySort: { + order: ['Global', 'Settings', 'Experimental'], + }, + }, + }, + decorators: [ + (Story) => ( +
When you submit this one, it will throw an error.
+ + + +