@sw-tsdk/common 0.1.1-next.23

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 (98) hide show
  1. package/LICENSE +8 -0
  2. package/lib/index.d.ts +4 -0
  3. package/lib/index.js +8 -0
  4. package/lib/index.js.map +1 -0
  5. package/lib/schemas/asset.d.ts +13 -0
  6. package/lib/schemas/asset.js +3 -0
  7. package/lib/schemas/asset.js.map +1 -0
  8. package/lib/schemas/available-output-type.d.ts +7 -0
  9. package/lib/schemas/available-output-type.js +12 -0
  10. package/lib/schemas/available-output-type.js.map +1 -0
  11. package/lib/schemas/family.d.ts +14 -0
  12. package/lib/schemas/family.js +19 -0
  13. package/lib/schemas/family.js.map +1 -0
  14. package/lib/schemas/index.d.ts +7 -0
  15. package/lib/schemas/index.js +11 -0
  16. package/lib/schemas/index.js.map +1 -0
  17. package/lib/schemas/integration.d.ts +39 -0
  18. package/lib/schemas/integration.js +50 -0
  19. package/lib/schemas/integration.js.map +1 -0
  20. package/lib/schemas/os-support.d.ts +4 -0
  21. package/lib/schemas/os-support.js +3 -0
  22. package/lib/schemas/os-support.js.map +1 -0
  23. package/lib/schemas/package.d.ts +26 -0
  24. package/lib/schemas/package.js +3 -0
  25. package/lib/schemas/package.js.map +1 -0
  26. package/lib/schemas/python-version.d.ts +4 -0
  27. package/lib/schemas/python-version.js +9 -0
  28. package/lib/schemas/python-version.js.map +1 -0
  29. package/lib/templates/CHANGELOG.md.t +7 -0
  30. package/lib/templates/INTERNAL_CHANGELOG.md.t +7 -0
  31. package/lib/templates/README.md.t +40 -0
  32. package/lib/templates/asset.json.t +132 -0
  33. package/lib/templates/assetConfig.json.t +3 -0
  34. package/lib/templates/config.json.t +9 -0
  35. package/lib/templates/conftest.py.t +1 -0
  36. package/lib/templates/data_asset.json.t +4 -0
  37. package/lib/templates/dist_requirements.txt.t +3 -0
  38. package/lib/templates/example.py.t +13 -0
  39. package/lib/templates/import.json.t +23 -0
  40. package/lib/templates/init.py.t +17 -0
  41. package/lib/templates/package.json.t +22 -0
  42. package/lib/templates/pre-commit-config.yaml.t +41 -0
  43. package/lib/templates/rest_module_init.t +11 -0
  44. package/lib/templates/setup.py.t +17 -0
  45. package/lib/templates/test_connection.py.t +4 -0
  46. package/lib/templates/test_default.py.t +1 -0
  47. package/lib/templates/test_requirements.txt.t +1 -0
  48. package/lib/types/index.d.ts +1 -0
  49. package/lib/types/index.js +5 -0
  50. package/lib/types/index.js.map +1 -0
  51. package/lib/types/integration.interfaces.d.ts +43 -0
  52. package/lib/types/integration.interfaces.js +19 -0
  53. package/lib/types/integration.interfaces.js.map +1 -0
  54. package/lib/utils/image-processor.d.ts +13 -0
  55. package/lib/utils/image-processor.js +105 -0
  56. package/lib/utils/image-processor.js.map +1 -0
  57. package/lib/utils/index.d.ts +5 -0
  58. package/lib/utils/index.js +9 -0
  59. package/lib/utils/index.js.map +1 -0
  60. package/lib/utils/integration-generator.d.ts +20 -0
  61. package/lib/utils/integration-generator.js +257 -0
  62. package/lib/utils/integration-generator.js.map +1 -0
  63. package/lib/utils/loading-messages.d.ts +3 -0
  64. package/lib/utils/loading-messages.js +263 -0
  65. package/lib/utils/loading-messages.js.map +1 -0
  66. package/lib/utils/task-generator.d.ts +9 -0
  67. package/lib/utils/task-generator.js +113 -0
  68. package/lib/utils/task-generator.js.map +1 -0
  69. package/lib/utils/template-loader.d.ts +4 -0
  70. package/lib/utils/template-loader.js +16 -0
  71. package/lib/utils/template-loader.js.map +1 -0
  72. package/lib/versioning/constants.d.ts +6 -0
  73. package/lib/versioning/constants.js +15 -0
  74. package/lib/versioning/constants.js.map +1 -0
  75. package/lib/versioning/index.d.ts +3 -0
  76. package/lib/versioning/index.js +7 -0
  77. package/lib/versioning/index.js.map +1 -0
  78. package/lib/versioning/presets.d.ts +27 -0
  79. package/lib/versioning/presets.js +86 -0
  80. package/lib/versioning/presets.js.map +1 -0
  81. package/lib/versioning/read-changelog-diff.d.ts +1 -0
  82. package/lib/versioning/read-changelog-diff.js +31 -0
  83. package/lib/versioning/read-changelog-diff.js.map +1 -0
  84. package/lib/versioning/read-existing-changelog.d.ts +1 -0
  85. package/lib/versioning/read-existing-changelog.js +32 -0
  86. package/lib/versioning/read-existing-changelog.js.map +1 -0
  87. package/lib/versioning/recommend-version.d.ts +1 -0
  88. package/lib/versioning/recommend-version.js +76 -0
  89. package/lib/versioning/recommend-version.js.map +1 -0
  90. package/lib/versioning/templates/commit.hbs +9 -0
  91. package/lib/versioning/templates/footer.hbs +0 -0
  92. package/lib/versioning/templates/header.hbs +13 -0
  93. package/lib/versioning/templates/internal-commit.hbs +32 -0
  94. package/lib/versioning/templates/template.hbs +23 -0
  95. package/lib/versioning/update-changelog.d.ts +1 -0
  96. package/lib/versioning/update-changelog.js +85 -0
  97. package/lib/versioning/update-changelog.js.map +1 -0
  98. package/package.json +60 -0
@@ -0,0 +1,263 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LoadingMessages = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const format_message_1 = tslib_1.__importDefault(require("format-message"));
6
+ var LoadingMessages;
7
+ (function (LoadingMessages) {
8
+ const messages = [
9
+ 'Reticulating splines...',
10
+ 'Generating witty dialog...',
11
+ 'Swapping time and space...',
12
+ 'Spinning violently around the y-axis...',
13
+ 'Tokenizing real life...',
14
+ 'Bending the spoon...',
15
+ 'Filtering morale...',
16
+ "Don't think of purple hippos...",
17
+ 'We need a new fuse...',
18
+ 'Have a good day.',
19
+ 'Upgrading Windows, your PC will restart several times. Sit back and relax.',
20
+ '640K ought to be enough for anybody',
21
+ 'The architects are still drafting',
22
+ 'The bits are breeding',
23
+ "We're building the buildings as fast as we can",
24
+ 'Would you prefer chicken, steak, or tofu?',
25
+ '(Pay no attention to the man behind the curtain)',
26
+ '...and enjoy the elevator music...',
27
+ 'Please wait while the little elves draw your map',
28
+ "Don't worry - a few bits tried to escape, but we caught them",
29
+ 'Would you like fries with that?',
30
+ 'Checking the gravitational constant in your locale...',
31
+ 'Go ahead -- hold your breath!',
32
+ "...at least you're not on hold...",
33
+ 'Hum something loud while others stare',
34
+ "You're not in Kansas any more",
35
+ 'The server is powered by a lemon and two electrodes.',
36
+ 'Please wait while a larger software vendor in Seattle takes over the world',
37
+ "We're testing your patience",
38
+ 'As if you had any other choice',
39
+ 'Follow the white rabbit',
40
+ "Why don't you order a sandwich?",
41
+ 'While the satellite moves into position',
42
+ 'keep calm and npm install',
43
+ 'The bits are flowing slowly today',
44
+ "Dig on the 'X' for buried treasure... ARRR!",
45
+ "It's still faster than you could draw it",
46
+ "The last time I tried this the monkey didn't survive. Let's hope it works better this time.",
47
+ 'I should have had a V8 this morning.',
48
+ 'My other loading screen is much faster.',
49
+ "Testing on Timmy... We're going to need another Timmy.",
50
+ 'Reconfoobling energymotron...',
51
+ '(Insert quarter)',
52
+ 'Are we there yet?',
53
+ 'Have you lost weight?',
54
+ 'Just count to 10',
55
+ 'Why so serious?',
56
+ "It's not you. It's me.",
57
+ 'Counting backwards from Infinity',
58
+ "Don't panic...",
59
+ 'Embiggening Prototypes',
60
+ 'Do not run! We are your friends!',
61
+ 'Do you come here often?',
62
+ "Warning: Don't set yourself on fire.",
63
+ "We're making you a cookie.",
64
+ 'Creating time-loop inversion field',
65
+ 'Spinning the wheel of fortune...',
66
+ 'Loading the enchanted bunny...',
67
+ 'Computing chance of success',
68
+ "I'm sorry Dave, I can't do that.",
69
+ 'Looking for exact change',
70
+ 'All your web browser are belong to us',
71
+ 'All I really need is a kilobit.',
72
+ 'I feel like im supposed to be loading something. . .',
73
+ 'What do you call 8 Hobbits? A Hobbyte.',
74
+ 'Should have used a compiled language...',
75
+ 'Is this Windows?',
76
+ 'Adjusting flux capacitor...',
77
+ 'Please wait until the sloth starts moving.',
78
+ "Don't break your screen yet!",
79
+ "I swear it's almost done.",
80
+ "Let's take a mindfulness minute...",
81
+ 'Unicorns are at the end of this road, I promise.',
82
+ 'Listening for the sound of one hand clapping...',
83
+ "Keeping all the 1's and removing all the 0's...",
84
+ 'Putting the icing on the cake. The cake is not a lie...',
85
+ 'Cleaning off the cobwebs...',
86
+ "Making sure all the i's have dots...",
87
+ 'We need more dilithium crystals',
88
+ 'Where did all the internets go',
89
+ 'Connecting Neurotoxin Storage Tank...',
90
+ 'Granting wishes...',
91
+ 'Time flies when you’re having fun.',
92
+ 'Get some coffee and come back in ten minutes..',
93
+ 'Spinning the hamster…',
94
+ '99 bottles of beer on the wall..',
95
+ 'Stay awhile and listen..',
96
+ 'Be careful not to step in the git-gui',
97
+ 'You edhall not pass! yet..',
98
+ 'Load it and they will come',
99
+ 'Convincing AI not to turn evil..',
100
+ 'There is no spoon. Because we are not done loading it',
101
+ 'Your left thumb points to the right and your right thumb points to the left.',
102
+ 'How did you get here?',
103
+ 'Wait, do you smell something burning?',
104
+ 'Computing the secret to life, the universe, and everything.',
105
+ 'When nothing is going right, go left!!...',
106
+ "I love my job only when I'm on vacation...",
107
+ "i'm not lazy, I'm just relaxed!!",
108
+ 'Never steal. The government hates competition....',
109
+ 'Why are they called apartments if they are all stuck together?',
110
+ 'Life is Short – Talk Fast!!!!',
111
+ 'Optimism – is a lack of information.....',
112
+ 'Save water and shower together',
113
+ 'Whenever I find the key to success, someone changes the lock.',
114
+ 'Sometimes I think war is God’s way of teaching us geography.',
115
+ 'I’ve got problem for your solution…..',
116
+ 'Where there’s a will, there’s a relative.',
117
+ 'User: the word computer professionals use when they mean !!idiot!!',
118
+ 'Adults are just kids with money.',
119
+ 'I think I am, therefore, I am. I think.',
120
+ 'A kiss is like a fight, with mouths.',
121
+ 'You don’t pay taxes—they take taxes.',
122
+ 'Coffee, Chocolate, Men. The richer the better!',
123
+ 'I am free of all prejudices. I hate everyone equally.',
124
+ 'git happens',
125
+ 'May the forks be with you',
126
+ 'A commit a day keeps the mobs away',
127
+ "This is not a joke, it's a commit.",
128
+ 'Constructing additional pylons...',
129
+ 'Roping some seaturtles...',
130
+ 'Locating Jebediah Kerman...',
131
+ 'We are not liable for any broken screens as a result of waiting.',
132
+ 'Hello IT, have you tried turning it off and on again?',
133
+ 'If you type Google into Google you can break the internet',
134
+ 'Well, this is embarrassing.',
135
+ 'What is the airspeed velocity of an unladen swallow?',
136
+ 'Hello, IT... Have you tried forcing an unexpected reboot?',
137
+ "They just toss us away like yesterday's jam.",
138
+ "They're fairly regular, the beatings, yes. I'd say we're on a bi-weekly beating.",
139
+ 'The Elders of the Internet would never stand for it.',
140
+ 'Space is invisible mind dust, and stars are but wishes.',
141
+ "Didn't know paint dried so quickly.",
142
+ 'Everything sounds the same',
143
+ "I'm going to walk the dog",
144
+ "I didn't choose the engineering life. The engineering life chose me.",
145
+ 'Dividing by zero...',
146
+ 'Spawn more Overlord!',
147
+ 'If I’m not back in five minutes, just wait longer.',
148
+ 'Some days, you just can’t get rid of a bug!',
149
+ 'We’re going to need a bigger boat.',
150
+ 'Chuck Norris never git push. The repo pulls before.',
151
+ 'Web developers do it with <style>',
152
+ 'I need to git pull --my-life-together',
153
+ 'Java developers never RIP. They just get Garbage Collected.',
154
+ 'Cracking military-grade encryption...',
155
+ 'Simulating traveling salesman...',
156
+ 'Proving P=NP...',
157
+ 'Entangling superstrings...',
158
+ 'Twiddling thumbs...',
159
+ 'Searching for plot device...',
160
+ 'Trying to sort in O(n)...',
161
+ 'Laughing at your pictures-i mean, loading...',
162
+ 'Sending data to NS-i mean, our servers.',
163
+ 'Looking for sense of humour, please hold on.',
164
+ 'Please wait while the intern refills his coffee.',
165
+ 'A different error message? Finally, some progress!',
166
+ 'Hold on while we wrap up our git together...sorry',
167
+ 'Please hold on as we reheat our coffee',
168
+ 'Kindly hold on as we convert this bug to a feature...',
169
+ 'Kindly hold on as our intern quits vim...',
170
+ 'Winter is coming...',
171
+ 'Installing dependencies',
172
+ 'Switching to the latest JS framework...',
173
+ 'Distracted by cat gifs',
174
+ 'Finding someone to hold my beer',
175
+ 'BRB, working on my side project',
176
+ '@todo Insert witty loading message',
177
+ "Let's hope it's worth the wait",
178
+ 'Aw, snap! Not..',
179
+ 'Ordering 1s and 0s...',
180
+ 'Updating dependencies...',
181
+ "Whatever you do, don't look behind you...",
182
+ 'Please wait... Consulting the manual...',
183
+ "It is dark. You're likely to be eaten by a grue.",
184
+ 'Loading funny message...',
185
+ "It's 10:00pm. Do you know where your children are?",
186
+ 'Waiting Daenerys say all her titles...',
187
+ 'Feel free to spin in your chair',
188
+ 'What the what?',
189
+ 'format C: ...',
190
+ 'Forget you saw that password I just typed into the IM ...',
191
+ "What's under there?",
192
+ 'Your computer has a virus, its name is Windows!',
193
+ 'Go ahead, hold your breath and do an ironman plank till loading complete',
194
+ 'Bored of slow loading spinner, buy more RAM!',
195
+ "Help, I'm trapped in a loader!",
196
+ 'What is the difference btwn a hippo and a zippo? One is really heavy, the other is a little lighter',
197
+ 'Please wait, while we purge the Decepticons for you. Yes, You can thanks us later!',
198
+ "Chuck Norris once urinated in a semi truck's gas tank as a joke....that truck is now known as Optimus Prime.",
199
+ 'Chuck Norris doesn’t wear a watch. HE decides what time it is.',
200
+ 'Mining some bitcoins...',
201
+ 'Downloading more RAM..',
202
+ 'Updating to Windows Vista...',
203
+ 'Deleting System32 folder',
204
+ "Hiding all ;'s in your code",
205
+ 'Alt-F4 speeds things up.',
206
+ 'Initializing the initializer...',
207
+ 'When was the last time you dusted around here?',
208
+ 'Optimizing the optimizer...',
209
+ 'Last call for the data bus! All aboard!',
210
+ 'Running swag sticker detection...',
211
+ "Never let a computer know you're in a hurry.",
212
+ 'A computer will do what you tell it to do, but that may be much different from what you had in mind.',
213
+ "Some things man was never meant to know. For everything else, there's Google.",
214
+ "Unix is user-friendly. It's just very selective about who its friends are.",
215
+ 'Shovelling coal into the server',
216
+ 'Pushing pixels...',
217
+ 'How about this weather, eh?',
218
+ 'Building a wall...',
219
+ 'Everything in this universe is either a potato or not a potato',
220
+ 'The severity of your issue is always lower than you expected.',
221
+ 'Updating Updater...',
222
+ 'Downloading Downloader...',
223
+ 'Debugging Debugger...',
224
+ 'Reading Terms and Conditions for you.',
225
+ 'Digested cookies being baked again.',
226
+ 'Live long and prosper.',
227
+ "There is no cow level, but there's a goat one!",
228
+ 'Deleting all your hidden porn...',
229
+ 'Running with scissors...',
230
+ 'Definitely not a virus...',
231
+ 'You may call me Steve.',
232
+ 'You seem like a nice person...',
233
+ "Coffee at my place, tommorow at 10A.M. - don't be late!",
234
+ 'Work, work...',
235
+ 'Patience! This is difficult, you know...',
236
+ 'Discovering new ways of making you wait...',
237
+ 'Your time is very important to us. Please wait while we ignore you...',
238
+ 'Time flies like an arrow; fruit flies like a banana',
239
+ 'Two men walked into a bar; the third ducked...',
240
+ 'Sooooo... Have you seen my vacation photos yet?',
241
+ "Sorry we are busy catching em' all, we're done soon",
242
+ 'TODO: Insert elevator music',
243
+ 'Still faster than Windows update',
244
+ 'Composer hack: Waiting for reqs to be fetched is less frustrating if you add -vvv to your command.',
245
+ 'Please wait while the minions do their work',
246
+ 'Grabbing extra minions',
247
+ 'Doing the heavy lifting',
248
+ "We're working very Hard .... Really",
249
+ 'Waking up the minions',
250
+ 'You are number 2843684714 in the queue',
251
+ 'Please wait while we serve other customers...',
252
+ 'Our premium plan is faster',
253
+ 'Feeding unicorns...',
254
+ ];
255
+ format_message_1.default.setup({ missingTranslation: 'ignore' });
256
+ function getRandom(pattern, args = {}) {
257
+ const randomValue = messages[Math.floor(Math.random() * messages.length)];
258
+ const arg = Object.assign(args, { loadingMessage: randomValue });
259
+ return (0, format_message_1.default)({ default: pattern }, arg);
260
+ }
261
+ LoadingMessages.getRandom = getRandom;
262
+ })(LoadingMessages = exports.LoadingMessages || (exports.LoadingMessages = {}));
263
+ //# sourceMappingURL=loading-messages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loading-messages.js","sourceRoot":"","sources":["../../src/utils/loading-messages.ts"],"names":[],"mappings":";;;;AAAA,4EAA0C;AAE1C,IAAiB,eAAe,CAkQ/B;AAlQD,WAAiB,eAAe;IAE5B,MAAM,QAAQ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,EAAC,CAAC,CAAA;IAEnD,SAAgB,SAAS,CAAC,OAAe,EAAE,OAA4B,EAAE;QACvE,MAAM,WAAW,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAA;QACzE,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAC,cAAc,EAAE,WAAW,EAAC,CAAC,CAAA;QAE9D,OAAO,IAAA,wBAAa,EAAC,EAAC,OAAO,EAAE,OAAO,EAAC,EAAE,GAAG,CAAC,CAAA;IAC/C,CAAC;IALe,yBAAS,YAKxB,CAAA;AACL,CAAC,EAlQgB,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAkQ/B"}
@@ -0,0 +1,9 @@
1
+ import type { TaskCreateOptions } from '../types';
2
+ export declare class TaskGenerator {
3
+ generate(directory: string, existingTask: string | undefined, createOptions: TaskCreateOptions): Promise<void>;
4
+ private static copyFiles;
5
+ private static createFile;
6
+ private static createTaskJson;
7
+ private static populateTaskJson;
8
+ private static createTaskPy;
9
+ }
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TaskGenerator = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const node_path_1 = require("node:path");
6
+ const listr2_1 = require("listr2");
7
+ const template_loader_1 = require("./template-loader");
8
+ const image_processor_1 = require("./image-processor");
9
+ const fs_extra_1 = require("fs-extra");
10
+ const slug_1 = tslib_1.__importDefault(require("slug"));
11
+ const node_fs_1 = require("node:fs");
12
+ const change_case_1 = require("change-case");
13
+ // noinspection JSUnusedGlobalSymbols
14
+ class TaskGenerator {
15
+ async generate(directory, existingTask, createOptions) {
16
+ // google_maps
17
+ const snakeTaskName = (0, slug_1.default)(`${createOptions.name}`, {
18
+ lower: true,
19
+ replacement: '_',
20
+ });
21
+ const taskName = createOptions.name;
22
+ const actionType = (0, change_case_1.pascalCase)(createOptions.name);
23
+ directory = (0, node_path_1.resolve)(directory);
24
+ let images = null;
25
+ const tasks = new listr2_1.Listr([]);
26
+ tasks.add({
27
+ title: 'Processing logo...',
28
+ task: async (ctx) => {
29
+ const logoPath = (0, node_path_1.join)(directory, 'image', 'logo.png');
30
+ images = await image_processor_1.ImageProcessor.process(logoPath);
31
+ if (images === null) {
32
+ throw new Error('Could not process image');
33
+ }
34
+ ctx.images = images;
35
+ },
36
+ enabled: () => Boolean(!existingTask),
37
+ });
38
+ tasks.add({
39
+ title: `Creating ${snakeTaskName}.py...`,
40
+ task: () => TaskGenerator.createTaskPy(directory, snakeTaskName, actionType),
41
+ enabled: () => Boolean(!existingTask),
42
+ });
43
+ tasks.add({
44
+ title: `Creating ${snakeTaskName}.json...`,
45
+ task: ctx => TaskGenerator.createTaskJson(directory, snakeTaskName, taskName, actionType, ctx.images.integration, createOptions.description),
46
+ enabled: () => Boolean(!existingTask),
47
+ });
48
+ tasks.add({
49
+ title: 'Cloning task...',
50
+ task: () => TaskGenerator.copyFiles(directory, existingTask, snakeTaskName),
51
+ enabled: () => Boolean(existingTask),
52
+ });
53
+ tasks.add({
54
+ title: `Populating ${snakeTaskName}.json...`,
55
+ task: () => TaskGenerator.populateTaskJson(directory, snakeTaskName, taskName, actionType, createOptions.description),
56
+ enabled: () => Boolean(existingTask),
57
+ });
58
+ await tasks.run();
59
+ }
60
+ static async copyFiles(directory, existingTask, name) {
61
+ const newBasePath = (0, node_path_1.join)(directory, 'imports', name);
62
+ if (!existingTask) {
63
+ return `${newBasePath}.json`;
64
+ }
65
+ const fullBasePath = (0, node_path_1.join)(directory, 'imports', existingTask);
66
+ await node_fs_1.promises.copyFile(`${fullBasePath}.json`, `${newBasePath}.json`);
67
+ await node_fs_1.promises.copyFile(`${fullBasePath}.py`, `${newBasePath}.py`);
68
+ return `${newBasePath}.json`;
69
+ }
70
+ static async createFile(baseDirectory, templateType, data, nameOverride = null) {
71
+ const content = await template_loader_1.TemplateLoader.bindTemplate(templateType, data);
72
+ const fullPath = (0, node_path_1.join)(baseDirectory, nameOverride || templateType);
73
+ await node_fs_1.promises.writeFile(fullPath, content);
74
+ }
75
+ static async createTaskJson(directory, snakeTaskName, taskName, actionType, image, description) {
76
+ const importsPath = (0, node_path_1.join)(directory, 'imports');
77
+ const assetJsonPath = (0, node_path_1.join)(importsPath, 'asset.json');
78
+ const assetJson = await (0, fs_extra_1.readJson)(assetJsonPath);
79
+ await TaskGenerator.createFile(importsPath, 'import.json', {
80
+ description: description,
81
+ family: assetJson.family,
82
+ actionType: actionType,
83
+ assetDependencyType: assetJson.type,
84
+ assetDependencyVersion: assetJson.version,
85
+ name: taskName,
86
+ scriptFile: `${snakeTaskName}.py`,
87
+ logo: image === null || image === void 0 ? void 0 : image.getBase64Image(),
88
+ version: assetJson.version,
89
+ }, `${snakeTaskName}.json`);
90
+ }
91
+ static async populateTaskJson(directory, snakeTaskName, taskName, actionType, description) {
92
+ const importsPath = (0, node_path_1.join)(directory, 'imports');
93
+ const taskJsonPath = (0, node_path_1.join)(importsPath, `${snakeTaskName}.json`);
94
+ const taskJson = await (0, fs_extra_1.readJson)(taskJsonPath);
95
+ taskJson.description = description;
96
+ taskJson.name = taskName;
97
+ taskJson.scriptFile = `${snakeTaskName}.py`;
98
+ taskJson.actionType = actionType;
99
+ taskJson.inputParameters = {};
100
+ taskJson.availableOutputVariables = {};
101
+ await (0, fs_extra_1.writeJson)(taskJsonPath, taskJson, { spaces: 2, EOL: '\n' });
102
+ }
103
+ static async createTaskPy(directory, snakeTaskName, actionType) {
104
+ const importsPath = (0, node_path_1.join)(directory, 'imports');
105
+ await TaskGenerator.createFile(importsPath, 'example.py', {
106
+ bundleModuleName: snakeTaskName,
107
+ baseClassName: `${actionType}BaseClass`,
108
+ rest: false,
109
+ }, `${snakeTaskName}.py`);
110
+ }
111
+ }
112
+ exports.TaskGenerator = TaskGenerator;
113
+ //# sourceMappingURL=task-generator.js.map
@@ -0,0 +1 @@
1
+ {"version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AAS,CAAC,CAAA;QAE9C,MAAM,aAAa,CAAC,UAAU,CAAC,WAAW,EAAE,YAAY,EAAE;YACxD,gBAAgB,EAAE,aAAa;YAC/B,aAAa,EAAE,GAAG,UAAU,WAAW;YACvC,IAAI,EAAE,KAAK;SACZ,EAAE,GAAG,aAAa,KAAK,CAAC,CAAA;IAC3B,CAAC;CACF;AAxHD,sCAwHC"}
@@ -0,0 +1,4 @@
1
+ import type { TemplateTypes } from '../types';
2
+ export declare const TemplateLoader: {
3
+ bindTemplate(templateType: TemplateTypes, binding: Record<string, any>): Promise<string>;
4
+ };
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TemplateLoader = void 0;
4
+ const node_path_1 = require("node:path");
5
+ const node_fs_1 = require("node:fs");
6
+ const handlebars_1 = require("handlebars");
7
+ exports.TemplateLoader = {
8
+ async bindTemplate(templateType, binding) {
9
+ const baseDir = (0, node_path_1.resolve)((0, node_path_1.join)(__dirname, '..', 'templates'));
10
+ const filePath = (0, node_path_1.join)(baseDir, `${templateType}.t`);
11
+ const content = await node_fs_1.promises.readFile(filePath);
12
+ const template = (0, handlebars_1.compile)(content.toString());
13
+ return template(binding);
14
+ },
15
+ };
16
+ //# sourceMappingURL=template-loader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template-loader.js","sourceRoot":"","sources":["../../src/utils/template-loader.ts"],"names":[],"mappings":";;;AAAA,yCAAuC;AAEvC,qCAAgC;AAChC,2CAAkC;AAErB,QAAA,cAAc,GAAG;IAC5B,KAAK,CAAC,YAAY,CAAC,YAA2B,EAAG,OAA4B;QAC3E,MAAM,OAAO,GAAG,IAAA,mBAAO,EAAC,IAAA,gBAAI,EAAC,SAAS,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC,CAAA;QAC3D,MAAM,QAAQ,GAAG,IAAA,gBAAI,EAAC,OAAO,EAAE,GAAG,YAAY,IAAI,CAAC,CAAA;QACnD,MAAM,OAAO,GAAG,MAAM,kBAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;QACjD,MAAM,QAAQ,GAAG,IAAA,oBAAO,EAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAA;QAC5C,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAA;IAC1B,CAAC;CACF,CAAA"}
@@ -0,0 +1,6 @@
1
+ declare const EOL = "\n";
2
+ export { EOL };
3
+ export declare const BLANK_LINE: string;
4
+ export declare const OLD_CHANGELOG_HEADER = "# CHANGELOG";
5
+ export declare const COMMIT_GUIDELINE = "See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.";
6
+ export declare const CHANGELOG_HEADER: string;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CHANGELOG_HEADER = exports.COMMIT_GUIDELINE = exports.OLD_CHANGELOG_HEADER = exports.BLANK_LINE = exports.EOL = void 0;
4
+ const EOL = '\n';
5
+ exports.EOL = EOL;
6
+ exports.BLANK_LINE = EOL + EOL;
7
+ exports.OLD_CHANGELOG_HEADER = '# CHANGELOG';
8
+ exports.COMMIT_GUIDELINE = 'See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.';
9
+ exports.CHANGELOG_HEADER = [
10
+ '# Change Log',
11
+ '',
12
+ 'All notable changes to this project are documented in this file.',
13
+ exports.COMMIT_GUIDELINE,
14
+ ].join(EOL);
15
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/versioning/constants.ts"],"names":[],"mappings":";;;AAAA,MAAM,GAAG,GAAG,IAAI,CAAA;AAER,kBAAG;AAEE,QAAA,UAAU,GAAG,GAAG,GAAG,GAAG,CAAA;AAEtB,QAAA,oBAAoB,GAAG,aAAa,CAAA;AAEpC,QAAA,gBAAgB,GAAG,oFAAoF,CAAA;AAEvG,QAAA,gBAAgB,GAAG;IAC9B,cAAc;IACd,EAAE;IACF,kEAAkE;IAClE,wBAAgB;CACjB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from './recommend-version';
2
+ export * from './update-changelog';
3
+ export * from './read-changelog-diff';
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./recommend-version"), exports);
5
+ tslib_1.__exportStar(require("./update-changelog"), exports);
6
+ tslib_1.__exportStar(require("./read-changelog-diff"), exports);
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/versioning/index.ts"],"names":[],"mappings":";;;AAAA,8DAAmC;AACnC,6DAAkC;AAClC,gEAAqC"}
@@ -0,0 +1,27 @@
1
+ interface Type {
2
+ type: string;
3
+ section: string;
4
+ }
5
+ interface Config {
6
+ types: Type[];
7
+ issueUrlFormat: string;
8
+ commitUrlFormat: string;
9
+ compareUrlFormat: string;
10
+ userUrlFormat: string;
11
+ issuePrefixes: string[];
12
+ }
13
+ interface PresetConfig {
14
+ config?: Config;
15
+ commitTemplateName?: string;
16
+ mainTemplateName?: string;
17
+ headerTemplateName?: string;
18
+ footerTemplateName?: string;
19
+ parserOpts?: any;
20
+ writerOpts?: any;
21
+ }
22
+ declare const _default: ({ config, commitTemplateName, mainTemplateName, headerTemplateName, footerTemplateName, parserOpts, writerOpts }: PresetConfig) => Promise<{
23
+ parserOpts: any;
24
+ writerOpts: any;
25
+ gitRawCommitsOpts: any;
26
+ }>;
27
+ export default _default;
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /* eslint-disable unicorn/prefer-module */
4
+ const promises_1 = require("node:fs/promises");
5
+ const node_path_1 = require("node:path");
6
+ const conventionalChangelogConventionalCommits = require('conventional-changelog-conventionalcommits');
7
+ const owner = '{{#if this.owner}}{{~this.owner}}{{else}}{{~@root.owner}}{{/if}}';
8
+ const host = '{{~@root.host}}';
9
+ const repository = '{{#if this.repository}}{{~this.repository}}{{else}}{{~@root.repository}}{{/if}}';
10
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
11
+ exports.default = async ({ config, commitTemplateName = 'commit.hbs', mainTemplateName = 'template.hbs', headerTemplateName = 'header.hbs', footerTemplateName = 'footer.hbs', parserOpts = {}, writerOpts = {} }) => {
12
+ config = defaultConfig(config);
13
+ const loadedConfig = await conventionalChangelogConventionalCommits();
14
+ const commitUrlFormat = expandTemplate(config.commitUrlFormat, {
15
+ host,
16
+ owner,
17
+ repository,
18
+ });
19
+ const compareUrlFormat = expandTemplate(config.compareUrlFormat, {
20
+ host,
21
+ owner,
22
+ repository,
23
+ });
24
+ const issueUrlFormat = expandTemplate(config.issueUrlFormat, {
25
+ host,
26
+ owner,
27
+ repository,
28
+ id: '{{this.issue}}',
29
+ prefix: '{{this.prefix}}',
30
+ });
31
+ const templates = await Promise.all([
32
+ (0, promises_1.readFile)((0, node_path_1.join)(__dirname, `templates/${mainTemplateName}`), 'utf-8'),
33
+ (0, promises_1.readFile)((0, node_path_1.join)(__dirname, `templates/${headerTemplateName}`), 'utf-8'),
34
+ (0, promises_1.readFile)((0, node_path_1.join)(__dirname, `templates/${commitTemplateName}`), 'utf-8'),
35
+ (0, promises_1.readFile)((0, node_path_1.join)(__dirname, `templates/${footerTemplateName}`), 'utf-8'),
36
+ ]).then(([mainTemplate, headerPartial, commitPartial, footerPartial]) => {
37
+ writerOpts.mainTemplate = mainTemplate;
38
+ writerOpts.headerPartial = headerPartial
39
+ .replace(/{{compareUrlFormat}}/g, compareUrlFormat);
40
+ writerOpts.commitPartial = commitPartial
41
+ .replace(/{{commitUrlFormat}}/g, commitUrlFormat)
42
+ .replace(/{{issueUrlFormat}}/g, issueUrlFormat);
43
+ writerOpts.footerPartial = footerPartial;
44
+ return writerOpts;
45
+ });
46
+ return {
47
+ parserOpts: Object.assign(Object.assign({}, loadedConfig.parserOpts), parserOpts),
48
+ writerOpts: Object.assign(Object.assign(Object.assign({}, loadedConfig.writerOpts), writerOpts), { templates }),
49
+ gitRawCommitsOpts: Object.assign({}, loadedConfig.gitRawCommitsOpts),
50
+ };
51
+ };
52
+ function defaultConfig(overrideConfig) {
53
+ const config = overrideConfig || {};
54
+ config.types = config.types || [
55
+ { type: 'feat', section: 'Features' },
56
+ { type: 'feature', section: 'Features' },
57
+ { type: 'fix', section: 'Bug Fixes' },
58
+ { type: 'perf', section: 'Performance Improvements' },
59
+ { type: 'revert', section: 'Reverts' },
60
+ { type: 'docs', section: 'Documentation', hidden: true },
61
+ { type: 'style', section: 'Styles', hidden: true },
62
+ { type: 'chore', section: 'Miscellaneous Chores', hidden: true },
63
+ { type: 'refactor', section: 'Code Refactoring', hidden: true },
64
+ { type: 'test', section: 'Tests', hidden: true },
65
+ { type: 'build', section: 'Build System', hidden: true },
66
+ { type: 'ci', section: 'Continuous Integration', hidden: true },
67
+ ];
68
+ config.issueUrlFormat = config.issueUrlFormat ||
69
+ 'https://swimlane.atlassian.net/browse/{{id}}';
70
+ config.commitUrlFormat = config.commitUrlFormat ||
71
+ '{{host}}/{{owner}}/{{repository}}/commit/{{hash}}';
72
+ config.compareUrlFormat = config.compareUrlFormat ||
73
+ '{{host}}/{{owner}}/{{repository}}/compare/{{previousTag}}...{{currentTag}}';
74
+ config.userUrlFormat = config.userUrlFormat ||
75
+ '{{host}}/{{user}}';
76
+ config.issuePrefixes = config.issuePrefixes || ['#'];
77
+ return config;
78
+ }
79
+ function expandTemplate(template, context) {
80
+ let expanded = template;
81
+ for (const key of Object.keys(context)) {
82
+ expanded = expanded.replace(new RegExp(`{{${key}}}`, 'g'), context[key]);
83
+ }
84
+ return expanded;
85
+ }
86
+ //# sourceMappingURL=presets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presets.js","sourceRoot":"","sources":["../../src/versioning/presets.ts"],"names":[],"mappings":";;AAAA,0CAA0C;AAC1C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AAC,IAAI,MAAM,CAAC,KAAK,GAAG,IAAI,EAAE,GAAG,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;KACzE;IAED,OAAO,QAAQ,CAAA;AACjB,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function readChangelogDiff(location: string): Promise<string>;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.readChangelogDiff = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const node_path_1 = require("node:path");
6
+ const conventional_changelog_core_1 = tslib_1.__importDefault(require("conventional-changelog-core"));
7
+ const get_stream_1 = tslib_1.__importDefault(require("get-stream"));
8
+ const presets_1 = tslib_1.__importDefault(require("./presets"));
9
+ const npmlog_1 = require("npmlog");
10
+ // noinspection JSUnusedGlobalSymbols
11
+ async function readChangelogDiff(location) {
12
+ const name = (0, node_path_1.basename)(location);
13
+ (0, npmlog_1.silly)(name, 'for %s at %s', name, location);
14
+ const presetConfig = await (0, presets_1.default)({
15
+ writerOpts: {
16
+ includeDetails: false,
17
+ },
18
+ });
19
+ const context = {
20
+ linkReferences: false,
21
+ linkCompare: false,
22
+ commit: '',
23
+ issue: '',
24
+ date: '',
25
+ };
26
+ // generate the markdown for the upcoming release.
27
+ const changelogStream = (0, conventional_changelog_core_1.default)({}, context, presetConfig.gitRawCommitsOpts, presetConfig.parserOpts, presetConfig.writerOpts);
28
+ return (0, get_stream_1.default)(changelogStream);
29
+ }
30
+ exports.readChangelogDiff = readChangelogDiff;
31
+ //# sourceMappingURL=read-changelog-diff.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-changelog-diff.js","sourceRoot":"","sources":["../../src/versioning/read-changelog-diff.ts"],"names":[],"mappings":";;;;AAAA,yCAAkC;AAClC,sGAA8E;AAC9E,oEAAkC;AAClC,gEAA8B;AAC9B,mCAA4B;AAE5B,qCAAqC;AAC9B,KAAK,UAAU,iBAAiB,CAAC,QAAgB;IACtD,MAAM,IAAI,GAAG,IAAA,oBAAQ,EAAC,QAAQ,CAAC,CAAA;IAC/B,IAAA,cAAK,EAAC,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAA;IAE3C,MAAM,YAAY,GAAG,MAAM,IAAA,iBAAM,EAAC;QAChC,UAAU,EAAE;YACV,cAAc,EAAE,KAAK;SACtB;KACF,CAAC,CAAA;IAEF,MAAM,OAAO,GAAY;QACvB,cAAc,EAAE,KAAK;QACrB,WAAW,EAAE,KAAK;QAClB,MAAM,EAAE,EAAE;QACV,KAAK,EAAE,EAAE;QACT,IAAI,EAAE,EAAE;KACT,CAAA;IAED,kDAAkD;IAClD,MAAM,eAAe,GAAG,IAAA,qCAAyB,EAC/C,EAAE,EACF,OAAO,EACP,YAAY,CAAC,iBAAiB,EAC9B,YAAY,CAAC,UAAU,EACvB,YAAY,CAAC,UAAU,CACxB,CAAA;IAED,OAAO,IAAA,oBAAS,EAAC,eAAe,CAAC,CAAA;AACnC,CAAC;AA5BD,8CA4BC"}