Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sberdevices/cra-template-plasma-shop-template

Package Overview
Dependencies
Maintainers
4
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sberdevices/cra-template-plasma-shop-template - npm Package Compare versions

Comparing version 1.1.0-canary.99.6c3284d6fec5302d60130ffe33deea1a3a160ad7.0 to 1.1.0-canary.99.b81e016458c290f1c0d3e18725cad2801b60961b.0

4

package.json
{
"name": "@sberdevices/cra-template-plasma-shop-template",
"version": "1.1.0-canary.99.6c3284d6fec5302d60130ffe33deea1a3a160ad7.0",
"version": "1.1.0-canary.99.b81e016458c290f1c0d3e18725cad2801b60961b.0",
"description": "",

@@ -27,3 +27,3 @@ "keywords": [

],
"gitHead": "6c3284d6fec5302d60130ffe33deea1a3a160ad7"
"gitHead": "b81e016458c290f1c0d3e18725cad2801b60961b"
}

@@ -1,5 +0,24 @@

# Шаблон магазина для create-react-app
# Шаблон смартапа магазина для create-react-app
## Описание
Базовый шаблон для создания [Canvas App](https://developer.sberdevices.ru/docs/ru/methodology/research/canvasapp) интернет магазина. Шаблон включает в себя следующие страницы:
- Основная страница магазина
- О магазине
- Каталог товаров
- Корзина
- Страница оформления заказа
- Страница с описанием товара
- Доставка
- Правовая информация
- Контакты
Так же настроено взаимодействие с [виртуальным ассистентом](https://developer.sberdevices.ru/docs/ru/basics/about_assistant).
> Шаблон включает пользовательский интерфейс смартапа и базовое взаимодействие со сценарием (обработка команд от ассистента, формирование состояния смартапа), сценарий необходимо разрабатывать отдельно, используя один из инструментов: [SmartApp Graph](https://developer.sberdevices.ru/docs/ru/developer_tools/flow/quick_start/quick_start), [SmartApp Code](https://developer.sberdevices.ru/docs/ru/developer_tools/ide/smartappcode_description_and_guide), [SaluteJS](https://developer.sberdevices.ru/docs/ru/developer_tools/salutejs), [SmartApp Framework](https://developer.sberdevices.ru/docs/ru/developer_tools/framework/overview).
## Установка
```bash
$ npx create-react-app <name> --template @sberdevices/plasma-shop-template
```
{
"package": {
"dependencies": {
"@sberdevices/assistant-client": "3.7.1",
"@sberdevices/plasma-icons": "1.25.0",
"@sberdevices/plasma-temple": "0.41.0-canary.95.62427e8212d31db1efe6ea186c42815f15f522a3.0",
"@sberdevices/plasma-tokens": "1.9.0",
"@sberdevices/plasma-ui": "1.30.2",
"@sberdevices/spatial-navigation": "1.0.3",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
"styled-components": "5.3.0",
"uuid": "8.3.2",
"web-vitals": "^1.1.2"
"package": {
"dependencies": {
"@sberdevices/assistant-client": "3.7.1",
"@sberdevices/plasma-icons": "1.25.0",
"@sberdevices/plasma-temple": "0.41.0-canary.95.00e226910542916b91028c629ae18caa1e3d68dc.0",
"@sberdevices/plasma-tokens": "1.9.0",
"@sberdevices/plasma-ui": "1.30.2",
"@sberdevices/spatial-navigation": "1.0.3",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
"styled-components": "5.3.0",
"uuid": "8.3.2",
"web-vitals": "^1.1.2"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^11.2.7",
"@testing-library/user-event": "^12.8.3",
"@types/jest": "^26.0.24",
"@types/node": "^12.20.16",
"@types/react": "^17.0.14",
"@types/react-dom": "^17.0.9",
"@types/styled-components": "5.1.11",
"@types/uuid": "8.3.1",
"serve": "12.0.0",
"typescript": "^4.3.5"
}
},
"devDependencies": {
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^11.2.7",
"@testing-library/user-event": "^12.8.3",
"@types/jest": "^26.0.24",
"@types/node": "^12.20.16",
"@types/react": "^17.0.14",
"@types/react-dom": "^17.0.9",
"@types/styled-components": "5.1.11",
"@types/uuid": "8.3.1",
"serve": "12.0.0",
"typescript": "^4.3.5"
"scripts": {
"serve": "serve -s build",
"build-and-serve": "npm run build && npm run serve"
}
},
"scripts": {
"serve": "serve -s build",
"build-and-serve": "npm run build && npm run serve"
}
}

@@ -1,46 +0,36 @@

# Getting Started with Create React App
# Шаблон смартапа магазина для create-react-app
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Доступные скрипты
## Available Scripts
В каталоге проекта вы можете выполнить:
In the project directory, you can run:
### `npm start`
Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
Запускает приложение в девелопмент режиме.\
Открыть [http://localhost:3000](http://localhost:3000) для просмотра в браузере.
The page will reload if you make edits.\
You will also see any lint errors in the console.
### `npm test`
Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
Запуск тестов
### `npm run build`
Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
Сборка проекта в папку `build`.\
The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
### `npm run eject`
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
**Примечание: Это необратимая операция и может быть выполнена только раз.**
### `npm run eject`
Позволяет выполнять настройку и сборку проекта самостоятельно.
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
### `npm run serve`
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Поднимает простой http сервер, настроенный на папку build
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
### `npm run build-and-serve`
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
Собирает проект и поднимает http сервер
## Learn More
## Переменные окружения
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).
REACT_APP_SMARTAPP_TOKEN - токен, используется для тестирования и отладки с помощью [Assistant Client](https://developer.sberdevices.ru/docs/ru/developer_tools/sdk/overview)

@@ -11,3 +11,3 @@ import { AssistantAppStateItem, useAssistantAppState } from '@sberdevices/plasma-temple';

[key: string]: unknown;
}) => {
}): void => {
useAssistantAppState({

@@ -14,0 +14,0 @@ screen,

@@ -6,3 +6,3 @@ import { AssistantAppStateItem } from '@sberdevices/plasma-temple';

export const useCatalogAssistantState = (screen: string, state: PageState['catalog']) => {
export const useCatalogAssistantState = (screen: string, state: PageState['catalog']): void => {
let items: AssistantAppStateItem[] = [];

@@ -9,0 +9,0 @@

import { GalleryCardParams, GalleryData } from '@sberdevices/plasma-temple';
import { getCategories, getPopularProducts, getProducts } from '../../api/products';
import { CatalogData, CatalogGalleryType, Product } from '../../types';
import { CatalogData, CatalogGalleryType, Category, Product } from '../../types';
import { productToGalleryItem } from '../../utils/mappers';

@@ -20,3 +21,6 @@

export const initCatalogState = async () => {
export const initCatalogState = async (): Promise<{
activeGalleryIndex: number;
gallery: Required<GalleryData<Category>>[];
}> => {
const categories = await getCategories();

@@ -23,0 +27,0 @@ const popularProducts = await getPopularProducts();

@@ -120,2 +120,4 @@ import React from 'react';

type EmptyObject = Record<string, never>;
export type AssistantAction =

@@ -141,3 +143,3 @@ | { type: ActionType.OPEN_ITEM; payload: { id: string } & AnyObject }

| { type: ServerActionType.DONE_REMOVE_FROM_CART; payload: { quantity: number } }
| { type: ServerActionType.DONE_REMOVE_FROM_CART; payload: {} }
| { type: ServerActionType.DONE_REMOVE_FROM_CART; payload: EmptyObject }
| { type: ServerActionType.CHECK_PAYMENT_STATUS; payload: { invoiceId: string } }

@@ -147,3 +149,3 @@ | { type: ServerActionType.CART_QUANTITY_LIMIT; payload: { limit: number } }

| { type: ServerActionType.CHECK_PAYMENT_STATUS; payload: { invoiceId: string } }
| { type: ServerActionType.GET_ACCESS_TOKEN; payload: {} }
| { type: ServerActionType.GET_ACCESS_TOKEN; payload: EmptyObject }
| { type: ServerActionType.ERROR; payload: { error?: string } };

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc