@wix/auto-patterns 1.33.0 → 1.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/GETTING_STARTED.md +98 -0
- package/docs/OVERVIEW.md +54 -0
- package/docs/documentation.yaml +11 -0
- package/{dist/docs → mcp-docs}/auto-patterns-guide.md +0 -2
- package/package.json +13 -14
- /package/{dist/docs → mcp-docs}/action_cell.md +0 -0
- /package/{dist/docs → mcp-docs}/app_config_structure.md +0 -0
- /package/{dist/docs → mcp-docs}/app_context.md +0 -0
- /package/{dist/docs → mcp-docs}/bulk_actions.md +0 -0
- /package/{dist/docs → mcp-docs}/collection_page.md +0 -0
- /package/{dist/docs → mcp-docs}/collection_page_actions.md +0 -0
- /package/{dist/docs → mcp-docs}/custom_overrides.md +0 -0
- /package/{dist/docs → mcp-docs}/entity_page.md +0 -0
- /package/{dist/docs → mcp-docs}/entity_page_actions.md +0 -0
- /package/{dist/docs → mcp-docs}/entity_page_view_actions.md +0 -0
- /package/{dist/docs → mcp-docs}/error_handling.md +0 -0
- /package/{dist/docs → mcp-docs}/index.md +0 -0
- /package/{dist/docs → mcp-docs}/installation.md +0 -0
- /package/{dist/docs → mcp-docs}/introduction.md +0 -0
- /package/{dist/docs → mcp-docs}/pages_configuration.md +0 -0
- /package/{dist/docs → mcp-docs}/resolved_action.md +0 -0
- /package/{dist/docs → mcp-docs}/schema_config.md +0 -0
- /package/{dist/docs → mcp-docs}/sdk_utilities.md +0 -0
- /package/{dist/docs → mcp-docs}/wix_fqdn_custom_data_source.md +0 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Getting Started
|
|
2
|
+
*Build your first dashboard page on Patterns using Cursor.*
|
|
3
|
+
|
|
4
|
+
## Library Installations
|
|
5
|
+
Run the following command to install the library and its peer dependencies:
|
|
6
|
+
```bash
|
|
7
|
+
yarn add @wix/auto-patterns @wix/patterns @wix/design-system react-router-dom
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## MCP Installations
|
|
11
|
+
|
|
12
|
+
* [Install Business Schema MCP in Cursor](cursor://anysphere.cursor-deeplink/mcp/install?name=business-schema&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyJAd2l4L2J1c2luZXNzLXNjaGVtYS1tY3AiXX0%3D)
|
|
13
|
+
* [Install Auto Patterns MCP in Cursor](cursor://anysphere.cursor-deeplink/mcp/install?name=auto-patterns&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyJAd2l4L2F1dG8tcGF0dGVybnMtbWNwIl19)
|
|
14
|
+
|
|
15
|
+
## Working with Auto Patterns
|
|
16
|
+
A typical usage of Auto Patterns is to render a `AutoPatternsApp` component with a configuration object. You don't need to do it manually, but generate it through Cursor's chat.
|
|
17
|
+
You can write a prompt like this:
|
|
18
|
+
```
|
|
19
|
+
I want a dashboard page for sessions, use wix.bookings.v1.sessions fqdn for that.
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Then Cursor will retrieve the schema for the `wix.bookings.v1.sessions` FQDN and create an Auto Patterns configuration with custom data source.
|
|
23
|
+
|
|
24
|
+
Then, you can run your app and see the results.
|
|
25
|
+
According to the results, you can ask Cursor to improve the configuration.
|
|
26
|
+
For example, you can ask Cursor to add specific filters, actions, or custom columns.
|
|
27
|
+
|
|
28
|
+
## Handling Translations
|
|
29
|
+
You should provide translated values everywhere you configure or render text content, just like you do in the rest of your app.
|
|
30
|
+
|
|
31
|
+
Example to properties in the configuration that need a translated content:
|
|
32
|
+
- Page titles
|
|
33
|
+
- Column names
|
|
34
|
+
- Action labels
|
|
35
|
+
|
|
36
|
+
Code Example: (props that are not relevant to translation are omitted)
|
|
37
|
+
```ts
|
|
38
|
+
import { AppConfig, AutoPatternsApp } from '@wix/auto-patterns';
|
|
39
|
+
import { useTranslation } from 'react-i18next';
|
|
40
|
+
|
|
41
|
+
const MyPage = () => {
|
|
42
|
+
const { t } = useTranslation();
|
|
43
|
+
|
|
44
|
+
const config: AppConfig = {
|
|
45
|
+
pages: [
|
|
46
|
+
{
|
|
47
|
+
id: 'wixPets-collection',
|
|
48
|
+
type: 'collectionPage',
|
|
49
|
+
collectionPage: {
|
|
50
|
+
title: { text: t('pages.pets.title') },
|
|
51
|
+
actions: {
|
|
52
|
+
primaryActions: {
|
|
53
|
+
type: 'action',
|
|
54
|
+
action: {
|
|
55
|
+
item: {
|
|
56
|
+
id: 'createPet',
|
|
57
|
+
label: t('actions.create'),
|
|
58
|
+
type: 'create',
|
|
59
|
+
create: { mode: 'page', page: { id: 'wixPets-entity' } },
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
components: [
|
|
65
|
+
{
|
|
66
|
+
type: 'collection',
|
|
67
|
+
entityPageId: 'wixPets-entity',
|
|
68
|
+
layout: [
|
|
69
|
+
{
|
|
70
|
+
type: 'Table',
|
|
71
|
+
table: {
|
|
72
|
+
columns: [
|
|
73
|
+
{ id: 'name', name: t('columns.name') },
|
|
74
|
+
{ id: 'age', name: t('columns.age') },
|
|
75
|
+
{ id: 'owner', name: t('columns.owner') },
|
|
76
|
+
],
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
id: 'wixPets-entity',
|
|
86
|
+
type: 'entityPage',
|
|
87
|
+
entityPage: {
|
|
88
|
+
title: { text: t('pages.pets.detailsTitle') },
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
return <AutoPatternsApp configuration={config} />;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export default MyPage;
|
|
98
|
+
```
|
package/docs/OVERVIEW.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Auto Patterns Overview
|
|
2
|
+
|
|
3
|
+
## What is Auto Patterns?
|
|
4
|
+
|
|
5
|
+
Auto Patterns is our AI-oriented library that lets anyone (Devs, PMs, UX) create rich dashboards with ease using Cursor.
|
|
6
|
+
|
|
7
|
+
## Key Concepts
|
|
8
|
+
|
|
9
|
+
### Configuration-Driven Development
|
|
10
|
+
Instead of manually building collection pages, entity forms, and data management interfaces, Auto Patterns allows you to define everything through a TypeScript configuration object that conforms to the `AppConfig` interface. This approach:
|
|
11
|
+
|
|
12
|
+
- Reduces development time
|
|
13
|
+
- Makes experience intuitive and expected
|
|
14
|
+
- Minimizes bugs
|
|
15
|
+
- Simplifies maintenance
|
|
16
|
+
|
|
17
|
+
### Relationship with @wix/patterns
|
|
18
|
+
Auto Patterns serves as a **configuration layer** on top of `@wix/patterns` by:
|
|
19
|
+
|
|
20
|
+
- **Configuration-driven approach**: Instead of imperatively composing `@wix/patterns` components, you define behavior through TypeScript configuration objects
|
|
21
|
+
- **Pre-built component combinations**: Uses existing `@wix/patterns` components like `CollectionPage`, `Table`, `Grid`, and `EntityPage`, but configures them automatically based on your AppConfig
|
|
22
|
+
- **Simplified integration**: Handles the wiring between `@wix/patterns` components, hooks, and providers so you don't need to set them up manually
|
|
23
|
+
- **Declarative API**: Transforms complex component composition patterns into simple configuration properties
|
|
24
|
+
|
|
25
|
+
## When to Use Auto Patterns
|
|
26
|
+
|
|
27
|
+
### Perfect For:
|
|
28
|
+
- **Collection management pages** (lists, tables, grids)
|
|
29
|
+
- **Entity detail/edit pages** (forms, CRUD operations)
|
|
30
|
+
- **Teams standardizing** UI patterns across applications
|
|
31
|
+
|
|
32
|
+
## Core Components
|
|
33
|
+
|
|
34
|
+
### AutoPatternsApp
|
|
35
|
+
The main component that renders your entire application based on configuration:
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
import { AutoPatternsApp } from '@wix/auto-patterns';
|
|
39
|
+
import { config } from './myConfig.patterns';
|
|
40
|
+
|
|
41
|
+
const MyPage = () => (
|
|
42
|
+
<AutoPatternsApp configuration={config} />
|
|
43
|
+
);
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### AppConfig Structure
|
|
47
|
+
The heart of Auto Patterns - a TypeScript configuration that defines:
|
|
48
|
+
|
|
49
|
+
- **Pages**: Collection pages (lists/tables) and entity pages (forms)
|
|
50
|
+
- **Data sources**: FQDN-based Wix entities, Wix Data Collections (CMS) or custom data sources
|
|
51
|
+
- **Actions**: Create, edit, delete, and custom operations
|
|
52
|
+
- **Filters**: Search and filtering capabilities
|
|
53
|
+
- **Layouts**: Table, grid, and form layouts
|
|
54
|
+
- **Customizations**: Column overrides, custom components, and styling
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
apiDoc:
|
|
2
|
+
title: Auto Patterns
|
|
3
|
+
description: Auto Patterns documentation
|
|
4
|
+
category: fe-guild
|
|
5
|
+
markdownOnlyAutoUpdate: true
|
|
6
|
+
gitUrl: https://github.com/wix-private/auto-cairo/
|
|
7
|
+
docs:
|
|
8
|
+
- file: ./GETTING_STARTED.md
|
|
9
|
+
title: Getting Started
|
|
10
|
+
- file: ./OVERVIEW.md
|
|
11
|
+
title: Overview
|
|
@@ -4317,5 +4317,3 @@ Before deploying your custom data source, ensure:
|
|
|
4317
4317
|
✅ **External API calls are NOT wrapped** with errorHandler (e.g., fetch(), axios, third-party HTTP clients)
|
|
4318
4318
|
✅ **SDK actions are used directly** without error handling (e.g., `sdk.getOptimisticActions()`, `sdk.getSchema()`)
|
|
4319
4319
|
✅ **@wix/essentials** is installed as a dependency
|
|
4320
|
-
|
|
4321
|
-
---
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/auto-patterns",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.34.0",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Matvey Oklander",
|
|
@@ -18,13 +18,14 @@
|
|
|
18
18
|
"!dist/**/__tests__",
|
|
19
19
|
"types",
|
|
20
20
|
"react",
|
|
21
|
-
"form"
|
|
21
|
+
"form",
|
|
22
|
+
"docs",
|
|
23
|
+
"mcp-docs"
|
|
22
24
|
],
|
|
23
25
|
"scripts": {
|
|
26
|
+
"build": "npm run generate-guide && yoshi-library build",
|
|
27
|
+
"start": "npm run generate-guide && yoshi-library start",
|
|
24
28
|
"generate-guide": "node scripts/generate-guide.js",
|
|
25
|
-
"build": "yoshi-library build && npm run generate-guide",
|
|
26
|
-
"prestart": "npm run generate-guide",
|
|
27
|
-
"start": "yoshi-library start",
|
|
28
29
|
"test": "yoshi-library test",
|
|
29
30
|
"test:watch": "yoshi-library test --watch",
|
|
30
31
|
"lint": "yoshi-library lint",
|
|
@@ -35,9 +36,8 @@
|
|
|
35
36
|
},
|
|
36
37
|
"dependencies": {
|
|
37
38
|
"@babel/runtime": "^7.28.4",
|
|
38
|
-
"@wix/data": "^1.0.
|
|
39
|
+
"@wix/data": "^1.0.289",
|
|
39
40
|
"@wix/wix-ui-icons-common": "^3.87.3",
|
|
40
|
-
"ejs": "^3.1.10",
|
|
41
41
|
"lodash": "^4.17.21"
|
|
42
42
|
},
|
|
43
43
|
"publishConfig": {
|
|
@@ -46,22 +46,21 @@
|
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@testing-library/react": "^11.2.7",
|
|
49
|
-
"@types/ejs": "^3.1.5",
|
|
50
49
|
"@types/jest": "^27.5.2",
|
|
51
50
|
"@types/lodash": "^4.17.20",
|
|
52
51
|
"@types/node": "^16.18.126",
|
|
53
52
|
"@types/node-fetch": "^2.6.13",
|
|
54
53
|
"@types/react": "^16.14.66",
|
|
55
|
-
"@wix/crm": "^1.0.
|
|
54
|
+
"@wix/crm": "^1.0.1021",
|
|
56
55
|
"@wix/design-system": "^1.214.3",
|
|
57
56
|
"@wix/eslint-config-yoshi": "^6.158.0",
|
|
58
57
|
"@wix/fe-essentials-standalone": "^1.1380.0",
|
|
59
58
|
"@wix/jest-yoshi-preset": "^6.158.0",
|
|
60
|
-
"@wix/patterns": "^1.
|
|
61
|
-
"@wix/sdk": "^1.
|
|
59
|
+
"@wix/patterns": "^1.277.0",
|
|
60
|
+
"@wix/sdk": "^1.16.0",
|
|
62
61
|
"@wix/sdk-testkit": ">=0.1.7",
|
|
63
|
-
"@wix/wix-data-items-common": "^1.0.
|
|
64
|
-
"@wix/wix-data-items-sdk": "^1.0.
|
|
62
|
+
"@wix/wix-data-items-common": "^1.0.235",
|
|
63
|
+
"@wix/wix-data-items-sdk": "^1.0.428",
|
|
65
64
|
"@wix/yoshi-flow-library": "^6.158.0",
|
|
66
65
|
"@wix/yoshi-style-dependencies": "^6.158.0",
|
|
67
66
|
"chance": "^1.1.13",
|
|
@@ -126,5 +125,5 @@
|
|
|
126
125
|
"wallaby": {
|
|
127
126
|
"autoDetect": true
|
|
128
127
|
},
|
|
129
|
-
"falconPackageHash": "
|
|
128
|
+
"falconPackageHash": "3b95f950e8cf046662d2a6326593abe425912fede0ff9c0711897c1f"
|
|
130
129
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|