@apso/cli 0.0.5 → 0.0.43

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 (194) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +313 -53
  3. package/bin/dev +17 -0
  4. package/bin/dev.cmd +3 -0
  5. package/bin/run +3 -3
  6. package/dist/commands/server/new.d.ts +22 -0
  7. package/dist/commands/server/new.js +105 -0
  8. package/dist/commands/server/scaffold.d.ts +14 -0
  9. package/dist/commands/server/scaffold.js +60 -0
  10. package/dist/index.d.ts +1 -0
  11. package/{lib → dist}/index.js +3 -2
  12. package/dist/lib/apsorc-parser.d.ts +26 -0
  13. package/dist/lib/apsorc-parser.js +65 -0
  14. package/dist/lib/base-command.d.ts +4 -0
  15. package/dist/lib/base-command.js +24 -0
  16. package/dist/lib/controller.d.ts +2 -0
  17. package/dist/lib/controller.js +36 -0
  18. package/dist/lib/dto.d.ts +7 -0
  19. package/dist/lib/dto.js +49 -0
  20. package/dist/lib/entity.d.ts +2 -0
  21. package/dist/lib/entity.js +43 -0
  22. package/dist/lib/enums.d.ts +6 -0
  23. package/dist/lib/enums.js +31 -0
  24. package/dist/lib/gql-dto.d.ts +3 -0
  25. package/dist/lib/gql-dto.js +43 -0
  26. package/dist/lib/index-module.d.ts +2 -0
  27. package/dist/lib/index-module.js +18 -0
  28. package/dist/lib/index.d.ts +10 -0
  29. package/dist/lib/index.js +21 -0
  30. package/dist/lib/module.d.ts +1 -0
  31. package/dist/lib/module.js +28 -0
  32. package/dist/lib/service.d.ts +1 -0
  33. package/dist/lib/service.js +24 -0
  34. package/dist/lib/templates/entities/entity-col-array.eta +12 -0
  35. package/dist/lib/templates/entities/entity-col-bigint.eta +11 -0
  36. package/dist/lib/templates/entities/entity-col-bigserial.eta +12 -0
  37. package/dist/lib/templates/entities/entity-col-boolean.eta +11 -0
  38. package/dist/lib/templates/entities/entity-col-bytea.eta +11 -0
  39. package/dist/lib/templates/entities/entity-col-char.eta +15 -0
  40. package/dist/lib/templates/entities/entity-col-date.eta +8 -0
  41. package/dist/lib/templates/entities/entity-col-decimal.eta +11 -0
  42. package/dist/lib/templates/entities/entity-col-double.eta +11 -0
  43. package/dist/lib/templates/entities/entity-col-enum.eta +12 -0
  44. package/dist/lib/templates/entities/entity-col-float.eta +7 -0
  45. package/dist/lib/templates/entities/entity-col-inet.eta +11 -0
  46. package/dist/lib/templates/entities/entity-col-int4range.eta +34 -0
  47. package/dist/lib/templates/entities/entity-col-integer.eta +11 -0
  48. package/dist/lib/templates/entities/entity-col-interval.eta +11 -0
  49. package/dist/lib/templates/entities/entity-col-json-plain.eta +8 -0
  50. package/dist/lib/templates/entities/entity-col-json.eta +5 -0
  51. package/dist/lib/templates/entities/entity-col-jsonb.eta +5 -0
  52. package/dist/lib/templates/entities/entity-col-money.eta +11 -0
  53. package/dist/lib/templates/entities/entity-col-numeric.eta +11 -0
  54. package/dist/lib/templates/entities/entity-col-point.eta +25 -0
  55. package/dist/lib/templates/entities/entity-col-real.eta +11 -0
  56. package/dist/lib/templates/entities/entity-col-serial.eta +12 -0
  57. package/dist/lib/templates/entities/entity-col-smallint.eta +11 -0
  58. package/dist/lib/templates/entities/entity-col-smallserial.eta +12 -0
  59. package/dist/lib/templates/entities/entity-col-string.eta +23 -0
  60. package/dist/lib/templates/entities/entity-col-text.eta +23 -0
  61. package/dist/lib/templates/entities/entity-col-time.eta +11 -0
  62. package/dist/lib/templates/entities/entity-col-timestamp.eta +4 -0
  63. package/dist/lib/templates/entities/entity-col-timestamptz.eta +4 -0
  64. package/dist/lib/templates/entities/entity-col-timetz.eta +11 -0
  65. package/dist/lib/templates/entities/entity-col-tsvector.eta +11 -0
  66. package/dist/lib/templates/entities/entity-col-uuid.eta +11 -0
  67. package/dist/lib/templates/entities/entity-col-varchar.eta +18 -0
  68. package/dist/lib/templates/entities/entity-col-xml.eta +11 -0
  69. package/dist/lib/templates/entities/entity.eta +116 -0
  70. package/dist/lib/templates/graphql/dto/dto-col-array.eta +4 -0
  71. package/dist/lib/templates/graphql/dto/dto-col-boolean.eta +6 -0
  72. package/dist/lib/templates/graphql/dto/dto-col-date.eta +4 -0
  73. package/dist/lib/templates/graphql/dto/dto-col-enum.eta +5 -0
  74. package/dist/lib/templates/graphql/dto/dto-col-float.eta +4 -0
  75. package/dist/lib/templates/graphql/dto/dto-col-integer.eta +4 -0
  76. package/dist/lib/templates/graphql/dto/dto-col-json-plain.eta +5 -0
  77. package/dist/lib/templates/graphql/dto/dto-col-json.eta +5 -0
  78. package/dist/lib/templates/graphql/dto/dto-col-text.eta +11 -0
  79. package/dist/lib/templates/graphql/dto/dto-col-timestamp.eta +3 -0
  80. package/dist/lib/templates/graphql/dto/dto-col-timestamptz.eta +3 -0
  81. package/dist/lib/templates/graphql/enums-graphql.eta +12 -0
  82. package/dist/lib/templates/graphql/gql-dto-graphql.eta +67 -0
  83. package/dist/lib/templates/graphql/index-module-graphql.eta +26 -0
  84. package/dist/lib/templates/graphql/module-graphql.eta +19 -0
  85. package/dist/lib/templates/header.eta +3 -0
  86. package/dist/lib/templates/rest/controller-rest-spec.eta +77 -0
  87. package/dist/lib/templates/rest/controller-rest.eta +171 -0
  88. package/dist/lib/templates/rest/dto-rest.eta +48 -0
  89. package/dist/lib/templates/rest/enums-rest.eta +7 -0
  90. package/dist/lib/templates/rest/index-module-rest.eta +11 -0
  91. package/dist/lib/templates/rest/module-rest.eta +16 -0
  92. package/dist/lib/templates/rest/ormconfig.eta +9 -0
  93. package/dist/lib/templates/rest/service-rest.eta +25 -0
  94. package/dist/lib/types/constraints.d.ts +4 -0
  95. package/dist/lib/types/constraints.js +2 -0
  96. package/dist/lib/types/entity.d.ts +13 -0
  97. package/dist/lib/types/entity.js +2 -0
  98. package/dist/lib/types/field.d.ts +16 -0
  99. package/dist/lib/types/field.js +2 -0
  100. package/dist/lib/types/index.d.ts +5 -0
  101. package/dist/lib/types/index.js +2 -0
  102. package/dist/lib/types/indices.d.ts +4 -0
  103. package/dist/lib/types/indices.js +2 -0
  104. package/dist/lib/types/json.d.ts +3 -0
  105. package/dist/lib/types/json.js +2 -0
  106. package/dist/lib/types/relationship.d.ts +43 -0
  107. package/dist/lib/types/relationship.js +2 -0
  108. package/dist/lib/utils/casing.d.ts +2 -0
  109. package/dist/lib/utils/casing.js +16 -0
  110. package/dist/lib/utils/field.d.ts +6 -0
  111. package/dist/lib/utils/field.js +65 -0
  112. package/dist/lib/utils/file-system.d.ts +2 -0
  113. package/dist/lib/utils/file-system.js +52 -0
  114. package/dist/lib/utils/relationships/index.d.ts +2 -0
  115. package/dist/lib/utils/relationships/index.js +11 -0
  116. package/dist/lib/utils/relationships/parse-v1.d.ts +4 -0
  117. package/dist/lib/utils/relationships/parse-v1.js +86 -0
  118. package/dist/lib/utils/relationships/parse.d.ts +11 -0
  119. package/dist/lib/utils/relationships/parse.js +192 -0
  120. package/dist/tests/templates/entities/types/array-template.spec.d.ts +1 -0
  121. package/dist/tests/templates/entities/types/array-template.spec.js +82 -0
  122. package/dist/tests/templates/entities/types/bigint-template.spec.d.ts +1 -0
  123. package/dist/tests/templates/entities/types/bigint-template.spec.js +82 -0
  124. package/dist/tests/templates/entities/types/boolean-template.spec.d.ts +1 -0
  125. package/dist/tests/templates/entities/types/boolean-template.spec.js +77 -0
  126. package/dist/tests/templates/entities/types/bytea-template.spec.d.ts +1 -0
  127. package/dist/tests/templates/entities/types/bytea-template.spec.js +68 -0
  128. package/dist/tests/templates/entities/types/char-template.spec.d.ts +1 -0
  129. package/dist/tests/templates/entities/types/char-template.spec.js +68 -0
  130. package/dist/tests/templates/entities/types/date-template.spec.d.ts +1 -0
  131. package/dist/tests/templates/entities/types/date-template.spec.js +56 -0
  132. package/dist/tests/templates/entities/types/decimal-template.spec.d.ts +1 -0
  133. package/dist/tests/templates/entities/types/decimal-template.spec.js +86 -0
  134. package/dist/tests/templates/entities/types/double-template.spec.d.ts +1 -0
  135. package/dist/tests/templates/entities/types/double-template.spec.js +67 -0
  136. package/dist/tests/templates/entities/types/enum-template.spec.d.ts +1 -0
  137. package/dist/tests/templates/entities/types/enum-template.spec.js +85 -0
  138. package/dist/tests/templates/entities/types/float-template.spec.d.ts +1 -0
  139. package/dist/tests/templates/entities/types/float-template.spec.js +67 -0
  140. package/dist/tests/templates/entities/types/inet-template.spec.d.ts +1 -0
  141. package/dist/tests/templates/entities/types/inet-template.spec.js +69 -0
  142. package/dist/tests/templates/entities/types/int4range-template.spec.d.ts +1 -0
  143. package/dist/tests/templates/entities/types/int4range-template.spec.js +60 -0
  144. package/dist/tests/templates/entities/types/integer-template.spec.d.ts +1 -0
  145. package/dist/tests/templates/entities/types/integer-template.spec.js +79 -0
  146. package/dist/tests/templates/entities/types/interval-template.spec.d.ts +1 -0
  147. package/dist/tests/templates/entities/types/interval-template.spec.js +68 -0
  148. package/dist/tests/templates/entities/types/json-plain-template.spec.d.ts +1 -0
  149. package/dist/tests/templates/entities/types/json-plain-template.spec.js +54 -0
  150. package/dist/tests/templates/entities/types/json-template.spec.d.ts +1 -0
  151. package/dist/tests/templates/entities/types/json-template.spec.js +40 -0
  152. package/dist/tests/templates/entities/types/jsonb-template.spec.d.ts +1 -0
  153. package/dist/tests/templates/entities/types/jsonb-template.spec.js +40 -0
  154. package/dist/tests/templates/entities/types/money-template.spec.d.ts +1 -0
  155. package/dist/tests/templates/entities/types/money-template.spec.js +68 -0
  156. package/dist/tests/templates/entities/types/numeric-template.spec.d.ts +1 -0
  157. package/dist/tests/templates/entities/types/numeric-template.spec.js +84 -0
  158. package/dist/tests/templates/entities/types/point-template.spec.d.ts +1 -0
  159. package/dist/tests/templates/entities/types/point-template.spec.js +58 -0
  160. package/dist/tests/templates/entities/types/real-template.spec.d.ts +1 -0
  161. package/dist/tests/templates/entities/types/real-template.spec.js +67 -0
  162. package/dist/tests/templates/entities/types/serial-template.spec.d.ts +1 -0
  163. package/dist/tests/templates/entities/types/serial-template.spec.js +113 -0
  164. package/dist/tests/templates/entities/types/smallint-template.spec.d.ts +1 -0
  165. package/dist/tests/templates/entities/types/smallint-template.spec.js +82 -0
  166. package/dist/tests/templates/entities/types/string-template.spec.d.ts +1 -0
  167. package/dist/tests/templates/entities/types/string-template.spec.js +111 -0
  168. package/dist/tests/templates/entities/types/text-template.spec.d.ts +1 -0
  169. package/dist/tests/templates/entities/types/text-template.spec.js +70 -0
  170. package/dist/tests/templates/entities/types/time-template.spec.d.ts +1 -0
  171. package/dist/tests/templates/entities/types/time-template.spec.js +68 -0
  172. package/dist/tests/templates/entities/types/timestamp-template.spec.d.ts +1 -0
  173. package/dist/tests/templates/entities/types/timestamp-template.spec.js +74 -0
  174. package/dist/tests/templates/entities/types/timetz-template.spec.d.ts +1 -0
  175. package/dist/tests/templates/entities/types/timetz-template.spec.js +68 -0
  176. package/dist/tests/templates/entities/types/tsvector-template.spec.d.ts +1 -0
  177. package/dist/tests/templates/entities/types/tsvector-template.spec.js +55 -0
  178. package/dist/tests/templates/entities/types/uuid-template.spec.d.ts +1 -0
  179. package/dist/tests/templates/entities/types/uuid-template.spec.js +82 -0
  180. package/dist/tests/templates/entities/types/varchar-template.spec.d.ts +1 -0
  181. package/dist/tests/templates/entities/types/varchar-template.spec.js +102 -0
  182. package/dist/tests/templates/entities/types/xml-template.spec.d.ts +1 -0
  183. package/dist/tests/templates/entities/types/xml-template.spec.js +55 -0
  184. package/dist/tests/templates/entities/utils/template-test-utils.d.ts +31 -0
  185. package/dist/tests/templates/entities/utils/template-test-utils.js +50 -0
  186. package/oclif.manifest.json +60 -1
  187. package/package.json +84 -55
  188. package/lib/commands/new.d.ts +0 -22
  189. package/lib/commands/new.js +0 -198
  190. package/lib/commands/scaffold.d.ts +0 -18
  191. package/lib/commands/scaffold.js +0 -106
  192. package/lib/index.d.ts +0 -1
  193. package/lib/lib/scaffold.d.ts +0 -30
  194. package/lib/lib/scaffold.js +0 -566
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const template_test_utils_1 = require("../utils/template-test-utils");
4
+ const globals_1 = require("@jest/globals");
5
+ (0, globals_1.describe)('Varchar Entity Template Tests', () => {
6
+ // Setup Eta configuration once before all tests
7
+ (0, globals_1.beforeAll)(() => {
8
+ (0, template_test_utils_1.configureEta)();
9
+ });
10
+ const templatePath = './entities/entity-col-varchar';
11
+ const testCases = [
12
+ {
13
+ name: 'should render basic varchar field correctly',
14
+ field: {
15
+ name: 'name',
16
+ dataType: 'string',
17
+ nullable: false
18
+ },
19
+ assertions: [
20
+ { type: 'contains', text: '@IsOptional({ groups: [UPDATE] })' },
21
+ { type: 'contains', text: '@IsNotEmpty({ groups: [CREATE] })' },
22
+ { type: 'contains', text: '@Column({ type: "varchar", length: 255' },
23
+ { type: 'contains', text: 'nullable: false' },
24
+ { type: 'contains', text: 'name: string;' },
25
+ { type: 'notContains', text: '@Index()' },
26
+ { type: 'notContains', text: '@IsEmail' }
27
+ ]
28
+ },
29
+ {
30
+ name: 'should render nullable varchar field correctly',
31
+ field: {
32
+ name: 'description',
33
+ dataType: 'string',
34
+ nullable: true
35
+ },
36
+ assertions: [
37
+ { type: 'contains', text: '@IsOptional({ groups: [UPDATE] })' },
38
+ { type: 'contains', text: '@Column({ type: "varchar"' },
39
+ { type: 'contains', text: 'nullable: true' },
40
+ { type: 'contains', text: 'description: string;' },
41
+ { type: 'notContains', text: '@IsNotEmpty' }
42
+ ]
43
+ },
44
+ {
45
+ name: 'should render varchar field with custom length correctly',
46
+ field: {
47
+ name: 'code',
48
+ dataType: 'string',
49
+ nullable: false,
50
+ length: 50
51
+ },
52
+ assertions: [
53
+ { type: 'contains', text: '@Column({ type: "varchar", length: 50' },
54
+ { type: 'contains', text: 'code: string;' }
55
+ ]
56
+ },
57
+ {
58
+ name: 'should render unique varchar field correctly',
59
+ field: {
60
+ name: 'username',
61
+ dataType: 'string',
62
+ nullable: false,
63
+ unique: true
64
+ },
65
+ assertions: [
66
+ { type: 'contains', text: '@Column({ type: "varchar"' },
67
+ { type: 'contains', text: 'unique: true' },
68
+ { type: 'contains', text: 'username: string;' }
69
+ ]
70
+ },
71
+ {
72
+ name: 'should render email field correctly',
73
+ field: {
74
+ name: 'email',
75
+ dataType: 'string',
76
+ nullable: false,
77
+ // eslint-disable-next-line camelcase
78
+ is_email: true
79
+ },
80
+ assertions: [
81
+ { type: 'contains', text: '@IsEmail({ require_tld: false }, { always: true })' },
82
+ { type: 'contains', text: '@Column({ type: "varchar"' },
83
+ { type: 'contains', text: 'email: string;' }
84
+ ]
85
+ },
86
+ {
87
+ name: 'should render indexed varchar field correctly',
88
+ field: {
89
+ name: 'indexedField',
90
+ dataType: 'string',
91
+ nullable: false,
92
+ index: true
93
+ },
94
+ assertions: [
95
+ { type: 'contains', text: '@Column({ type: "varchar"' },
96
+ { type: 'contains', text: '@Index()' },
97
+ { type: 'contains', text: 'indexedField: string;' }
98
+ ]
99
+ }
100
+ ];
101
+ (0, template_test_utils_1.runTemplateTests)(templatePath, testCases);
102
+ });
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const template_test_utils_1 = require("../utils/template-test-utils");
4
+ const globals_1 = require("@jest/globals");
5
+ (0, globals_1.describe)('XML Entity Template Tests', () => {
6
+ // Setup Eta configuration once before all tests
7
+ (0, globals_1.beforeAll)(() => {
8
+ (0, template_test_utils_1.configureEta)();
9
+ });
10
+ const templatePath = './entities/entity-col-xml';
11
+ const testCases = [
12
+ {
13
+ name: 'should render basic xml field correctly',
14
+ field: {
15
+ name: 'xmlContent',
16
+ dataType: 'string',
17
+ nullable: false
18
+ },
19
+ assertions: [
20
+ { type: 'contains', text: '@Column({ "type": "xml"' },
21
+ { type: 'contains', text: 'xmlContent: string;' },
22
+ { type: 'notContains', text: '@Index()' },
23
+ { type: 'notContains', text: '@PrimaryColumn()' }
24
+ ]
25
+ },
26
+ {
27
+ name: 'should render nullable xml field correctly',
28
+ field: {
29
+ name: 'optionalXml',
30
+ dataType: 'string',
31
+ nullable: true
32
+ },
33
+ assertions: [
34
+ { type: 'contains', text: '@Column({ "type": "xml"' },
35
+ { type: 'contains', text: 'nullable: true' },
36
+ { type: 'contains', text: 'optionalXml: string;' }
37
+ ]
38
+ },
39
+ {
40
+ name: 'should render indexed xml field correctly',
41
+ field: {
42
+ name: 'indexedXml',
43
+ dataType: 'string',
44
+ nullable: false,
45
+ index: true
46
+ },
47
+ assertions: [
48
+ { type: 'contains', text: '@Column({ "type": "xml"' },
49
+ { type: 'contains', text: '@Index()' },
50
+ { type: 'contains', text: 'indexedXml: string;' }
51
+ ]
52
+ }
53
+ ];
54
+ (0, template_test_utils_1.runTemplateTests)(templatePath, testCases);
55
+ });
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Configures Eta for template testing
3
+ * @returns {void} Nothing
4
+ */
5
+ export declare function configureEta(): void;
6
+ /**
7
+ * Renders a template file with the given field data
8
+ * @param templatePath The relative path to the template file
9
+ * @param field The field data to render the template with
10
+ * @returns {Promise<string|undefined>} The rendered template
11
+ */
12
+ export declare function renderTemplate(templatePath: string, field: any): Promise<string | undefined>;
13
+ /**
14
+ * Common test cases for entity templates
15
+ */
16
+ export interface TemplateTestCase {
17
+ name: string;
18
+ field: any;
19
+ assertions: Array<{
20
+ type: 'contains' | 'notContains';
21
+ text: string;
22
+ }>;
23
+ }
24
+ /**
25
+ * Run common test cases for a template
26
+ *
27
+ * @param templatePath Path to the template to test
28
+ * @param testCases Array of test cases
29
+ * @returns {void} Nothing
30
+ */
31
+ export declare function runTemplateTests(templatePath: string, testCases: TemplateTestCase[]): void;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.runTemplateTests = exports.renderTemplate = exports.configureEta = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const Eta = tslib_1.__importStar(require("eta"));
6
+ const path = tslib_1.__importStar(require("path"));
7
+ const globals_1 = require("@jest/globals");
8
+ /**
9
+ * Configures Eta for template testing
10
+ * @returns {void} Nothing
11
+ */
12
+ function configureEta() {
13
+ Eta.configure({
14
+ views: path.join(__dirname, '../../../../lib/templates'),
15
+ });
16
+ }
17
+ exports.configureEta = configureEta;
18
+ /**
19
+ * Renders a template file with the given field data
20
+ * @param templatePath The relative path to the template file
21
+ * @param field The field data to render the template with
22
+ * @returns {Promise<string|undefined>} The rendered template
23
+ */
24
+ async function renderTemplate(templatePath, field) {
25
+ return Eta.renderFileAsync(templatePath, { field });
26
+ }
27
+ exports.renderTemplate = renderTemplate;
28
+ /**
29
+ * Run common test cases for a template
30
+ *
31
+ * @param templatePath Path to the template to test
32
+ * @param testCases Array of test cases
33
+ * @returns {void} Nothing
34
+ */
35
+ function runTemplateTests(templatePath, testCases) {
36
+ testCases.forEach(testCase => {
37
+ (0, globals_1.it)(testCase.name, async () => {
38
+ const rendered = await renderTemplate(templatePath, testCase.field);
39
+ for (const assertion of testCase.assertions) {
40
+ if (assertion.type === 'contains') {
41
+ (0, globals_1.expect)(rendered).toContain(assertion.text);
42
+ }
43
+ else {
44
+ (0, globals_1.expect)(rendered).not.toContain(assertion.text);
45
+ }
46
+ }
47
+ });
48
+ });
49
+ }
50
+ exports.runTemplateTests = runTemplateTests;
@@ -1 +1,60 @@
1
- {"version":"0.0.5","commands":{"new":{"id":"new","description":"Initialize your server or client project","pluginName":"@apso/cli","pluginType":"core","aliases":[],"examples":["$ apso new --web\nhello world from ./src/hello.ts!\n"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"name":{"name":"name","type":"option","char":"n","description":"name of application"},"web":{"name":"web","type":"boolean","char":"w","description":"initialize web application","allowNo":false},"server":{"name":"server","type":"boolean","char":"s","description":"initialize server application","allowNo":false},"serverless":{"name":"serverless","type":"boolean","char":"S","description":"initialize serverless application","allowNo":false},"force":{"name":"force","type":"boolean","char":"f","allowNo":false}},"args":[{"name":"web"},{"name":"server"},{"name":"serverless"},{"name":"name"}]},"scaffold":{"id":"scaffold","description":"Create new models for Server or Client","pluginName":"@apso/cli","pluginType":"core","aliases":[],"examples":["$ apso scaffold\nhello world from ./src/hello.ts!\n"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"entity":{"name":"entity","type":"option","char":"m","description":"model name"},"web":{"name":"web","type":"boolean","char":"w","description":"initialize web application","allowNo":false},"server":{"name":"server","type":"boolean","char":"s","description":"initialize server application","allowNo":false}},"args":[{"name":"web"},{"name":"server"},{"name":"entity"}]}}}
1
+ {
2
+ "version": "0.0.43",
3
+ "commands": {
4
+ "server:new": {
5
+ "id": "server:new",
6
+ "description": "Initialize your server project",
7
+ "strict": true,
8
+ "pluginName": "@apso/cli",
9
+ "pluginAlias": "@apso/cli",
10
+ "pluginType": "core",
11
+ "aliases": [],
12
+ "examples": [
13
+ "$ apso server new --name TestProject"
14
+ ],
15
+ "flags": {
16
+ "name": {
17
+ "name": "name",
18
+ "type": "option",
19
+ "char": "n",
20
+ "description": "name of application",
21
+ "multiple": false
22
+ },
23
+ "type": {
24
+ "name": "type",
25
+ "type": "option",
26
+ "char": "t",
27
+ "description": "api type (rest or graphql)",
28
+ "multiple": false
29
+ }
30
+ },
31
+ "args": {
32
+ "name": {
33
+ "name": "name"
34
+ }
35
+ }
36
+ },
37
+ "server:scaffold": {
38
+ "id": "server:scaffold",
39
+ "description": "Setup new entities and interfaces for an Apso Server",
40
+ "strict": true,
41
+ "pluginName": "@apso/cli",
42
+ "pluginAlias": "@apso/cli",
43
+ "pluginType": "core",
44
+ "aliases": [],
45
+ "examples": [
46
+ "$ apso server scaffold"
47
+ ],
48
+ "flags": {
49
+ "help": {
50
+ "name": "help",
51
+ "type": "boolean",
52
+ "char": "h",
53
+ "description": "Show CLI help.",
54
+ "allowNo": false
55
+ }
56
+ },
57
+ "args": {}
58
+ }
59
+ }
60
+ }
package/package.json CHANGED
@@ -1,74 +1,103 @@
1
1
  {
2
2
  "name": "@apso/cli",
3
- "version": "0.0.5",
4
- "author": "Matt Cullerton",
5
- "publishConfig": {
6
- "access": "public"
7
- },
3
+ "version": "0.0.43",
4
+ "description": "Apso CLI",
5
+ "author": "Apso by Mavric - @mavric",
8
6
  "bin": {
9
7
  "apso": "./bin/run"
10
8
  },
11
- "bugs": "https://github.com/mavric/apso/issues",
12
- "dependencies": {
13
- "@oclif/command": "^1",
14
- "@oclif/config": "^1",
15
- "@oclif/plugin-help": "^3",
16
- "chalk": "^4.0.0",
17
- "fs-extra": "^9.0.1",
18
- "rc": "^1.2.8",
19
- "tslib": "^1",
20
- "validate-npm-package-name": "^3.0.0"
21
- },
22
- "devDependencies": {
23
- "@oclif/dev-cli": "^1",
24
- "@oclif/test": "^1",
25
- "@types/chai": "^4",
26
- "@types/chalk": "^2.2.0",
27
- "@types/fs-extra": "^9.0.1",
28
- "@types/mocha": "^5",
29
- "@types/node": "^14.0.13",
30
- "@types/rc": "^1.1.0",
31
- "@types/validate-npm-package-name": "^3.0.0",
32
- "chai": "^4",
33
- "eslint": "^5.13",
34
- "eslint-config-oclif": "^3.1",
35
- "eslint-config-oclif-typescript": "^0.1",
36
- "globby": "^10",
37
- "mocha": "^5",
38
- "nyc": "^14",
39
- "ts-node": "^8",
40
- "typescript": "^3.3"
9
+ "homepage": "https://github.com/apsoai/cli",
10
+ "license": "MIT",
11
+ "main": "dist/index.js",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/apsoai/cli.git"
41
15
  },
42
- "engines": {
43
- "node": ">=8.0.0"
16
+ "publishConfig": {
17
+ "access": "public"
44
18
  },
45
19
  "files": [
46
20
  "/bin",
47
- "/lib",
21
+ "/dist",
48
22
  "/npm-shrinkwrap.json",
49
23
  "/oclif.manifest.json"
50
24
  ],
51
- "homepage": "https://github.com/mavric/apso",
52
- "keywords": [
53
- "oclif"
54
- ],
55
- "license": "MIT",
56
- "main": "lib/index.js",
25
+ "dependencies": {
26
+ "@oclif/core": "^2",
27
+ "@oclif/plugin-help": "^5",
28
+ "@oclif/plugin-plugins": "^3",
29
+ "debug": "^4.3.4",
30
+ "eta": "^2.0.0",
31
+ "pluralize": "^8.0.0",
32
+ "rc": "^1.2.8",
33
+ "shelljs": "^0.8.5"
34
+ },
35
+ "devDependencies": {
36
+ "@jest/globals": "^29.5.0",
37
+ "@oclif/test": "^2.4.7",
38
+ "@types/chai": "^4",
39
+ "@types/mocha": "^10",
40
+ "@types/node": "^20",
41
+ "@types/pluralize": "^0.0.29",
42
+ "@types/rc": "^1.2.1",
43
+ "@types/shelljs": "^0.8.15",
44
+ "@typescript-eslint/eslint-plugin": "^5.59.8",
45
+ "chai": "^4",
46
+ "copyfiles": "^2.4.1",
47
+ "eslint": "^7.32.0",
48
+ "eslint-config-oclif": "^4",
49
+ "eslint-config-oclif-typescript": "^1.0.3",
50
+ "eslint-config-prettier": "^8.6.0",
51
+ "eslint-plugin-unicorn": "^40.1.0",
52
+ "mocha": "^10",
53
+ "oclif": "^3",
54
+ "prettier": "^2.8.4",
55
+ "shx": "^0.3.3",
56
+ "ts-jest": "^29.1.0",
57
+ "ts-node": "^10.9.1",
58
+ "tslib": "^2.5.0",
59
+ "typescript": "^5"
60
+ },
57
61
  "oclif": {
58
- "commands": "./lib/commands",
59
62
  "bin": "apso",
63
+ "dirname": "apso",
64
+ "commands": "./dist/commands",
60
65
  "plugins": [
61
- "@oclif/plugin-help"
62
- ]
66
+ "@oclif/plugin-help",
67
+ "@oclif/plugin-plugins"
68
+ ],
69
+ "topicSeparator": " ",
70
+ "topics": {
71
+ "hello": {
72
+ "description": "Say hello to the world and others"
73
+ }
74
+ }
63
75
  },
64
- "repository": "mavric/apso",
65
76
  "scripts": {
66
- "postpack": "rm -f oclif.manifest.json",
67
- "posttest": "eslint . --ext .ts --config .eslintrc",
68
- "prepack": "rm -rf lib && tsc -b && oclif-dev manifest && oclif-dev readme",
69
- "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
70
- "version": "oclif-dev readme && git add README.md"
77
+ "post-build": "copyfiles -u 1 src/**/*.eta dist/",
78
+ "build": "shx rm -rf dist && tsc -b && npm run post-build",
79
+ "lint": "eslint . --ext .ts --config .eslintrc",
80
+ "format": "prettier \"{src,test}/**/*.ts\" --write",
81
+ "pre-build": "npm run format && npm run lint",
82
+ "postpack": "shx rm -f oclif.manifest.json",
83
+ "pack": "oclif pack tarballs",
84
+ "posttest": "npm run lint",
85
+ "prepack": "npm run build && oclif manifest && oclif readme",
86
+ "test": "jest",
87
+ "test:watch": "jest --watch",
88
+ "test:cov": "jest --coverage",
89
+ "version": "oclif readme && git add README.md"
90
+ },
91
+ "engines": {
92
+ "node": ">=12.0.0"
71
93
  },
72
- "types": "lib/index.d.ts",
73
- "gitHead": "92c8bc381797fd45751dad9dda9700437a9678d8"
94
+ "bugs": "https://github.com/@apsoai/cli/issues",
95
+ "keywords": [
96
+ "apso",
97
+ "apsoai",
98
+ "apso-cli",
99
+ "cli",
100
+ "oclif"
101
+ ],
102
+ "types": "dist/index.d.ts"
74
103
  }
@@ -1,22 +0,0 @@
1
- import { Command, flags } from '@oclif/command';
2
- export default class Init extends Command {
3
- static description: string;
4
- static examples: string[];
5
- static flags: {
6
- help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
7
- name: flags.IOptionFlag<string | undefined>;
8
- web: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
9
- server: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
10
- serverless: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
11
- force: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
12
- };
13
- static args: {
14
- name: string;
15
- }[];
16
- checkAppName(appName: string): Promise<void>;
17
- install(root: string, dependencies: string[]): Promise<unknown>;
18
- installModules(root: string): Promise<unknown>;
19
- startApp(root: string): Promise<unknown>;
20
- initFromTemplate(name: string, template: string): Promise<void>;
21
- run(): Promise<void>;
22
- }