Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
klzns committed Feb 19, 2020
0 parents commit 4d2caa4
Show file tree
Hide file tree
Showing 24 changed files with 6,641 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .allcontributorsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"files": [
"docs/README.md"
],
"imageSize": 100,
"commit": false,
"contributors": [],
"contributorsPerLine": 7,
"projectName": "CHANGE_ME",
"projectOwner": "vtex-apps",
"repoType": "github",
"repoHost": "https://github.com",
"skipCi": true,
"commitConvention": "none"
}
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# editorconfig.org
root = true

[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
coverage/
*.snap.ts
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Bug report
about: Create a report to help us improve
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
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.
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Feature request
about: Suggest an idea for this project
---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
11 changes: 11 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#### What does this PR do? \*

#### How to test it? \*

#### Describe alternatives you've considered, if any. \*

<!--- Optional -->

#### Related to / Depends on \*

<!--- Optional -->
40 changes: 40 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
### SublimeText ###
*.sublime-workspace

### OSX ###
.DS_Store
.AppleDouble
.LSOverride
Icon

# Thumbnails
._*

# Files that might appear on external disk
.Spotlight-V100
.Trashes

### Windows ###
# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# App specific
node_modules/
docs/_book/
.tmp
.idea
npm-debug.log
.build/
lib
dist
build
lerna-debug.log
yarn-error.log
*.orig
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"@vtex/prettier-config"
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"EditorConfig.EditorConfig",
"esbenp.prettier-vscode"
]
}
24 changes: 24 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
"eslint.alwaysShowStatus": true,
"eslint.packageManager": "yarn",
"eslint.workingDirectories": [
{
"directory": "react",
"changeProcessCWD": true
},
{
"directory": "node",
"changeProcessCWD": true
}
]
}
16 changes: 16 additions & 0 deletions .vtex/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 0.2
phases:
install:
commands:
- echo Installing Packages...
- cd react
- npm install
- echo Packages installed!
pre_build:
commands:
- echo Running tests...
- npm run verify
- echo Lint and tests finished!
cache:
paths:
- 'node_modules/**/*'
10 changes: 10 additions & 0 deletions .vtexignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.git/
react/node_modules/
.eslintrc
.gitignore
package.json
README.md
CHANGELOG.md
react/**/__tests__/**
react/**/__mocks__/**
react/testUtils/**
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added
- Intial release.
60 changes: 60 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
First of all (even before the block's name), its README.md should contain the following sentence at the very beginning:

`📢 Use this project, [contribute](https://github.com/{OrganizationName}/{AppName}) to it or open issues to help evolve it using [Store Discussion](https://github.com/vtex-apps/store-discussion).`

> :warning: *Remember to replace the values between braces according to your scenario. For example: https://github.com/vtex-apps/breadcrumb*
# BLOCK NAME

Under the block's name, you should explain the topic, giving a **brief description** of the **block's functionality** in a store.

Next, **add media** (either an image of a GIF) with the rendered block, so that users can better understand how the block works in practice.

![Media Placeholder](https://user-images.githubusercontent.com/52087100/71204177-42ca4f80-227e-11ea-89e6-e92e65370c69.png)

## Configuration

In this section, you first must **add the primary instructions** that will allow users to use the block in their store, such as adding the block's app as a dependency in the `manifest.json` and declaring the block itself in a given template.

Next, add the **block's props table**:

| Prop name | Type | Description | Default value |
| ------------ | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| `XXXXX` | `XXXXXX` | XXXXXXXX | `XXXXXX` |


Remember to also **showcase any necessary disclaimer** related to the block in this section, such as the different behavior it may display during its configuration.

## Modus Operandi *(not mandatory)*

There are scenarios in which a block can behave differently in a store, according to how it was added to the catalog, for example. It's crucial to go through these **behavioral changes** in this section, allowing users to fully understand the **practical application** of the block in their store.

If you feel compelled to give further details about the block, such as it's **relationship with the VTEX admin**, don't hesitate to use this section.

## Customization

The first thing that should be present in this section is the sentence below, showing users the recipe pertaining to CSS customization in blocks:

`In order to apply CSS customizations in this and other blocks, follow the instructions given in the recipe on [Using CSS Handles for store customization](https://vtex.io/docs/recipes/style/using-css-handles-for-store-customization).`

Thereafter, you should add a single column table with the available CSS handles for that block:

| CSS Handles |
| ----------- |
| `XXXXX` |
| `XXXXX` |
| `XXXXX` |
| `XXXXX` |
| `XXXXX` |


If there are none, add the following sentence instead:

`The component still doesn't have CSS Handles for its specific customization.`

---

Check out some documentation models that are already live:
- [Breadcrumb](https://github.com/vtex-apps/breadcrumb)
- [Image](https://vtex.io/docs/components/general/vtex.store-components/image)

18 changes: 18 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"vendor": "CHANGE_ME",
"name": "CHANGE_ME",
"version": "0.0.0",
"title": "CHANGE_ME",
"description": "CHANGE_ME",
"builders": {
"react": "3.x",
"messages": "1.x",
"docs": "0.x"
},
"dependencies": {},
"registries": [
"smartcheckout"
],
"policies": [],
"$schema": "https://raw.githubusercontent.com/vtex/node-vtex-api/master/gen/manifest.schema"
}
4 changes: 4 additions & 0 deletions messages/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"admin/test": "test",
"store/test": "test"
}
4 changes: 4 additions & 0 deletions messages/es.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"admin/test": "teste",
"store/test": "teste"
}
4 changes: 4 additions & 0 deletions messages/pt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"admin/test": "teste",
"store/test": "teste"
}
44 changes: 44 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"version": "0.0.0",
"name": "CHANGE_ME",
"private": true,
"license": "UNLICENSED",
"workspaces": [
"react"
],
"scripts": {
"lint": "eslint --ext js,jsx,ts,tsx .",
"format": "prettier --write \"**/*.{ts,js,json}\"",
"test": "cd ./react && yarn test",
"lint:locales": "intl-equalizer",
"locales:fix": "intl-equalizer --fix",
"verify": "yarn lint && yarn lint:locales && yarn test"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged && yarn lint:locales && yarn locales:fix",
"pre-push": "yarn verify"
}
},
"lint-staged": {
"*.{ts,js,tsx,jsx}": [
"eslint --fix",
"prettier --write"
],
"*.json": [
"prettier --write"
]
},
"devDependencies": {
"@vtex/intl-equalizer": "^2.4.2",
"@vtex/prettier-config": "^0.1.3",
"husky": "^4.2.3",
"lint-staged": "^10.0.7",
"prettier": "^1.19.1",
"typescript": "^3.7.5"
},
"intl-equalizer": {
"referenceLocale": "en",
"localeDirectory": "messages"
}
}
8 changes: 8 additions & 0 deletions react/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "vtex-react",
"env": {
"browser": true,
"es6": true,
"jest": true
}
}
5 changes: 5 additions & 0 deletions react/__tests__/index.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe('Orders List Scenarios', () => {
it('should work', () => {
expect(1).toBe(1)
})
})
28 changes: 28 additions & 0 deletions react/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "CHANGE_ME",
"version": "0.0.0",
"scripts": {
"test": "vtex-test-tools test"
},
"dependencies": {
"apollo-client": "^2.6.8",
"react": "^16.12.0",
"react-apollo": "^3.1.3",
"react-dom": "^16.12.0",
"react-intl": "^3.12.0"
},
"devDependencies": {
"@apollo/react-testing": "^3.1.3",
"@types/jest": "^25.1.2",
"@types/node": "^13.7.1",
"@types/react": "^16.9.19",
"@vtex/test-tools": "^3.0.3",
"@vtex/tsconfig": "^0.4.3",
"apollo-cache-inmemory": "^1.6.5",
"eslint-config-vtex-react": "^6.1.1",
"eslint": "^6.8.0",
"graphql": "^14.6.0",
"prop-types": "^15.7.2",
"typescript": "3.7.5"
}
}
Loading

0 comments on commit 4d2caa4

Please sign in to comment.