Skip to content

Commit 94735e8

Browse files
committed
docs(workspace-plugin): update style guide
1 parent da74541 commit 94735e8

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

tools/workspace-plugin/STYLE-GUIDE.md

+13-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Generators
44

5-
Generators should live in the `tools/generators` folder. [Learn more about Nx generators](https://nx.dev/generators/workspace-generators).
5+
Generators live in the `tools/workspace-plugin/src/generators` folder. [Learn more about Nx generators](https://nx.dev/generators/workspace-generators).
66

77
### Scaffolding
88

@@ -52,7 +52,7 @@ Integration tests for the generator as a whole.
5252

5353
TypeScript interface that matches `schema.json`. You can generate this from the json file by running:
5454

55-
- `npx json-schema-to-typescript -i tools/generators/<generator-name>/schema.json -o tools/generators/<generator-name>/schema.ts --additionalProperties false`
55+
- `npx json-schema-to-typescript@latest -i tools/workspace-plugin/src/generators/<name>/schema.json -o tools/workspace-plugin/src/generators/<name>/schema.d.ts --additionalProperties false`
5656

5757
**`schema.json`**
5858

@@ -95,12 +95,20 @@ Migrations follow same rules as [Generators](#Generators) as they behave the sam
9595

9696
## Executors
9797

98-
Executors should live in the `tools/executors` folder. [Learn more about Nx executors](https://nx.dev/executors/using-builders).
98+
Executors live in the `tools/workspace-plugin/src/executors` folder. [Learn more about Nx executors](https://nx.dev/executors/using-builders).
9999

100100
### Scaffolding
101101

102-
TBA
102+
**`schema.d.ts`**
103+
104+
TypeScript interface that matches `schema.json`. You can generate this from the json file by running:
105+
106+
- `npx json-schema-to-typescript@latest -i tools/workspace-plugin/src/executors/<name>/schema.json -o tools/workspace-plugin/src/executors/<name>/schema.d.ts --additionalProperties false`
107+
108+
**`schema.json`**
109+
110+
Provides a description of the generator, available options, validation information, and default values. This is processed by nx cli when invoking generator to provide argument validations/processing/prompts.
103111

104112
### Bootstrap new executor
105113

106-
TBA
114+
`yarn nx g @nx/plugin:executor --directory tools/workspace-plugin/src/executors/<name-of-executor>`

0 commit comments

Comments
 (0)