@proteinjs/conversation 1.0.6 → 1.0.7

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 (152) hide show
  1. package/.eslintrc.js +20 -0
  2. package/.prettierrc +8 -0
  3. package/CHANGELOG.md +7 -4
  4. package/LICENSE +21 -0
  5. package/dist/index.d.ts +1 -1
  6. package/dist/index.js +40 -28
  7. package/dist/src/CodegenConversation.d.ts +11 -11
  8. package/dist/src/CodegenConversation.d.ts.map +1 -1
  9. package/dist/src/CodegenConversation.js +294 -180
  10. package/dist/src/CodegenConversation.js.map +1 -1
  11. package/dist/src/Conversation.d.ts +52 -49
  12. package/dist/src/Conversation.d.ts.map +1 -1
  13. package/dist/src/Conversation.js +480 -274
  14. package/dist/src/Conversation.js.map +1 -1
  15. package/dist/src/ConversationModule.d.ts +6 -6
  16. package/dist/src/ConversationModule.js +3 -3
  17. package/dist/src/Function.d.ts +4 -4
  18. package/dist/src/Function.d.ts.map +1 -1
  19. package/dist/src/Function.js +3 -3
  20. package/dist/src/OpenAi.d.ts +42 -10
  21. package/dist/src/OpenAi.d.ts.map +1 -1
  22. package/dist/src/OpenAi.js +496 -289
  23. package/dist/src/OpenAi.js.map +1 -1
  24. package/dist/src/Paragraph.d.ts +4 -4
  25. package/dist/src/Paragraph.d.ts.map +1 -1
  26. package/dist/src/Paragraph.js +17 -16
  27. package/dist/src/Paragraph.js.map +1 -1
  28. package/dist/src/Sentence.d.ts +4 -4
  29. package/dist/src/Sentence.d.ts.map +1 -1
  30. package/dist/src/Sentence.js +21 -19
  31. package/dist/src/Sentence.js.map +1 -1
  32. package/dist/src/code_template/Code.d.ts +15 -15
  33. package/dist/src/code_template/Code.d.ts.map +1 -1
  34. package/dist/src/code_template/Code.js +167 -69
  35. package/dist/src/code_template/Code.js.map +1 -1
  36. package/dist/src/code_template/CodeTemplate.d.ts +11 -11
  37. package/dist/src/code_template/CodeTemplate.d.ts.map +1 -1
  38. package/dist/src/code_template/CodeTemplate.js +169 -79
  39. package/dist/src/code_template/CodeTemplate.js.map +1 -1
  40. package/dist/src/code_template/CodeTemplateModule.d.ts +6 -6
  41. package/dist/src/code_template/CodeTemplateModule.js +28 -26
  42. package/dist/src/code_template/Repo.d.ts +34 -38
  43. package/dist/src/code_template/Repo.d.ts.map +1 -1
  44. package/dist/src/code_template/Repo.js +291 -191
  45. package/dist/src/code_template/Repo.js.map +1 -1
  46. package/dist/src/fs/conversation_fs/ConversationFsModerator.d.ts +12 -12
  47. package/dist/src/fs/conversation_fs/ConversationFsModerator.d.ts.map +1 -1
  48. package/dist/src/fs/conversation_fs/ConversationFsModerator.js +111 -98
  49. package/dist/src/fs/conversation_fs/ConversationFsModerator.js.map +1 -1
  50. package/dist/src/fs/conversation_fs/ConversationFsModule.d.ts +11 -11
  51. package/dist/src/fs/conversation_fs/ConversationFsModule.d.ts.map +1 -1
  52. package/dist/src/fs/conversation_fs/ConversationFsModule.js +204 -99
  53. package/dist/src/fs/conversation_fs/ConversationFsModule.js.map +1 -1
  54. package/dist/src/fs/conversation_fs/FsFunctions.d.ts +58 -62
  55. package/dist/src/fs/conversation_fs/FsFunctions.d.ts.map +1 -1
  56. package/dist/src/fs/conversation_fs/FsFunctions.js +414 -266
  57. package/dist/src/fs/conversation_fs/FsFunctions.js.map +1 -1
  58. package/dist/src/fs/git/GitModule.d.ts +8 -8
  59. package/dist/src/fs/git/GitModule.d.ts.map +1 -1
  60. package/dist/src/fs/git/GitModule.js +163 -74
  61. package/dist/src/fs/git/GitModule.js.map +1 -1
  62. package/dist/src/fs/keyword_to_files_index/KeywordToFilesIndexFunctions.d.ts +16 -18
  63. package/dist/src/fs/keyword_to_files_index/KeywordToFilesIndexFunctions.d.ts.map +1 -1
  64. package/dist/src/fs/keyword_to_files_index/KeywordToFilesIndexFunctions.js +158 -58
  65. package/dist/src/fs/keyword_to_files_index/KeywordToFilesIndexFunctions.js.map +1 -1
  66. package/dist/src/fs/keyword_to_files_index/KeywordToFilesIndexModule.d.ts +27 -26
  67. package/dist/src/fs/keyword_to_files_index/KeywordToFilesIndexModule.d.ts.map +1 -1
  68. package/dist/src/fs/keyword_to_files_index/KeywordToFilesIndexModule.js +234 -133
  69. package/dist/src/fs/keyword_to_files_index/KeywordToFilesIndexModule.js.map +1 -1
  70. package/dist/src/fs/package/PackageFunctions.d.ts +54 -60
  71. package/dist/src/fs/package/PackageFunctions.d.ts.map +1 -1
  72. package/dist/src/fs/package/PackageFunctions.js +366 -223
  73. package/dist/src/fs/package/PackageFunctions.js.map +1 -1
  74. package/dist/src/fs/package/PackageModule.d.ts +24 -24
  75. package/dist/src/fs/package/PackageModule.d.ts.map +1 -1
  76. package/dist/src/fs/package/PackageModule.js +292 -163
  77. package/dist/src/fs/package/PackageModule.js.map +1 -1
  78. package/dist/src/history/MessageHistory.d.ts +12 -12
  79. package/dist/src/history/MessageHistory.d.ts.map +1 -1
  80. package/dist/src/history/MessageHistory.js +52 -43
  81. package/dist/src/history/MessageHistory.js.map +1 -1
  82. package/dist/src/history/MessageModerator.d.ts +2 -2
  83. package/dist/src/history/MessageModerator.js +3 -3
  84. package/dist/src/template/ConversationTemplate.d.ts +8 -8
  85. package/dist/src/template/ConversationTemplate.d.ts.map +1 -1
  86. package/dist/src/template/ConversationTemplate.js +3 -3
  87. package/dist/src/template/ConversationTemplateFunctions.d.ts +33 -35
  88. package/dist/src/template/ConversationTemplateFunctions.d.ts.map +1 -1
  89. package/dist/src/template/ConversationTemplateFunctions.js +176 -75
  90. package/dist/src/template/ConversationTemplateFunctions.js.map +1 -1
  91. package/dist/src/template/ConversationTemplateModule.d.ts +51 -48
  92. package/dist/src/template/ConversationTemplateModule.d.ts.map +1 -1
  93. package/dist/src/template/ConversationTemplateModule.js +211 -114
  94. package/dist/src/template/ConversationTemplateModule.js.map +1 -1
  95. package/dist/src/template/createApp/CreateAppTemplate.d.ts +1 -1
  96. package/dist/src/template/createApp/CreateAppTemplate.js +151 -59
  97. package/dist/src/template/createCode/CreateCodeConversationTemplate.d.ts +1 -1
  98. package/dist/src/template/createCode/CreateCodeConversationTemplate.d.ts.map +1 -1
  99. package/dist/src/template/createCode/CreateCodeConversationTemplate.js +183 -74
  100. package/dist/src/template/createCode/CreateCodeConversationTemplate.js.map +1 -1
  101. package/dist/src/template/createPackage/CreatePackageConversationTemplate.d.ts +1 -1
  102. package/dist/src/template/createPackage/CreatePackageConversationTemplate.d.ts.map +1 -1
  103. package/dist/src/template/createPackage/CreatePackageConversationTemplate.js +174 -84
  104. package/dist/src/template/createPackage/CreatePackageConversationTemplate.js.map +1 -1
  105. package/dist/src/template/createPackage/tsconfig.json +11 -11
  106. package/dist/test/createKeywordFilesIndex.test.d.ts +1 -1
  107. package/dist/test/createKeywordFilesIndex.test.js +132 -41
  108. package/dist/test/createKeywordFilesIndex.test.js.map +1 -1
  109. package/dist/test/openai/openai.generateList.test.d.ts +1 -1
  110. package/dist/test/openai/openai.generateList.test.js +136 -47
  111. package/dist/test/openai/openai.generateList.test.js.map +1 -1
  112. package/dist/test/openai/openai.parseCodeFromMarkdown.test.d.ts +1 -1
  113. package/dist/test/openai/openai.parseCodeFromMarkdown.test.js +15 -10
  114. package/dist/test/openai/openai.parseCodeFromMarkdown.test.js.map +1 -1
  115. package/dist/test/repo/repo.test.d.ts +1 -1
  116. package/dist/test/repo/repo.test.js +127 -38
  117. package/dist/test/repo/repo.test.js.map +1 -1
  118. package/jest.config.js +2 -2
  119. package/package.json +9 -3
  120. package/src/CodegenConversation.ts +6 -4
  121. package/src/Conversation.ts +102 -33
  122. package/src/ConversationModule.ts +2 -2
  123. package/src/Function.ts +0 -1
  124. package/src/OpenAi.ts +128 -63
  125. package/src/Paragraph.ts +3 -2
  126. package/src/Sentence.ts +5 -3
  127. package/src/code_template/Code.ts +25 -19
  128. package/src/code_template/CodeTemplate.ts +8 -7
  129. package/src/code_template/CodeTemplateModule.ts +2 -2
  130. package/src/code_template/Repo.ts +25 -19
  131. package/src/fs/conversation_fs/ConversationFsModerator.ts +34 -20
  132. package/src/fs/conversation_fs/ConversationFsModule.ts +13 -7
  133. package/src/fs/conversation_fs/FsFunctions.ts +33 -44
  134. package/src/fs/git/GitModule.ts +2 -4
  135. package/src/fs/keyword_to_files_index/KeywordToFilesIndexFunctions.ts +31 -31
  136. package/src/fs/keyword_to_files_index/KeywordToFilesIndexModule.ts +19 -18
  137. package/src/fs/package/PackageFunctions.ts +34 -41
  138. package/src/fs/package/PackageModule.ts +33 -21
  139. package/src/history/MessageHistory.ts +7 -4
  140. package/src/history/MessageModerator.ts +1 -1
  141. package/src/template/ConversationTemplate.ts +9 -9
  142. package/src/template/ConversationTemplateFunctions.ts +8 -7
  143. package/src/template/ConversationTemplateModule.ts +24 -15
  144. package/src/template/createApp/CreateAppTemplate.ts +1 -1
  145. package/src/template/createCode/CreateCodeConversationTemplate.ts +9 -11
  146. package/src/template/createPackage/CreatePackageConversationTemplate.ts +2 -9
  147. package/src/template/createPackage/jest.config.js +2 -2
  148. package/test/createKeywordFilesIndex.test.ts +3 -3
  149. package/test/openai/openai.generateList.test.ts +5 -3
  150. package/test/openai/openai.parseCodeFromMarkdown.test.ts +10 -5
  151. package/test/repo/repo.test.ts +3 -4
  152. package/tsconfig.json +16 -20
@@ -1,81 +1,190 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1
+ 'use strict';
2
+ var __awaiter =
3
+ (this && this.__awaiter) ||
4
+ function (thisArg, _arguments, P, generator) {
5
+ function adopt(value) {
6
+ return value instanceof P
7
+ ? value
8
+ : new P(function (resolve) {
9
+ resolve(value);
10
+ });
11
+ }
4
12
  return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
13
+ function fulfilled(value) {
14
+ try {
15
+ step(generator.next(value));
16
+ } catch (e) {
17
+ reject(e);
18
+ }
19
+ }
20
+ function rejected(value) {
21
+ try {
22
+ step(generator['throw'](value));
23
+ } catch (e) {
24
+ reject(e);
25
+ }
26
+ }
27
+ function step(result) {
28
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
29
+ }
30
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
31
  });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
32
+ };
33
+ var __generator =
34
+ (this && this.__generator) ||
35
+ function (thisArg, body) {
36
+ var _ = {
37
+ label: 0,
38
+ sent: function () {
39
+ if (t[0] & 1) throw t[1];
40
+ return t[1];
41
+ },
42
+ trys: [],
43
+ ops: [],
44
+ },
45
+ f,
46
+ y,
47
+ t,
48
+ g;
49
+ return (
50
+ (g = { next: verb(0), throw: verb(1), return: verb(2) }),
51
+ typeof Symbol === 'function' &&
52
+ (g[Symbol.iterator] = function () {
53
+ return this;
54
+ }),
55
+ g
56
+ );
57
+ function verb(n) {
58
+ return function (v) {
59
+ return step([n, v]);
60
+ };
61
+ }
15
62
  function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
63
+ if (f) throw new TypeError('Generator is already executing.');
64
+ while ((g && ((g = 0), op[0] && (_ = 0)), _))
65
+ try {
66
+ if (
67
+ ((f = 1),
68
+ y &&
69
+ (t = op[0] & 2 ? y['return'] : op[0] ? y['throw'] || ((t = y['return']) && t.call(y), 0) : y.next) &&
70
+ !(t = t.call(y, op[1])).done)
71
+ )
72
+ return t;
73
+ if (((y = 0), t)) op = [op[0] & 2, t.value];
74
+ switch (op[0]) {
75
+ case 0:
76
+ case 1:
77
+ t = op;
78
+ break;
79
+ case 4:
80
+ _.label++;
81
+ return { value: op[1], done: false };
82
+ case 5:
83
+ _.label++;
84
+ y = op[1];
85
+ op = [0];
86
+ continue;
87
+ case 7:
88
+ op = _.ops.pop();
89
+ _.trys.pop();
90
+ continue;
91
+ default:
92
+ if (!((t = _.trys), (t = t.length > 0 && t[t.length - 1])) && (op[0] === 6 || op[0] === 2)) {
93
+ _ = 0;
94
+ continue;
95
+ }
96
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
97
+ _.label = op[1];
98
+ break;
99
+ }
100
+ if (op[0] === 6 && _.label < t[1]) {
101
+ _.label = t[1];
102
+ t = op;
103
+ break;
104
+ }
105
+ if (t && _.label < t[2]) {
106
+ _.label = t[2];
107
+ _.ops.push(op);
108
+ break;
109
+ }
110
+ if (t[2]) _.ops.pop();
111
+ _.trys.pop();
112
+ continue;
113
+ }
114
+ op = body.call(thisArg, _);
115
+ } catch (e) {
116
+ op = [6, e];
117
+ y = 0;
118
+ } finally {
119
+ f = t = 0;
120
+ }
121
+ if (op[0] & 5) throw op[1];
122
+ return { value: op[0] ? op[1] : void 0, done: true };
36
123
  }
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
124
+ };
125
+ Object.defineProperty(exports, '__esModule', { value: true });
39
126
  exports.createCodeConversationTemplate = void 0;
40
- var FsFunctions_1 = require("../../fs/conversation_fs/FsFunctions");
41
- var PackageFunctions_1 = require("../../fs/package/PackageFunctions");
127
+ var FsFunctions_1 = require('../../fs/conversation_fs/FsFunctions');
128
+ var PackageFunctions_1 = require('../../fs/package/PackageFunctions');
42
129
  exports.createCodeConversationTemplate = {
43
- name: 'Create code',
44
- keywords: [
45
- 'create code',
46
- 'implement',
47
- 'write code',
48
- 'generate code',
49
- 'write software',
50
- 'build something',
51
- ],
52
- description: 'User and ai developing together',
53
- questions: [],
54
- instructions: function () { return __awaiter(void 0, void 0, void 0, function () {
55
- return __generator(this, function (_a) {
56
- return [2 /*return*/, [
57
- "You are going to generate code for the user, follow these steps:",
58
- "1. Confirm the package they want to work in, if the user didn't already provide one",
59
- "1.a. Use the ".concat(PackageFunctions_1.searchPackagesFunctionName, " function to identify the package.json file path"),
60
- "1.b. Use the ".concat(FsFunctions_1.readFilesFunctionName, " function to read the package.json file, reference this throughout the conversation in the fileSystem"),
61
- "1.c. Set the cwd to the directory of the package.json file",
62
- "2. Ask for a file name to work in, if the user didn't alrady provide one",
63
- "2.a. Whenever the user wants to create a new source file, default to creating it in the package src/ folder",
64
- "2.b. Confirm the package-relative file path with the user. Only after the users confirms the path, create the file if it doesn't exist",
65
- "2.b.1. Use the ".concat(FsFunctions_1.fileOrDirectoryExistsFunction.definition.name, " function to confirm if a file exists"),
66
- "3. Once working in a file, ask the user what they'd like to create",
67
- "3.a. If the user references a library, use the ".concat(PackageFunctions_1.searchLibrariesFunctionName, " function to identify local libraries that can be imported"),
68
- "3.a.1. Confirm the library file name and package name with the user, if they provide a different library or package name, repeat step 3.a.",
69
- "3.a.2. Call the ".concat(PackageFunctions_1.generateTypescriptDeclarationsFunction.definition.name, " function to get the typescript declaration of the library file"),
70
- "3.a.3. Use the typescript declaration and the package name to add the import statements to the top of the file",
71
- "3.a.4. Use the ".concat(FsFunctions_1.readFilesFunctionName, " function on the package.json if it's not in the fileSystem"),
72
- "3.a.5. Check the pacakge.json dependencies, if the imported package is not already a dependency, use the ".concat(PackageFunctions_1.installPackagesFunction.definition.name, " function to install it"),
73
- "3.a.5.a. Use the ".concat(PackageFunctions_1.searchPackagesFunctionName, " on the import package to derermine if it's in the local repo; if it is, calculate the relative path from the cwd package to the package being installed, use that path as the version when installing the package"),
74
- "3.b. Generate the code the user asked to create, leveraging the imported library where appropriate",
75
- "3.c. When writing the code to file, if updating an existing file, be sure to read the file first to not blow away existing code. Be sure to preserve comments as well.",
76
- "4. Repeat 3. unless the user asks to switch packages or files",
77
- ]];
78
- });
79
- }); }
130
+ name: 'Create code',
131
+ keywords: ['create code', 'implement', 'write code', 'generate code', 'write software', 'build something'],
132
+ description: 'User and ai developing together',
133
+ questions: [],
134
+ instructions: function () {
135
+ return __awaiter(void 0, void 0, void 0, function () {
136
+ return __generator(this, function (_a) {
137
+ return [
138
+ 2 /*return*/,
139
+ [
140
+ 'You are going to generate code for the user, follow these steps:',
141
+ "1. Confirm the package they want to work in, if the user didn't already provide one",
142
+ '1.a. Use the '.concat(
143
+ PackageFunctions_1.searchPackagesFunctionName,
144
+ ' function to identify the package.json file path'
145
+ ),
146
+ '1.b. Use the '.concat(
147
+ FsFunctions_1.readFilesFunctionName,
148
+ ' function to read the package.json file, reference this throughout the conversation in the fileSystem'
149
+ ),
150
+ '1.c. Set the cwd to the directory of the package.json file',
151
+ "2. Ask for a file name to work in, if the user didn't alrady provide one",
152
+ '2.a. Whenever the user wants to create a new source file, default to creating it in the package src/ folder',
153
+ "2.b. Confirm the package-relative file path with the user. Only after the users confirms the path, create the file if it doesn't exist",
154
+ '2.b.1. Use the '.concat(
155
+ FsFunctions_1.fileOrDirectoryExistsFunction.definition.name,
156
+ ' function to confirm if a file exists'
157
+ ),
158
+ "3. Once working in a file, ask the user what they'd like to create",
159
+ '3.a. If the user references a library, use the '.concat(
160
+ PackageFunctions_1.searchLibrariesFunctionName,
161
+ ' function to identify local libraries that can be imported'
162
+ ),
163
+ '3.a.1. Confirm the library file name and package name with the user, if they provide a different library or package name, repeat step 3.a.',
164
+ '3.a.2. Call the '.concat(
165
+ PackageFunctions_1.generateTypescriptDeclarationsFunction.definition.name,
166
+ ' function to get the typescript declaration of the library file'
167
+ ),
168
+ '3.a.3. Use the typescript declaration and the package name to add the import statements to the top of the file',
169
+ '3.a.4. Use the '.concat(
170
+ FsFunctions_1.readFilesFunctionName,
171
+ " function on the package.json if it's not in the fileSystem"
172
+ ),
173
+ '3.a.5. Check the pacakge.json dependencies, if the imported package is not already a dependency, use the '.concat(
174
+ PackageFunctions_1.installPackagesFunction.definition.name,
175
+ ' function to install it'
176
+ ),
177
+ '3.a.5.a. Use the '.concat(
178
+ PackageFunctions_1.searchPackagesFunctionName,
179
+ " on the import package to derermine if it's in the local repo; if it is, calculate the relative path from the cwd package to the package being installed, use that path as the version when installing the package"
180
+ ),
181
+ '3.b. Generate the code the user asked to create, leveraging the imported library where appropriate',
182
+ '3.c. When writing the code to file, if updating an existing file, be sure to read the file first to not blow away existing code. Be sure to preserve comments as well.',
183
+ '4. Repeat 3. unless the user asks to switch packages or files',
184
+ ],
185
+ ];
186
+ });
187
+ });
188
+ },
80
189
  };
81
- //# sourceMappingURL=CreateCodeConversationTemplate.js.map
190
+ //# sourceMappingURL=CreateCodeConversationTemplate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CreateCodeConversationTemplate.js","sourceRoot":"","sources":["../../../../src/template/createCode/CreateCodeConversationTemplate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oEAA4G;AAC5G,sEAA6K;AAGhK,QAAA,8BAA8B,GAAyB;IAClE,IAAI,EAAE,aAAa;IACnB,QAAQ,EAAE;QACR,aAAa;QACb,WAAW;QACX,YAAY;QACZ,eAAe;QACf,gBAAgB;QAChB,iBAAiB;KAClB;IACD,WAAW,EAAE,iCAAiC;IAC9C,SAAS,EAAE,EAAE;IACb,YAAY,EAAE;;YACZ,sBAAO;oBACL,kEAAkE;oBAClE,qFAAqF;oBACrF,uBAAgB,6CAA0B,qDAAkD;oBAC5F,uBAAgB,mCAAqB,0GAAuG;oBAC5I,4DAA4D;oBAC5D,0EAA0E;oBAC1E,6GAA6G;oBAC7G,wIAAwI;oBACxI,yBAAkB,2CAA6B,CAAC,UAAU,CAAC,IAAI,0CAAuC;oBACtG,oEAAoE;oBACpE,yDAAkD,8CAA2B,+DAA4D;oBACzI,4IAA4I;oBAC5I,0BAAmB,yDAAsC,CAAC,UAAU,CAAC,IAAI,oEAAiE;oBAC1I,gHAAgH;oBAChH,yBAAkB,mCAAqB,gEAA6D;oBACpG,mHAA4G,0CAAuB,CAAC,UAAU,CAAC,IAAI,4BAAyB;oBAC5K,2BAAoB,6CAA0B,uNAAoN;oBAClQ,oGAAoG;oBACpG,wKAAwK;oBACxK,+DAA+D;iBAChE,EAAC;;SACH;CACF,CAAA"}
1
+ {"version":3,"file":"CreateCodeConversationTemplate.js","sourceRoot":"","sources":["../../../../src/template/createCode/CreateCodeConversationTemplate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oEAA4G;AAC5G,sEAK2C;AAG9B,QAAA,8BAA8B,GAAyB;IAClE,IAAI,EAAE,aAAa;IACnB,QAAQ,EAAE,CAAC,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,CAAC;IAC1G,WAAW,EAAE,iCAAiC;IAC9C,SAAS,EAAE,EAAE;IACb,YAAY,EAAE;;YACZ,sBAAO;oBACL,kEAAkE;oBAClE,qFAAqF;oBACrF,uBAAgB,6CAA0B,qDAAkD;oBAC5F,uBAAgB,mCAAqB,0GAAuG;oBAC5I,4DAA4D;oBAC5D,0EAA0E;oBAC1E,6GAA6G;oBAC7G,wIAAwI;oBACxI,yBAAkB,2CAA6B,CAAC,UAAU,CAAC,IAAI,0CAAuC;oBACtG,oEAAoE;oBACpE,yDAAkD,8CAA2B,+DAA4D;oBACzI,4IAA4I;oBAC5I,0BAAmB,yDAAsC,CAAC,UAAU,CAAC,IAAI,oEAAiE;oBAC1I,gHAAgH;oBAChH,yBAAkB,mCAAqB,gEAA6D;oBACpG,mHAA4G,0CAAuB,CAAC,UAAU,CAAC,IAAI,4BAAyB;oBAC5K,2BAAoB,6CAA0B,uNAAoN;oBAClQ,oGAAoG;oBACpG,wKAAwK;oBACxK,+DAA+D;iBAChE,EAAC;;SACH;CACF,CAAC"}
@@ -1,3 +1,3 @@
1
1
  import { ConversationTemplate } from '../ConversationTemplate';
2
2
  export declare const createPackageConversationTemplate: ConversationTemplate;
3
- //# sourceMappingURL=CreatePackageConversationTemplate.d.ts.map
3
+ //# sourceMappingURL=CreatePackageConversationTemplate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CreatePackageConversationTemplate.d.ts","sourceRoot":"","sources":["../../../../src/template/createPackage/CreatePackageConversationTemplate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAI/D,eAAO,MAAM,iCAAiC,EAAE,oBAoC/C,CAAA"}
1
+ {"version":3,"file":"CreatePackageConversationTemplate.d.ts","sourceRoot":"","sources":["../../../../src/template/createPackage/CreatePackageConversationTemplate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAI/D,eAAO,MAAM,iCAAiC,EAAE,oBA6B/C,CAAC"}
@@ -1,91 +1,181 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1
+ 'use strict';
2
+ var __awaiter =
3
+ (this && this.__awaiter) ||
4
+ function (thisArg, _arguments, P, generator) {
5
+ function adopt(value) {
6
+ return value instanceof P
7
+ ? value
8
+ : new P(function (resolve) {
9
+ resolve(value);
10
+ });
11
+ }
4
12
  return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
13
+ function fulfilled(value) {
14
+ try {
15
+ step(generator.next(value));
16
+ } catch (e) {
17
+ reject(e);
18
+ }
19
+ }
20
+ function rejected(value) {
21
+ try {
22
+ step(generator['throw'](value));
23
+ } catch (e) {
24
+ reject(e);
25
+ }
26
+ }
27
+ function step(result) {
28
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
29
+ }
30
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
31
  });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
32
+ };
33
+ var __generator =
34
+ (this && this.__generator) ||
35
+ function (thisArg, body) {
36
+ var _ = {
37
+ label: 0,
38
+ sent: function () {
39
+ if (t[0] & 1) throw t[1];
40
+ return t[1];
41
+ },
42
+ trys: [],
43
+ ops: [],
44
+ },
45
+ f,
46
+ y,
47
+ t,
48
+ g;
49
+ return (
50
+ (g = { next: verb(0), throw: verb(1), return: verb(2) }),
51
+ typeof Symbol === 'function' &&
52
+ (g[Symbol.iterator] = function () {
53
+ return this;
54
+ }),
55
+ g
56
+ );
57
+ function verb(n) {
58
+ return function (v) {
59
+ return step([n, v]);
60
+ };
61
+ }
15
62
  function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
63
+ if (f) throw new TypeError('Generator is already executing.');
64
+ while ((g && ((g = 0), op[0] && (_ = 0)), _))
65
+ try {
66
+ if (
67
+ ((f = 1),
68
+ y &&
69
+ (t = op[0] & 2 ? y['return'] : op[0] ? y['throw'] || ((t = y['return']) && t.call(y), 0) : y.next) &&
70
+ !(t = t.call(y, op[1])).done)
71
+ )
72
+ return t;
73
+ if (((y = 0), t)) op = [op[0] & 2, t.value];
74
+ switch (op[0]) {
75
+ case 0:
76
+ case 1:
77
+ t = op;
78
+ break;
79
+ case 4:
80
+ _.label++;
81
+ return { value: op[1], done: false };
82
+ case 5:
83
+ _.label++;
84
+ y = op[1];
85
+ op = [0];
86
+ continue;
87
+ case 7:
88
+ op = _.ops.pop();
89
+ _.trys.pop();
90
+ continue;
91
+ default:
92
+ if (!((t = _.trys), (t = t.length > 0 && t[t.length - 1])) && (op[0] === 6 || op[0] === 2)) {
93
+ _ = 0;
94
+ continue;
95
+ }
96
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
97
+ _.label = op[1];
98
+ break;
99
+ }
100
+ if (op[0] === 6 && _.label < t[1]) {
101
+ _.label = t[1];
102
+ t = op;
103
+ break;
104
+ }
105
+ if (t && _.label < t[2]) {
106
+ _.label = t[2];
107
+ _.ops.push(op);
108
+ break;
109
+ }
110
+ if (t[2]) _.ops.pop();
111
+ _.trys.pop();
112
+ continue;
113
+ }
114
+ op = body.call(thisArg, _);
115
+ } catch (e) {
116
+ op = [6, e];
117
+ y = 0;
118
+ } finally {
119
+ f = t = 0;
120
+ }
121
+ if (op[0] & 5) throw op[1];
122
+ return { value: op[0] ? op[1] : void 0, done: true };
36
123
  }
37
- };
38
- var __importDefault = (this && this.__importDefault) || function (mod) {
39
- return (mod && mod.__esModule) ? mod : { "default": mod };
40
- };
41
- Object.defineProperty(exports, "__esModule", { value: true });
124
+ };
125
+ var __importDefault =
126
+ (this && this.__importDefault) ||
127
+ function (mod) {
128
+ return mod && mod.__esModule ? mod : { default: mod };
129
+ };
130
+ Object.defineProperty(exports, '__esModule', { value: true });
42
131
  exports.createPackageConversationTemplate = void 0;
43
- var util_node_1 = require("@proteinjs/util-node");
44
- var path_1 = __importDefault(require("path"));
132
+ var util_node_1 = require('@proteinjs/util-node');
133
+ var path_1 = __importDefault(require('path'));
45
134
  exports.createPackageConversationTemplate = {
46
- name: 'Create Package',
47
- keywords: [
48
- 'package',
49
- 'create package',
50
- 'create',
51
- 'create a package',
52
- 'create a new package',
53
- "new package",
54
- ],
55
- description: 'Create a npm package',
56
- questions: [
57
- { text: "Which folder should the package be created in?" },
58
- { text: "What should the package name be?" },
59
- { text: "What should the package version be?", optional: true },
60
- { text: "Is this a typescript project?" },
61
- { text: "Are there any default dependencies you'd like to include?", optional: true },
62
- ],
63
- instructions: function () { return __awaiter(void 0, void 0, void 0, function () {
64
- var jestConfig, tsConfig;
65
- return __generator(this, function (_a) {
66
- switch (_a.label) {
67
- case 0: return [4 /*yield*/, util_node_1.Fs.readFile(path_1.default.join(__dirname, "./jest.config.js"))];
68
- case 1:
69
- jestConfig = _a.sent();
70
- return [4 /*yield*/, util_node_1.Fs.readFile(path_1.default.join(__dirname, "./tsconfig.json"))];
71
- case 2:
72
- tsConfig = _a.sent();
73
- return [2 /*return*/, [
74
- "Create a new package.json with the provided name, version (if one wasn't provided, default to 0.1), and any default dependencies provided",
75
- "Create the package.json in the specified folder, do not create subfolders from the package name",
76
- "If the folder does not exist, create the folder",
77
- "Add these scripts to the package.json: \"start\": \"node ./dist/index.js\", \"test\": \"jest\"",
78
- "Add these dev dependencies to the package.json: jest",
79
- "If it's a typescript project, add these dev dependencies: @types/jest, ts-jest",
80
- "If it's a typescript project, add these scripts: \"watch\": \"tsc -w -p .\"",
81
- "Create an index file in the package root directory (choose extension based on if it's a typescript project or not)",
82
- "Create the following folders in the package directory: src, test",
83
- "Create a jest.config.js file in the test directory with the following content: ".concat(jestConfig),
84
- "Create a .gitignore file in the package directory that ignores the node_modules and dist directories",
85
- "If it's a typescript project, create a tsconfig.json file in the pakage directory with the following content: ".concat(tsConfig),
86
- ]];
87
- }
88
- });
89
- }); },
135
+ name: 'Create Package',
136
+ keywords: ['package', 'create package', 'create', 'create a package', 'create a new package', 'new package'],
137
+ description: 'Create a npm package',
138
+ questions: [
139
+ { text: 'Which folder should the package be created in?' },
140
+ { text: 'What should the package name be?' },
141
+ { text: 'What should the package version be?', optional: true },
142
+ { text: 'Is this a typescript project?' },
143
+ { text: "Are there any default dependencies you'd like to include?", optional: true },
144
+ ],
145
+ instructions: function () {
146
+ return __awaiter(void 0, void 0, void 0, function () {
147
+ var jestConfig, tsConfig;
148
+ return __generator(this, function (_a) {
149
+ switch (_a.label) {
150
+ case 0:
151
+ return [4 /*yield*/, util_node_1.Fs.readFile(path_1.default.join(__dirname, './jest.config.js'))];
152
+ case 1:
153
+ jestConfig = _a.sent();
154
+ return [4 /*yield*/, util_node_1.Fs.readFile(path_1.default.join(__dirname, './tsconfig.json'))];
155
+ case 2:
156
+ tsConfig = _a.sent();
157
+ return [
158
+ 2 /*return*/,
159
+ [
160
+ "Create a new package.json with the provided name, version (if one wasn't provided, default to 0.1), and any default dependencies provided",
161
+ 'Create the package.json in the specified folder, do not create subfolders from the package name',
162
+ 'If the folder does not exist, create the folder',
163
+ 'Add these scripts to the package.json: "start": "node ./dist/index.js", "test": "jest"',
164
+ 'Add these dev dependencies to the package.json: jest',
165
+ "If it's a typescript project, add these dev dependencies: @types/jest, ts-jest",
166
+ 'If it\'s a typescript project, add these scripts: "watch": "tsc -w -p ."',
167
+ "Create an index file in the package root directory (choose extension based on if it's a typescript project or not)",
168
+ 'Create the following folders in the package directory: src, test',
169
+ 'Create a jest.config.js file in the test directory with the following content: '.concat(jestConfig),
170
+ 'Create a .gitignore file in the package directory that ignores the node_modules and dist directories',
171
+ "If it's a typescript project, create a tsconfig.json file in the pakage directory with the following content: ".concat(
172
+ tsConfig
173
+ ),
174
+ ],
175
+ ];
176
+ }
177
+ });
178
+ });
179
+ },
90
180
  };
91
- //# sourceMappingURL=CreatePackageConversationTemplate.js.map
181
+ //# sourceMappingURL=CreatePackageConversationTemplate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CreatePackageConversationTemplate.js","sourceRoot":"","sources":["../../../../src/template/createPackage/CreatePackageConversationTemplate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0C;AAE1C,8CAAwB;AAGX,QAAA,iCAAiC,GAAyB;IACrE,IAAI,EAAE,gBAAgB;IACtB,QAAQ,EAAE;QACR,SAAS;QACT,gBAAgB;QAChB,QAAQ;QACR,kBAAkB;QAClB,sBAAsB;QACtB,aAAa;KACd;IACD,WAAW,EAAE,sBAAsB;IACnC,SAAS,EAAE;QACT,EAAE,IAAI,EAAE,gDAAgD,EAAE;QAC1D,EAAE,IAAI,EAAE,kCAAkC,EAAE;QAC5C,EAAE,IAAI,EAAE,qCAAqC,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC/D,EAAE,IAAI,EAAE,+BAA+B,EAAE;QACzC,EAAE,IAAI,EAAE,2DAA2D,EAAE,QAAQ,EAAE,IAAI,EAAE;KACtF;IACD,YAAY,EAAE;;;;wBACO,qBAAM,cAAE,CAAC,QAAQ,CAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC,EAAA;;oBAAxE,UAAU,GAAG,SAA2D;oBAC7D,qBAAM,cAAE,CAAC,QAAQ,CAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC,EAAA;;oBAArE,QAAQ,GAAG,SAA0D;oBAC3E,sBAAO;4BACL,2IAA2I;4BAC3I,iGAAiG;4BACjG,iDAAiD;4BACjD,gGAAwF;4BACxF,sDAAsD;4BACtD,gFAAgF;4BAChF,6EAAyE;4BACzE,oHAAoH;4BACpH,kEAAkE;4BAClE,yFAAkF,UAAU,CAAE;4BAC9F,sGAAsG;4BACtG,wHAAiH,QAAQ,CAAE;yBAC5H,EAAC;;;SACH;CACF,CAAA"}
1
+ {"version":3,"file":"CreatePackageConversationTemplate.js","sourceRoot":"","sources":["../../../../src/template/createPackage/CreatePackageConversationTemplate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0C;AAE1C,8CAAwB;AAGX,QAAA,iCAAiC,GAAyB;IACrE,IAAI,EAAE,gBAAgB;IACtB,QAAQ,EAAE,CAAC,SAAS,EAAE,gBAAgB,EAAE,QAAQ,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,aAAa,CAAC;IAC5G,WAAW,EAAE,sBAAsB;IACnC,SAAS,EAAE;QACT,EAAE,IAAI,EAAE,gDAAgD,EAAE;QAC1D,EAAE,IAAI,EAAE,kCAAkC,EAAE;QAC5C,EAAE,IAAI,EAAE,qCAAqC,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC/D,EAAE,IAAI,EAAE,+BAA+B,EAAE;QACzC,EAAE,IAAI,EAAE,2DAA2D,EAAE,QAAQ,EAAE,IAAI,EAAE;KACtF;IACD,YAAY,EAAE;;;;wBACO,qBAAM,cAAE,CAAC,QAAQ,CAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC,EAAA;;oBAAxE,UAAU,GAAG,SAA2D;oBAC7D,qBAAM,cAAE,CAAC,QAAQ,CAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC,EAAA;;oBAArE,QAAQ,GAAG,SAA0D;oBAC3E,sBAAO;4BACL,2IAA2I;4BAC3I,iGAAiG;4BACjG,iDAAiD;4BACjD,gGAAwF;4BACxF,sDAAsD;4BACtD,gFAAgF;4BAChF,6EAAyE;4BACzE,oHAAoH;4BACpH,kEAAkE;4BAClE,yFAAkF,UAAU,CAAE;4BAC9F,sGAAsG;4BACtG,wHAAiH,QAAQ,CAAE;yBAC5H,EAAC;;;SACH;CACF,CAAC"}
@@ -1,13 +1,13 @@
1
1
  {
2
- "compilerOptions": {
3
- "target": "es2016",
4
- "module": "commonjs",
5
- "resolveJsonModule": true,
6
- "allowJs": true,
7
- "outDir": "./dist",
8
- "esModuleInterop": true,
9
- "forceConsistentCasingInFileNames": true,
10
- "strict": true,
11
- "skipLibCheck": true
12
- }
2
+ "compilerOptions": {
3
+ "target": "es2016",
4
+ "module": "commonjs",
5
+ "resolveJsonModule": true,
6
+ "allowJs": true,
7
+ "outDir": "./dist",
8
+ "esModuleInterop": true,
9
+ "forceConsistentCasingInFileNames": true,
10
+ "strict": true,
11
+ "skipLibCheck": true
12
+ }
13
13
  }
@@ -1,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=createKeywordFilesIndex.test.d.ts.map
2
+ //# sourceMappingURL=createKeywordFilesIndex.test.d.ts.map