Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
wizardlyhel committed Nov 4, 2021
1 parent 0323f74 commit 3d9b6c6
Show file tree
Hide file tree
Showing 863 changed files with 117,883 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .alexignore
Original file line number Diff line number Diff line change
@@ -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
19 changes: 19 additions & 0 deletions .alexrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
allow: [
'hook',
'hooks',
'execute',
'invalid',
'failure',
'cracks',
'knives',
'simple',
'obvious',
'just',
'easy',
'period',
'of-course',
'special',
'dive',
],
};
121 changes: 121 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -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',
},
},
],
});
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -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.
18 changes: 18 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!-- Thank you for contributing! -->

### Description

<!-- Insert your description here and provide info about what issue this PR is solving -->

### Additional context

<!-- e.g. is there anything you'd like reviewers to focus on? -->

---

### 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
92 changes: 92 additions & 0 deletions .github/commit-convention.md
Original file line number Diff line number Diff line change
@@ -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:

<!-- prettier-ignore -->
```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**:

```
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
```

The **header** is mandatory and the **scope** of the header is optional.

### Revert

If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. In the body, it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.

### Type

If the prefix is `feat`, `fix` or `perf`, it will appear in the changelog. However, if there is any [BREAKING CHANGE](#footer), the commit will always appear in the changelog.

Other prefixes are up to your discretion. Suggested prefixes are `docs`, `chore`, `style`, `refactor`, and `test` for non-changelog related tasks.

### Scope

The scope could be anything specifying the place of the commit change. For example `dev`, `build`, `starter`, `cli` etc...

### Subject

The subject contains a succinct description of the change:

- use the imperative, present tense: "change" not "changed" nor "changes"
- don't capitalize the first letter
- no dot (.) at the end

### Body

Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
The body should include the motivation for the change and contrast this with previous behavior.

### Footer

The footer should contain any information about **Breaking Changes** and is also the place to
reference GitHub issues that this commit **Closes**.

**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.
57 changes: 57 additions & 0 deletions .github/workflows/tests_and_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Tests and Lint

on:
push:
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x, 15.x, 16.x]

name: Node.js ${{ matrix.node-version }}

steps:
- name: Checkout the code
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Get the yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Get the cache for yarn
uses: actions/cache@v2
id: yarn-cache
with:
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install the packages
run: yarn install --frozen-lockfile

- name: Lint the framework code
run: yarn lint

- name: Lint the template code
run: yarn lint
working-directory: ./packages/dev

- name: Build the code
run: yarn build

- name: Run the unit tests
run: yarn test

- name: Run the E2E tests
run: yarn test-e2e
Loading

0 comments on commit 3d9b6c6

Please sign in to comment.