@servable/tools 1.0.1

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.
Files changed (155) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +33 -0
  3. package/package.json +106 -0
  4. package/src/config/candidates/featureCandidates/index.js +48 -0
  5. package/src/config/candidates/index.js +18 -0
  6. package/src/config/index.js +2 -0
  7. package/src/config/validate/feature/index.js +7 -0
  8. package/src/config/validate/index.js +5 -0
  9. package/src/document/1.0.0/all/build/class/index.js +67 -0
  10. package/src/document/1.0.0/all/build/feature/index.js +135 -0
  11. package/src/document/1.0.0/all/index.js +17 -0
  12. package/src/document/1.0.0/all/write/class/index.js +25 -0
  13. package/src/document/1.0.0/all/write/feature/index.js +43 -0
  14. package/src/document/1.0.0/all/write/index.js +10 -0
  15. package/src/document/1.0.0/all/write/utils/chunk.js +19 -0
  16. package/src/document/1.0.0/chunks/build/class/class.js +20 -0
  17. package/src/document/1.0.0/chunks/build/class/functions.js +21 -0
  18. package/src/document/1.0.0/chunks/build/class/lib.js +21 -0
  19. package/src/document/1.0.0/chunks/build/class/seed.js +21 -0
  20. package/src/document/1.0.0/chunks/build/class/triggers.js +26 -0
  21. package/src/document/1.0.0/chunks/build/feature/afterInit.js +20 -0
  22. package/src/document/1.0.0/chunks/build/feature/beforeInit.js +20 -0
  23. package/src/document/1.0.0/chunks/build/feature/class.js +42 -0
  24. package/src/document/1.0.0/chunks/build/feature/config.js +20 -0
  25. package/src/document/1.0.0/chunks/build/feature/functions.js +20 -0
  26. package/src/document/1.0.0/chunks/build/feature/lib.js +21 -0
  27. package/src/document/1.0.0/chunks/build/feature/liveClasses.js +20 -0
  28. package/src/document/1.0.0/chunks/build/feature/schema.js +206 -0
  29. package/src/document/1.0.0/chunks/build/feature/seed.js +20 -0
  30. package/src/document/1.0.0/chunks/build/feature/system.js +20 -0
  31. package/src/document/1.0.0/chunks/build/feature/triggers.js +20 -0
  32. package/src/document/1.0.0/generateGithubReadme/build/chunks/_generateBadge.js +4 -0
  33. package/src/document/1.0.0/generateGithubReadme/build/chunks/_githubPackage.js +4 -0
  34. package/src/document/1.0.0/generateGithubReadme/build/chunks/adapters.js +40 -0
  35. package/src/document/1.0.0/generateGithubReadme/build/chunks/apis.js +39 -0
  36. package/src/document/1.0.0/generateGithubReadme/build/chunks/categories.js +32 -0
  37. package/src/document/1.0.0/generateGithubReadme/build/chunks/dependencies/build.js +29 -0
  38. package/src/document/1.0.0/generateGithubReadme/build/chunks/dependencies/index.js +40 -0
  39. package/src/document/1.0.0/generateGithubReadme/build/chunks/footer.js +33 -0
  40. package/src/document/1.0.0/generateGithubReadme/build/chunks/githubTags.js +42 -0
  41. package/src/document/1.0.0/generateGithubReadme/build/chunks/install.js +29 -0
  42. package/src/document/1.0.0/generateGithubReadme/build/chunks/packages.js +26 -0
  43. package/src/document/1.0.0/generateGithubReadme/build/chunks/registry.js +42 -0
  44. package/src/document/1.0.0/generateGithubReadme/build/chunks/usage.js +68 -0
  45. package/src/document/1.0.0/generateGithubReadme/build/index.js +224 -0
  46. package/src/document/1.0.0/generateGithubReadme/index.js +28 -0
  47. package/src/document/1.1.0/all/build/class/index.js +67 -0
  48. package/src/document/1.1.0/all/build/feature/index.js +135 -0
  49. package/src/document/1.1.0/all/index.js +17 -0
  50. package/src/document/1.1.0/all/write/class/index.js +25 -0
  51. package/src/document/1.1.0/all/write/feature/index.js +43 -0
  52. package/src/document/1.1.0/all/write/index.js +10 -0
  53. package/src/document/1.1.0/all/write/utils/chunk.js +19 -0
  54. package/src/document/1.1.0/chunks/build/class/class.js +20 -0
  55. package/src/document/1.1.0/chunks/build/class/functions.js +21 -0
  56. package/src/document/1.1.0/chunks/build/class/lib.js +21 -0
  57. package/src/document/1.1.0/chunks/build/class/seed.js +21 -0
  58. package/src/document/1.1.0/chunks/build/class/triggers.js +26 -0
  59. package/src/document/1.1.0/chunks/build/feature/afterInit.js +20 -0
  60. package/src/document/1.1.0/chunks/build/feature/beforeInit.js +20 -0
  61. package/src/document/1.1.0/chunks/build/feature/class.js +42 -0
  62. package/src/document/1.1.0/chunks/build/feature/config.js +20 -0
  63. package/src/document/1.1.0/chunks/build/feature/functions.js +20 -0
  64. package/src/document/1.1.0/chunks/build/feature/lib.js +21 -0
  65. package/src/document/1.1.0/chunks/build/feature/liveClasses.js +20 -0
  66. package/src/document/1.1.0/chunks/build/feature/schema.js +206 -0
  67. package/src/document/1.1.0/chunks/build/feature/seed.js +20 -0
  68. package/src/document/1.1.0/chunks/build/feature/system.js +20 -0
  69. package/src/document/1.1.0/chunks/build/feature/triggers.js +20 -0
  70. package/src/document/1.1.0/generateGithubReadme/build/chunks/_generateBadge.js +4 -0
  71. package/src/document/1.1.0/generateGithubReadme/build/chunks/_githubPackage.js +4 -0
  72. package/src/document/1.1.0/generateGithubReadme/build/chunks/adapters.js +40 -0
  73. package/src/document/1.1.0/generateGithubReadme/build/chunks/apis.js +39 -0
  74. package/src/document/1.1.0/generateGithubReadme/build/chunks/categories.js +32 -0
  75. package/src/document/1.1.0/generateGithubReadme/build/chunks/dependencies/build.js +29 -0
  76. package/src/document/1.1.0/generateGithubReadme/build/chunks/dependencies/index.js +40 -0
  77. package/src/document/1.1.0/generateGithubReadme/build/chunks/footer.js +33 -0
  78. package/src/document/1.1.0/generateGithubReadme/build/chunks/githubTags.js +42 -0
  79. package/src/document/1.1.0/generateGithubReadme/build/chunks/install.js +29 -0
  80. package/src/document/1.1.0/generateGithubReadme/build/chunks/packages.js +26 -0
  81. package/src/document/1.1.0/generateGithubReadme/build/chunks/registry.js +42 -0
  82. package/src/document/1.1.0/generateGithubReadme/build/chunks/usage.js +68 -0
  83. package/src/document/1.1.0/generateGithubReadme/build/index.js +224 -0
  84. package/src/document/1.1.0/generateGithubReadme/index.js +28 -0
  85. package/src/document/gateway/all/index.js +23 -0
  86. package/src/document/gateway/generateGithubReadme/index.js +24 -0
  87. package/src/domain/feature/factory/absoluteModuleSrcPath.js +10 -0
  88. package/src/domain/feature/factory/featurePath.js +41 -0
  89. package/src/domain/feature/factory/index.js +71 -0
  90. package/src/domain/feature/index.js +117 -0
  91. package/src/domain/feature/lib/instancesPathIdUniqueId.js +17 -0
  92. package/src/domain/featureInstance/factory/getLoaderWithPayload.js +7 -0
  93. package/src/domain/featureInstance/factory/index.js +65 -0
  94. package/src/domain/featureInstance/factory/instancesWithPath.js +12 -0
  95. package/src/domain/featureInstance/index.js +199 -0
  96. package/src/domain/featureLoader/base.js +100 -0
  97. package/src/domain/featureLoader/factory/getModule.js +40 -0
  98. package/src/domain/featureLoader/factory/index.js +9 -0
  99. package/src/domain/featureLoader/lib/importJSDefault.js +12 -0
  100. package/src/domain/featureLoader/lib/importJSONDefault.js +14 -0
  101. package/src/domain/featureLoader/lib/mergeClassFeatures.js +17 -0
  102. package/src/domain/featureLoader/lib/triggerItems.js +8 -0
  103. package/src/domain/featureLoader/v1.0.0.js +861 -0
  104. package/src/domain/featureLoader/v1.1.0.js +871 -0
  105. package/src/domain/lib/checkFileExists.js +6 -0
  106. package/src/domain/servable/index.js +19 -0
  107. package/src/domain/servable/parse/index.js +5 -0
  108. package/src/domain/servable/parse/utils/index.js +216 -0
  109. package/src/index.js +29 -0
  110. package/src/lib/adaptConfig/basic.js +85 -0
  111. package/src/lib/adaptFeaturePayload.js +18 -0
  112. package/src/lib/checkFileExists.js +6 -0
  113. package/src/lib/cleanFeatures.js +25 -0
  114. package/src/lib/directories.js +49 -0
  115. package/src/lib/directoryFilesRecursive.js +83 -0
  116. package/src/lib/directoryGlob.js +14 -0
  117. package/src/lib/ensureDirectoryExists.js +14 -0
  118. package/src/lib/featureApiVersion.js +30 -0
  119. package/src/lib/foldersInFolder.js +46 -0
  120. package/src/lib/getModuleDir.js +19 -0
  121. package/src/lib/importFileAsText.js +15 -0
  122. package/src/lib/importJSONAsync.js +16 -0
  123. package/src/lib/sanitizePath.js +4 -0
  124. package/src/manifest/access/accessChildInTreeWithRoute.js +49 -0
  125. package/src/manifest/access/index.js +58 -0
  126. package/src/manifest/data/1.0.0/class.json +233 -0
  127. package/src/manifest/data/1.0.0/enums.js +255 -0
  128. package/src/manifest/data/1.0.0/feature.json +503 -0
  129. package/src/manifest/data/1.0.0/schema.json +145 -0
  130. package/src/manifest/data/1.1.0/class.json +233 -0
  131. package/src/manifest/data/1.1.0/enums.js +267 -0
  132. package/src/manifest/data/1.1.0/feature.json +542 -0
  133. package/src/manifest/data/1.1.0/schema.json +145 -0
  134. package/src/manifest/extract/extractAst.js +36 -0
  135. package/src/manifest/extract/extractItem.js +70 -0
  136. package/src/manifest/extract/formatFile.js +22 -0
  137. package/src/manifest/extract/index.js +23 -0
  138. package/src/manifest/extract/route/extractFileWithVariants.js +38 -0
  139. package/src/manifest/extract/route/extractFiles.js +87 -0
  140. package/src/manifest/extract/route/imageToBase64.js +42 -0
  141. package/src/manifest/extract/route/index.js +102 -0
  142. package/src/manifest/extract/templateDataForId.js +44 -0
  143. package/src/schema/build/buildFeature/classStruct/extractFeaturesFeatures.js +29 -0
  144. package/src/schema/build/buildFeature/classStruct/featureInClassClassSchema.js +36 -0
  145. package/src/schema/build/buildFeature/classStruct/index.js +62 -0
  146. package/src/schema/build/buildFeature/classStruct/preserveMostRestricted.js +68 -0
  147. package/src/schema/build/buildFeature/extractClassesFeature.js +49 -0
  148. package/src/schema/build/buildFeature/index.js +119 -0
  149. package/src/schema/build/index.js +54 -0
  150. package/src/schema/build/lib/getFeaturesLiveClasses.js +14 -0
  151. package/src/schema/build/lib/updateFeaturesExcerpt.js +24 -0
  152. package/src/schema/index.js +57 -0
  153. package/src/schema/validate/handleFeature/computeVersions.js +48 -0
  154. package/src/schema/validate/handleFeature/index.js +5 -0
  155. package/src/schema/validate/index.js +52 -0
@@ -0,0 +1,26 @@
1
+ import { FeatureEnum, DataTemplateType } from "../../../../../manifest/data/1.0.0/enums.js"
2
+ import access from '../../../../../manifest/access/index.js'
3
+
4
+ export default async props => {
5
+ const { path, extraction } = props
6
+ const payload = []
7
+
8
+ const target = await access({
9
+ item: FeatureEnum.Triggers,
10
+ type: DataTemplateType.Class,
11
+ path,
12
+ extraction
13
+ })
14
+ if (target && target.data) {
15
+ const { astAdapted } = target.data
16
+ if (astAdapted) {
17
+ }
18
+ }
19
+
20
+ return {
21
+ payload,
22
+ name: 'Triggers',
23
+ id: 'triggers',
24
+ auxiliary: (target && target.data) ? target.data.documentation : null
25
+ }
26
+ }
@@ -0,0 +1,20 @@
1
+ import { FeatureEnum } from "../../../../../manifest/data/1.0.0/enums.js"
2
+ import access from '../../../../../manifest/access/index.js'
3
+
4
+ export default async props => {
5
+ const { path, extraction } = props
6
+ const payload = []
7
+
8
+ const target = await access({
9
+ item: FeatureEnum.AfterInit,
10
+ path,
11
+ extraction
12
+ })
13
+ if (target && target.data) {
14
+ const { astAdapted } = target.data
15
+ if (astAdapted) {
16
+ }
17
+ }
18
+
19
+ return { payload, name: 'After init', id: 'afterInit', auxiliary: (target && target.data) ? target.data.documentation : null }
20
+ }
@@ -0,0 +1,20 @@
1
+ import { FeatureEnum } from "../../../../../manifest/data/1.0.0/enums.js"
2
+ import access from '../../../../../manifest/access/index.js'
3
+
4
+ export default async props => {
5
+ const { path, extraction } = props
6
+ const payload = []
7
+
8
+ const target = await access({
9
+ item: FeatureEnum.BeforeInit,
10
+ path,
11
+ extraction
12
+ })
13
+ if (target && target.data) {
14
+ const { astAdapted } = target.data
15
+ if (astAdapted) {
16
+ }
17
+ }
18
+
19
+ return { payload, name: 'Before init', id: 'beforeInit', auxiliary: (target && target.data) ? target.data.documentation : null }
20
+ }
@@ -0,0 +1,42 @@
1
+ import { FeatureEnum } from "../../../../../manifest/data/1.0.0/enums.js"
2
+ import access from '../../../../../manifest/access/index.js'
3
+
4
+ export default async props => {
5
+ const { path, extraction } = props
6
+ const payload = []
7
+
8
+ const target = await access({
9
+ item: FeatureEnum.Class.Index,
10
+ path,
11
+ extraction
12
+ })
13
+ if (target && target.data) {
14
+ const { astAdapted } = target.data
15
+ if (astAdapted) {
16
+ const { description, params = [], } = astAdapted
17
+ const rows = []
18
+
19
+ payload.push({
20
+ p: description
21
+ })
22
+ params.forEach(param => {
23
+ const { title, name, description: paramDescription, type } = param
24
+ rows.push([name ? name : "", description ? description : "", type.name ? type.name : ""])
25
+ })
26
+ if (rows && rows.length) {
27
+ payload.push({
28
+ table: {
29
+ headers: ["Name", "Description", "Type"],
30
+ rows
31
+ }
32
+ })
33
+ }
34
+ }
35
+ }
36
+
37
+ return {
38
+ payload, name: 'Feature class',
39
+ id: 'class',
40
+ auxiliary: (target && target.data) ? target.data.documentation : null
41
+ }
42
+ }
@@ -0,0 +1,20 @@
1
+ import { FeatureEnum } from "../../../../../manifest/data/1.0.0/enums.js"
2
+ import access from '../../../../../manifest/access/index.js'
3
+
4
+ export default async props => {
5
+ const { path, extraction } = props
6
+ const payload = []
7
+
8
+ const target = await access({
9
+ item: FeatureEnum.Config,
10
+ path,
11
+ extraction
12
+ })
13
+ if (target && target.data) {
14
+ const { astAdapted } = target.data
15
+ if (astAdapted) {
16
+ }
17
+ }
18
+
19
+ return { payload, name: 'Config', id: 'config', auxiliary: (target && target.data) ? target.data.documentation : null }
20
+ }
@@ -0,0 +1,20 @@
1
+ import { FeatureEnum } from "../../../../../manifest/data/1.0.0/enums.js"
2
+ import access from '../../../../../manifest/access/index.js'
3
+
4
+ export default async props => {
5
+ const { path, extraction } = props
6
+ const payload = []
7
+
8
+ const target = await access({
9
+ item: FeatureEnum.Functions,
10
+ path,
11
+ extraction
12
+ })
13
+ if (target && target.data) {
14
+ const { astAdapted } = target.data
15
+ if (astAdapted) {
16
+ }
17
+ }
18
+
19
+ return { payload, name: 'Functions', id: 'functions', auxiliary: (target && target.data) ? target.data.documentation : null }
20
+ }
@@ -0,0 +1,21 @@
1
+ import { FeatureEnum } from "../../../../../manifest/data/1.0.0/enums.js"
2
+ import access from '../../../../../manifest/access/index.js'
3
+
4
+ export default async props => {
5
+ const { path, extraction } = props
6
+ const payload = []
7
+
8
+ const target = await access({
9
+ item: FeatureEnum.Lib,
10
+ path,
11
+ extraction
12
+ })
13
+ if (target && target.data) {
14
+ const { astAdapted } = target.data
15
+ if (astAdapted) {
16
+ }
17
+ }
18
+
19
+ return { payload, name: 'Lib', id: 'lib', auxiliary: (target && target.data) ? target.data.documentation : null }
20
+
21
+ }
@@ -0,0 +1,20 @@
1
+ import { FeatureEnum } from "../../../../../manifest/data/1.0.0/enums.js"
2
+ import access from '../../../../../manifest/access/index.js'
3
+
4
+ export default async props => {
5
+ const { path, extraction } = props
6
+ const payload = []
7
+
8
+ const target = await access({
9
+ item: FeatureEnum.LiveClasses,
10
+ path,
11
+ extraction
12
+ })
13
+ if (target && target.data) {
14
+ const { astAdapted } = target.data
15
+ if (astAdapted) {
16
+ }
17
+ }
18
+
19
+ return { payload, name: 'Live Classes', id: 'liveClasses', auxiliary: (target && target.data) ? target.data.documentation : null }
20
+ }
@@ -0,0 +1,206 @@
1
+ import { FeatureEnum } from "../../../../../manifest/data/1.0.0/enums.js"
2
+ import access from '../../../../../manifest/access/index.js'
3
+
4
+ export default async props => {
5
+ const { path, extraction, version } = props
6
+ const payload = []
7
+
8
+ const target = await access({
9
+ item: FeatureEnum.Schema,
10
+ path,
11
+ extraction
12
+ })
13
+
14
+ if (!target || !target.children || !target.children.length) {
15
+ return { payload, name: 'Schema', id: 'schema', }
16
+ }
17
+
18
+ //TODO: version
19
+ const schema = target.children[0]
20
+
21
+ if (!schema.children || !schema.children.length) {
22
+ return { payload, name: 'Schema', id: 'schema', }
23
+ }
24
+
25
+ const index = schema.children.filter(a => a.id === 'index')
26
+ if (!index || !index.length || !index[0].data || !index[0].data.length) {
27
+ return { payload, name: 'Schema', id: 'schema', }
28
+ }
29
+ const data = index[0].data[0]
30
+ const { astAdapted, module: _module } = data
31
+ const { managed, target: _target } = _module
32
+
33
+ if (managed && managed.classes && managed.classes.length) {
34
+ payload.push({
35
+ h4: "Managed classes"
36
+ })
37
+ managed.classes.forEach(_class => {
38
+ const { className, fields, classLevelPermissions, indexes, } = _class
39
+ payload.push({
40
+ h5: className
41
+ })
42
+
43
+ let rows = []
44
+
45
+ if (fields && Object.keys(fields).length) {
46
+ Object.keys(fields).forEach(key => {
47
+ const { type, targetClass, defaultValue } = fields[key]
48
+ rows.push([key ? key : "", type, targetClass ? targetClass : "", defaultValue ? defaultValue : ""])
49
+
50
+ })
51
+ if (rows && rows.length) {
52
+ payload.push({
53
+ p: '**Fields**'
54
+ })
55
+ payload.push({
56
+ table: {
57
+ headers: ["Name", "Type", "Target class", "Default value"],
58
+ rows
59
+ }
60
+ })
61
+ }
62
+ } else {
63
+ payload.push({
64
+ p: 'No fields'
65
+ })
66
+ }
67
+
68
+
69
+ rows = []
70
+ if (classLevelPermissions && Object.keys(classLevelPermissions).length) {
71
+ Object.keys(classLevelPermissions).forEach(key => {
72
+ // rows.push([key, `${JSON.stringify(classLevelPermissions[key], null, 2)}`])
73
+ rows.push([key, `${JSON.stringify(classLevelPermissions[key],)}`])
74
+ })
75
+ if (rows && rows.length) {
76
+ payload.push({
77
+ p: '**Class Level Permissions**'
78
+ })
79
+ payload.push({
80
+ table: {
81
+ headers: ["Name", "Content"],
82
+ rows
83
+ }
84
+ })
85
+ }
86
+ } else {
87
+ payload.push({
88
+ p: 'No classLevelPermissions'
89
+ })
90
+ }
91
+
92
+
93
+ rows = []
94
+ if (indexes && Object.keys(indexes).length) {
95
+ Object.keys(indexes).forEach(key => {
96
+ // rows.push([key, `${JSON.stringify(classLevelPermissions[key], null, 2)}`])
97
+ rows.push([key, `${JSON.stringify(indexes[key],)}`])
98
+ })
99
+ if (rows && rows.length) {
100
+ payload.push({
101
+ p: '**Indexes**'
102
+ })
103
+ payload.push({
104
+ table: {
105
+ headers: ["Name", "Content"],
106
+ rows
107
+ }
108
+ })
109
+ }
110
+ } else {
111
+ payload.push({
112
+ p: 'No indexes'
113
+ })
114
+ }
115
+
116
+ })
117
+ }
118
+
119
+
120
+ if (_target) {
121
+ payload.push({
122
+ h4: "Target class"
123
+ })
124
+
125
+ const { fields, classLevelPermissions, indexes, } = _target
126
+ let rows = []
127
+
128
+ if (fields && Object.keys(fields).length) {
129
+ Object.keys(fields).forEach(key => {
130
+ const { type, targetClass, defaultValue } = fields[key]
131
+ rows.push([key ? key : "", type, targetClass ? targetClass : "", defaultValue ? defaultValue : ""])
132
+
133
+ })
134
+ if (rows && rows.length) {
135
+ payload.push({
136
+ p: '**Fields**'
137
+ })
138
+ payload.push({
139
+ table: {
140
+ headers: ["Name", "Type", "Target class", "Default value"],
141
+ rows
142
+ }
143
+ })
144
+ }
145
+ } else {
146
+ payload.push({
147
+ p: 'No fields'
148
+ })
149
+ }
150
+
151
+
152
+ rows = []
153
+ if (classLevelPermissions && Object.keys(classLevelPermissions).length) {
154
+ Object.keys(classLevelPermissions).forEach(key => {
155
+ // rows.push([key, `${JSON.stringify(classLevelPermissions[key], null, 2)}`])
156
+ rows.push([key, `${JSON.stringify(classLevelPermissions[key],)}`])
157
+ })
158
+ if (rows && rows.length) {
159
+ payload.push({
160
+ p: '**Class Level Permissions**'
161
+ })
162
+ payload.push({
163
+ table: {
164
+ headers: ["Name", "Content"],
165
+ rows
166
+ }
167
+ })
168
+ }
169
+ } else {
170
+ payload.push({
171
+ p: 'No classLevelPermissions'
172
+ })
173
+ }
174
+
175
+
176
+ rows = []
177
+ if (indexes && Object.keys(indexes).length) {
178
+ Object.keys(indexes).forEach(key => {
179
+ // rows.push([key, `${JSON.stringify(classLevelPermissions[key], null, 2)}`])
180
+ rows.push([key, `${JSON.stringify(indexes[key],)}`])
181
+ })
182
+ if (rows && rows.length) {
183
+ payload.push({
184
+ p: '**Indexes**'
185
+ })
186
+ payload.push({
187
+ table: {
188
+ headers: ["Name", "Content"],
189
+ rows
190
+ }
191
+ })
192
+ }
193
+ } else {
194
+ payload.push({
195
+ p: 'No indexes'
196
+ })
197
+ }
198
+ }
199
+
200
+ return {
201
+ payload, name: 'Schema',
202
+ id: 'schema',
203
+ auxiliary: (target && target.data) ? target.data.documentation : null
204
+ }
205
+
206
+ }
@@ -0,0 +1,20 @@
1
+ import { FeatureEnum } from "../../../../../manifest/data/1.0.0/enums.js"
2
+ import access from '../../../../../manifest/access/index.js'
3
+
4
+ export default async props => {
5
+ const { path, extraction, includeAuxiliary = true } = props
6
+ const payload = []
7
+
8
+ const target = await access({
9
+ item: FeatureEnum.Class.Index,
10
+ path,
11
+ extraction
12
+ })
13
+ if (target && target.data) {
14
+ const { astAdapted } = target.data
15
+ if (astAdapted) {
16
+ }
17
+ }
18
+
19
+ return { payload, name: 'Seed', id: 'seed', auxiliary: (target && target.data) ? target.data.documentation : null }
20
+ }
@@ -0,0 +1,20 @@
1
+ import { FeatureEnum } from "../../../../../manifest/data/1.0.0/enums.js"
2
+ import access from '../../../../../manifest/access/index.js'
3
+
4
+ export default async props => {
5
+ const { path, extraction } = props
6
+ const payload = []
7
+
8
+ const target = await access({
9
+ item: FeatureEnum.System,
10
+ path,
11
+ extraction
12
+ })
13
+ if (target && target.data) {
14
+ const { astAdapted } = target.data
15
+ if (astAdapted) {
16
+ }
17
+ }
18
+
19
+ return { payload, name: 'System', id: 'system', auxiliary: (target && target.data) ? target.data.documentation : null }
20
+ }
@@ -0,0 +1,20 @@
1
+ import { FeatureEnum } from "../../../../../manifest/data/1.0.0/enums.js"
2
+ import access from '../../../../../manifest/access/index.js'
3
+
4
+ export default async props => {
5
+ const { path, extraction } = props
6
+ const payload = []
7
+
8
+ const target = await access({
9
+ item: FeatureEnum.Triggers,
10
+ path,
11
+ extraction
12
+ })
13
+ if (target && target.data) {
14
+ const { astAdapted } = target.data
15
+ if (astAdapted) {
16
+ }
17
+ }
18
+
19
+ return { payload, name: 'Triggers', id: 'triggers', auxiliary: (target && target.data) ? target.data.documentation : null }
20
+ }
@@ -0,0 +1,4 @@
1
+
2
+ export default value => {
3
+ return `![Static Badge](https://img.shields.io/badge/${value})`
4
+ }
@@ -0,0 +1,4 @@
1
+
2
+ export default ({ username, name }) => ({
3
+ p: `<img src="https://github-readme-stats.vercel.app/api/pin/?username=${username}&repo=${name}"/>`
4
+ })
@@ -0,0 +1,40 @@
1
+
2
+ export default async props => {
3
+ const { mainPackage } = props
4
+ const payload = []
5
+ payload.push({
6
+ h2: 'Compatible framework bridges'
7
+ })
8
+
9
+ if (!mainPackage || !mainPackage.adapters || !mainPackage.adapters.length) {
10
+ payload.push({
11
+ p: "No adapters specified."
12
+ })
13
+ return { payload, name: 'Adapters', id: 'adapters', }
14
+ }
15
+
16
+ const rows = []
17
+ mainPackage.adapters.forEach((adapter) => {
18
+ const { id, version = "*", url = "" } = adapter
19
+ if (!id) {
20
+ return
21
+ }
22
+
23
+ rows.push([
24
+ id,
25
+ version,
26
+ url
27
+ ])
28
+ })
29
+
30
+ if (rows && rows.length) {
31
+ payload.push({
32
+ table: {
33
+ headers: ["Adapter", "Version", "Link"],
34
+ rows
35
+ }
36
+ })
37
+ }
38
+
39
+ return { payload, name: 'Adapters', id: 'adapters', }
40
+ }
@@ -0,0 +1,39 @@
1
+
2
+ export default async props => {
3
+ const { mainPackage } = props
4
+ const payload = []
5
+ payload.push({
6
+ h2: 'Used APIs'
7
+ })
8
+
9
+ if (!mainPackage || !mainPackage.apis || !mainPackage.apis.length) {
10
+ payload.push({
11
+ p: "No apis specified."
12
+ })
13
+ return { payload, name: 'APIs', id: 'apis', }
14
+ }
15
+
16
+ const rows = []
17
+ mainPackage.apis.forEach((adapter) => {
18
+ const { id, version = "*", url = "" } = adapter
19
+ if (!id) {
20
+ return
21
+ }
22
+
23
+ rows.push([
24
+ id,
25
+ version,
26
+ ])
27
+ })
28
+
29
+ if (rows && rows.length) {
30
+ payload.push({
31
+ table: {
32
+ headers: ["Api", "Version",],
33
+ rows
34
+ }
35
+ })
36
+ }
37
+
38
+ return { payload, name: 'APIs', id: 'apis', }
39
+ }
@@ -0,0 +1,32 @@
1
+ import _generateBadge from "./_generateBadge.js"
2
+
3
+ export default async props => {
4
+ const { mainPackage } = props
5
+ const payload = []
6
+ payload.push({
7
+ h2: 'Categories'
8
+ })
9
+
10
+ if (!mainPackage || !mainPackage.categories || !mainPackage.categories.length) {
11
+ payload.push({
12
+ p: "No categories specified."
13
+ })
14
+ return { payload, name: 'Categories', id: 'categories', }
15
+ }
16
+
17
+ const rows = []
18
+ mainPackage.categories.forEach((item) => {
19
+
20
+ if (!item) {
21
+ return
22
+ }
23
+
24
+ rows.push(_generateBadge(`${item}-orange`))
25
+ })
26
+
27
+ payload.push({
28
+ p: rows.join(' ')
29
+ })
30
+
31
+ return { payload, name: 'Categories', id: 'categories', }
32
+ }
@@ -0,0 +1,29 @@
1
+ import _githubPackage from "../_githubPackage.js"
2
+ import gitUrlParse from "git-url-parse"
3
+
4
+ export default props => {
5
+ const { items, } = props
6
+ const payload = []
7
+
8
+ if (!items || !items.length) {
9
+
10
+ payload.push({
11
+ p: 'No dependencies.'
12
+ })
13
+ return payload
14
+ }
15
+
16
+
17
+ items.forEach(p => {
18
+
19
+ if (p.classes) {
20
+ payload.push({
21
+ h5: `Applies to classes: *${p.classes.join(', ')}*`
22
+ })
23
+ }
24
+ const { owner, name } = gitUrlParse(p.url)
25
+ payload.push(_githubPackage({ username: owner, name }))
26
+ })
27
+
28
+ return payload
29
+ }
@@ -0,0 +1,40 @@
1
+ import build from "./build.js"
2
+
3
+ export default async props => {
4
+ const { dependencies, } = props
5
+ let payload = []
6
+
7
+ payload.push({
8
+ h3: 'Dependencies'
9
+ })
10
+
11
+ if ((!dependencies || !dependencies.length)) {
12
+ payload.push({
13
+ p: 'This feature has no feature dependencies.'
14
+ })
15
+ return { payload, name: 'Dependencies', id: 'dependencies', }
16
+ }
17
+ const managed = dependencies.filter(a => a.appliesto === 'managed')
18
+ const target = dependencies.filter(a => a.appliesto === 'target')
19
+
20
+ if ((!managed || !managed.length)
21
+ && (!target || !target.length)) {
22
+ payload.push({
23
+ p: 'This feature has no feature dependencies.'
24
+ })
25
+ return { payload, name: 'Dependencies', id: 'dependencies', }
26
+ }
27
+
28
+ payload.push({
29
+ h4: 'Target classes'
30
+ })
31
+ payload = payload.concat(build({ items: target }))
32
+ payload.push({
33
+ h4: 'Managed classes'
34
+ })
35
+ payload = payload.concat(build({ items: managed }))
36
+
37
+ payload = payload.filter(a => a)
38
+
39
+ return { payload, name: 'Packages', id: 'packages', }
40
+ }