@yaks/project 0.0.0-stage → 0.2.36
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/LICENSE +202 -0
- package/README.md +145 -2
- package/_dist/comp.d.ts +12 -0
- package/_dist/comp.d.ts.map +1 -0
- package/_dist/graph.d.ts +6 -0
- package/_dist/graph.d.ts.map +1 -0
- package/_dist/guard.d.ts +23 -0
- package/_dist/guard.d.ts.map +1 -0
- package/_dist/mod.d.ts +26 -0
- package/_dist/mod.d.ts.map +1 -0
- package/_dist/plugin.d.ts +12 -0
- package/_dist/plugin.d.ts.map +1 -0
- package/_dist/tools.d.ts +15 -0
- package/_dist/tools.d.ts.map +1 -0
- package/_dist/tree.d.ts +23 -0
- package/_dist/tree.d.ts.map +1 -0
- package/_dist/views.d.ts +24 -0
- package/_dist/views.d.ts.map +1 -0
- package/_dist/vocab.d.ts +7 -0
- package/_dist/vocab.d.ts.map +1 -0
- package/comp.js +45 -0
- package/comp.js.map +1 -0
- package/comp.ts +54 -0
- package/deno.json +1 -0
- package/graph.js +14 -0
- package/graph.js.map +1 -0
- package/graph.ts +18 -0
- package/guard.js +99 -0
- package/guard.js.map +1 -0
- package/guard.ts +119 -0
- package/mod.js +26 -0
- package/mod.js.map +1 -0
- package/mod.ts +26 -0
- package/package.json +37 -4
- package/plugin.js +38 -0
- package/plugin.js.map +1 -0
- package/plugin.ts +39 -0
- package/tools.js +105 -0
- package/tools.js.map +1 -0
- package/tools.ts +138 -0
- package/tree.js +74 -0
- package/tree.js.map +1 -0
- package/tree.ts +105 -0
- package/views.js +27 -0
- package/views.js.map +1 -0
- package/views.ts +29 -0
- package/vocab.js +14 -0
- package/vocab.js.map +1 -0
- package/vocab.json +205 -0
- package/vocab.ts +16 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright 2026 Jeff Peterson
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,146 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @yaks/project
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Organize graph entities into projects, assign priorities and people, save query
|
|
4
|
+
filters as boards, and record a business's phase and repository policy. Tasks
|
|
5
|
+
belong to [@yaks/task](../task); this package declares their optional project
|
|
6
|
+
metadata. Data lives in the graph you provide, with no separate database.
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
deno add jsr:@yaks/project
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Stored components
|
|
13
|
+
|
|
14
|
+
- `project` — something work is grouped under. It is addressed by name as well
|
|
15
|
+
as by id.
|
|
16
|
+
- `filed{project, priority, domain, assignee}` — the filing itself, kept
|
|
17
|
+
separate from being a task so that a task can have none. `priority` orders a
|
|
18
|
+
queue (lower is more urgent) and `domain` names the area of work.
|
|
19
|
+
`filed.project` is a reference declared `death: detach`, so deleting a project
|
|
20
|
+
removes that reference instead of deleting the tasks. A project filed under
|
|
21
|
+
another project is its sub-project (below).
|
|
22
|
+
- `board{query}` — a saved filter over the portfolio. A board is its query.
|
|
23
|
+
Membership is never stored — there is no row saying this task is on that board
|
|
24
|
+
— so a board is always current, and a task that starts matching is on it with
|
|
25
|
+
nothing to reconcile. The empty query selects nothing, which is what a board
|
|
26
|
+
nobody has written a filter for should show.
|
|
27
|
+
- `venture{phase, tagline, site}` — a business being built. It has a phase —
|
|
28
|
+
`building`, `launching` or `live` — separate from a task's completion status.
|
|
29
|
+
A venture put away for good wears [@yaks/kernel](../kernel)'s `archived`.
|
|
30
|
+
- `paused{at}` — work on it is suspended. It is a separate component rather than
|
|
31
|
+
a phase, so the phase underneath is untouched and resuming means removing the
|
|
32
|
+
component; there is no `paused_from` property remembering where to put the
|
|
33
|
+
phase back.
|
|
34
|
+
- `repo{repository, base_branch, push}` — a project's policy for landing its
|
|
35
|
+
source: which repository the work is in, which branch it branches from and
|
|
36
|
+
lands into, and whether landing also pushes. The repository, its checkouts and
|
|
37
|
+
its remote are [@yaks/git](../git)'s. A sub-project without a `repo` lands
|
|
38
|
+
through the nearest project above it that has one.
|
|
39
|
+
|
|
40
|
+
## Sub-projects
|
|
41
|
+
|
|
42
|
+
A project filed under another project is its sub-project: its parent is its own
|
|
43
|
+
`filed.project`, the property that files a task under it. A property holds one
|
|
44
|
+
value, so a project has at most one parent. Everything under a project, at any
|
|
45
|
+
depth, is one walk in the query grammar:
|
|
46
|
+
|
|
47
|
+
- `.filed.project->P-1` — what is filed under P-1, its sub-projects, what is
|
|
48
|
+
filed under those, and so on down;
|
|
49
|
+
- `.task .filed.project->P-1` — the tasks among them, which is what a board
|
|
50
|
+
rolling up a project's work says;
|
|
51
|
+
- `.filed.project=P-1` — only what is filed directly under it.
|
|
52
|
+
|
|
53
|
+
`lineage(g, eid)` reads the other way: the projects an entity is under, nearest
|
|
54
|
+
first — the entity itself when it is a project, then each `filed.project` above
|
|
55
|
+
it. It is how a sub-project finds the `repo` it lands through and the common
|
|
56
|
+
personas its agents are owed ([@yaks/persona](../persona)). The plugin refuses a
|
|
57
|
+
project filed under itself or under a project already under it, so the projects
|
|
58
|
+
form a tree.
|
|
59
|
+
|
|
60
|
+
## Checking a board's query
|
|
61
|
+
|
|
62
|
+
`projects(vocab)` returns a graph plugin registering a `precondition` hook. It
|
|
63
|
+
runs inside the write transaction, before any row has changed, and rejects a
|
|
64
|
+
board query with an unknown property or task status. It does not reject a valid
|
|
65
|
+
query merely because no current records match. Because a board is its query, an
|
|
66
|
+
empty board and a board with a typo in its filter look exactly alike — no error,
|
|
67
|
+
no empty state saying why, just a board that is always blank. Two ways a query
|
|
68
|
+
is wrong are caught:
|
|
69
|
+
|
|
70
|
+
- it names a property the vocabulary does not have (`.task.staus=open`), or a
|
|
71
|
+
property without its component (`.status=open`);
|
|
72
|
+
- it names a status outside the closed set (`.task.status=complete`, where
|
|
73
|
+
@yaks/task declares `done`, `cancelled` and `open`).
|
|
74
|
+
|
|
75
|
+
The set of statuses a board may name is the ladder the loaded vocabulary
|
|
76
|
+
declares (@yaks/vocab's `status` keyword), so a graph that also loads
|
|
77
|
+
[@yaks/session](../session) gets `wip` in the check by composing it, and one
|
|
78
|
+
without leases knows only the three @yaks/task declares.
|
|
79
|
+
|
|
80
|
+
The empty query is still allowed, and `task.status` needs no check here: it is
|
|
81
|
+
declared `computed: true`, and @yaks/graph drops a computed property before this
|
|
82
|
+
hook sees the write.
|
|
83
|
+
|
|
84
|
+
## Two checks
|
|
85
|
+
|
|
86
|
+
`@yaks/project/tools` implements the two tools this package declares, both
|
|
87
|
+
read-only, both declared with the verb `check` so @yaks/tools can discover them:
|
|
88
|
+
|
|
89
|
+
- `board_check` reads every saved board query and reports the ones that refer to
|
|
90
|
+
unknown properties or task statuses. The hook above refuses a bad query while
|
|
91
|
+
the person who typed it is still there, but loaded schemas can change: a
|
|
92
|
+
property can be renamed, a status removed, or a component no longer loaded.
|
|
93
|
+
The check detects invalid saved queries even when no one is writing the board.
|
|
94
|
+
- `project_check` reports governed entities that no project can reach. A
|
|
95
|
+
component declaring the `governed` keyword ([@yaks/kernel](../kernel)) is one
|
|
96
|
+
a project answers for: a task, a memory, a design. The check walks out from
|
|
97
|
+
the projects and from everything filed under one, following containment edges
|
|
98
|
+
(`contains` by default; set `through` in config for other relation tags), and
|
|
99
|
+
reports governed entities it does not reach. This detects missing project
|
|
100
|
+
associations; it does not imply that those entities are invisible to every
|
|
101
|
+
possible board query.
|
|
102
|
+
|
|
103
|
+
## Use and exports
|
|
104
|
+
|
|
105
|
+
A bundle is a JSON object containing one entity's components. This example
|
|
106
|
+
stores a project and a saved board in RAM and enables query validation:
|
|
107
|
+
|
|
108
|
+
```ts
|
|
109
|
+
import { docDoc } from '@yaks/doc'
|
|
110
|
+
import { graph } from '@yaks/graph'
|
|
111
|
+
import { projectDoc, projects } from '@yaks/project'
|
|
112
|
+
import { ram } from '@yaks/ram'
|
|
113
|
+
import { loadVocab } from '@yaks/vocab'
|
|
114
|
+
|
|
115
|
+
let vocab = loadVocab([docDoc, projectDoc])
|
|
116
|
+
let g = graph({ storage: ram(vocab), vocab, plugins: [projects(vocab)] })
|
|
117
|
+
await g.apply([
|
|
118
|
+
{ entity: { eid: 'website' }, project: {}, doc: { title: 'Website' } },
|
|
119
|
+
{
|
|
120
|
+
entity: { eid: 'website-board' },
|
|
121
|
+
board: { query: '.filed.project=website' },
|
|
122
|
+
doc: { title: 'Website work' },
|
|
123
|
+
},
|
|
124
|
+
])
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
- `@yaks/project`: `projectDoc`, `PROJECT`, `FILED`, `BOARD`, `VENTURE`,
|
|
128
|
+
`projects(vocab)`, `guarding(vocab)`, `unroutable(query, vocab)` (a diagnostic
|
|
129
|
+
string or `null`), `lineage(g, eid)`, and `nesting` (the hook keeping projects
|
|
130
|
+
a tree).
|
|
131
|
+
- `@yaks/project/vocab`: schema documents in `docs`.
|
|
132
|
+
- `@yaks/project/graph`: `plugins(host)` supplies the validation plugin.
|
|
133
|
+
- `@yaks/project/tools`: `runs(host, options)` supplies the two checks above;
|
|
134
|
+
`options.through` chooses containment relation tags.
|
|
135
|
+
- `@yaks/project/views`: `destinations`, the Projects and Saved searches pages a
|
|
136
|
+
browsing app lists in its sidebar.
|
|
137
|
+
|
|
138
|
+
Here `host` is the process that opened the graph; these factories need its
|
|
139
|
+
loaded vocabulary. A schema keyword is metadata on a declaration: `governed`
|
|
140
|
+
identifies components the project check should examine, and must be loaded
|
|
141
|
+
through @yaks/kernel's `kernelKeywords` (imported from `@yaks/kernel`).
|
|
142
|
+
|
|
143
|
+
## Compatibility
|
|
144
|
+
|
|
145
|
+
Deno and Node. The vocabulary is a JSON document with no runtime calls; the
|
|
146
|
+
plugin and the two checks need a loaded vocabulary and a graph.
|
package/_dist/comp.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { VocabDoc } from "@yaks/vocab";
|
|
2
|
+
/** The component naming something work is filed under. */ export declare let PROJECT: string;
|
|
3
|
+
/** The optional portfolio filing: project, priority, domain and assignee. */ export declare let FILED: string;
|
|
4
|
+
/** The component carrying a board's saved query. */ export declare let BOARD: string;
|
|
5
|
+
/** The component naming a business being built. */ export declare let VENTURE: string;
|
|
6
|
+
/**
|
|
7
|
+
* The portfolio vocabulary, to load beside {@link https://jsr.io/@yaks/task |
|
|
8
|
+
* @yaks/task}'s: `loadVocab([taskDoc, projectDoc, ...mine])`. It declares
|
|
9
|
+
* nothing about what a task is — only what one is filed under and looked at
|
|
10
|
+
* through.
|
|
11
|
+
*/ export declare let projectDoc: VocabDoc;
|
|
12
|
+
//# sourceMappingURL=comp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comp.d.ts","sources":["../comp.ts"],"names":[],"mappings":"AAgCA,cAAc,QAAQ,2BAAgC;AAGtD,wDAAwD,GACxD,OAAO,YAAI,gBAAmB;AAE9B,2EAA2E,GAC3E,OAAO,YAAI,cAAe;AAE1B,kDAAkD,GAClD,OAAO,YAAI,cAAe;AAE1B,iDAAiD,GACjD,OAAO,YAAI,gBAAmB;AAE9B;;;;;CAKC,GACD,OAAO,YAAI,YAAY,SAA0B"}
|
package/_dist/graph.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Plugin } from "@yaks/graph";
|
|
2
|
+
import type { Vocab } from "@yaks/vocab";
|
|
3
|
+
/** The project work is filed under, the filing, and the board over it. */ export declare let plugins: (host: {
|
|
4
|
+
vocab: Vocab;
|
|
5
|
+
}) => Plugin[];
|
|
6
|
+
//# sourceMappingURL=graph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph.d.ts","sources":["../graph.ts"],"names":[],"mappings":"AAUA,cAAc,MAAM,2BAAgC;AACpD,cAAc,KAAK,2BAAgC;AAGnD,wEAAwE,GACxE,OAAO,YAAI,UACT;EAAQ,OAAO;MACd,SAAkC"}
|
package/_dist/guard.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Hook } from "@yaks/graph";
|
|
2
|
+
import type { Vocab } from "@yaks/vocab";
|
|
3
|
+
/**
|
|
4
|
+
* Returns why this query cannot stand as a board's filter, or `null` when it
|
|
5
|
+
* can: every predicate must route through the vocabulary, and every status it
|
|
6
|
+
* names must be one its component's ladder gives (@yaks/vocab's `status`
|
|
7
|
+
* keyword). The set is the vocabulary's, so a board in a graph that leases its
|
|
8
|
+
* tasks knows `wip` without @yaks/project being told about @yaks/session.
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { unroutable } from '@yaks/project'
|
|
12
|
+
*
|
|
13
|
+
* // unroutable('.task.status=open', vocab) → null
|
|
14
|
+
* // unroutable('.task.status=complete', vocab) → 'no such status: complete — …'
|
|
15
|
+
* ```
|
|
16
|
+
*/ export declare let unroutable: (query: string, vocab: Vocab) => string | null;
|
|
17
|
+
/**
|
|
18
|
+
* The `precondition` hook: refuses a board whose query does not route, or which
|
|
19
|
+
* names a status outside the closed set. Registered by
|
|
20
|
+
* {@link https://jsr.io/@yaks/project/doc/~/projects | projects}; exported on
|
|
21
|
+
* its own for a graph that wants the check without the rest of the plugin.
|
|
22
|
+
*/ export declare let guarding: (vocab: Vocab) => Hook;
|
|
23
|
+
//# sourceMappingURL=guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guard.d.ts","sources":["../guard.ts"],"names":[],"mappings":"AA+BA,cAA4B,IAAI,2BAAgC;AAIhE,cAAc,KAAK,2BAAgC;AAgBnD;;;;;;;;;;;;;CAaC,GACD,OAAO,YAAI,aAAc,OAAO,MAAM,EAAE,OAAO,UAAQ,MAAM,GAAG,IAAI,CAsBnE;AAED;;;;;CAKC,GACD,OAAO,YAAI,WAAY,OAAO,UAAQ,KAKrC"}
|
package/_dist/mod.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A portfolio. A `project` is what work is filed under — `filed{project,
|
|
3
|
+
* priority, domain, assignee}` is that filing, kept separate from being a task
|
|
4
|
+
* so that a task can have none. A `board` is a saved filter over the portfolio
|
|
5
|
+
* rather than a stored list of members, and the one piece of machinery here
|
|
6
|
+
* refuses a board whose query would quietly match nothing. A project filed
|
|
7
|
+
* under another project is its sub-project, so `.filed.project->P` is
|
|
8
|
+
* everything under P, and {@link lineage} reads the way up. A `venture` is a
|
|
9
|
+
* business being built, with a phase rather than a status.
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { loadVocab } from '@yaks/vocab'
|
|
13
|
+
* import { edgeDoc, edgeKeywords } from '@yaks/edge'
|
|
14
|
+
* import { taskDoc } from '@yaks/task'
|
|
15
|
+
* import { projectDoc, projects } from '@yaks/project'
|
|
16
|
+
*
|
|
17
|
+
* let vocab = loadVocab([edgeDoc, taskDoc, projectDoc], [edgeKeywords])
|
|
18
|
+
* // let g = graph({ storage, vocab, plugins: [projects(vocab)] })
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @module
|
|
22
|
+
*/ export * from "./comp.js";
|
|
23
|
+
export * from "./guard.js";
|
|
24
|
+
export * from "./plugin.js";
|
|
25
|
+
export * from "./tree.js";
|
|
26
|
+
//# sourceMappingURL=mod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sources":["../mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;CAqBC,GACD,0BAAyB;AACzB,2BAA0B;AAC1B,4BAA2B;AAC3B,0BAAyB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Plugin } from "@yaks/graph/plugin";
|
|
2
|
+
import type { Vocab } from "@yaks/vocab";
|
|
3
|
+
/**
|
|
4
|
+
* The portfolio plugin: the `project`, `filed`, `board` and `venture`
|
|
5
|
+
* components, and a `precondition` hook that refuses a board whose query would
|
|
6
|
+
* quietly match nothing, or a project filed under one already under it.
|
|
7
|
+
*
|
|
8
|
+
* A board's statuses are checked against the ladder the loaded vocabulary
|
|
9
|
+
* declares, so a server that loads leases gets `wip` without this package
|
|
10
|
+
* being told about them.
|
|
11
|
+
*/ export declare let projects: (vocab: Vocab) => Plugin;
|
|
12
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sources":["../plugin.ts"],"names":[],"mappings":"AAWA,SAAe,KAAK,MAAM,kCAAuC;AACjE,cAAc,KAAK,2BAAgC;AAKnD;;;;;;;;CAQC,GACD,OAAO,YAAI,WAAY,OAAO,UAAQ,OAYrC"}
|
package/_dist/tools.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Runs } from "@yaks/graph/tools";
|
|
2
|
+
import type { Vocab } from "@yaks/vocab";
|
|
3
|
+
/** The configuration `@yaks/project`'s checks accept. */ export type Options = {
|
|
4
|
+
/** which relation tags mean containment, when working out whether a project
|
|
5
|
+
* reaches something. The default is `contains` — @yaks/task's tag, and the
|
|
6
|
+
* one the fleet graph uses — because a package cannot know what another
|
|
7
|
+
* package named the edge meaning "part of". */ through?: string[];
|
|
8
|
+
};
|
|
9
|
+
/** The implementations of the tools ./vocab.json declares. The loaded
|
|
10
|
+
* vocabulary is what a board's query routes through, and what declares which
|
|
11
|
+
* components are governed, so both checks are built against the components this
|
|
12
|
+
* graph actually has. */ export declare let runs: (host: {
|
|
13
|
+
vocab: Vocab;
|
|
14
|
+
}, options?: Options) => Runs;
|
|
15
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sources":["../tools.ts"],"names":[],"mappings":"AA2BA,cAAc,IAAI,iCAAsC;AACxD,cAAc,KAAK,2BAAgC;AAInD,uDAAuD,GACvD,YAAY;EACV;;;+CAG6C,GAC7C,UAAU,MAAM;;AAmDlB;;;uBAGuB,GACvB,OAAO,YAAI,OACT;EAAQ,OAAO;GACf,UAAS,YACR,KAyCD"}
|
package/_dist/tree.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Bundle, Eid, Hook } from "@yaks/graph";
|
|
2
|
+
/** What reading up a lineage needs: entities by eid, synchronously or not. */ export type Reads = {
|
|
3
|
+
get: (eids: Eid[]) => Bundle[] | Promise<Bundle[]>;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* The projects an entity is under, nearest first: the entity itself when it is
|
|
7
|
+
* a project, then each project its `filed.project` chain passes through. A
|
|
8
|
+
* task's lineage starts at the project it is filed in. Synchronous over a
|
|
9
|
+
* synchronous storage, a promise over one that returns promises.
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { lineage } from '@yaks/project'
|
|
13
|
+
*
|
|
14
|
+
* // (await lineage(g, 'T-7')).find((p) => p.repo) — where T-7 lands
|
|
15
|
+
* ```
|
|
16
|
+
*/ export declare let lineage: (g: Reads, eid: Eid) => Bundle[] | Promise<Bundle[]>;
|
|
17
|
+
/**
|
|
18
|
+
* The `precondition` hook that keeps projects a tree: it refuses filing an
|
|
19
|
+
* entity under a project that is already under it, itself included. The
|
|
20
|
+
* parents it walks are the ones this batch leaves, so two projects filed under
|
|
21
|
+
* each other in one batch are refused too.
|
|
22
|
+
*/ export declare let nesting: Hook;
|
|
23
|
+
//# sourceMappingURL=tree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree.d.ts","sources":["../tree.ts"],"names":[],"mappings":"AAgBA,cAAc,MAAM,EAAQ,GAAG,EAAE,IAAI,2BAAgC;AAKrE,4EAA4E,GAC5E,YAAY;EAAU,MAAM,MAAM,UAAU,WAAW,QAAQ;;AAqB/D;;;;;;;;;;;CAWC,GACD,OAAO,YAAI,UACT,GAAG,OACH,KAAK,QACJ,WAAW,QAAQ,UAAsC;AAc5D;;;;;CAKC,GACD,OAAO,YAAI,SAAS,KA0BnB"}
|
package/_dist/views.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `./views` facet: the pages this package offers a browsing app's
|
|
3
|
+
* sidebar, each a list of what its query finds (@yaks/browse destinations):
|
|
4
|
+
* the projects work is filed under, and the boards that are saved searches
|
|
5
|
+
* over it.
|
|
6
|
+
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { destinations } from '@yaks/project/views'
|
|
9
|
+
* destinations.map((d) => d.name) // ['Projects', 'Saved searches']
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* @module
|
|
13
|
+
*/ /** The sidebar's pages: a key for the address, a name, an icon, a query. */ export declare let destinations: readonly [{
|
|
14
|
+
readonly key: string;
|
|
15
|
+
readonly name: string;
|
|
16
|
+
readonly icon: string;
|
|
17
|
+
readonly query: string;
|
|
18
|
+
}, {
|
|
19
|
+
readonly key: string;
|
|
20
|
+
readonly name: string;
|
|
21
|
+
readonly icon: string;
|
|
22
|
+
readonly query: string;
|
|
23
|
+
}];
|
|
24
|
+
//# sourceMappingURL=views.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"views.d.ts","sources":["../views.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;CAYC,GAED,0EAA0E,GAC1E,OAAO,YAAI;aAEP;aACA;aACA;aACA;;aAGA;aACA;aACA;aACA;KAEH"}
|
package/_dist/vocab.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { VocabDoc } from "@yaks/vocab";
|
|
2
|
+
import { projectDoc } from "./comp.js";
|
|
3
|
+
export { projectDoc };
|
|
4
|
+
/** What this package is: its manifest's description, the one place it is
|
|
5
|
+
* written, which a host stamps on each document here. */ export declare let description: string;
|
|
6
|
+
/** Every document this plugin declares. */ export declare let docs: VocabDoc[];
|
|
7
|
+
//# sourceMappingURL=vocab.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vocab.d.ts","sources":["../vocab.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,2BAAgC;AACtD,SAAS,UAAU,oBAAmB;AAGtC,SAAS,UAAU,GAAE;AAErB;uDACuD,GACvD,OAAO,YAAI,aAAa,MAAM,CAAuB;AAErD,yCAAyC,GACzC,OAAO,YAAI,MAAM,WAAyB"}
|
package/comp.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// The components this package ships, as one vocabulary document to load beside
|
|
2
|
+
// your own.
|
|
3
|
+
//
|
|
4
|
+
// project{} what work is filed under
|
|
5
|
+
// filed{project, priority, domain, assignee} the filing itself
|
|
6
|
+
// board{query} a saved filter over it
|
|
7
|
+
// venture{phase, tagline, site} a business being built
|
|
8
|
+
// paused{at} work on it is suspended
|
|
9
|
+
// repo{repository, base_branch, push} where it lands its source
|
|
10
|
+
//
|
|
11
|
+
// Filing is separate from being A task. A task with no `filed` component at all
|
|
12
|
+
// is still a task, and the filing is the optional component that puts one in a
|
|
13
|
+
// portfolio. `filed.project` is declared `death: detach`: deleting a project
|
|
14
|
+
// frees its tasks rather than deleting them, because they are not about the
|
|
15
|
+
// project, they were only filed under it. A project filed under another is its
|
|
16
|
+
// sub-project, and is freed the same way (./tree.ts).
|
|
17
|
+
//
|
|
18
|
+
// A board is its query. `board{query}` holds a filter, and membership is never
|
|
19
|
+
// stored — there is no row saying this task is on that board. So a board is
|
|
20
|
+
// always current: a task that starts matching is on it, with nothing to
|
|
21
|
+
// reconcile. The empty query selects nothing, which is what a board nobody has
|
|
22
|
+
// written a filter for should show, and ./guard.ts refuses the rest.
|
|
23
|
+
//
|
|
24
|
+
// A venture has A phase, not A status. It is never done: it is building, or
|
|
25
|
+
// launching, or live. Suspending work on it is the separate `paused` component,
|
|
26
|
+
// so the phase underneath is untouched and resuming means removing that
|
|
27
|
+
// component — there is no property remembering which phase to put back. A
|
|
28
|
+
// venture put away for good wears the kernel's `archived` mark.
|
|
29
|
+
//
|
|
30
|
+
// The document itself is `./vocab.json` — plain JSON Schema, readable by
|
|
31
|
+
// anything that reads JSON.
|
|
32
|
+
import doc from './vocab.json' with {
|
|
33
|
+
type: 'json'
|
|
34
|
+
};
|
|
35
|
+
/** The component naming something work is filed under. */ export let PROJECT = 'project';
|
|
36
|
+
/** The optional portfolio filing: project, priority, domain and assignee. */ export let FILED = 'filed';
|
|
37
|
+
/** The component carrying a board's saved query. */ export let BOARD = 'board';
|
|
38
|
+
/** The component naming a business being built. */ export let VENTURE = 'venture';
|
|
39
|
+
/**
|
|
40
|
+
* The portfolio vocabulary, to load beside {@link https://jsr.io/@yaks/task |
|
|
41
|
+
* @yaks/task}'s: `loadVocab([taskDoc, projectDoc, ...mine])`. It declares
|
|
42
|
+
* nothing about what a task is — only what one is filed under and looked at
|
|
43
|
+
* through.
|
|
44
|
+
*/ export let projectDoc = doc;
|
|
45
|
+
//# sourceMappingURL=comp.js.map
|
package/comp.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comp.js","sources":["./comp.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,YAAY;AACZ,EAAE;AACF,yEAAyE;AACzE,kEAAkE;AAClE,uEAAuE;AACvE,uEAAuE;AACvE,wEAAwE;AACxE,oEAAoE;AACpE,EAAE;AACF,gFAAgF;AAChF,+EAA+E;AAC/E,6EAA6E;AAC7E,4EAA4E;AAC5E,+EAA+E;AAC/E,sDAAsD;AACtD,EAAE;AACF,+EAA+E;AAC/E,4EAA4E;AAC5E,wEAAwE;AACxE,+EAA+E;AAC/E,qEAAqE;AACrE,EAAE;AACF,4EAA4E;AAC5E,gFAAgF;AAChF,wEAAwE;AACxE,0EAA0E;AAC1E,gEAAgE;AAChE,EAAE;AACF,yEAAyE;AACzE,4BAA4B;AAG5B,OAAO,SAAS,oBAAoB;EAAE,MAAM;AAAO,EAAC;AAEpD,wDAAwD,GACxD,OAAO,IAAI,UAAU,UAAS;AAE9B,2EAA2E,GAC3E,OAAO,IAAI,QAAQ,QAAO;AAE1B,kDAAkD,GAClD,OAAO,IAAI,QAAQ,QAAO;AAE1B,iDAAiD,GACjD,OAAO,IAAI,UAAU,UAAS;AAE9B;;;;;CAKC,GACD,OAAO,IAAI,aAAuB,IAAe"}
|
package/comp.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// The components this package ships, as one vocabulary document to load beside
|
|
2
|
+
// your own.
|
|
3
|
+
//
|
|
4
|
+
// project{} what work is filed under
|
|
5
|
+
// filed{project, priority, domain, assignee} the filing itself
|
|
6
|
+
// board{query} a saved filter over it
|
|
7
|
+
// venture{phase, tagline, site} a business being built
|
|
8
|
+
// paused{at} work on it is suspended
|
|
9
|
+
// repo{repository, base_branch, push} where it lands its source
|
|
10
|
+
//
|
|
11
|
+
// Filing is separate from being A task. A task with no `filed` component at all
|
|
12
|
+
// is still a task, and the filing is the optional component that puts one in a
|
|
13
|
+
// portfolio. `filed.project` is declared `death: detach`: deleting a project
|
|
14
|
+
// frees its tasks rather than deleting them, because they are not about the
|
|
15
|
+
// project, they were only filed under it. A project filed under another is its
|
|
16
|
+
// sub-project, and is freed the same way (./tree.ts).
|
|
17
|
+
//
|
|
18
|
+
// A board is its query. `board{query}` holds a filter, and membership is never
|
|
19
|
+
// stored — there is no row saying this task is on that board. So a board is
|
|
20
|
+
// always current: a task that starts matching is on it, with nothing to
|
|
21
|
+
// reconcile. The empty query selects nothing, which is what a board nobody has
|
|
22
|
+
// written a filter for should show, and ./guard.ts refuses the rest.
|
|
23
|
+
//
|
|
24
|
+
// A venture has A phase, not A status. It is never done: it is building, or
|
|
25
|
+
// launching, or live. Suspending work on it is the separate `paused` component,
|
|
26
|
+
// so the phase underneath is untouched and resuming means removing that
|
|
27
|
+
// component — there is no property remembering which phase to put back. A
|
|
28
|
+
// venture put away for good wears the kernel's `archived` mark.
|
|
29
|
+
//
|
|
30
|
+
// The document itself is `./vocab.json` — plain JSON Schema, readable by
|
|
31
|
+
// anything that reads JSON.
|
|
32
|
+
|
|
33
|
+
import type { VocabDoc } from 'jsr:@yaks/vocab@0.2.36'
|
|
34
|
+
import doc from './vocab.json' with { type: 'json' }
|
|
35
|
+
|
|
36
|
+
/** The component naming something work is filed under. */
|
|
37
|
+
export let PROJECT = 'project'
|
|
38
|
+
|
|
39
|
+
/** The optional portfolio filing: project, priority, domain and assignee. */
|
|
40
|
+
export let FILED = 'filed'
|
|
41
|
+
|
|
42
|
+
/** The component carrying a board's saved query. */
|
|
43
|
+
export let BOARD = 'board'
|
|
44
|
+
|
|
45
|
+
/** The component naming a business being built. */
|
|
46
|
+
export let VENTURE = 'venture'
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The portfolio vocabulary, to load beside {@link https://jsr.io/@yaks/task |
|
|
50
|
+
* @yaks/task}'s: `loadVocab([taskDoc, projectDoc, ...mine])`. It declares
|
|
51
|
+
* nothing about what a task is — only what one is filed under and looked at
|
|
52
|
+
* through.
|
|
53
|
+
*/
|
|
54
|
+
export let projectDoc: VocabDoc = doc as VocabDoc
|