@travetto/doc 3.0.0-rc.2 → 3.0.0-rc.21
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/README.md +31 -26
- package/package.json +15 -9
- package/src/doc.ts +2 -2
- package/src/lib.ts +15 -2
- package/src/mod-mapping.ts +258 -0
- package/src/mod.ts +5 -70
- package/src/nodes.ts +60 -23
- package/src/render/code-highlight.ts +16 -23
- package/src/render/context.ts +12 -31
- package/src/render/html.ts +3 -2
- package/src/render/markdown.ts +2 -1
- package/src/render/prism.d.ts +14 -386
- package/src/render/util.ts +24 -7
- package/src/types.ts +4 -9
- package/src/util/file.ts +25 -18
- package/src/util/resolve.ts +14 -21
- package/src/util/run.ts +29 -21
- package/support/cli.doc.ts +84 -0
- package/bin/cli-doc.ts +0 -84
- /package/{index.ts → __index__.ts} +0 -0
package/README.md
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
<!-- This file was generated by @travetto/doc and should not be modified directly -->
|
|
2
|
-
<!-- Please modify https://github.com/travetto/travetto/tree/main/module/doc/
|
|
2
|
+
<!-- Please modify https://github.com/travetto/travetto/tree/main/module/doc/DOC.ts and execute "npx trv doc" to rebuild -->
|
|
3
3
|
# Documentation
|
|
4
|
-
## Documentation support for the
|
|
4
|
+
## Documentation support for the Travetto framework
|
|
5
5
|
|
|
6
6
|
**Install: @travetto/doc**
|
|
7
7
|
```bash
|
|
8
8
|
npm install @travetto/doc
|
|
9
|
+
|
|
10
|
+
# or
|
|
11
|
+
|
|
12
|
+
yarn add @travetto/doc
|
|
9
13
|
```
|
|
10
14
|
|
|
11
15
|
This module provides the ability to generate documentation in [HTML](https://en.wikipedia.org/wiki/HTML) and/or [Markdown](https://en.wikipedia.org/wiki/Markdown). The module relies on integrating with the source of the project, and providing a fully referenced code-base. This allows for automatic updates when code is changed and/or refactored.
|
|
@@ -14,7 +18,7 @@ This module provides the ability to generate documentation in [HTML](https://en.
|
|
|
14
18
|
```typescript
|
|
15
19
|
import { d, mod } from '@travetto/doc';
|
|
16
20
|
|
|
17
|
-
export const text = d`
|
|
21
|
+
export const text = () => d`
|
|
18
22
|
${d.Header()}
|
|
19
23
|
|
|
20
24
|
Sample documentation for fictional module. This module fictitiously relies upon ${mod.Cache} functionality.
|
|
@@ -27,7 +31,7 @@ ${d.Ordered(
|
|
|
27
31
|
|
|
28
32
|
${d.Section('Content')}
|
|
29
33
|
|
|
30
|
-
${d.Code('Document Sample', '
|
|
34
|
+
${d.Code('Document Sample', './src/test.ts')}
|
|
31
35
|
|
|
32
36
|
${d.SubSection('Output')}
|
|
33
37
|
|
|
@@ -38,7 +42,7 @@ ${d.Execute('Run program', 'trv')}
|
|
|
38
42
|
**Code: Document Context**
|
|
39
43
|
```typescript
|
|
40
44
|
export interface DocumentShape<T extends DocNode = DocNode> {
|
|
41
|
-
text:
|
|
45
|
+
text: () => (T | Promise<T>);
|
|
42
46
|
wrap?: Wrapper;
|
|
43
47
|
}
|
|
44
48
|
```
|
|
@@ -62,7 +66,7 @@ As you can see, you need to export a field named `text` as the body of the help
|
|
|
62
66
|
* `Header` - Standard header
|
|
63
67
|
* `Image` - Image reference
|
|
64
68
|
* `Input` - Input text
|
|
65
|
-
* `Install` -
|
|
69
|
+
* `Install` - Installing a package or program
|
|
66
70
|
* `Item` - List item
|
|
67
71
|
* `Library` - Library reference
|
|
68
72
|
* `List` - Standard List
|
|
@@ -78,10 +82,11 @@ As you can see, you need to export a field named `text` as the body of the help
|
|
|
78
82
|
* `SnippetLink` - Link to a snippet of code, including line number
|
|
79
83
|
* `Strong` - Strong Content
|
|
80
84
|
* `SubSection` - Sub-section
|
|
85
|
+
* `SubSubSection` - Sub-sub-section
|
|
81
86
|
* `Table` - Table
|
|
82
87
|
* `TableOfContents` - Table Of Contents
|
|
83
88
|
* `Terminal` - Terminal output
|
|
84
|
-
* `Text` - Simple Text
|
|
89
|
+
* `Text` - Simple Text Contentf
|
|
85
90
|
|
|
86
91
|
## Libraries
|
|
87
92
|
|
|
@@ -102,31 +107,33 @@ $ trv doc --help
|
|
|
102
107
|
Usage: doc [options]
|
|
103
108
|
|
|
104
109
|
Options:
|
|
105
|
-
-i, --input <input>
|
|
106
|
-
-o, --
|
|
107
|
-
-
|
|
108
|
-
-
|
|
109
|
-
-h, --help display help for command
|
|
110
|
+
-i, --input <input> Input File (default: "DOC.ts")
|
|
111
|
+
-o, --outputs <outputs> Outputs (default: [])
|
|
112
|
+
-w, --watch Watch
|
|
113
|
+
-h, --help display help for command
|
|
110
114
|
```
|
|
111
115
|
|
|
112
116
|
By default, running the command will output the [Markdown](https://en.wikipedia.org/wiki/Markdown) content directly to the terminal.
|
|
113
117
|
|
|
114
118
|
**Terminal: Sample CLI Output**
|
|
115
119
|
```bash
|
|
116
|
-
$ trv doc -
|
|
120
|
+
$ trv doc -o html
|
|
117
121
|
|
|
118
122
|
<!-- This file was generated by @travetto/doc and should not be modified directly -->
|
|
119
|
-
<!-- Please modify
|
|
120
|
-
<h1
|
|
121
|
-
|
|
122
|
-
|
|
123
|
+
<!-- Please modify ./doc-exec/DOC.ts and execute "npx trv doc" to rebuild -->
|
|
124
|
+
<h1>@travetto-doc/doc
|
|
125
|
+
|
|
123
126
|
</h1>
|
|
124
127
|
|
|
125
128
|
<figure class="install">
|
|
126
|
-
<figcaption class="install">Install @travetto/doc
|
|
129
|
+
<figcaption class="install">Install @travetto-doc/doc
|
|
127
130
|
|
|
128
131
|
</figcaption>
|
|
129
|
-
<pre><code class="language-bash"><span class="token function">npm</span> <span class="token function">install</span> @travetto/doc
|
|
132
|
+
<pre><code class="language-bash"><span class="token function">npm</span> <span class="token function">install</span> @travetto-doc/doc
|
|
133
|
+
|
|
134
|
+
<span class="token comment"># or</span>
|
|
135
|
+
|
|
136
|
+
<span class="token function">yarn</span> <span class="token function">add</span> @travetto-doc/doc</code></pre>
|
|
130
137
|
</figure>
|
|
131
138
|
|
|
132
139
|
Sample documentation for fictional module. This module fictitiously relies upon <a class="module-link" href="https://github.com/travetto/travetto/tree/main/module/cache" title="Caching functionality with decorators for declarative use.">Caching</a> functionality.
|
|
@@ -139,7 +146,7 @@ Sample documentation for fictional module. This module fictitiously relies upon
|
|
|
139
146
|
|
|
140
147
|
<figure class="code">
|
|
141
148
|
<figcaption class="code">Document Sample
|
|
142
|
-
<cite><a target="_blank" href="
|
|
149
|
+
<cite><a target="_blank" href="./doc-exec/src/test.ts">Source</a></cite>
|
|
143
150
|
</figcaption>
|
|
144
151
|
<pre><code class="language-typescript"><span class="token keyword">class</span> <span class="token class-name">TestFile</span> <span class="token punctuation">{{'{'}}</span>
|
|
145
152
|
<span class="token keyword">static</span> <span class="token function">method</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">:</span> <span class="token keyword">void</span> <span class="token punctuation">{{'{'}}</span> <span class="token punctuation">{{'}'}}</span>
|
|
@@ -157,14 +164,12 @@ Sample documentation for fictional module. This module fictitiously relies upon
|
|
|
157
164
|
Usage: <span class="token punctuation">[</span>options<span class="token punctuation">]</span> <span class="token punctuation">[</span>command<span class="token punctuation">]</span>
|
|
158
165
|
|
|
159
166
|
Options:
|
|
160
|
-
-V, <span class="token parameter variable">--version</span>
|
|
161
|
-
-h, <span class="token parameter variable">--help</span>
|
|
167
|
+
-V, <span class="token parameter variable">--version</span> output the version number
|
|
168
|
+
-h, <span class="token parameter variable">--help</span> display <span class="token builtin class-name">help</span> <span class="token keyword">for</span> <span class="token builtin class-name">command</span>
|
|
162
169
|
|
|
163
170
|
Commands:
|
|
164
|
-
build <span class="token punctuation">[</span>options<span class="token punctuation">]</span>
|
|
165
|
-
clean <span class="token punctuation">[</span>options<span class="token punctuation">]</span>
|
|
166
171
|
doc <span class="token punctuation">[</span>options<span class="token punctuation">]</span>
|
|
167
|
-
|
|
168
|
-
<span class="token builtin class-name">help</span> <span class="token punctuation">[</span>command<span class="token punctuation">]</span>
|
|
172
|
+
main <span class="token operator"><</span>fileOrImport<span class="token operator">></span> <span class="token punctuation">[</span>args<span class="token punctuation">..</span>.<span class="token punctuation">]</span>
|
|
173
|
+
<span class="token builtin class-name">help</span> <span class="token punctuation">[</span>command<span class="token punctuation">]</span> display <span class="token builtin class-name">help</span> <span class="token keyword">for</span> <span class="token builtin class-name">command</span></code></pre>
|
|
169
174
|
</figure>
|
|
170
175
|
```
|
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/doc",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"description": "Documentation support for the travetto framework",
|
|
3
|
+
"version": "3.0.0-rc.21",
|
|
4
|
+
"description": "Documentation support for the Travetto framework",
|
|
6
5
|
"keywords": [
|
|
7
6
|
"docs",
|
|
8
7
|
"travetto",
|
|
@@ -15,27 +14,34 @@
|
|
|
15
14
|
"name": "Travetto Framework"
|
|
16
15
|
},
|
|
17
16
|
"files": [
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
17
|
+
"__index__.ts",
|
|
18
|
+
"src",
|
|
19
|
+
"support"
|
|
21
20
|
],
|
|
22
|
-
"main": "
|
|
21
|
+
"main": "__index__.ts",
|
|
23
22
|
"repository": {
|
|
24
23
|
"url": "https://github.com/travetto/travetto.git",
|
|
25
24
|
"directory": "module/doc"
|
|
26
25
|
},
|
|
27
26
|
"dependencies": {
|
|
28
|
-
"@travetto/base": "^3.0.0-rc.
|
|
27
|
+
"@travetto/base": "^3.0.0-rc.21",
|
|
28
|
+
"@types/prismjs": "^1.26.0",
|
|
29
29
|
"prismjs": "^1.29.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@travetto/cli": "^3.0.0-rc.
|
|
32
|
+
"@travetto/cli": "^3.0.0-rc.24"
|
|
33
33
|
},
|
|
34
34
|
"peerDependenciesMeta": {
|
|
35
35
|
"@travetto/cli": {
|
|
36
36
|
"optional": true
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
|
+
"travetto": {
|
|
40
|
+
"profiles": [
|
|
41
|
+
"doc"
|
|
42
|
+
],
|
|
43
|
+
"displayName": "Documentation"
|
|
44
|
+
},
|
|
39
45
|
"private": false,
|
|
40
46
|
"publishConfig": {
|
|
41
47
|
"access": "public"
|
package/src/doc.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AllType, node } from './nodes';
|
|
2
2
|
|
|
3
|
-
export function doc(values: TemplateStringsArray, ...keys: (AllType |
|
|
3
|
+
export function doc(values: TemplateStringsArray, ...keys: (AllType | Function | string)[]): AllType {
|
|
4
4
|
const out: AllType[] = [];
|
|
5
5
|
|
|
6
6
|
keys.forEach((el, i) =>
|
|
@@ -8,7 +8,7 @@ export function doc(values: TemplateStringsArray, ...keys: (AllType | { ᚕfile:
|
|
|
8
8
|
node.Text(values[i] ?? ''),
|
|
9
9
|
typeof el === 'string' ?
|
|
10
10
|
node.Text(el) :
|
|
11
|
-
'
|
|
11
|
+
typeof el === 'function' ? node.Ref(el.name, el) : el
|
|
12
12
|
)
|
|
13
13
|
);
|
|
14
14
|
|
package/src/lib.ts
CHANGED
|
@@ -6,8 +6,18 @@ const { Library } = node;
|
|
|
6
6
|
export const lib = {
|
|
7
7
|
Travetto: Library('Travetto', 'https://travetto.dev'),
|
|
8
8
|
Typescript: Library('Typescript', 'https://typescriptlang.org'),
|
|
9
|
+
Javascript: Library('Javascript', 'https://developer.mozilla.org/en-US/docs/Web/JavaScript'),
|
|
9
10
|
Node: Library('Node', 'https://nodejs.org'),
|
|
10
11
|
TravettoPlugin: Library('VSCode plugin', 'https://marketplace.visualstudio.com/items?itemName=arcsine.travetto-plugin'),
|
|
12
|
+
Npm: Library('Npm', 'https://docs.npmjs.com/downloading-and-installing-node-js-and-npm'),
|
|
13
|
+
Yarn: Library('Yarn', 'https://yarnpg.com'),
|
|
14
|
+
Eslint: Library('ESLint', 'https://eslint.org/'),
|
|
15
|
+
Rollup: Library('Rollup', 'https://rollupjs.org/'),
|
|
16
|
+
|
|
17
|
+
// Module
|
|
18
|
+
CommonJS: Library('CommonJS', 'https://nodejs.org/api/modules.html'),
|
|
19
|
+
EcmascriptModule: Library('Ecmascript Module', 'https://nodejs.org/api/esm.html'),
|
|
20
|
+
PackageJson: Library('Package JSON', 'https://docs.npmjs.com/cli/v9/configuring-npm/package-json'),
|
|
11
21
|
|
|
12
22
|
// Download
|
|
13
23
|
NodeDownload: Library('Node', 'https://nodejs.org/en/download/current/'),
|
|
@@ -29,11 +39,14 @@ export const lib = {
|
|
|
29
39
|
JSDoc: Library('JSDoc', 'http://usejsdoc.org/about-getting-started.html'),
|
|
30
40
|
CodeLens: Library('CodeLens',
|
|
31
41
|
'https://code.visualstudio.com/api/language-extensions/programmatic-language-features#codelens-show-actionable-context-information-within-source-code'),
|
|
42
|
+
ORM: Library('Object Relationship Mapping', 'https://en.wikipedia.org/wiki/Object%E2%80%93relational_mapping'),
|
|
43
|
+
UUID: Library('UUID', 'https://en.wikipedia.org/wiki/Universally_unique_identifier'),
|
|
32
44
|
|
|
33
45
|
// Node
|
|
34
46
|
ChildProcess: Library('child_process', 'https://nodejs.org/api/child_process.html'),
|
|
35
47
|
AsyncHooks: Library('async_hooks', 'https://nodejs.org/api/async_hooks.html'),
|
|
36
48
|
Http: Library('http', 'https://nodejs.org/api/http.html'),
|
|
49
|
+
Path: Library('http', 'https://nodejs.org/api/path.html'),
|
|
37
50
|
Https: Library('https', 'https://nodejs.org/api/https.html'),
|
|
38
51
|
Console: Library('console', 'https://nodejs.org/api/console.html'),
|
|
39
52
|
Assert: Library('assert', 'https://nodejs.org/api/assert.html'),
|
|
@@ -49,11 +62,12 @@ export const lib = {
|
|
|
49
62
|
OpenAPIGenerator: Library('OpenAPI client generation tools', 'https://github.com/OpenAPITools/openapi-generator'),
|
|
50
63
|
Gaze: Library('gaze', 'https://github.com/shama/gaze'),
|
|
51
64
|
Chokidar: Library('chokidar', 'https://github.com/paulmillr/chokidar'),
|
|
52
|
-
Faker: Library('faker', 'https://github.com/
|
|
65
|
+
Faker: Library('faker', 'https://github.com/faker-js/faker'),
|
|
53
66
|
Yeoman: Library('yeoman', 'http://yeoman.io'),
|
|
54
67
|
Commander: Library('commander', 'https://www.npmjs.com/package/commander'),
|
|
55
68
|
Curl: Library('curl', 'https://curl.haxx.se/'),
|
|
56
69
|
Fetch: Library('fetch', 'https://www.npmjs.com/package/node-fetch'),
|
|
70
|
+
ParcelWatcher: Library('fetch', 'https://www.npmjs.com/package/@parcel/watcher'),
|
|
57
71
|
|
|
58
72
|
// JWT
|
|
59
73
|
JWT: Library('JWT', 'https://jwt.io/'),
|
|
@@ -83,7 +97,6 @@ export const lib = {
|
|
|
83
97
|
Firestore: Library('Firestore', 'https://firebase.google.com/docs/firestore'),
|
|
84
98
|
SQLite: Library('SQLite', 'https://www.sqlite.org/'),
|
|
85
99
|
|
|
86
|
-
|
|
87
100
|
// Rest
|
|
88
101
|
Express: Library('express', 'https://expressjs.com'),
|
|
89
102
|
Passport: Library('passport', 'http://passportjs.org'),
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
export const MOD_MAPPING = {
|
|
2
|
+
App: {
|
|
3
|
+
name:'@travetto/app', folder:'@travetto/app', displayName: 'Application',
|
|
4
|
+
description: 'Application registration/management and run support.'
|
|
5
|
+
},
|
|
6
|
+
Asset: {
|
|
7
|
+
name:'@travetto/asset', folder:'@travetto/asset', displayName: 'Asset',
|
|
8
|
+
description: 'Modular library for storing and retrieving binary assets'
|
|
9
|
+
},
|
|
10
|
+
AssetRest: {
|
|
11
|
+
name:'@travetto/asset-rest', folder:'@travetto/asset-rest', displayName: 'Asset Rest Support',
|
|
12
|
+
description: 'Provides integration between the travetto asset and rest module.'
|
|
13
|
+
},
|
|
14
|
+
Auth: {
|
|
15
|
+
name:'@travetto/auth', folder:'@travetto/auth', displayName: 'Authentication',
|
|
16
|
+
description: 'Authentication scaffolding for the Travetto framework'
|
|
17
|
+
},
|
|
18
|
+
AuthModel: {
|
|
19
|
+
name:'@travetto/auth-model', folder:'@travetto/auth-model', displayName: 'Authentication Model',
|
|
20
|
+
description: 'Authentication model support for the Travetto framework'
|
|
21
|
+
},
|
|
22
|
+
AuthRest: {
|
|
23
|
+
name:'@travetto/auth-rest', folder:'@travetto/auth-rest', displayName: 'Rest Auth',
|
|
24
|
+
description: 'Rest authentication integration support for the Travetto framework'
|
|
25
|
+
},
|
|
26
|
+
AuthRestContext: {
|
|
27
|
+
name:'@travetto/auth-rest-context', folder:'@travetto/auth-rest-context', displayName: 'Rest Auth Context',
|
|
28
|
+
description: 'Rest authentication context integration support for the Travetto framework'
|
|
29
|
+
},
|
|
30
|
+
AuthRestJwt: {
|
|
31
|
+
name:'@travetto/auth-rest-jwt', folder:'@travetto/auth-rest-jwt', displayName: 'Rest Auth JWT',
|
|
32
|
+
description: 'Rest authentication JWT integration support for the Travetto framework'
|
|
33
|
+
},
|
|
34
|
+
AuthRestPassport: {
|
|
35
|
+
name:'@travetto/auth-rest-passport', folder:'@travetto/auth-rest-passport', displayName: 'Rest Auth Passport',
|
|
36
|
+
description: 'Rest authentication integration support for the Travetto framework'
|
|
37
|
+
},
|
|
38
|
+
AuthRestSession: {
|
|
39
|
+
name:'@travetto/auth-rest-session', folder:'@travetto/auth-rest-session', displayName: 'Rest Auth Session',
|
|
40
|
+
description: 'Rest authentication session integration support for the Travetto framework'
|
|
41
|
+
},
|
|
42
|
+
Base: {
|
|
43
|
+
name:'@travetto/base', folder:'@travetto/base', displayName: 'Base',
|
|
44
|
+
description: 'Environment config and common utilities for travetto applications.'
|
|
45
|
+
},
|
|
46
|
+
Cache: {
|
|
47
|
+
name:'@travetto/cache', folder:'@travetto/cache', displayName: 'Caching',
|
|
48
|
+
description: 'Caching functionality with decorators for declarative use.'
|
|
49
|
+
},
|
|
50
|
+
Cli: {
|
|
51
|
+
name:'@travetto/cli', folder:'@travetto/cli', displayName: 'Command Line Interface',
|
|
52
|
+
description: 'CLI infrastructure for Travetto framework'
|
|
53
|
+
},
|
|
54
|
+
Command: {
|
|
55
|
+
name:'@travetto/command', folder:'@travetto/command', displayName: 'Command',
|
|
56
|
+
description: 'Support for executing complex commands at runtime.'
|
|
57
|
+
},
|
|
58
|
+
Compiler: {
|
|
59
|
+
name:'@travetto/compiler', folder:'@travetto/compiler', displayName: 'Compiler',
|
|
60
|
+
description: 'The compiler infrastructure for the Travetto framework'
|
|
61
|
+
},
|
|
62
|
+
Config: {
|
|
63
|
+
name:'@travetto/config', folder:'@travetto/config', displayName: 'Configuration',
|
|
64
|
+
description: 'Configuration support'
|
|
65
|
+
},
|
|
66
|
+
Context: {
|
|
67
|
+
name:'@travetto/context', folder:'@travetto/context', displayName: 'Async Context',
|
|
68
|
+
description: 'Async-aware state management, maintaining context across asynchronous calls.'
|
|
69
|
+
},
|
|
70
|
+
Di: {
|
|
71
|
+
name:'@travetto/di', folder:'@travetto/di', displayName: 'Dependency Injection',
|
|
72
|
+
description: 'Dependency registration/management and injection support.'
|
|
73
|
+
},
|
|
74
|
+
Doc: {
|
|
75
|
+
name:'@travetto/doc', folder:'@travetto/doc', displayName: 'Documentation',
|
|
76
|
+
description: 'Documentation support for the Travetto framework'
|
|
77
|
+
},
|
|
78
|
+
Email: {
|
|
79
|
+
name:'@travetto/email', folder:'@travetto/email', displayName: 'Email',
|
|
80
|
+
description: 'Email transmission module.'
|
|
81
|
+
},
|
|
82
|
+
EmailNodemailer: {
|
|
83
|
+
name:'@travetto/email-nodemailer', folder:'@travetto/email-nodemailer', displayName: 'Email Nodemailer Support',
|
|
84
|
+
description: 'Email transmission module.'
|
|
85
|
+
},
|
|
86
|
+
EmailTemplate: {
|
|
87
|
+
name:'@travetto/email-template', folder:'@travetto/email-template', displayName: 'Email Templating',
|
|
88
|
+
description: 'Email templating module'
|
|
89
|
+
},
|
|
90
|
+
Eslint: {
|
|
91
|
+
name:'@travetto/eslint', folder:'@travetto/eslint', displayName: 'ES Linting Rules',
|
|
92
|
+
description: 'ES Linting Rules'
|
|
93
|
+
},
|
|
94
|
+
Image: {
|
|
95
|
+
name:'@travetto/image', folder:'@travetto/image', displayName: 'Image',
|
|
96
|
+
description: 'Image support, resizing, and optimization'
|
|
97
|
+
},
|
|
98
|
+
Jwt: {
|
|
99
|
+
name:'@travetto/jwt', folder:'@travetto/jwt', displayName: 'JWT',
|
|
100
|
+
description: 'JSON Web Token implementation'
|
|
101
|
+
},
|
|
102
|
+
Log: {
|
|
103
|
+
name:'@travetto/log', folder:'@travetto/log', displayName: 'Logging',
|
|
104
|
+
description: 'Logging framework that integrates at the console.log level.'
|
|
105
|
+
},
|
|
106
|
+
Manifest: {
|
|
107
|
+
name:'@travetto/manifest', folder:'@travetto/manifest', displayName: 'Manifest',
|
|
108
|
+
description: 'Support for project indexing, manifesting, along with file watching'
|
|
109
|
+
},
|
|
110
|
+
Model: {
|
|
111
|
+
name:'@travetto/model', folder:'@travetto/model', displayName: 'Data Modeling Support',
|
|
112
|
+
description: 'Datastore abstraction for core operations.'
|
|
113
|
+
},
|
|
114
|
+
ModelDynamodb: {
|
|
115
|
+
name:'@travetto/model-dynamodb', folder:'@travetto/model-dynamodb', displayName: 'DynamoDB Model Support',
|
|
116
|
+
description: 'DynamoDB backing for the travetto model module.'
|
|
117
|
+
},
|
|
118
|
+
ModelElasticsearch: {
|
|
119
|
+
name:'@travetto/model-elasticsearch', folder:'@travetto/model-elasticsearch', displayName: 'Elasticsearch Model Source',
|
|
120
|
+
description: 'Elasticsearch backing for the travetto model module, with real-time modeling support for Elasticsearch mappings.'
|
|
121
|
+
},
|
|
122
|
+
ModelFirestore: {
|
|
123
|
+
name:'@travetto/model-firestore', folder:'@travetto/model-firestore', displayName: 'Firestore Model Support',
|
|
124
|
+
description: 'Firestore backing for the travetto model module.'
|
|
125
|
+
},
|
|
126
|
+
ModelMongo: {
|
|
127
|
+
name:'@travetto/model-mongo', folder:'@travetto/model-mongo', displayName: 'MongoDB Model Support',
|
|
128
|
+
description: 'Mongo backing for the travetto model module.'
|
|
129
|
+
},
|
|
130
|
+
ModelMysql: {
|
|
131
|
+
name:'@travetto/model-mysql', folder:'@travetto/model-mysql', displayName: 'MySQL Model Service',
|
|
132
|
+
description: 'MySQL backing for the travetto model module, with real-time modeling support for SQL schemas.'
|
|
133
|
+
},
|
|
134
|
+
ModelPostgres: {
|
|
135
|
+
name:'@travetto/model-postgres', folder:'@travetto/model-postgres', displayName: 'PostgreSQL Model Service',
|
|
136
|
+
description: 'PostgreSQL backing for the travetto model module, with real-time modeling support for SQL schemas.'
|
|
137
|
+
},
|
|
138
|
+
ModelQuery: {
|
|
139
|
+
name:'@travetto/model-query', folder:'@travetto/model-query', displayName: 'Data Model Querying',
|
|
140
|
+
description: 'Datastore abstraction for advanced query support.'
|
|
141
|
+
},
|
|
142
|
+
ModelRedis: {
|
|
143
|
+
name:'@travetto/model-redis', folder:'@travetto/model-redis', displayName: 'Redis Model Support',
|
|
144
|
+
description: 'Redis backing for the travetto model module.'
|
|
145
|
+
},
|
|
146
|
+
ModelS3: {
|
|
147
|
+
name:'@travetto/model-s3', folder:'@travetto/model-s3', displayName: 'S3 Model Support',
|
|
148
|
+
description: 'S3 backing for the travetto model module.'
|
|
149
|
+
},
|
|
150
|
+
ModelSql: {
|
|
151
|
+
name:'@travetto/model-sql', folder:'@travetto/model-sql', displayName: 'SQL Model Service',
|
|
152
|
+
description: 'SQL backing for the travetto model module, with real-time modeling support for SQL schemas.'
|
|
153
|
+
},
|
|
154
|
+
ModelSqlite: {
|
|
155
|
+
name:'@travetto/model-sqlite', folder:'@travetto/model-sqlite', displayName: 'SQLite Model Service',
|
|
156
|
+
description: 'SQLite backing for the travetto model module, with real-time modeling support for SQL schemas.'
|
|
157
|
+
},
|
|
158
|
+
Openapi: {
|
|
159
|
+
name:'@travetto/openapi', folder:'@travetto/openapi', displayName: 'OpenAPI Specification',
|
|
160
|
+
description: 'OpenAPI integration support for the Travetto framework'
|
|
161
|
+
},
|
|
162
|
+
Overview: {
|
|
163
|
+
name:'@travetto/overview', folder:'@travetto/overview', displayName: 'Overview Docs',
|
|
164
|
+
description: 'Documentation overview'
|
|
165
|
+
},
|
|
166
|
+
Pack: {
|
|
167
|
+
name:'@travetto/pack', folder:'@travetto/pack', displayName: 'Pack',
|
|
168
|
+
description: 'Code packing utilities'
|
|
169
|
+
},
|
|
170
|
+
Registry: {
|
|
171
|
+
name:'@travetto/registry', folder:'@travetto/registry', displayName: 'Registry',
|
|
172
|
+
description: 'Patterns and utilities for handling registration of metadata and functionality for run-time use'
|
|
173
|
+
},
|
|
174
|
+
Repo: {
|
|
175
|
+
name:'@travetto/repo', folder:'@travetto/repo', displayName: 'Repo',
|
|
176
|
+
description: 'Monorepo utilities'
|
|
177
|
+
},
|
|
178
|
+
Rest: {
|
|
179
|
+
name:'@travetto/rest', folder:'@travetto/rest', displayName: 'RESTful API',
|
|
180
|
+
description: 'Declarative api for RESTful APIs with support for the dependency injection module.'
|
|
181
|
+
},
|
|
182
|
+
RestAwsLambda: {
|
|
183
|
+
name:'@travetto/rest-aws-lambda', folder:'@travetto/rest-aws-lambda', displayName: 'RESTful AWS Lambda',
|
|
184
|
+
description: 'RESTful APIs entry point support for AWS Lambdas.'
|
|
185
|
+
},
|
|
186
|
+
RestExpress: {
|
|
187
|
+
name:'@travetto/rest-express', folder:'@travetto/rest-express', displayName: 'Express REST Source',
|
|
188
|
+
description: 'Express provider for the travetto rest module.'
|
|
189
|
+
},
|
|
190
|
+
RestExpressLambda: {
|
|
191
|
+
name:'@travetto/rest-express-lambda', folder:'@travetto/rest-express-lambda', displayName: 'Express REST AWS Lambda Source',
|
|
192
|
+
description: 'Express AWS Lambda provider for the travetto rest module.'
|
|
193
|
+
},
|
|
194
|
+
RestFastify: {
|
|
195
|
+
name:'@travetto/rest-fastify', folder:'@travetto/rest-fastify', displayName: 'Fastify REST Source',
|
|
196
|
+
description: 'Fastify provider for the travetto rest module.'
|
|
197
|
+
},
|
|
198
|
+
RestFastifyLambda: {
|
|
199
|
+
name:'@travetto/rest-fastify-lambda', folder:'@travetto/rest-fastify-lambda', displayName: 'Fastify REST AWS Lambda Source',
|
|
200
|
+
description: 'Fastify AWS Lambda provider for the travetto rest module.'
|
|
201
|
+
},
|
|
202
|
+
RestKoa: {
|
|
203
|
+
name:'@travetto/rest-koa', folder:'@travetto/rest-koa', displayName: 'Koa REST Source',
|
|
204
|
+
description: 'Koa provider for the travetto rest module.'
|
|
205
|
+
},
|
|
206
|
+
RestKoaLambda: {
|
|
207
|
+
name:'@travetto/rest-koa-lambda', folder:'@travetto/rest-koa-lambda', displayName: 'Koa REST AWS Lambda Source',
|
|
208
|
+
description: 'Koa provider for the travetto rest module.'
|
|
209
|
+
},
|
|
210
|
+
RestModel: {
|
|
211
|
+
name:'@travetto/rest-model', folder:'@travetto/rest-model', displayName: 'RESTful Model Routes',
|
|
212
|
+
description: 'RESTful support for generating APIs from Model classes.'
|
|
213
|
+
},
|
|
214
|
+
RestModelQuery: {
|
|
215
|
+
name:'@travetto/rest-model-query', folder:'@travetto/rest-model-query', displayName: 'RESTful Model Query Routes',
|
|
216
|
+
description: 'RESTful support for generating query APIs from Model classes.'
|
|
217
|
+
},
|
|
218
|
+
RestSession: {
|
|
219
|
+
name:'@travetto/rest-session', folder:'@travetto/rest-session', displayName: 'REST Session',
|
|
220
|
+
description: 'Session provider for the travetto rest module.'
|
|
221
|
+
},
|
|
222
|
+
Scaffold: {
|
|
223
|
+
name:'@travetto/scaffold', folder:'@travetto/scaffold', displayName: 'App Scaffold',
|
|
224
|
+
description: 'App Scaffold for the Travetto framework'
|
|
225
|
+
},
|
|
226
|
+
Schema: {
|
|
227
|
+
name:'@travetto/schema', folder:'@travetto/schema', displayName: 'Schema',
|
|
228
|
+
description: 'Data type registry for runtime validation, reflection and binding.'
|
|
229
|
+
},
|
|
230
|
+
SchemaFaker: {
|
|
231
|
+
name:'@travetto/schema-faker', folder:'@travetto/schema-faker', displayName: 'Schema Faker',
|
|
232
|
+
description: 'Data generation for schema-registered objects.'
|
|
233
|
+
},
|
|
234
|
+
Terminal: {
|
|
235
|
+
name:'@travetto/terminal', folder:'@travetto/terminal', displayName: 'Terminal',
|
|
236
|
+
description: 'General terminal support'
|
|
237
|
+
},
|
|
238
|
+
Test: {
|
|
239
|
+
name:'@travetto/test', folder:'@travetto/test', displayName: 'Testing',
|
|
240
|
+
description: 'Declarative test framework'
|
|
241
|
+
},
|
|
242
|
+
TodoApp: {
|
|
243
|
+
name:'@travetto/todo-app', folder:'@travetto/todo-app', displayName: 'Todo Application',
|
|
244
|
+
description: ''
|
|
245
|
+
},
|
|
246
|
+
Transformer: {
|
|
247
|
+
name:'@travetto/transformer', folder:'@travetto/transformer', displayName: 'Transformation',
|
|
248
|
+
description: 'Functionality for AST transformations, with transformer registration, and general utils'
|
|
249
|
+
},
|
|
250
|
+
Worker: {
|
|
251
|
+
name:'@travetto/worker', folder:'@travetto/worker', displayName: 'Worker',
|
|
252
|
+
description: 'Process management utilities, with a focus on inter-process communication'
|
|
253
|
+
},
|
|
254
|
+
Yaml: {
|
|
255
|
+
name:'@travetto/yaml', folder:'@travetto/yaml', displayName: 'YAML',
|
|
256
|
+
description: 'Simple YAML support, provides only clean subset of yaml'
|
|
257
|
+
}
|
|
258
|
+
};
|
package/src/mod.ts
CHANGED
|
@@ -1,73 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TypedObject } from '@travetto/base';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Asset: '@travetto/asset',
|
|
6
|
-
AssetRest: '@travetto/asset-rest',
|
|
7
|
-
Auth: '@travetto/auth',
|
|
8
|
-
AuthRest: '@travetto/auth-rest',
|
|
9
|
-
AuthRestContext: '@travetto/auth-rest-context',
|
|
10
|
-
AuthRestJwt: '@travetto/auth-rest-jwt',
|
|
11
|
-
AuthRestSession: '@travetto/auth-rest-session',
|
|
12
|
-
AuthRestPassport: '@travetto/auth-rest-passport',
|
|
13
|
-
Base: '@travetto/base',
|
|
14
|
-
Boot: '@travetto/boot',
|
|
15
|
-
Cache: '@travetto/cache',
|
|
16
|
-
Cli: '@travetto/cli',
|
|
17
|
-
Command: '@travetto/command',
|
|
18
|
-
Compiler: '@travetto/compiler',
|
|
19
|
-
Config: '@travetto/config',
|
|
20
|
-
Context: '@travetto/context',
|
|
21
|
-
Di: '@travetto/di',
|
|
22
|
-
Doc: '@travetto/doc',
|
|
23
|
-
Email: '@travetto/email',
|
|
24
|
-
EmailNodemailer: '@travetto/email-nodemailer',
|
|
25
|
-
EmailTemplate: '@travetto/email-template',
|
|
26
|
-
Image: '@travetto/image',
|
|
27
|
-
Jwt: '@travetto/jwt',
|
|
28
|
-
Log: '@travetto/log',
|
|
29
|
-
Model: '@travetto/model',
|
|
30
|
-
ModelDynamodb: '@travetto/model-dynamodb',
|
|
31
|
-
ModelElasticsearch: '@travetto/model-elasticsearch',
|
|
32
|
-
ModelFirestore: '@travetto/model-firestore',
|
|
33
|
-
ModelMongo: '@travetto/model-mongo',
|
|
34
|
-
ModelQuery: '@travetto/model-query',
|
|
35
|
-
ModelRedis: '@travetto/model-redis',
|
|
36
|
-
ModelS3: '@travetto/model-s3',
|
|
37
|
-
ModelSQLite: '@travetto/model-sqlite',
|
|
38
|
-
ModelPostgres: '@travetto/model-postgres',
|
|
39
|
-
ModelMysql: '@travetto/model-mysql',
|
|
40
|
-
ModelSql: '@travetto/model-sql',
|
|
41
|
-
Openapi: '@travetto/openapi',
|
|
42
|
-
Pack: '@travetto/pack',
|
|
43
|
-
Registry: '@travetto/registry',
|
|
44
|
-
Rest: '@travetto/rest',
|
|
45
|
-
RestAwsLambda: '@travetto/rest-aws-lambda',
|
|
46
|
-
RestExpress: '@travetto/rest-express',
|
|
47
|
-
RestExpressLambda: '@travetto/rest-express-lambda',
|
|
48
|
-
RestFastify: '@travetto/rest-fastify',
|
|
49
|
-
RestFastifyLambda: '@travetto/rest-fastify-lambda',
|
|
50
|
-
RestKoa: '@travetto/rest-koa',
|
|
51
|
-
RestKoaLambda: '@travetto/rest-koa-lambda',
|
|
52
|
-
RestModel: '@travetto/rest-model',
|
|
53
|
-
RestModelQuery: '@travetto/rest-model-query',
|
|
54
|
-
RestSession: '@travetto/rest-session',
|
|
55
|
-
Scaffold: '@travetto/scaffold',
|
|
56
|
-
Schema: '@travetto/schema',
|
|
57
|
-
SchemaFaker: '@travetto/schema-faker',
|
|
58
|
-
Test: '@travetto/test',
|
|
59
|
-
Transformer: '@travetto/transformer',
|
|
60
|
-
Watch: '@travetto/watch',
|
|
61
|
-
Worker: '@travetto/worker',
|
|
62
|
-
Yaml: '@travetto/yaml'
|
|
63
|
-
};
|
|
3
|
+
import { node } from './nodes';
|
|
4
|
+
import { MOD_MAPPING } from './mod-mapping';
|
|
64
5
|
|
|
65
|
-
export const mod =
|
|
66
|
-
|
|
67
|
-
{} as Record<keyof typeof MAPPING, AllTypeMap['Mod']>,
|
|
68
|
-
{
|
|
69
|
-
get(tgt, p: keyof typeof MAPPING): AllTypeMap['Mod'] {
|
|
70
|
-
return node.Mod(MAPPING[p]);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
6
|
+
export const mod = TypedObject.fromEntries(
|
|
7
|
+
TypedObject.entries(MOD_MAPPING).map(([k, v]) => [k, node.Mod(v.name, v)])
|
|
73
8
|
);
|