@powerhousedao/academy 2.5.0-dev.30 → 2.5.0-dev.32
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/CHANGELOG.md +21 -0
- package/docs/academy/01-GetStarted/01-CreateNewPowerhouseProject.md +1 -1
- package/docs/academy/02-MasteryTrack/01-BuilderEnvironment/01-Prerequisites.md +0 -18
- package/docs/academy/02-MasteryTrack/01-BuilderEnvironment/02-StandardDocumentModelWorkflow.md +3 -3
- package/docs/academy/03-ExampleUsecases/Chatroom/02-CreateNewPowerhouseProject.md +10 -9
- package/docs/academy/03-ExampleUsecases/Chatroom/03-DefineChatroomDocumentModel.md +3 -4
- package/docs/academy/03-ExampleUsecases/Chatroom/05-ImplementChatroomEditor.md +1 -1
- package/docs/academy/03-ExampleUsecases/Chatroom/_category_.json +1 -1
- package/docs/academy/04-APIReferences/00-PowerhouseCLI.md +9 -12
- package/docs/academy/06-ComponentLibrary/00-DocumentEngineering.md +1 -3
- package/docs/academy/06-ComponentLibrary/02-CreateCustomScalars.md +13 -35
- package/docs/academy/07-Cookbook.md +43 -0
- package/docusaurus.config.ts +4 -0
- package/package.json +1 -1
- package/src/css/custom.css +23 -1
- package/docs/academy/03-ExampleUsecases/Chatroom/01-SetupBuilderEnvironment.md +0 -216
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
## 2.5.0-dev.32 (2025-06-18)
|
|
2
|
+
|
|
3
|
+
This was a version bump only for @powerhousedao/academy to align it with other projects, there were no code changes.
|
|
4
|
+
|
|
5
|
+
## 2.5.0-dev.31 (2025-06-18)
|
|
6
|
+
|
|
7
|
+
### 🚀 Features
|
|
8
|
+
|
|
9
|
+
- **connect,builder-tools,ph-cli:** added support for path argument on ph connect build and preview ([fe049aae8](https://github.com/powerhouse-inc/powerhouse/commit/fe049aae8))
|
|
10
|
+
- **reactor:** initial event-bus implementation with tests and benchmarks ([ef5b3c42e](https://github.com/powerhouse-inc/powerhouse/commit/ef5b3c42e))
|
|
11
|
+
|
|
12
|
+
### 🩹 Fixes
|
|
13
|
+
|
|
14
|
+
- **ph-cli:** install and uninstall packages with and without version tag ([c2a4ad13f](https://github.com/powerhouse-inc/powerhouse/commit/c2a4ad13f))
|
|
15
|
+
|
|
16
|
+
### ❤️ Thank You
|
|
17
|
+
|
|
18
|
+
- acaldas
|
|
19
|
+
- Benjamin Jordan (@thegoldenmule)
|
|
20
|
+
- Frank
|
|
21
|
+
|
|
1
22
|
## 2.5.0-dev.30 (2025-06-17)
|
|
2
23
|
|
|
3
24
|
### 🩹 Fixes
|
|
@@ -11,7 +11,7 @@ For this purpose, you'll be using Connect, our use-centric collaboration tool, l
|
|
|
11
11
|
- Visual Studio Code (or your preferred IDE)
|
|
12
12
|
- Terminal/Command Prompt access
|
|
13
13
|
|
|
14
|
-
If you need help with installing the prerequisites you can visit our page prerequisites
|
|
14
|
+
If you need help with installing the prerequisites you can visit our page [prerequisites](/academy/MasteryTrack/BuilderEnvironment/Prerequisites)
|
|
15
15
|
|
|
16
16
|
## Quick Start
|
|
17
17
|
Create a new Powerhouse project with a single command:
|
|
@@ -7,24 +7,6 @@ If you've already set up **Git, Node, and pnpm**, your most important step is to
|
|
|
7
7
|
:::
|
|
8
8
|
___
|
|
9
9
|
|
|
10
|
-
## Table of Contents
|
|
11
|
-
- [Prerequisites](#prerequisites)
|
|
12
|
-
- [Installing node.js 22](#installing-nodejs)
|
|
13
|
-
- [For Windows](#for-windows)
|
|
14
|
-
- [For macOS](#for-macos)
|
|
15
|
-
- [For Linux (Ubuntu/Debian)](#for-linux-ubuntudebian)
|
|
16
|
-
- [Installing Visual Studio Code](#installing-visual-studio-code)
|
|
17
|
-
- [For Windows](#for-windows-1)
|
|
18
|
-
- [For macOS](#for-macos-1)
|
|
19
|
-
- [For Linux (Ubuntu/Debian)](#for-linux-ubuntudebian-1)
|
|
20
|
-
- [Install Git](#install-git)
|
|
21
|
-
- [For Windows](#for-windows-2)
|
|
22
|
-
- [For macOS](#for-macos-2)
|
|
23
|
-
- [For Linux (Ubuntu/Debian)](#for-linux-ubuntudebian-2)
|
|
24
|
-
- [Configure Git](#configure-git-all-systems)
|
|
25
|
-
- [Install Powerhouse CLI](#install-powerhouse-cli)
|
|
26
|
-
- [Verify Installation](#verify-installation)
|
|
27
|
-
|
|
28
10
|
## Overview
|
|
29
11
|
|
|
30
12
|
Before we begin building our Document Model, we need to install some software on your machine. We'll need three main tools:
|
package/docs/academy/02-MasteryTrack/01-BuilderEnvironment/02-StandardDocumentModelWorkflow.md
CHANGED
|
@@ -29,8 +29,8 @@ Ensure you have the Powerhouse Command Line Interface (`ph-cmd`) installed. This
|
|
|
29
29
|
```bash
|
|
30
30
|
pnpm install -g ph-cmd
|
|
31
31
|
```
|
|
32
|
-
:::info
|
|
33
|
-
|
|
32
|
+
:::info **Prerequisites**
|
|
33
|
+
The [Prerequisites](/academy/MasteryTrack/BuilderEnvironment/Prerequisites) guide for detailed installation instructions for Node.js, pnpm, and Git if you haven't set them up yet.
|
|
34
34
|
:::
|
|
35
35
|
|
|
36
36
|
### 1.2. Initialize Your Project Environment
|
|
@@ -129,7 +129,7 @@ ph generate --editor YourModelName --document-types powerhouse/YourModelName
|
|
|
129
129
|
This creates a template file, typically at `editors/your-model-name/editor.tsx`.
|
|
130
130
|
- Customize this React component to build your UI.
|
|
131
131
|
- You can use standard HTML, Tailwind CSS (available in Connect), or import custom CSS.
|
|
132
|
-
- Utilize components from `@powerhousedao/document-engineering` for consistency and rapid development.
|
|
132
|
+
- Utilize components from `@powerhousedao/document-engineering` for consistency and rapid development. Learn more at [Document-Engineering](/academy/ComponentLibrary/DocumentEngineering)
|
|
133
133
|
|
|
134
134
|
|
|
135
135
|
### 3.5. Test the Editor
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
# Create New Powerhouse Project
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
:::tip **Prerequisites**
|
|
4
|
+
- Powerhouse CLI installed: `pnpm install -g ph-cmd`
|
|
5
|
+
- node.js 22 and pnpm installed
|
|
6
|
+
- Visual Studio Code (or your preferred IDE)
|
|
7
|
+
- Terminal/Command Prompt access
|
|
8
|
+
|
|
9
|
+
If you need help with installing the prerequisites you can visit our page [prerequisites](/academy/MasteryTrack/BuilderEnvironment/Prerequisites)
|
|
10
|
+
:::
|
|
4
11
|
|
|
5
12
|
To create a new Powerhouse Document Model Library project, you can use the `ph init` command in your terminal. This command will create a new project in the current directory.
|
|
13
|
+
This command will create a new project in the current directory. You can run the command in the terminal window of your OS or you open the newly installed VSCode and run the command in the terminal window of VSCode.Make sure the terminal reflects the directory where you want to create the new project.
|
|
6
14
|
|
|
7
|
-
:::info
|
|
8
|
-
This command will create a new project in the current directory.
|
|
9
|
-
You can run the command in the terminal window of your OS or you open the newly installed VSCode and run the command in the terminal window of VSCode.
|
|
10
|
-
You will need VSCode later in the tutorial once you have generated the document model.
|
|
11
|
-
Make sure the terminal reflects the directory where you want to create the new project.
|
|
12
|
-
To open a directory in a terminal, you use the cd command to change your current directory. The cd command takes an argument, usually the name of the folder you want to move to, so the full command is
|
|
13
15
|
```bash
|
|
14
16
|
cd your-directory
|
|
15
17
|
```
|
|
16
18
|
This essentially opens that folder and places you in it.
|
|
17
|
-
:::
|
|
18
19
|
|
|
19
20
|
Once you've navigated to the directory where you want to create the new project and in your terminal, run the following command:
|
|
20
21
|
|
|
@@ -22,7 +23,7 @@ Once you've navigated to the directory where you want to create the new project
|
|
|
22
23
|
ph init
|
|
23
24
|
```
|
|
24
25
|
|
|
25
|
-
In the terminal, you will be asked to enter the project name. Fill in the project name and press enter. Make sure to
|
|
26
|
+
In the terminal, you will be asked to enter the project name. Fill in the project name and press enter. Make sure to pay attention to the capitalization of our name `ChatRoom` as it will influence your code generation.
|
|
26
27
|
|
|
27
28
|
```bash
|
|
28
29
|
you@yourmachine:~/Powerhouse$ ph init
|
|
@@ -9,9 +9,8 @@ Before you start, make sure you have the Connect application running.
|
|
|
9
9
|
|
|
10
10
|
We use GraphQL Schema Definition Language (SDL) to define the document model schema. Below, you can see the SDL for the `ChatRoom` document model.
|
|
11
11
|
|
|
12
|
-
:::info
|
|
13
|
-
This schema contains the data structure of the document model and the basic operations that can be performed on the document model.
|
|
14
|
-
Document models in Powerhouse leverage event sourcing principles, where every state transition is represented by an operation. GraphQL input types describe operations, ensuring that user intents are captured effectively. These operations detail the parameters needed for state transitions The use of GraphQL aligns these transitions with explicit, validated, and reproducible commands, supporting CQRS (Command Query Responsibility Segregation) patterns.
|
|
12
|
+
:::info **The State Schema**
|
|
13
|
+
This schema contains the data structure of the document model and the basic operations that can be performed on the document model. For more in depth information please visit [State Schema](/academy/MasteryTrack/DocumentModelCreation/SpecifyTheStateSchema)
|
|
15
14
|
:::
|
|
16
15
|
|
|
17
16
|
## State Schema (See next steps)
|
|
@@ -101,7 +100,7 @@ The steps below show you how to do this:
|
|
|
101
100
|
1. In the Connect application, click on the `ChatRoom` document model you've created in the previous step, to open the document model editor.
|
|
102
101
|
2. You'll be welcomed with a form to fill, this is metadata about the document model, fill in the details in the fields.
|
|
103
102
|
|
|
104
|
-
In the `Document Type` field, type `powerhouse/
|
|
103
|
+
In the `Document Type` field, type `powerhouse/chat-room`. This defines the new type of document that will be created with this document model.
|
|
105
104
|
|
|
106
105
|

|
|
107
106
|
|
|
@@ -191,4 +191,4 @@ Below GIF shows the `Chatroom` editor in action.
|
|
|
191
191
|
|
|
192
192
|

|
|
193
193
|
|
|
194
|
-
If you managed to follow this tutorial until this point, you have successfully implemented the `ChatRoom` document model with its reducer operations and editor.
|
|
194
|
+
If you managed to follow this tutorial until this point, you have successfully implemented the `ChatRoom` document model with its reducer operations and editor.
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
"position": 2,
|
|
4
4
|
"link": {
|
|
5
5
|
"type": "generated-index",
|
|
6
|
-
"description": "Get started with the Chatroom
|
|
6
|
+
"description": "Get started with the Chatroom tutoria: Jump into creating a new Powerhouse project if you have NodeJs, VSCode, and Git installed. Whe are going to create a new document model that represents a chat. So you as a user can post messages into that chat room, react to the messages. This chatroom will be synchronized between different connect instances. Let's explore the potential of the tools available in the powerhouse toolkit"
|
|
7
7
|
}
|
|
8
8
|
}
|
|
@@ -14,10 +14,7 @@ pnpm install -g ph-cmd
|
|
|
14
14
|
```
|
|
15
15
|
:::
|
|
16
16
|
|
|
17
|
-
<!-- AUTO-GENERATED-CLI-COMMANDS-START
|
|
18
|
-
|
|
19
|
-
## ph-cmd Commands
|
|
20
|
-
- [Init](#init)
|
|
17
|
+
<!-- AUTO-GENERATED-CLI-COMMANDS-START -->\n<!-- This content is automatically generated. Do not edit directly. -->\n### ph-cmd Commands\n\n- [Init](#init)
|
|
21
18
|
- [Setup Globals](#setup-globals)
|
|
22
19
|
- [Update](#update)
|
|
23
20
|
- [Use](#use)
|
|
@@ -210,7 +207,7 @@ Examples:
|
|
|
210
207
|
|
|
211
208
|
---
|
|
212
209
|
|
|
213
|
-
- [Connect Build](#connect-build)
|
|
210
|
+
*This document was automatically generated from the help text in the codebase.*\n\n### ph-cli Commands\n\n- [Connect Build](#connect-build)
|
|
214
211
|
- [Connect Preview](#connect-preview)
|
|
215
212
|
- [Connect Studio](#connect-studio)
|
|
216
213
|
- [Dev](#dev)
|
|
@@ -231,6 +228,7 @@ Command Overview:
|
|
|
231
228
|
The Connect build command creates a connect build with the project's local and external packages included.
|
|
232
229
|
|
|
233
230
|
Options:
|
|
231
|
+
--base <path> The base path for the app. Default is "/".
|
|
234
232
|
--project-root <path> The root directory of the project. Default is "process.cwd()".
|
|
235
233
|
--assets-dir-name <name> The name of the assets directory. Default is "${DEFAULT_ASSETS_DIR_NAME}".
|
|
236
234
|
--external-packages-file-name <name> The name of the external packages file. Default is "${DEFAULT_EXTERNAL_PACKAGES_FILE_NAME}".
|
|
@@ -246,6 +244,7 @@ Command Overview:
|
|
|
246
244
|
NOTE: You must run \`ph connect build\` first.
|
|
247
245
|
|
|
248
246
|
Options:
|
|
247
|
+
--base <path> The base path for the app. Default is "/".
|
|
249
248
|
--project-root <path> The root directory of the project. Default is "process.cwd()".
|
|
250
249
|
--port <port> The port to run the server on. Default is 4173.
|
|
251
250
|
--open Open the browser. Default is true.
|
|
@@ -573,13 +572,11 @@ Arguments:
|
|
|
573
572
|
- all: Act on all services (default)
|
|
574
573
|
|
|
575
574
|
Examples:
|
|
576
|
-
$ ph service
|
|
577
|
-
$ ph service start
|
|
578
|
-
$ ph service stop
|
|
579
|
-
$ ph service start all # Start all services
|
|
575
|
+
$ ph service setup # Setup services
|
|
576
|
+
$ ph service start # Start the services
|
|
577
|
+
$ ph service stop # Stop the services
|
|
580
578
|
$ ph service status # Check status of all services
|
|
581
|
-
|
|
582
|
-
$ ph service unstartup # Remove services from system startup
|
|
579
|
+
|
|
583
580
|
|
|
584
581
|
Notes:
|
|
585
582
|
- Services are managed using PM2, a process manager for Node.js applications
|
|
@@ -704,4 +701,4 @@ Notes:
|
|
|
704
701
|
|
|
705
702
|
---
|
|
706
703
|
|
|
707
|
-
*This document was automatically generated from the help text in the codebase
|
|
704
|
+
*This document was automatically generated from the help text in the codebase.*\n<!-- AUTO-GENERATED-CLI-COMMANDS-END -->
|
|
@@ -56,9 +56,7 @@ While Storybook aims for accuracy, there might occasionally be discrepancies or
|
|
|
56
56
|
|
|
57
57
|
## Implementing a Component
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
Let's walk through the typical workflow for using a component from the document-engineering system, using the `Checkbox` from the [To-do List editor](/academy/GetStarted/BuildToDoListEditor).
|
|
59
|
+
Let's walk through the typical workflow for using a component from the document-engineering system, using the `Checkbox` from the [To-do List editor](/academy/MasteryTrack/BuildingUserExperiences/BuildingDocumentEditors).
|
|
62
60
|
|
|
63
61
|
1. **Identify the Need:** While building your feature (e.g., the To-do List editor in `editor.tsx`), you determine the need for a standard UI element, like a checkbox.
|
|
64
62
|
2. **Consult the Document Engineering Components in Storybook:**
|
|
@@ -3,33 +3,11 @@
|
|
|
3
3
|
This tutorial provides step-by-step instructions for creating custom scalars & components, and to contributing to the document-engineering project.
|
|
4
4
|
The github repo for the Document-Engineering can be found [here](https://github.com/powerhouse-inc/document-engineering/tree/main)
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
- [Creating New GraphQL Scalars](#creating-new-graphql-scalars)
|
|
9
|
-
- [Step 1: Create the Scalar File](#step-1-create-the-scalar-file)
|
|
10
|
-
- [Key Components to Update](#key-components-to-update)
|
|
11
|
-
- [Step 2: Register the Scalar in scalars.ts](#step-2-register-the-scalar-in-scalarts)
|
|
12
|
-
- [2.1 Add Namespace Import](#21-add-namespace-import)
|
|
13
|
-
- [2.2 Add Type Export](#22-add-type-export)
|
|
14
|
-
- [2.3 Add to Export Object](#23-add-to-export-object)
|
|
15
|
-
- [2.4 Add to Custom Scalars](#24-add-to-custom-scalars)
|
|
16
|
-
- [2.5 Add to Resolvers](#25-add-to-resolvers)
|
|
17
|
-
- [2.6 Add to Type Definitions](#26-add-to-type-definitions)
|
|
18
|
-
- [2.7 Add to Generator Type Definitions](#27-add-to-generator-type-definitions)
|
|
19
|
-
- [2.8 Add to Validation Schema](#28-add-to-validation-schema)
|
|
20
|
-
- [Step 3: Create Tests for Your Scalar](#step-3-create-tests-for-your-scalar)
|
|
21
|
-
- [Required Test Cases](#required-test-cases)
|
|
22
|
-
- [Testing Best Practices](#testing-best-practices)
|
|
23
|
-
- [Example Edge Cases for Different Scalar Types](#example-edge-cases-for-different-scalar-types)
|
|
24
|
-
- [Step 4: Validate Your Implementation](#step-4-validate-your-implementation)
|
|
25
|
-
- [Common Scalar Types](#common-scalar-types)
|
|
26
|
-
- [Tips](#tips)
|
|
27
|
-
|
|
28
|
-
## Creating New GraphQL Scalars
|
|
6
|
+
### Creating New GraphQL Scalars
|
|
29
7
|
|
|
30
8
|
GraphQL scalars are custom data types that define how data is validated, serialized, and parsed. This guide will walk you through creating a new scalar in the `src/scalars/graphql/` directory.
|
|
31
9
|
|
|
32
|
-
|
|
10
|
+
## Step 1: Create the Scalar File
|
|
33
11
|
|
|
34
12
|
Create a new TypeScript file in `src/scalars/graphql/` for your scalar. Use `EmailAddress.ts` as a reference.
|
|
35
13
|
|
|
@@ -80,7 +58,7 @@ export const config: GraphQLScalarTypeConfig<string, string> = {
|
|
|
80
58
|
export const scalar = new GraphQLScalarType(config)
|
|
81
59
|
```
|
|
82
60
|
|
|
83
|
-
|
|
61
|
+
### Key Components to Update:
|
|
84
62
|
|
|
85
63
|
1. **`type`**: The TypeScript type (usually `'string'` for text-based scalars)
|
|
86
64
|
2. **`typedef`**: The GraphQL type definition (e.g., `'scalar PhoneNumber'`)
|
|
@@ -90,12 +68,12 @@ export const scalar = new GraphQLScalarType(config)
|
|
|
90
68
|
6. **`config.name`**: The name of your scalar (must match the typedef)
|
|
91
69
|
7. **`config.description`**: Human-readable description of the scalar
|
|
92
70
|
|
|
93
|
-
|
|
71
|
+
## Step 2: Register the Scalar in `scalars.ts`
|
|
94
72
|
|
|
95
73
|
After creating your scalar file, you need to register it in `src/scalars/graphql/scalars.ts`. This involves updating multiple sections of the file.
|
|
96
74
|
The github repo for the Document-Engineering can be found [here](https://github.com/powerhouse-inc/document-engineering/tree/main)
|
|
97
75
|
|
|
98
|
-
|
|
76
|
+
### 2.1 Add Namespace Import
|
|
99
77
|
|
|
100
78
|
Add your scalar to the namespace imports section (around line 2):
|
|
101
79
|
|
|
@@ -108,7 +86,7 @@ import * as PhoneNumber from './PhoneNumber.js' // ADD THIS LINE
|
|
|
108
86
|
import * as URLScalar from './URL.js'
|
|
109
87
|
```
|
|
110
88
|
|
|
111
|
-
|
|
89
|
+
### 2.2 Add Type Export
|
|
112
90
|
|
|
113
91
|
Add the type export (around line 22):
|
|
114
92
|
|
|
@@ -120,7 +98,7 @@ export type { ScalarType as PhoneNumberScalarType } from './PhoneNumber.js' // A
|
|
|
120
98
|
export type { ScalarType as URLScalarType } from './URL.js'
|
|
121
99
|
```
|
|
122
100
|
|
|
123
|
-
|
|
101
|
+
### 2.3 Add to Export Object
|
|
124
102
|
|
|
125
103
|
Add your scalar to the main export object (around line 40):
|
|
126
104
|
|
|
@@ -134,7 +112,7 @@ export {
|
|
|
134
112
|
}
|
|
135
113
|
```
|
|
136
114
|
|
|
137
|
-
|
|
115
|
+
### 2.4 Add to Custom Scalars
|
|
138
116
|
|
|
139
117
|
Add your scalar to the `customScalars` object (around line 54):
|
|
140
118
|
|
|
@@ -160,7 +138,7 @@ export const resolvers = {
|
|
|
160
138
|
}
|
|
161
139
|
```
|
|
162
140
|
|
|
163
|
-
|
|
141
|
+
### 2.6 Add to Type Definitions
|
|
164
142
|
|
|
165
143
|
Add your typedef to the `typeDefs` array (around line 90):
|
|
166
144
|
|
|
@@ -174,7 +152,7 @@ export const typeDefs = [
|
|
|
174
152
|
]
|
|
175
153
|
```
|
|
176
154
|
|
|
177
|
-
|
|
155
|
+
### 2.7 Add to Generator Type Definitions
|
|
178
156
|
|
|
179
157
|
Add your scalar to the `generatorTypeDefs` object (around line 105):
|
|
180
158
|
|
|
@@ -188,7 +166,7 @@ export const generatorTypeDefs = {
|
|
|
188
166
|
}
|
|
189
167
|
```
|
|
190
168
|
|
|
191
|
-
|
|
169
|
+
### 2.8 Add to Validation Schema
|
|
192
170
|
|
|
193
171
|
Add your scalar to the `validationSchema` object (around line 120):
|
|
194
172
|
|
|
@@ -202,7 +180,7 @@ export const validationSchema = {
|
|
|
202
180
|
}
|
|
203
181
|
```
|
|
204
182
|
|
|
205
|
-
|
|
183
|
+
## Step 3: Create Tests for Your Scalar
|
|
206
184
|
|
|
207
185
|
Every scalar must have comprehensive tests to ensure it works correctly. Create a test file in `src/scalars/graphql/test/` following the naming convention `YourScalar.test.ts`.
|
|
208
186
|
|
|
@@ -352,7 +330,7 @@ expect(scalar.parseValue('2023-12-25T00:00:00Z')).toBe('2023-12-25T00:00:00Z')
|
|
|
352
330
|
expect(() => scalar.parseValue('25/12/2023')).toThrow()
|
|
353
331
|
```
|
|
354
332
|
|
|
355
|
-
|
|
333
|
+
## Step 4: Validate Your Implementation
|
|
356
334
|
|
|
357
335
|
After implementing your scalar and tests, make sure to:
|
|
358
336
|
|
|
@@ -1132,6 +1132,49 @@ Understanding the different GraphQL endpoints in Powerhouse is crucial for effec
|
|
|
1132
1132
|
|
|
1133
1133
|
</details>
|
|
1134
1134
|
|
|
1135
|
+
<details id="resetting-your-localhost-environment">
|
|
1136
|
+
<summary>Resetting Your Localhost Environment</summary>
|
|
1137
|
+
|
|
1138
|
+
## How to Reset Your Localhost Environment
|
|
1139
|
+
---
|
|
1140
|
+
|
|
1141
|
+
## Problem Statement
|
|
1142
|
+
You are running Powerhouse Connect locally (via `ph connect`), but you can't find your local drive in the interface. Alternatively, you can see the drive or have recreated it, but the `DocumentModel` button is missing, preventing you from creating new document model schemas.
|
|
1143
|
+
|
|
1144
|
+
## Prerequisites
|
|
1145
|
+
- Powerhouse Connect is running locally.
|
|
1146
|
+
- The Powerhouse Connect interface is open in your browser.
|
|
1147
|
+
|
|
1148
|
+
## Solution
|
|
1149
|
+
This issue is often caused by corrupted or inconsistent data stored in your browser's local storage for the Connect application. Clearing this storage forces a re-initialization of your local environment.
|
|
1150
|
+
|
|
1151
|
+
### Step 1: Open Settings
|
|
1152
|
+
In the bottom-left corner of the Powerhouse Connect UI, click on the "Settings" menu.
|
|
1153
|
+
|
|
1154
|
+
### Step 2: Find the Danger Zone
|
|
1155
|
+
In the settings panel that appears, scroll or navigate to the "Danger Zone" section.
|
|
1156
|
+
|
|
1157
|
+
### Step 3: Clear Local Storage
|
|
1158
|
+
Click the "Clear storage" button. A confirmation prompt may appear. Confirming this action will wipe all application data stored in your browser for your local environment, including the state of your local drive.
|
|
1159
|
+
|
|
1160
|
+
### Step 4: Verify the Reset
|
|
1161
|
+
The application should automatically refresh and re-initialize its state. If it doesn't, manually reload the page. Your local drive should now be present with the `DocumentModel` button restored.
|
|
1162
|
+
|
|
1163
|
+
## Expected Outcome
|
|
1164
|
+
- Your local drive is visible again in the Powerhouse Connect UI.
|
|
1165
|
+
- The `DocumentModel` button is available inside the local drive.
|
|
1166
|
+
- You can proceed to create and edit document models in your local environment.
|
|
1167
|
+
|
|
1168
|
+
## Common Issues and Solutions
|
|
1169
|
+
- **Issue**: The problem persists after clearing storage.
|
|
1170
|
+
- **Solution**: Try clearing your browser's cache and cookies for the localhost domain. As a last resort, follow the recipe for [Clearing Package Manager Caches](#clearing-package-manager-caches) and reinstalling dependencies.
|
|
1171
|
+
|
|
1172
|
+
## Related Recipes
|
|
1173
|
+
- [Troubleshooting Document Syncing](#troubleshooting-document-syncing)
|
|
1174
|
+
- [Initializing a New Project & Document Model](#initializing-a-new-project-and-document-model)
|
|
1175
|
+
|
|
1176
|
+
</details>
|
|
1177
|
+
|
|
1135
1178
|
<details id="clearing-package-manager-caches">
|
|
1136
1179
|
<summary>Clearing Package Manager Caches</summary>
|
|
1137
1180
|
|
package/docusaurus.config.ts
CHANGED
package/package.json
CHANGED
package/src/css/custom.css
CHANGED
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
--ifm-color-primary-lightest: #1A1A1B;
|
|
16
16
|
--ifm-code-font-size: 95%;
|
|
17
17
|
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);
|
|
18
|
+
--toc-color: #555; /* Muted black for inactive items */
|
|
19
|
+
--toc-color-active: #1A1A1B; /* Black for active items */
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
/* For readability concerns, you should choose a lighter palette in dark mode. */
|
|
@@ -27,6 +29,8 @@
|
|
|
27
29
|
--ifm-color-primary-lighter: #ffffff;
|
|
28
30
|
--ifm-color-primary-lightest: #ffffff;
|
|
29
31
|
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
|
|
32
|
+
--toc-color: #ccc; /* Light grey for inactive items */
|
|
33
|
+
--toc-color-active: #ffffff; /* White for active items */
|
|
30
34
|
}
|
|
31
35
|
|
|
32
36
|
@font-face {
|
|
@@ -155,7 +159,6 @@ a {
|
|
|
155
159
|
|
|
156
160
|
/* Reset styling for navigation elements, category pages, and utility links */
|
|
157
161
|
.breadcrumbs a,
|
|
158
|
-
.table-of-contents a,
|
|
159
162
|
.pagination-nav a,
|
|
160
163
|
.navbar a,
|
|
161
164
|
.theme-doc-sidebar-container a,
|
|
@@ -464,3 +467,22 @@ html[data-theme='dark'] .DocSearch-Hits > *:empty {
|
|
|
464
467
|
.doc-card-list .card h2 svg {
|
|
465
468
|
display: none !important;
|
|
466
469
|
}
|
|
470
|
+
|
|
471
|
+
/* Table of Contents Styling */
|
|
472
|
+
.theme-doc-toc-desktop .table-of-contents__link {
|
|
473
|
+
color: var(--toc-color);
|
|
474
|
+
text-decoration: none;
|
|
475
|
+
font-weight: 400;
|
|
476
|
+
transition: color 0.2s ease;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
.theme-doc-toc-desktop .table-of-contents__link:hover {
|
|
480
|
+
color: var(--toc-color-active);
|
|
481
|
+
text-decoration: none;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
.theme-doc-toc-desktop .table-of-contents__link--active {
|
|
485
|
+
color: var(--toc-color-active);
|
|
486
|
+
font-weight: bold;
|
|
487
|
+
text-decoration: none;
|
|
488
|
+
}
|
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
# Setup Builder Environment
|
|
3
|
-
|
|
4
|
-
Let's set up your computer to start building your first Document Model. Don't worry if this is your first time setting up a development environment - we'll guide you through each step!
|
|
5
|
-
|
|
6
|
-
:::warning
|
|
7
|
-
If you've already setup git, node, and npm, your most important step is to install the Powerhouse CLI with the command `npm install ph-cmd`. A global install is recommended if you want to use the command from any directory as a power user. The Powerhouse CLI is used to create, build, and run your Document Models and give you direct access to a series of Powerhouse ecosystem tools.
|
|
8
|
-
:::
|
|
9
|
-
|
|
10
|
-
## Table of Contents
|
|
11
|
-
- [Prerequisites](#prerequisites)
|
|
12
|
-
- [Installing node.js 22](#installing-nodejs)
|
|
13
|
-
- [For Windows](#for-windows)
|
|
14
|
-
- [For macOS](#for-macos)
|
|
15
|
-
- [For Linux (Ubuntu/Debian)](#for-linux-ubuntudebian)
|
|
16
|
-
- [Installing Visual Studio Code](#installing-visual-studio-code)
|
|
17
|
-
- [For Windows](#for-windows-1)
|
|
18
|
-
- [For macOS](#for-macos-1)
|
|
19
|
-
- [For Linux (Ubuntu/Debian)](#for-linux-ubuntudebian-1)
|
|
20
|
-
- [Install Git](#install-git)
|
|
21
|
-
- [For Windows](#for-windows-2)
|
|
22
|
-
- [For macOS](#for-macos-2)
|
|
23
|
-
- [For Linux (Ubuntu/Debian)](#for-linux-ubuntudebian-2)
|
|
24
|
-
- [Configure Git](#configure-git-all-systems)
|
|
25
|
-
- [Verify Installation](#verify-installation)
|
|
26
|
-
|
|
27
|
-
## Prerequisites
|
|
28
|
-
|
|
29
|
-
Before we begin building our Document Model, we need to install some software on your computer. We'll need three main tools: node.js 22, which helps us run our code, Visual Studio Code (VS Code), which is where we'll write our code, and Git, which helps us manage our code. Follow the steps below based on your computer's operating system.
|
|
30
|
-
|
|
31
|
-
### Installing node.js 22
|
|
32
|
-
|
|
33
|
-
node.js 22 is a tool that lets us run our application. Let's install it step by step.
|
|
34
|
-
|
|
35
|
-
#### For Windows:
|
|
36
|
-
1. **Set up PowerShell for running commands:**
|
|
37
|
-
- Press the Windows key
|
|
38
|
-
- Type "PowerShell"
|
|
39
|
-
- Right-click on "Windows PowerShell" and select "Run as administrator"
|
|
40
|
-
- In the PowerShell window, type this command and press Enter:
|
|
41
|
-
```powershell
|
|
42
|
-
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
|
|
43
|
-
```
|
|
44
|
-
- Type 'A' when prompted to confirm
|
|
45
|
-
- You can now close this window and open PowerShell normally for the remaining steps
|
|
46
|
-
|
|
47
|
-
2. **Install node.js 22:**
|
|
48
|
-
- Visit the [node.js 22 official website](https://nodejs.org/)
|
|
49
|
-
- Click the big green button that says "LTS" (this means Long Term Support - it's the most stable version)
|
|
50
|
-
- Once the installer downloads, double-click it to start installation
|
|
51
|
-
- Click "Next" through the installation wizard, leaving all settings at their defaults
|
|
52
|
-
|
|
53
|
-
3. **Verify Installation:**
|
|
54
|
-
- Open PowerShell (no need for admin mode)
|
|
55
|
-
- Type these commands one at a time and press Enter after each:
|
|
56
|
-
```powershell
|
|
57
|
-
node --version
|
|
58
|
-
pnpm --version
|
|
59
|
-
```
|
|
60
|
-
- You should see version numbers appear after each command (e.g., v18.17.0). If you do, congratulations - node.js 22 is installed!
|
|
61
|
-
|
|
62
|
-
> **Note**: If node.js 22 commands don't work in VS Code, restart VS Code to refresh environment variables.
|
|
63
|
-
|
|
64
|
-
#### For macOS:
|
|
65
|
-
1. **Install Homebrew:**
|
|
66
|
-
- Open Terminal (press Command + Space and type "Terminal")
|
|
67
|
-
- Copy and paste this command into Terminal and press Enter:
|
|
68
|
-
```bash
|
|
69
|
-
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
|
70
|
-
```
|
|
71
|
-
- Follow any additional instructions that appear
|
|
72
|
-
|
|
73
|
-
2. **Install node.js 22:**
|
|
74
|
-
- In the same Terminal window, type this command and press Enter:
|
|
75
|
-
```bash
|
|
76
|
-
brew install node
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
3. **Verify Installation:**
|
|
80
|
-
- In Terminal, type these commands one at a time and press Enter after each:
|
|
81
|
-
```bash
|
|
82
|
-
node --version
|
|
83
|
-
pnpm --version
|
|
84
|
-
```
|
|
85
|
-
- If you see version numbers, you've successfully installed node.js 22!
|
|
86
|
-
|
|
87
|
-
#### For Linux (Ubuntu/Debian):
|
|
88
|
-
1. **Open Terminal:**
|
|
89
|
-
- Press Ctrl + Alt + T on your keyboard, or
|
|
90
|
-
- Click the Activities button and type "Terminal"
|
|
91
|
-
|
|
92
|
-
2. **Update Package List:**
|
|
93
|
-
```bash
|
|
94
|
-
sudo apt update
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
3. **Install node.js 22 and npm:**
|
|
98
|
-
```bash
|
|
99
|
-
sudo apt install nodejs npm
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
4. **Verify Installation:**
|
|
103
|
-
- Type these commands one at a time and press Enter after each:
|
|
104
|
-
```bash
|
|
105
|
-
node --version
|
|
106
|
-
pnpm --version
|
|
107
|
-
```
|
|
108
|
-
- If you see version numbers, you're all set!
|
|
109
|
-
|
|
110
|
-
### Installing Visual Studio Code
|
|
111
|
-
|
|
112
|
-
VS Code is the editor we'll use to write our code. Here's how to install it:
|
|
113
|
-
|
|
114
|
-
#### For Windows:
|
|
115
|
-
1. Visit the [Visual Studio Code website](https://code.visualstudio.com/)
|
|
116
|
-
2. Click the blue "Download for Windows" button
|
|
117
|
-
3. Once the installer downloads, double-click it
|
|
118
|
-
4. Accept the license agreement and click "Next"
|
|
119
|
-
5. Leave the default installation location and click "Next"
|
|
120
|
-
6. In the Select Additional Tasks window, make sure "Add to PATH" is checked
|
|
121
|
-
7. Click "Next" and then "Install"
|
|
122
|
-
8. When installation is complete, click "Finish"
|
|
123
|
-
|
|
124
|
-
#### For macOS:
|
|
125
|
-
1. Visit the [Visual Studio Code website](https://code.visualstudio.com/)
|
|
126
|
-
2. Click the blue "Download for Mac" button
|
|
127
|
-
3. Once the .zip file downloads, double-click it to extract
|
|
128
|
-
4. Drag Visual Studio Code.app to the Applications folder
|
|
129
|
-
5. Double-click the app to launch it
|
|
130
|
-
6. To make VS Code available in your terminal:
|
|
131
|
-
- Open VS Code
|
|
132
|
-
- Press Command + Shift + P
|
|
133
|
-
- Type "shell command" and select "Install 'code' command in PATH"
|
|
134
|
-
|
|
135
|
-
#### For Linux (Ubuntu/Debian):
|
|
136
|
-
1. Open Terminal (Ctrl + Alt + T)
|
|
137
|
-
2. First, update the packages list:
|
|
138
|
-
```bash
|
|
139
|
-
sudo apt update
|
|
140
|
-
```
|
|
141
|
-
3. Install the dependencies needed to add Microsoft's repository:
|
|
142
|
-
```bash
|
|
143
|
-
sudo apt install software-properties-common apt-transport-https wget
|
|
144
|
-
```
|
|
145
|
-
4. Import Microsoft's GPG key:
|
|
146
|
-
```bash
|
|
147
|
-
wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -
|
|
148
|
-
```
|
|
149
|
-
5. Add the VS Code repository:
|
|
150
|
-
```bash
|
|
151
|
-
sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"
|
|
152
|
-
```
|
|
153
|
-
6. Install VS Code:
|
|
154
|
-
```bash
|
|
155
|
-
sudo apt install code
|
|
156
|
-
```
|
|
157
|
-
7. Once installed, you can launch VS Code by:
|
|
158
|
-
- Typing `code` in the terminal, or
|
|
159
|
-
- Finding it in your Applications menu
|
|
160
|
-
|
|
161
|
-
### Install Git
|
|
162
|
-
|
|
163
|
-
#### Windows
|
|
164
|
-
1. Open PowerShell (press Windows key, type "PowerShell", and press Enter)
|
|
165
|
-
2. Visit the [Git website](https://git-scm.com/)
|
|
166
|
-
3. Download the latest version for Windows
|
|
167
|
-
4. Run the installer and use the recommended settings
|
|
168
|
-
5. Verify installation by opening PowerShell:
|
|
169
|
-
```powershell
|
|
170
|
-
git --version
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
#### macOS
|
|
174
|
-
1. Install using Homebrew:
|
|
175
|
-
```bash
|
|
176
|
-
brew install git
|
|
177
|
-
```
|
|
178
|
-
2. Verify installation:
|
|
179
|
-
```bash
|
|
180
|
-
git --version
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
#### Linux (Ubuntu/Debian)
|
|
184
|
-
1. Update package list:
|
|
185
|
-
```bash
|
|
186
|
-
sudo apt update
|
|
187
|
-
```
|
|
188
|
-
2. Install Git:
|
|
189
|
-
```bash
|
|
190
|
-
sudo apt install git
|
|
191
|
-
```
|
|
192
|
-
3. Verify installation:
|
|
193
|
-
```bash
|
|
194
|
-
git --version
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
### Configure Git (All Systems)
|
|
198
|
-
|
|
199
|
-
Open your terminal (command prompt) and run the following commands to set up Git:
|
|
200
|
-
|
|
201
|
-
After installation, set up your identity:
|
|
202
|
-
```bash
|
|
203
|
-
git config --global user.name "Your Name"
|
|
204
|
-
git config --global user.email "your.email@example.com"
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
### Verify Installation
|
|
208
|
-
|
|
209
|
-
Open your terminal (command prompt) and run the following commands to verify your setup:
|
|
210
|
-
```bash
|
|
211
|
-
node --version
|
|
212
|
-
pnpm --version
|
|
213
|
-
git --version
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
You should see version numbers displayed for all commands. You're now ready to start building your Document Model!
|