docs: descricoes basicas de como rodar o projeto
This commit is contained in:
parent
b5c8c26aa1
commit
e68e9c8305
@ -1,65 +1,54 @@
|
|||||||
# Store theme
|
# Desafio M3 Academy - VTEX IO
|
||||||
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
||||||
[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)
|
|
||||||
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
||||||
Our boilerplate theme to create stores in the VTEX IO platform.
|
|
||||||
|
|
||||||
## Preview
|
## Configuração do inicial
|
||||||
![store-theme-default](https://user-images.githubusercontent.com/1354492/63937047-e8d81c80-ca37-11e9-86fc-61e88847bbfb.png)
|
|
||||||
|
|
||||||
## Tutorial
|
1. Instale as dependências do projeto
|
||||||
To understand how things work check our tutorial [Build a store using VTEX IO](https://vtex.io/docs/getting-started/build-stores-with-store-framework/1/)
|
|
||||||
|
|
||||||
## Dependencies
|
```bash
|
||||||
All store components that you see on this document are open source too. Production ready, you can found those apps in this GitHub organization.
|
yarn
|
||||||
|
```
|
||||||
|
|
||||||
Store framework is the baseline to create any store using _VTEX IO Web Framework_.
|
2. Faça o login na VTEX na agencia Magma
|
||||||
- [Store](https://github.com/vtex-apps/store/blob/master/README.md)
|
|
||||||
|
|
||||||
Store GraphQL is a middleware to access all VTEX APIs.
|
```bash
|
||||||
- [Store GraphQL](https://github.com/vtex-apps/store-graphql/blob/master/docs/README.md)
|
vtex login agenciamagma
|
||||||
|
```
|
||||||
|
|
||||||
### Store Component Apps
|
3. Crie um workspace de desenvolvimento.
|
||||||
- [Header](https://github.com/vtex-apps/store-header/blob/master/docs/README.md)
|
Recomendamos seguir o padrão: `m3academy<nome>`. so e permitido o uso de letras minusculas e números.
|
||||||
- [Footer](https://github.com/vtex-apps/store-footer/blob/master/docs/README.md)
|
|
||||||
- [Slider Layout](https://github.com/vtex-apps/slider-layout/blob/master/docs/README.md)
|
|
||||||
- [Shelf](https://github.com/vtex-apps/shelf/blob/master/docs/README.md)
|
|
||||||
- [Telemarketing](https://github.com/vtex-apps/telemarketing/blob/master/docs/README.md)
|
|
||||||
- [Menu](https://github.com/vtex-apps/menu/blob/master/docs/README.md)
|
|
||||||
- [Login](https://github.com/vtex-apps/login/blob/master/docs/README.md)
|
|
||||||
- [Minicart](https://github.com/vtex-apps/minicart/blob/master/docs/README.md)
|
|
||||||
- [Category Menu](https://github.com/vtex-apps/category-menu/blob/master/docs/README.md)
|
|
||||||
- [Product Summary](https://github.com/vtex-apps/product-summary/blob/master/docs/README.md)
|
|
||||||
- [Breadcrumb](https://github.com/vtex-apps/breadcrumb/blob/master/docs/README.md)
|
|
||||||
- [Search Result](https://github.com/vtex-apps/search-result/blob/master/docs/README.md)
|
|
||||||
- [Product Details](https://github.com/vtex-apps/product-details/blob/master/docs/README.md)
|
|
||||||
- [Store Components](https://github.com/vtex-apps/store-components/blob/master/docs/README.md)
|
|
||||||
- [Order Placed](https://github.com/vtex-apps/order-placed/blob/master/docs/README.md)
|
|
||||||
|
|
||||||
### Store Pixel Apps
|
```bash
|
||||||
|
vtex use m3academyanabrunasouza
|
||||||
|
```
|
||||||
|
|
||||||
- [Facebook Pixel](https://github.com/vtex-apps/facebook-pixel/blob/master/docs/README.md)
|
## Desenvolvimento
|
||||||
- [Google Tag Manager](https://github.com/vtex-apps/google-tag-manager/blob/master/docs/README.md)
|
|
||||||
|
|
||||||
## Contributing
|
1. Inicie o projeto
|
||||||
|
|
||||||
Check it out [how to contribute](https://github.com/vtex-apps/awesome-io#contributing) with this project.
|
```bash
|
||||||
|
vtex link
|
||||||
|
```
|
||||||
|
|
||||||
## Contributors ✨
|
2. Rode o gulp para compilar os arquivos
|
||||||
|
|
||||||
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
|
```bash
|
||||||
|
yarn scss
|
||||||
|
```
|
||||||
|
|
||||||
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
3. Abrar o seu workspace no navegador
|
||||||
<!-- prettier-ignore-start -->
|
|
||||||
<!-- markdownlint-disable -->
|
```bash
|
||||||
<table>
|
vtex browse
|
||||||
<tr>
|
```
|
||||||
<td align="center"><a href="http://www.hugoccosta.com"><img src="https://avatars2.githubusercontent.com/u/20212776?v=4" width="100px;" alt=""/><br /><sub><b>Hugo Costa</b></sub></a><br /><a href="https://github.com/vtex-apps/store-theme/commits?author=hugocostadev" title="Documentation">📖</a></td>
|
|
||||||
</tr>
|
## Problemas frequentes
|
||||||
</table>
|
|
||||||
|
### As vezes pode acontecer de bugar o link do projeto. Para resolver isso, rode o comando abaixo que vai desfazer o link e depois rode o comando de link novamente.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
vtex unlink --all
|
||||||
|
|
||||||
|
vtex link
|
||||||
|
```
|
||||||
|
|
||||||
<!-- markdownlint-enable -->
|
|
||||||
<!-- prettier-ignore-end -->
|
|
||||||
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
|
||||||
|
|
||||||
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
|
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
{
|
|
||||||
"title": "Contact",
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"title": {
|
|
||||||
"type": "string",
|
|
||||||
"title": "Title"
|
|
||||||
},
|
|
||||||
"name": {
|
|
||||||
"type": "string",
|
|
||||||
"title": "Name"
|
|
||||||
},
|
|
||||||
"email": {
|
|
||||||
"type": "string",
|
|
||||||
"format": "email",
|
|
||||||
"title": "Email address"
|
|
||||||
},
|
|
||||||
"message": {
|
|
||||||
"type": "string",
|
|
||||||
"title": "Message"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": ["email", "message"],
|
|
||||||
"v-security": {
|
|
||||||
"publicJsonSchema": true
|
|
||||||
}
|
|
||||||
}
|
|
130
gulpfile.js
130
gulpfile.js
@ -1,7 +1,7 @@
|
|||||||
const gulp = require("gulp"),
|
const gulp = require("gulp"),
|
||||||
concat = require("gulp-concat"),
|
concat = require("gulp-concat"),
|
||||||
path = require("path"),
|
path = require("path"),
|
||||||
glob = require("glob");
|
glob = require("glob");
|
||||||
|
|
||||||
const sass = require("gulp-sass")(require("sass"));
|
const sass = require("gulp-sass")(require("sass"));
|
||||||
|
|
||||||
@ -14,93 +14,93 @@ const sass = require("gulp-sass")(require("sass"));
|
|||||||
*/
|
*/
|
||||||
// Custom sass para o storefront
|
// Custom sass para o storefront
|
||||||
const pathsStore = {
|
const pathsStore = {
|
||||||
styles: {
|
styles: {
|
||||||
styles: "styles/sass/**/",
|
styles: "styles/sass/**/",
|
||||||
ext: "styles/sass/**/*.{css,scss,sass}",
|
ext: "styles/sass/**/*.{css,scss,sass}",
|
||||||
dest: "styles/css",
|
dest: "styles/css",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// Quick/efficient way to get the unique values from a array.
|
// Quick/efficient way to get the unique values from a array.
|
||||||
function uniqValuesArray(a) {
|
function uniqValuesArray(a) {
|
||||||
var seen = {};
|
var seen = {};
|
||||||
var out = [];
|
var out = [];
|
||||||
var len = a.length;
|
var len = a.length;
|
||||||
var j = 0;
|
var j = 0;
|
||||||
for (var i = 0; i < len; i++) {
|
for (var i = 0; i < len; i++) {
|
||||||
var item = a[i];
|
var item = a[i];
|
||||||
if (seen[item] !== 1) {
|
if (seen[item] !== 1) {
|
||||||
seen[item] = 1;
|
seen[item] = 1;
|
||||||
out[j++] = item;
|
out[j++] = item;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return out;
|
}
|
||||||
|
return out;
|
||||||
}
|
}
|
||||||
function getCurrentTimestamp() {
|
function getCurrentTimestamp() {
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
|
|
||||||
const hours = String(date.getHours()).padStart(2, "0");
|
const hours = String(date.getHours()).padStart(2, "0");
|
||||||
const minutes = String(date.getMinutes()).padStart(2, "0");
|
const minutes = String(date.getMinutes()).padStart(2, "0");
|
||||||
const seconds = String(date.getSeconds()).padStart(2, "0");
|
const seconds = String(date.getSeconds()).padStart(2, "0");
|
||||||
|
|
||||||
return `\x1b[35m[${hours}:${minutes}:${seconds}]\x1b[0m`;
|
return `\x1b[35m[${hours}:${minutes}:${seconds}]\x1b[0m`;
|
||||||
}
|
}
|
||||||
|
|
||||||
let filteredFiles = [];
|
let filteredFiles = [];
|
||||||
|
|
||||||
gulp.task("getFiles", function (done) {
|
gulp.task("getFiles", function (done) {
|
||||||
glob(pathsStore.styles.ext, function (er, files) {
|
glob(pathsStore.styles.ext, function (er, files) {
|
||||||
filteredFiles = uniqValuesArray([
|
filteredFiles = uniqValuesArray([
|
||||||
...files.map((file) => path.basename(file)),
|
...files.map((file) => path.basename(file)),
|
||||||
]);
|
]);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task("sass", function (done) {
|
gulp.task("sass", function (done) {
|
||||||
filteredFiles.forEach((file) => {
|
filteredFiles.forEach((file) => {
|
||||||
const fileName = file;
|
const fileName = file;
|
||||||
|
|
||||||
gulp.src([
|
gulp
|
||||||
"styles/sass/utils/_mixin.scss",
|
.src([
|
||||||
"styles/sass/utils/_vars.scss",
|
"styles/sass/utils/_mixin.scss",
|
||||||
pathsStore.styles.styles + fileName,
|
"styles/sass/utils/_vars.scss",
|
||||||
])
|
pathsStore.styles.styles + fileName,
|
||||||
.pipe(concat(fileName))
|
])
|
||||||
.pipe(sass().on("error", sass.logError))
|
.pipe(concat(fileName))
|
||||||
.pipe(gulp.dest(pathsStore.styles.dest));
|
.pipe(sass().on("error", sass.logError))
|
||||||
});
|
.pipe(gulp.dest(pathsStore.styles.dest));
|
||||||
done();
|
});
|
||||||
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task("run", gulp.series("getFiles", "sass"));
|
gulp.task("run", gulp.series("getFiles", "sass"));
|
||||||
|
|
||||||
gulp.task("watch", function () {
|
gulp.task("watch", function () {
|
||||||
gulp.watch(pathsStore.styles.ext).on("change", function (fileName) {
|
gulp.watch(pathsStore.styles.ext).on("change", function (fileName) {
|
||||||
fileName = path.basename(fileName);
|
fileName = path.basename(fileName);
|
||||||
|
|
||||||
if (fileName.includes(".css")) {
|
if (fileName.includes(".css")) {
|
||||||
gulp.src(pathsStore.styles.styles + fileName)
|
gulp
|
||||||
.pipe(concat(fileName))
|
.src(pathsStore.styles.styles + fileName)
|
||||||
.pipe(gulp.dest(pathsStore.styles.dest));
|
.pipe(concat(fileName))
|
||||||
} else {
|
.pipe(gulp.dest(pathsStore.styles.dest));
|
||||||
gulp.src([
|
} else {
|
||||||
"styles/sass/utils/_mixin.scss",
|
gulp
|
||||||
"styles/sass/utils/_vars.scss",
|
.src([
|
||||||
pathsStore.styles.styles + fileName,
|
"styles/sass/utils/_mixin.scss",
|
||||||
])
|
"styles/sass/utils/_vars.scss",
|
||||||
.pipe(concat(fileName))
|
pathsStore.styles.styles + fileName,
|
||||||
.pipe(sass().on("error", sass.logError))
|
])
|
||||||
.pipe(gulp.dest(pathsStore.styles.dest));
|
.pipe(concat(fileName))
|
||||||
}
|
.pipe(sass().on("error", sass.logError))
|
||||||
|
.pipe(gulp.dest(pathsStore.styles.dest));
|
||||||
|
}
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
getCurrentTimestamp() +
|
getCurrentTimestamp() + " File: \x1b[32m" + fileName + "\x1b[0m builded."
|
||||||
" File: \x1b[32m" +
|
);
|
||||||
fileName +
|
});
|
||||||
"\x1b[0m builded."
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task("storefront", gulp.series("run", "watch"));
|
gulp.task("storefront", gulp.series("run", "watch"));
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
|
|
||||||
"name": "storefront",
|
"name": "storefront",
|
||||||
"shopName": "alliedrecommerce",
|
"shopName": "alliedrecommerce",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
@ -12,7 +11,8 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"dev": "concurrently \"vtex unlink --all && vtex link\" \"gulp storefront\"",
|
"dev": "concurrently \"vtex unlink --all && vtex link\" \"gulp storefront\"",
|
||||||
"lint": "eslint ./ --fix"
|
"lint": "eslint ./ --fix",
|
||||||
|
"scss": "gulp storefront"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"urlset": {
|
|
||||||
"url": [
|
|
||||||
{
|
|
||||||
"loc": "https://storetheme.vtex.com/about-us"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
@ -2,7 +2,6 @@
|
|||||||
"store.product": {
|
"store.product": {
|
||||||
"children": [
|
"children": [
|
||||||
"html#breadcrumb",
|
"html#breadcrumb",
|
||||||
"image#example",
|
|
||||||
"condition-layout.product#availability",
|
"condition-layout.product#availability",
|
||||||
"flex-layout.row#description",
|
"flex-layout.row#description",
|
||||||
"flex-layout.row#specifications-title",
|
"flex-layout.row#specifications-title",
|
||||||
@ -11,6 +10,14 @@
|
|||||||
"product-questions-and-answers"
|
"product-questions-and-answers"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"html#breadcrumb": {
|
||||||
|
"props": {
|
||||||
|
"tag": "section",
|
||||||
|
"testId": "a1",
|
||||||
|
"blockClass": "pdp-breadcrumb"
|
||||||
|
},
|
||||||
|
"children": ["breadcrumb"]
|
||||||
|
},
|
||||||
"flex-layout.row#specifications-title": {
|
"flex-layout.row#specifications-title": {
|
||||||
"children": ["rich-text#specifications"]
|
"children": ["rich-text#specifications"]
|
||||||
},
|
},
|
||||||
@ -19,30 +26,12 @@
|
|||||||
"text": "##### Product Specifications"
|
"text": "##### Product Specifications"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"image#example": {
|
|
||||||
"props": {
|
|
||||||
"src": "https://storecomponents.vteximg.com.br/arquivos/box.png",
|
|
||||||
"maxHeight": 24
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"rich-text#teste-academy": {
|
|
||||||
"props": {
|
|
||||||
"text": "Teeeeste doooooooo amor"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flex-layout.row#product-breadcrumb": {
|
"flex-layout.row#product-breadcrumb": {
|
||||||
"props": {
|
"props": {
|
||||||
"marginTop": 4
|
"marginTop": 4
|
||||||
},
|
},
|
||||||
"children": ["breadcrumb"]
|
"children": ["breadcrumb"]
|
||||||
},
|
},
|
||||||
"html#breadcrumb": {
|
|
||||||
"props": {
|
|
||||||
"tag": "section",
|
|
||||||
"testId": "a1"
|
|
||||||
},
|
|
||||||
"children": ["breadcrumb"]
|
|
||||||
},
|
|
||||||
|
|
||||||
"flex-layout.row#description": {
|
"flex-layout.row#description": {
|
||||||
"props": {
|
"props": {
|
||||||
|
Loading…
Reference in New Issue
Block a user