-
Notifications
You must be signed in to change notification settings - Fork 48
Add the react, app-connect, and localizaton packages. #1188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 11 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
3cb75f6
Add the react, app-connect, and localizaton packages.
wcole1-godaddy e1a18b7
Changeset description
wcole1-godaddy 80bc99b
Updating package versions.
wcole1-godaddy 39c0c74
fix(app-connect): use req.path instead of req.url for canonical strin…
wcole1-godaddy cf96a6b
fix(root): ensure packages are built before running tests
wcole1-godaddy 6ab4ac8
Remove .DS_Store files and add to .gitignore
wcole1-godaddy e3d6935
Update README.md
wcole1-godaddy c498818
Update packages/react/package.json
wcole1-godaddy 34f1228
address pr feedback
wcole1-godaddy 3943954
Remove internal references and update to public registry
wcole1-godaddy e423ac3
Remove .DS_Store files
wcole1-godaddy 3248099
Remove dev and test environment references from README
wcole1-godaddy 0fffcf4
Remove HOST lookup.
wcole1-godaddy fffb252
Update @godaddy/react changelog
wcole1-godaddy 20297cf
Address some more PR feedback
wcole1-godaddy 9c4a713
Merge main into godaddy-dev-js-libraries
wcole1-godaddy ee80427
Update lockfile
wcole1-godaddy 699730c
add licenses to each package
wcole1-godaddy d25775f
chore: Remove unnecessary .DS_Store files from packages and subdirect…
rmarkins-godaddy 33bfacd
Merge branch 'main' into godaddy-dev-js-libraries
wcole1-godaddy b3b744d
Revise AGENTS.md to enhance clarity and detail on monorepo usage, com…
wcole1-godaddy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| --- | ||
| "@godaddy/localizations": major | ||
| "@godaddy/app-connect": major | ||
| "@godaddy/react": major | ||
| --- | ||
|
|
||
| This marks the first stable major release of our GoDaddy JavaScript libraries, representing a significant milestone in our platform development. | ||
|
|
||
| A comprehensive React component library for GoDaddy checkout experiences, featuring: | ||
|
|
||
| - Complete checkout session management with GraphQL integration | ||
| - Support for multiple payment providers (Stripe, PayPal) | ||
| - Comprehensive checkout features including billing/shipping addresses, tips, promotions, and tax collection | ||
| - Multi-environment support (dev, ote, prod, test) | ||
| - Built with modern React patterns using Radix UI components and Tailwind CSS | ||
|
|
||
| Internationalization support for GoDaddy checkout components: | ||
|
|
||
| - Structured localization framework covering all checkout aspects | ||
| - Initial French (France) localization with comprehensive translation coverage | ||
| - Extensible architecture for adding additional locales | ||
| - Seamless integration with the React component library | ||
|
|
||
| Essential platform integration tools for GoDaddy app developers: | ||
|
|
||
| - Cryptographic request verification using ECDSA-P256-SHA256 | ||
| - Webhook subscription verification with HMAC-SHA256 | ||
| - Framework-specific adapters for Express.js and Next.js | ||
| - Comprehensive error handling following GoDaddy standards | ||
| - Environment-based configuration support | ||
|
|
||
| These packages provide the foundation for building robust, secure, and internationalized applications on the GoDaddy platform. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # AGENTS.md - GoDaddy JavaScript Style Guide | ||
|
|
||
| ## Commands | ||
| - Root lint: `pnpm lint` (runs across all packages) | ||
| - Root test: `pnpm test` (runs all package tests in parallel) | ||
| - Package-specific: `cd packages/<package> && pnpm <command>` | ||
| - Single test: Navigate to package directory, then `pnpm test` | ||
| - Clean: `pnpm clean` (removes node_modules from all packages) | ||
|
|
||
| ## Architecture | ||
| - Monorepo with pnpm workspaces containing ESLint configs | ||
| - Main packages: `eslint-config-godaddy` (base), `eslint-config-godaddy-react`, `eslint-config-godaddy-typescript` | ||
| - `app-connect/` - Platform Applications Registry API (TypeScript with Biome) | ||
| - `react/` - React component library with GraphQL schema | ||
| - Uses changesets for versioning and publishing | ||
|
|
||
| ## Code Style | ||
| - ESLint configs define GoDaddy JavaScript standards for ES6+, React, TypeScript | ||
| - Base config enforces strict mode, jsdoc, mocha, and json rules | ||
| - TypeScript: strict typing, no `any`, functional approach over classes | ||
| - Naming: lowercase-with-dashes for directories, camelCase for variables | ||
| - Error handling: wrap async in try/catch, use Result<T> types where applicable | ||
| - Testing: Mocha for base packages, Vitest for modern TypeScript packages | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,178 +1,158 @@ | ||
| # godaddy-style | ||
| # GoDaddy JavaScript | ||
|
|
||
| Official GoDaddy JavaScript styleguide. It includes `eslint` packages for various use-cases and can be used as a standard in any new project. | ||
| [](https://www.npmjs.com/package/eslint-config-godaddy) | ||
| [](https://github.com/godaddy/javascript/blob/main/LICENSE) | ||
| [](https://github.com/godaddy/javascript) | ||
|
|
||
| - [`eslint-config-godaddy`]: Base configuration for _non-React_, ES6 JavaScript applications | ||
| - [`eslint-config-godaddy-react`]: Configuration for ES6 React JavaScript applications | ||
| - [`eslint-config-godaddy-typescript`]: Configuration for ES6 TypeScript applications | ||
| - [`eslint-config-godaddy-react-typescript`]: Configuration for ES6 React JavaScript applications | ||
| Official collection of JavaScript libraries, tools, and configurations for building on the GoDaddy platform. This monorepo contains all the JavaScript SDKs, ESLint configurations, and React components under the `@godaddy` namespace. | ||
|
|
||
| There are many useful features: | ||
| ## Getting Started | ||
|
|
||
| - **Standard. No configuration.** – Stop worrying about style and focus on your work. | ||
| - **Modern** – Uses modern linting tools like `eslint`. | ||
| - **Auto-fix** – Auto-fix is enabled by-default through in `eslint`. Many rules will fix themselves! | ||
|
|
||
| This styleguide is used by dozens of product teams at GoDaddy. Have a question or comment? [Open an issue!](https://github.com/godaddy/javascript/issues/new) | ||
|
|
||
| - [Installation](#installation) | ||
| - [Usage](#usage) | ||
| - [Additional Best Practices](#additional-best-practices) | ||
| - [FAQ](#faq) | ||
| - [Roadmap](#roadmap) | ||
| - [Contributors](https://github.com/godaddy/javascript/graphs/contributors) | ||
|
|
||
| ## Installation | ||
|
|
||
| Install one of the provided packages depending on the kind of application you are developing: | ||
| ### ESLint Configurations | ||
|
|
||
| ``` sh | ||
| # Default with ES6 | ||
| npm i eslint-config-godaddy --save-dev | ||
| Choose the configuration that fits your project: | ||
|
|
||
| # OR (ES6 with React rules) | ||
| npm i eslint-config-godaddy-react --save-dev | ||
| ```bash | ||
| # For ES6 JavaScript applications | ||
| npm install eslint-config-godaddy --save-dev | ||
|
|
||
| # OR (legacy ES5 with React rules) | ||
| npm i eslint-config-godaddy-es5 --save-dev | ||
| # For React applications | ||
| npm install eslint-config-godaddy-react --save-dev | ||
|
|
||
| # OR (ES6 with TypeScript rules) | ||
| npm i eslint-config-godaddy-typescript --save-dev | ||
| # For TypeScript applications | ||
| npm install eslint-config-godaddy-typescript --save-dev | ||
|
|
||
| # OR (ES6 with React and TypeScript rules) | ||
| npm i eslint-config-godaddy-react-typescript --save-dev | ||
| # For React + TypeScript applications | ||
| npm install eslint-config-godaddy-react-typescript --save-dev | ||
| ``` | ||
|
|
||
| ## Usage | ||
|
|
||
| There are two ways to use this styleguide depending on your own tooling preference: directly using pre-included binaries or running `eslint` yourself with a custom `.eslintrc` config. | ||
| ### Other Packages | ||
|
|
||
| ### 2. Define your local `eslint.config.js|mjs` and run `eslint` yourself | ||
| ```bash | ||
| # For GoDaddy platform integration | ||
| npm install @godaddy/app-connect | ||
|
|
||
| ``` js | ||
| import GDConfig from 'eslint-config-godaddy'; | ||
| import { defineConfig } from 'eslint-define-config'; | ||
| export default defineConfig({ | ||
| extends: [ | ||
| GDConfig, | ||
| ], | ||
| rules: { | ||
| // Add your own rules here | ||
| 'no-console': 'warn', | ||
| }, | ||
| }); | ||
| # For React components with commerce APIs | ||
| npm install @godaddy/react | ||
| ``` | ||
|
|
||
| The `--fix` option in `eslint` is [**only** available as a CLI option](https://github.com/eslint/eslint/issues/8041). Auto-fix will **_NOT be enabled_** unless you run `eslint --fix` in your `package.json`. | ||
| ## Packages | ||
|
|
||
| ``` js | ||
| { | ||
| "scripts": { | ||
| "lint": "eslint --fix files/ you/ want-to/ lint/" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## Additional Best Practices | ||
| This monorepo contains the following packages: | ||
|
|
||
| This section is a place for additional best practices that may be useful but are not strictly enforced by this styleguide. Have something to add here? Great! [Submit a PR](#how-do-i-contribute). | ||
| | Package | Description | NPM | | ||
| |---------|-------------|-----| | ||
| | [`eslint-config-godaddy`](/packages/eslint-config-godaddy) | Base ESLint configuration for ES6 JavaScript | [](https://www.npmjs.com/package/eslint-config-godaddy) | | ||
| | [`eslint-config-godaddy-react`](/packages/eslint-config-godaddy-react) | ESLint configuration for React applications | [](https://www.npmjs.com/package/eslint-config-godaddy-react) | | ||
| | [`eslint-config-godaddy-typescript`](/packages/eslint-config-godaddy-typescript) | ESLint configuration for TypeScript applications | [](https://www.npmjs.com/package/eslint-config-godaddy-typescript) | | ||
| | [`eslint-config-godaddy-react-typescript`](/packages/eslint-config-godaddy-react-typescript) | ESLint configuration for React + TypeScript applications | [](https://www.npmjs.com/package/eslint-config-godaddy-react-typescript) | | ||
| | [`@godaddy/app-connect`](/packages/app-connect) | Platform integration tools for GoDaddy apps | [](https://www.npmjs.com/package/@godaddy/app-connect) | | ||
| | [`@godaddy/react`](/packages/react) | React components and commerce API integration | [](https://www.npmjs.com/package/@godaddy/react) | | ||
|
|
||
| ### React | ||
| ## Why GoDaddy JavaScript? | ||
|
|
||
| - [AirBnB React Styleguide](https://github.com/airbnb/javascript/tree/master/react) | ||
| - **Standard. No configuration.** – Stop worrying about style and focus on your work. | ||
| - **Modern** – Uses modern linting tools like ESLint with support for ES6+, React, and TypeScript. | ||
| - **Auto-fix** – Auto-fix is enabled by default. Many rules will fix themselves! | ||
| - **Battle-tested** – Used by dozens of product teams at GoDaddy in production. | ||
|
|
||
| ## FAQ | ||
| ## Quick Start | ||
|
|
||
| ## How do I override a specific rule ? | ||
| ### ESLint Configuration | ||
|
|
||
| ### 1. Add a `eslint.config.js|mjs` file at the root of your project | ||
| 1. Install the appropriate configuration for your project | ||
| 2. Create an `eslint.config.js` file: | ||
|
|
||
| ``` js | ||
| ```js | ||
| import GDConfig from 'eslint-config-godaddy'; | ||
| import { defineConfig } from 'eslint-define-config'; | ||
|
|
||
| export default defineConfig({ | ||
| extends: [ | ||
| GDConfig, | ||
| ], | ||
| extends: [GDConfig], | ||
| rules: { | ||
| // Add your own rules here | ||
| // Add your custom rules here | ||
| 'no-console': 'warn', | ||
| }, | ||
| }); | ||
| ``` | ||
|
|
||
| ### 2. Add a param to specify the path of your own `my-config.js|cjs|mjs` file in your `package.json` | ||
| 3. Add a lint script to your `package.json`: | ||
|
|
||
| ``` js | ||
| ```json | ||
| { | ||
| "scripts": { | ||
| "eslint": "eslint -c myconfig.js lib/ test/", | ||
| "lint": "eslint --fix src/" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## How do I contribute? | ||
| ### Platform Integration | ||
|
|
||
| Fork this repository and submit a pull request. | ||
| For applications integrating with the GoDaddy platform: | ||
|
|
||
| ### Local setup | ||
| ```typescript | ||
| import { verifyAction } from '@godaddy/app-connect'; | ||
|
|
||
| This repo uses [pnpm] to install node_modules and handle script execution. Please install and setup `pnpm` after cloning and before installing packages. | ||
| // Verify requests from GoDaddy platform | ||
| const result = verifyAction(request); | ||
| if (result.success) { | ||
| // Process verified request | ||
| } | ||
| ``` | ||
|
|
||
| For a first time setup make sure to run from the root of the monorepo. | ||
| ## Release Notes | ||
|
|
||
| ```bash | ||
| pnpm install | ||
| ``` | ||
| Release information is available through: | ||
| - [GitHub Releases](https://github.com/godaddy/javascript/releases) page | ||
| - Individual `CHANGELOG.md` files within each package (e.g., [`packages/eslint-config-godaddy/CHANGELOG.md`](/packages/eslint-config-godaddy/CHANGELOG.md)) | ||
|
|
||
| ## How to Contribute | ||
|
|
||
| Since this repository uses npm workspaces it will install and hoist all `node_modules` to the root of the monorepo. | ||
| We welcome contributions! To get started: | ||
|
|
||
| ### Submit a changeset | ||
| 1. Fork this repository | ||
| 2. Make your changes | ||
| 3. Submit a pull request | ||
|
|
||
| This repository utilizes [changesets] to handle versioning and publishing as you submit a pull-request. | ||
| A changeset should be included with your pull-request to help the maintainers | ||
| understand the changes and to help with the release process. | ||
| ### Local Development | ||
|
|
||
| To initiate a changeset run: | ||
| This repository uses [pnpm](https://pnpm.io/) for package management and workspace handling. | ||
|
|
||
| ```bash | ||
| pnpm run changeset | ||
| ``` | ||
| # Install dependencies | ||
| pnpm install | ||
|
|
||
| After which follow the command prompts to select which packages and which version each package should receive. | ||
| # Run tests across all packages | ||
| pnpm test | ||
|
|
||
| Commit and push the changeset to your branch to be included with your pull-request. | ||
| # Run linting across all packages | ||
| pnpm lint | ||
|
|
||
| ## Publishing | ||
| # Create a changeset for your changes | ||
| pnpm changeset | ||
| ``` | ||
|
|
||
| ### Submitting Changes | ||
|
|
||
| When a pull-request is merged into the `main`, the changeset will be used | ||
| to determine the next version of the package. | ||
| This repository uses [changesets](https://github.com/changesets/changesets) for versioning and publishing. Include a changeset with your pull request: | ||
|
|
||
| A "Version Packages" pull-request will be automatically created to bump the | ||
| versions. | ||
| If multiple PRs with changesets are merged, this PR will automatically update to | ||
| include all changesets. | ||
| ```bash | ||
| pnpm changeset | ||
| ``` | ||
|
|
||
| When all changes are ready to be published, repo admins can force squash merge | ||
| the "Version Packages" PR to main (CI worflows do not run on this automated branch). | ||
| This will trigger the CI to publish the packages to npm. | ||
| Follow the prompts to select which packages should receive version bumps. | ||
|
|
||
| ## I disagree with a specific rule | ||
| ## Support | ||
|
|
||
| Great. We'd love to talk about it. Fork this repository and submit a pull-request. | ||
| Have a question or found an issue? | ||
|
|
||
| ## Help! It's not working for me | ||
| - [Open an issue](https://github.com/godaddy/javascript/issues/new) on GitHub | ||
| - Check out our [contributing guidelines](CONTRIBUTING.md) | ||
|
|
||
| No problem. Reach out to us by [opening an issue] | ||
| ## License | ||
|
|
||
| ## Roadmap | ||
| This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. | ||
|
|
||
| - ESLint v9 support ([guide](https://eslint.org/docs/latest/use/migrate-to-9.0.0)) | ||
| --- | ||
|
|
||
| [opening an issue]: https://github.com/godaddy/javascript/issues | ||
| [`eslint-config-godaddy`]: /packages/eslint-config-godaddy | ||
| [`eslint-config-godaddy-react`]: /packages/eslint-config-godaddy-react | ||
| [`eslint-config-godaddy-typescript`]: /packages/eslint-config-godaddy-typescript | ||
| [`eslint-config-godaddy-react-typescript`]: /packages/eslint-config-godaddy-react-typescript | ||
| [changesets]: https://github.com/changesets/changesets | ||
| [pnpm]: https://pnpm.io/ | ||
| Built with ❤️ by the GoDaddy engineering team |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,8 +12,9 @@ | |
| "pnpm": ">=10" | ||
| }, | ||
| "scripts": { | ||
| "build": "pnpm run -r build", | ||
| "lint": "pnpm run -r lint", | ||
| "test": "pnpm run -r --parallel test", | ||
| "test": "pnpm run build && pnpm run -r --parallel test", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the build script could be a |
||
| "version": "changeset version && pnpm install --prefer-offline", | ||
| "release": "changeset publish", | ||
| "changeset": "changeset", | ||
|
|
||
wcole1-godaddy marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
Binary file not shown.
wcole1-godaddy marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # AGENT.md - Platform Applications Registry API | ||
|
|
||
| ## Commands | ||
| - Build: `pnpm build` | ||
| - Dev mode: `pnpm dev` | ||
| - Lint: `pnpm lint` (Biome linter) | ||
| - Type check: `pnpm check` (Biome checks) | ||
| - Test: `pnpm test`, `pnpm test:watch` | ||
|
|
||
| ## Code Style | ||
| - TypeScript with strict typing (no `any`) | ||
| - Functions must return `Result<T>` type, check with `if (result.success)` | ||
| - Use Zod for validation | ||
| - Functional approach - minimal classes | ||
| - Naming: lowercase-with-dashes for directories | ||
| - Error handling: wrap async in try/catch at lowest level | ||
| - Tests: use Vitest with small, focused tests | ||
|
|
||
| ## Architecture |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should just be GoDaddy JavaScript since it's no longer including components that are just for linting and formatting.