diff --git a/.alexignore b/.alexignore new file mode 100644 index 0000000..ef88c0d --- /dev/null +++ b/.alexignore @@ -0,0 +1,4 @@ +docs/code_of_conduct.md +packages/hydrogen/src/docs/hooks.md +packages/hydrogen/src/docs/components.md +packages/hydrogen/src/docs/hydrogen-sdk.md diff --git a/.alexrc.js b/.alexrc.js new file mode 100644 index 0000000..0a87926 --- /dev/null +++ b/.alexrc.js @@ -0,0 +1,19 @@ +module.exports = { + allow: [ + 'hook', + 'hooks', + 'execute', + 'invalid', + 'failure', + 'cracks', + 'knives', + 'simple', + 'obvious', + 'just', + 'easy', + 'period', + 'of-course', + 'special', + 'dive', + ], +}; diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..bb03a8b --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,121 @@ +// @ts-check +const {defineConfig} = require('eslint-define-config'); + +module.exports = defineConfig({ + root: true, + plugins: ['eslint-plugin-tsdoc'], + extends: [ + 'plugin:node/recommended', + 'plugin:react/recommended', + 'plugin:react-hooks/recommended', + ], + settings: { + react: { + version: 'detect', + }, + }, + parser: '@typescript-eslint/parser', + parserOptions: { + sourceType: 'module', + ecmaVersion: 2020, + }, + rules: { + 'tsdoc/syntax': 'warn', + 'no-debugger': ['error'], + 'node/no-missing-import': [ + 'error', + { + allowModules: ['types', 'testUtils', '@shopify/hydrogen'], + tryExtensions: ['.ts', '.js', '.jsx', '.tsx', '.d.ts'], + }, + ], + 'node/no-missing-require': [ + 'error', + { + tryExtensions: ['.ts', '.js', '.jsx', '.tsx', '.d.ts'], + }, + ], + 'node/no-extraneous-import': [ + 'error', + { + allowModules: [ + '@shopify/hydrogen', + '@testing-library/react', + '@testing-library/user-event', + '@shopify/react-testing', + ], + }, + ], + 'node/no-extraneous-require': [ + 'error', + { + allowModules: ['@shopify/hydrogen'], + }, + ], + 'node/no-deprecated-api': 'off', + 'node/no-unpublished-import': 'off', + 'node/no-unpublished-require': 'off', + 'node/no-unsupported-features/es-syntax': 'off', + 'node/no-unsupported-features/es-builtins': [ + 'error', + // We need to manually specify a min-version since we can't use `engine` + { + version: '>=14.0.0', + ignores: [], + }, + ], + 'node/no-unsupported-features/node-builtins': [ + 'error', + // We need to manually specify a min-version since we can't use `engine` + { + version: '>=14.0.0', + ignores: [], + }, + ], + 'no-process-exit': 'off', + 'prefer-const': [ + 'warn', + { + destructuring: 'all', + }, + ], + 'react/prop-types': 'off', + }, + overrides: [ + { + files: ['packages/playground/**'], + rules: { + 'node/no-extraneous-import': 'off', + 'node/no-extraneous-require': 'off', + }, + }, + { + files: ['packages/create-hydrogen-app/template-*/**'], + rules: { + 'node/no-missing-import': 'off', + }, + }, + { + files: [ + 'packages/dev/**', + 'packages/localdev/**', + 'packages/playground/**', + ], + rules: { + 'react/react-in-jsx-scope': 'off', + 'react/prop-types': 'off', + }, + }, + { + files: ['**/*.example.*'], + rules: { + 'react/react-in-jsx-scope': 'off', + 'react-hooks/exhaustive-deps': 'off', + 'react/jsx-key': 'off', + 'react-hooks/rules-of-hooks': 'off', + 'node/no-extraneous-import': 'off', + 'node/no-missing-import': 'off', + }, + }, + ], +}); diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..d535723 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,31 @@ +--- +name: Bug report +about: Report a reproducible bug to help us improve +title: '[BUG]' +labels: bug +assignees: '' +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behaviour: + +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error '....' + +**Expected behaviour** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Additional context** +Add any other context about the problem here. eg. + +- Hydrogen version +- Node version +- Device details diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..186cd32 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,11 @@ +blank_issues_enabled: true +contact_links: + - name: Ideas + Feature requests + url: https://github.com/Shopify/hydrogen/discussions/categories/ideas-feature-requests + about: Upvote existing ideas + feature requests, or start a new discussion with yours. + - name: Help + url: https://github.com/Shopify/hydrogen/discussions/categories/help + about: See if your question was already answered, or start a new discussion. + - name: Feedback + url: https://github.com/Shopify/hydrogen/discussions/categories/feedback + about: We <3 feedback. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..1f257dd --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,18 @@ + + +### Description + + + +### Additional context + + + +--- + +### Before submitting the PR, please make sure you do the following: + +- [ ] Add your change under the `Unreleased` heading in the package's `CHANGELOG.md` +- [ ] Read the [Contributing Guidelines](https://github.com/shopify/hydrogen/blob/main/docs/contributing.md) +- [ ] Provide a description in this PR that addresses **what** the PR is solving, or reference the issue that it solves (e.g. `fixes #123`) +- [ ] (Shopifolk only) Open a PR in the Shopify Dev Docs with updates to the Hydrogen documentation, if needed diff --git a/.github/commit-convention.md b/.github/commit-convention.md new file mode 100644 index 0000000..225733d --- /dev/null +++ b/.github/commit-convention.md @@ -0,0 +1,92 @@ +## Git Commit Message Convention + +> This is adapted from [Angular's commit convention](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular). + +#### TL;DR: + +Messages must be matched by the following regex: + + +```js +/^(revert: )?(feat|fix|docs|dx|refactor|perf|test|workflow|build|ci|chore|types|wip|release|deps)(\(.+\))?: .{1,50}/ +``` + +#### Examples + +Appears under "Features" header, `dev` subheader: + +``` +feat(dev): add 'comments' option +``` + +Appears under "Bug Fixes" header, `dev` subheader, with a link to issue #28: + +``` +fix(dev): fix dev error + +close #28 +``` + +Appears under "Performance Improvements" header, and under "Breaking Changes" with the breaking change explanation: + +``` +perf(build): remove 'foo' option + +BREAKING CHANGE: The 'foo' option has been removed. +``` + +The following commit and commit `667ecc1` do not appear in the changelog if they are under the same release. If not, the revert commit appears under the "Reverts" header. + +``` +revert: feat(compiler): add 'comments' option + +This reverts commit 667ecc1654a317a13331b17617d973392f415f02. +``` + +### Full Message Format + +A commit message consists of a **header**, **body** and **footer**. The header has a **type**, **scope** and **subject**: + +``` +(): + + + +