@procedures/procedure 0.3.0 → 0.5.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/CHANGELOG.md +30 -0
- package/README.md +7 -2
- package/dist/.tsbuildinfo +1 -1
- package/dist/procedures/procedure/new.d.ts +23 -7
- package/dist/procedures/procedure/new.d.ts.map +1 -1
- package/dist/procedures/procedure/new.js +207 -48
- package/dist/procedures/procedure/new.js.map +1 -1
- package/package.json +2 -2
- package/src/procedures/procedure/new.ts +235 -51
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @procedures/procedure
|
|
2
2
|
|
|
3
|
+
## 0.5.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 64120d9: `procedure.new` ends its `operations` with the step "Write metadata.effects: lib audit reports a procedure without them". The scaffold writes no effects on purpose, because a default of "pure" can be false.
|
|
8
|
+
- Updated dependencies [0f75644]
|
|
9
|
+
- Updated dependencies [09e5566]
|
|
10
|
+
- Updated dependencies [ab77f75]
|
|
11
|
+
- Updated dependencies [a47bee6]
|
|
12
|
+
- Updated dependencies [bc74091]
|
|
13
|
+
- @procedures/client@0.5.0
|
|
14
|
+
|
|
15
|
+
## 0.4.0
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- bae25e2: `procedure.new` puts the procedure into the list that `defineModule` gets: an array literal, a variable of `module.ts`, or a spread of such a variable. Before, a variable list sent the procedure into `registerModules(registry, [...])`. When the list comes from another file or a function, `procedure.new` fails with the reason and writes nothing.
|
|
20
|
+
- Updated dependencies [d919678]
|
|
21
|
+
- Updated dependencies [057d69a]
|
|
22
|
+
- Updated dependencies [b2a1a1e]
|
|
23
|
+
- Updated dependencies [057d69a]
|
|
24
|
+
- Updated dependencies [057d69a]
|
|
25
|
+
- Updated dependencies [057d69a]
|
|
26
|
+
- Updated dependencies [057d69a]
|
|
27
|
+
- Updated dependencies [057d69a]
|
|
28
|
+
- Updated dependencies [afd6a19]
|
|
29
|
+
- Updated dependencies [057d69a]
|
|
30
|
+
- Updated dependencies [4e751da]
|
|
31
|
+
- @procedures/client@0.4.0
|
|
32
|
+
|
|
3
33
|
## 0.3.0
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -219,7 +219,12 @@ export interface UserCreateOutput {
|
|
|
219
219
|
export { userCreate } from "./create.js";
|
|
220
220
|
```
|
|
221
221
|
|
|
222
|
-
4. **Registration
|
|
222
|
+
4. **Registration**: the imports, the definition, and the item of the list of procedures go into `src/module.ts`. The list is the second argument of `defineModule`:
|
|
223
|
+
- an array literal: `defineModule("@procedures/demo", [userCreateProcedure])`
|
|
224
|
+
- a variable that `src/module.ts` declares as an array: `const procedures = [userCreateProcedure]`
|
|
225
|
+
- a spread of such a variable: `defineModule("@procedures/demo", [...procedures])`. The item goes into the array of the variable.
|
|
226
|
+
|
|
227
|
+
The definition goes before the list that uses it. When the list comes from another file or from a function, `procedure.new` fails and writes nothing. A package of the old kind, without `src/module.ts`, gets the procedure in the `registerProcedures([...])` array of `src/register.ts`:
|
|
223
228
|
```typescript
|
|
224
229
|
import { createProcedure, outputSchema, registerProcedures, zodAdapter } from "@procedures/client";
|
|
225
230
|
import { userCreate } from "./procedures/user/create.js";
|
|
@@ -243,7 +248,7 @@ export function register(): void {
|
|
|
243
248
|
}
|
|
244
249
|
```
|
|
245
250
|
|
|
246
|
-
If
|
|
251
|
+
If the file has no list that `procedure.new` can change, the result has `success: false`, the error gives the reason, and no file changes.
|
|
247
252
|
|
|
248
253
|
#### `procedure.list`
|
|
249
254
|
|