@eclipse-che/che-devworkspace-generator 0.0.1-d7aefd7 → 7.69.0-8717dbc

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 (91) hide show
  1. package/README.md +56 -0
  2. package/lib/api/devfile-context.d.ts +19 -0
  3. package/lib/bitbucket/bitbucket-module.d.ts +12 -0
  4. package/lib/bitbucket/bitbucket-module.js +21 -0
  5. package/lib/bitbucket/bitbucket-module.js.map +1 -0
  6. package/lib/bitbucket/bitbucket-resolver.d.ts +17 -0
  7. package/lib/bitbucket/bitbucket-resolver.js +56 -0
  8. package/lib/bitbucket/bitbucket-resolver.js.map +1 -0
  9. package/lib/bitbucket/bitbucket-url.d.ts +22 -0
  10. package/lib/bitbucket/bitbucket-url.js +38 -0
  11. package/lib/bitbucket/bitbucket-url.js.map +1 -0
  12. package/lib/bitbucket-server/bitbucket-server-module.d.ts +12 -0
  13. package/lib/bitbucket-server/bitbucket-server-module.js +21 -0
  14. package/lib/bitbucket-server/bitbucket-server-module.js.map +1 -0
  15. package/lib/bitbucket-server/bitbucket-server-resolver.d.ts +17 -0
  16. package/lib/bitbucket-server/bitbucket-server-resolver.js +64 -0
  17. package/lib/bitbucket-server/bitbucket-server-resolver.js.map +1 -0
  18. package/lib/bitbucket-server/bitbucket-server-url.d.ts +24 -0
  19. package/lib/bitbucket-server/bitbucket-server-url.js +43 -0
  20. package/lib/bitbucket-server/bitbucket-server-url.js.map +1 -0
  21. package/lib/devfile/dev-container-component-finder.d.ts +18 -0
  22. package/lib/devfile/dev-container-component-finder.js +20 -7
  23. package/lib/devfile/dev-container-component-finder.js.map +1 -1
  24. package/lib/devfile/dev-container-component-inserter.d.ts +18 -0
  25. package/lib/devfile/dev-container-component-inserter.js +98 -0
  26. package/lib/devfile/dev-container-component-inserter.js.map +1 -0
  27. package/lib/devfile/devfile-module.d.ts +12 -0
  28. package/lib/devfile/devfile-module.js +2 -0
  29. package/lib/devfile/devfile-module.js.map +1 -1
  30. package/lib/entrypoint.d.ts +11 -0
  31. package/lib/fetch/fetch-module.d.ts +12 -0
  32. package/lib/fetch/url-fetcher.d.ts +9 -0
  33. package/lib/generate.d.ts +16 -0
  34. package/lib/generate.js +32 -21
  35. package/lib/generate.js.map +1 -1
  36. package/lib/github/github-module.d.ts +12 -0
  37. package/lib/github/github-module.js +3 -1
  38. package/lib/github/github-module.js.map +1 -1
  39. package/lib/github/github-resolver.d.ts +17 -0
  40. package/lib/github/github-resolver.js +10 -5
  41. package/lib/github/github-resolver.js.map +1 -1
  42. package/lib/github/github-url.d.ts +27 -0
  43. package/lib/github/github-url.js +7 -9
  44. package/lib/github/github-url.js.map +1 -1
  45. package/lib/inversify/inversify-binding.d.ts +26 -0
  46. package/lib/inversify/inversify-binding.js +6 -0
  47. package/lib/inversify/inversify-binding.js.map +1 -1
  48. package/lib/main.d.ts +38 -0
  49. package/lib/main.js +106 -66
  50. package/lib/main.js.map +1 -1
  51. package/lib/plugin-registry/plugin-registry-module.d.ts +12 -0
  52. package/lib/plugin-registry/plugin-registry-resolver.d.ts +17 -0
  53. package/lib/plugin-registry/plugin-registry-resolver.js +1 -1
  54. package/lib/plugin-registry/plugin-registry-resolver.js.map +1 -1
  55. package/lib/resolve/git-url-resolver.d.ts +5 -0
  56. package/lib/resolve/git-url-resolver.js +43 -0
  57. package/lib/resolve/git-url-resolver.js.map +1 -0
  58. package/lib/resolve/resolve-module.d.ts +12 -0
  59. package/lib/resolve/resolve-module.js +19 -0
  60. package/lib/resolve/resolve-module.js.map +1 -0
  61. package/lib/resolve/resolver.d.ts +22 -0
  62. package/lib/resolve/resolver.js +12 -0
  63. package/lib/resolve/resolver.js.map +1 -0
  64. package/lib/resolve/url.d.ts +35 -0
  65. package/lib/resolve/url.js +12 -0
  66. package/lib/resolve/url.js.map +1 -0
  67. package/lib/types.d.ts +13 -0
  68. package/lib/types.js +17 -0
  69. package/lib/types.js.map +1 -0
  70. package/package.json +6 -4
  71. package/src/bitbucket/bitbucket-module.ts +21 -0
  72. package/src/bitbucket/bitbucket-resolver.ts +46 -0
  73. package/src/bitbucket/bitbucket-url.ts +41 -0
  74. package/src/bitbucket-server/bitbucket-server-module.ts +21 -0
  75. package/src/bitbucket-server/bitbucket-server-resolver.ts +53 -0
  76. package/src/bitbucket-server/bitbucket-server-url.ts +51 -0
  77. package/src/devfile/dev-container-component-finder.ts +23 -4
  78. package/src/devfile/dev-container-component-inserter.ts +49 -0
  79. package/src/devfile/devfile-module.ts +2 -0
  80. package/src/generate.ts +59 -25
  81. package/src/github/github-module.ts +4 -1
  82. package/src/github/github-resolver.ts +17 -9
  83. package/src/github/github-url.ts +8 -9
  84. package/src/inversify/inversify-binding.ts +6 -0
  85. package/src/main.ts +126 -62
  86. package/src/plugin-registry/plugin-registry-resolver.ts +1 -1
  87. package/src/resolve/git-url-resolver.ts +30 -0
  88. package/src/resolve/resolve-module.ts +18 -0
  89. package/src/resolve/resolver.ts +25 -0
  90. package/src/resolve/url.ts +40 -0
  91. package/src/types.ts +14 -0
package/lib/main.js CHANGED
@@ -68,62 +68,38 @@ exports.Main = void 0;
68
68
  var axios = __importStar(require("axios"));
69
69
  var fs = __importStar(require("fs-extra"));
70
70
  var generate_1 = require("./generate");
71
- var github_resolver_1 = require("./github/github-resolver");
72
71
  var jsYaml = __importStar(require("js-yaml"));
73
72
  var inversify_binding_1 = require("./inversify/inversify-binding");
74
73
  var url_fetcher_1 = require("./fetch/url-fetcher");
75
74
  var plugin_registry_resolver_1 = require("./plugin-registry/plugin-registry-resolver");
75
+ var git_url_resolver_1 = require("./resolve/git-url-resolver");
76
76
  var Main = /** @class */ (function () {
77
+ /**
78
+ * Default constructor.
79
+ */
77
80
  function Main() {
81
+ // no-op
78
82
  }
79
- Main.prototype.doStart = function () {
83
+ // Generates a devfile context object based on params
84
+ Main.prototype.generateDevfileContext = function (params, axiosInstance) {
80
85
  return __awaiter(this, void 0, void 0, function () {
81
- var devfilePath, devfileUrl, outputFile, editorPath, pluginRegistryUrl, editorEntry, projects, args, axiosInstance, inversifyBinbding, container, devfileContent, editorContent, githubResolver, githubUrl, devfileParsed, editorDevfile, generate;
86
+ var pluginRegistryUrl, inversifyBinbding, container, devfileContent, editorContent, resolver, url, devfileParsed, editorDevfile, generate;
82
87
  return __generator(this, function (_a) {
83
88
  switch (_a.label) {
84
89
  case 0:
85
- projects = [];
86
- args = process.argv.slice(2);
87
- args.forEach(function (arg) {
88
- if (arg.startsWith('--devfile-path:')) {
89
- devfilePath = arg.substring('--devfile-path:'.length);
90
- }
91
- if (arg.startsWith('--devfile-url:')) {
92
- devfileUrl = arg.substring('--devfile-url:'.length);
93
- }
94
- if (arg.startsWith('--plugin-registry-url:')) {
95
- pluginRegistryUrl = arg.substring('--plugin-registry-url:'.length);
96
- }
97
- if (arg.startsWith('--editor-entry:')) {
98
- editorEntry = arg.substring('--editor-entry:'.length);
99
- }
100
- if (arg.startsWith('--editor-path:')) {
101
- editorPath = arg.substring('--editor-path:'.length);
102
- }
103
- if (arg.startsWith('--output-file:')) {
104
- outputFile = arg.substring('--output-file:'.length);
105
- }
106
- if (arg.startsWith('--project.')) {
107
- var name = arg.substring('--project.'.length, arg.indexOf('='));
108
- var location = arg.substring(arg.indexOf('=') + 1);
109
- location = location.replace('{{_INTERNAL_URL_}}', '{{ INTERNAL_URL }}');
110
- projects.push({ name: name, location: location });
111
- }
112
- });
113
- if (!editorPath && !editorEntry) {
114
- throw new Error('missing --editor-path: or --editor-entry: parameter');
90
+ if (!params.editorPath && !params.editorEntry && !params.editorContent) {
91
+ throw new Error('missing editorPath or editorEntry or editorContent');
115
92
  }
116
- if (editorEntry && !pluginRegistryUrl) {
117
- pluginRegistryUrl = 'https://eclipse-che.github.io/che-plugin-registry/main/v3';
118
- console.log("No plug-in registry url. Setting to " + pluginRegistryUrl);
93
+ if (!params.devfilePath && !params.devfileUrl && !params.devfileContent) {
94
+ throw new Error('missing devfilePath or devfileUrl or devfileContent');
119
95
  }
120
- if (!devfilePath && !devfileUrl) {
121
- throw new Error('missing --devfile-path: or --devfile-url: parameter');
96
+ if (params.pluginRegistryUrl) {
97
+ pluginRegistryUrl = params.pluginRegistryUrl;
122
98
  }
123
- if (!outputFile) {
124
- throw new Error('missing --output-file: parameter');
99
+ else {
100
+ pluginRegistryUrl = 'https://eclipse-che.github.io/che-plugin-registry/main/v3';
101
+ console.log("No plug-in registry url. Setting to " + pluginRegistryUrl);
125
102
  }
126
- axiosInstance = axios["default"];
127
103
  inversifyBinbding = new inversify_binding_1.InversifyBinding();
128
104
  return [4 /*yield*/, inversifyBinbding.initBindings({
129
105
  pluginRegistryUrl: pluginRegistryUrl,
@@ -132,10 +108,10 @@ var Main = /** @class */ (function () {
132
108
  case 1:
133
109
  container = _a.sent();
134
110
  container.bind(generate_1.Generate).toSelf().inSingletonScope();
135
- if (!devfileUrl) return [3 /*break*/, 3];
136
- githubResolver = container.get(github_resolver_1.GithubResolver);
137
- githubUrl = githubResolver.resolve(devfileUrl);
138
- return [4 /*yield*/, container.get(url_fetcher_1.UrlFetcher).fetchText(githubUrl.getContentUrl('devfile.yaml'))];
111
+ if (!params.devfileUrl) return [3 /*break*/, 3];
112
+ resolver = container.get(git_url_resolver_1.GitUrlResolver);
113
+ url = resolver.resolve(params.devfileUrl);
114
+ return [4 /*yield*/, container.get(url_fetcher_1.UrlFetcher).fetchText(url.getContentUrl('devfile.yaml'))];
139
115
  case 2:
140
116
  // user devfile
141
117
  devfileContent = _a.sent();
@@ -145,37 +121,46 @@ var Main = /** @class */ (function () {
145
121
  // no, so add the current project being cloned
146
122
  devfileParsed.projects = [
147
123
  {
148
- name: githubUrl.getRepoName(),
124
+ name: url.getRepoName(),
149
125
  git: {
150
- remotes: { origin: githubUrl.getCloneUrl() },
151
- checkoutFrom: { revision: githubUrl.getBranchName() }
126
+ remotes: { origin: url.getCloneUrl() },
127
+ checkoutFrom: { revision: url.getBranchName() }
152
128
  }
153
129
  },
154
130
  ];
155
131
  }
156
132
  // get back the content
157
133
  devfileContent = jsYaml.dump(devfileParsed);
158
- return [3 /*break*/, 5];
159
- case 3: return [4 /*yield*/, fs.readFile(devfilePath)];
134
+ return [3 /*break*/, 6];
135
+ case 3:
136
+ if (!params.devfilePath) return [3 /*break*/, 5];
137
+ return [4 /*yield*/, fs.readFile(params.devfilePath)];
160
138
  case 4:
161
139
  devfileContent = _a.sent();
162
- _a.label = 5;
140
+ return [3 /*break*/, 6];
163
141
  case 5:
164
- // enhance projects
165
- devfileContent = this.replaceIfExistingProjects(devfileContent, projects);
166
- if (!editorEntry) return [3 /*break*/, 7];
167
- return [4 /*yield*/, container.get(plugin_registry_resolver_1.PluginRegistryResolver).loadDevfilePlugin(editorEntry)];
142
+ devfileContent = params.devfileContent;
143
+ _a.label = 6;
168
144
  case 6:
145
+ // enhance projects
146
+ devfileContent = this.replaceIfExistingProjects(devfileContent, params.projects);
147
+ if (!params.editorContent) return [3 /*break*/, 7];
148
+ editorContent = params.editorContent;
149
+ return [3 /*break*/, 11];
150
+ case 7:
151
+ if (!params.editorEntry) return [3 /*break*/, 9];
152
+ return [4 /*yield*/, container.get(plugin_registry_resolver_1.PluginRegistryResolver).loadDevfilePlugin(params.editorEntry)];
153
+ case 8:
169
154
  editorDevfile = _a.sent();
170
155
  editorContent = jsYaml.dump(editorDevfile);
171
- return [3 /*break*/, 9];
172
- case 7: return [4 /*yield*/, fs.readFile(editorPath)];
173
- case 8:
156
+ return [3 /*break*/, 11];
157
+ case 9: return [4 /*yield*/, fs.readFile(params.editorPath)];
158
+ case 10:
174
159
  editorContent = _a.sent();
175
- _a.label = 9;
176
- case 9:
160
+ _a.label = 11;
161
+ case 11:
177
162
  generate = container.get(generate_1.Generate);
178
- return [2 /*return*/, generate.generate(devfileContent, editorContent, outputFile)];
163
+ return [2 /*return*/, generate.generate(devfileContent, editorContent, params.outputFile, params.injectDefaultComponent, params.defaultComponentImage)];
179
164
  }
180
165
  });
181
166
  });
@@ -208,21 +193,76 @@ var Main = /** @class */ (function () {
208
193
  };
209
194
  Main.prototype.start = function () {
210
195
  return __awaiter(this, void 0, void 0, function () {
211
- var error_1;
196
+ var devfilePath, devfileUrl, outputFile, editorPath, pluginRegistryUrl, editorEntry, injectDefaultComponent, defaultComponentImage, projects, args, error_1;
212
197
  return __generator(this, function (_a) {
213
198
  switch (_a.label) {
214
199
  case 0:
215
- _a.trys.push([0, 2, , 3]);
216
- return [4 /*yield*/, this.doStart()];
200
+ projects = [];
201
+ args = process.argv.slice(2);
202
+ args.forEach(function (arg) {
203
+ if (arg.startsWith('--devfile-path:')) {
204
+ devfilePath = arg.substring('--devfile-path:'.length);
205
+ }
206
+ if (arg.startsWith('--devfile-url:')) {
207
+ devfileUrl = arg.substring('--devfile-url:'.length);
208
+ }
209
+ if (arg.startsWith('--plugin-registry-url:')) {
210
+ pluginRegistryUrl = arg.substring('--plugin-registry-url:'.length);
211
+ }
212
+ if (arg.startsWith('--editor-entry:')) {
213
+ editorEntry = arg.substring('--editor-entry:'.length);
214
+ }
215
+ if (arg.startsWith('--editor-path:')) {
216
+ editorPath = arg.substring('--editor-path:'.length);
217
+ }
218
+ if (arg.startsWith('--output-file:')) {
219
+ outputFile = arg.substring('--output-file:'.length);
220
+ }
221
+ if (arg.startsWith('--project.')) {
222
+ var name = arg.substring('--project.'.length, arg.indexOf('='));
223
+ var location = arg.substring(arg.indexOf('=') + 1);
224
+ location = location.replace('{{_INTERNAL_URL_}}', '{{ INTERNAL_URL }}');
225
+ projects.push({ name: name, location: location });
226
+ }
227
+ if (arg.startsWith('--injectDefaultComponent:')) {
228
+ injectDefaultComponent = arg.substring('--injectDefaultComponent:'.length);
229
+ }
230
+ if (arg.startsWith('--defaultComponentImage:')) {
231
+ defaultComponentImage = arg.substring('--defaultComponentImage:'.length);
232
+ }
233
+ });
234
+ _a.label = 1;
217
235
  case 1:
236
+ _a.trys.push([1, 3, , 4]);
237
+ if (!editorPath && !editorEntry) {
238
+ throw new Error('missing --editor-path: or --editor-entry: parameter');
239
+ }
240
+ if (!devfilePath && !devfileUrl) {
241
+ throw new Error('missing --devfile-path: or --devfile-url: parameter');
242
+ }
243
+ if (!outputFile) {
244
+ throw new Error('missing --output-file: parameter');
245
+ }
246
+ return [4 /*yield*/, this.generateDevfileContext({
247
+ devfilePath: devfilePath,
248
+ devfileUrl: devfileUrl,
249
+ editorPath: editorPath,
250
+ outputFile: outputFile,
251
+ pluginRegistryUrl: pluginRegistryUrl,
252
+ editorEntry: editorEntry,
253
+ projects: projects,
254
+ injectDefaultComponent: injectDefaultComponent,
255
+ defaultComponentImage: defaultComponentImage
256
+ }, axios["default"])];
257
+ case 2:
218
258
  _a.sent();
219
259
  return [2 /*return*/, true];
220
- case 2:
260
+ case 3:
221
261
  error_1 = _a.sent();
222
262
  console.error('stack=' + error_1.stack);
223
263
  console.error('Unable to start', error_1);
224
264
  return [2 /*return*/, false];
225
- case 3: return [2 /*return*/];
265
+ case 4: return [2 /*return*/];
226
266
  }
227
267
  });
228
268
  });
package/lib/main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";AAAA;;;;;;;;yEAQyE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEzE,2CAA+B;AAC/B,2CAA+B;AAC/B,uCAAsC;AACtC,4DAA0D;AAC1D,8CAAkC;AAClC,mEAAiE;AACjE,mDAAiD;AACjD,uFAAoF;AAIpF;IAAA;IAgJA,CAAC;IA/IiB,sBAAO,GAAvB;;;;;;wBAOQ,QAAQ,GAAyC,EAAE,CAAC;wBAEpD,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;wBACnC,IAAI,CAAC,OAAO,CAAC,UAAA,GAAG;4BACd,IAAI,GAAG,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE;gCACrC,WAAW,GAAG,GAAG,CAAC,SAAS,CAAC,iBAAiB,CAAC,MAAM,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AAqB,uBAAA;6BACtB,EACD,KAAK,CAAC,SAAO,CAAA,CACd,EAAA;;wBAbD,SAaC,CAAC;wBACF,sBAAO,IAAI,EAAC;;;wBAEZ,OAAO,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAK,CAAC,KAAK,CAAC,CAAC;wBACtC,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE,OAAK,CAAC,CAAC;wBACxC,sBAAO,KAAK,EAAC;;;;;KAEhB;IACH,WAAC;AAAD,CAAC,AAhND,IAgNC;AAhNY,oBAAI"}
@@ -0,0 +1,12 @@
1
+ /**********************************************************************
2
+ * Copyright (c) 2022 Red Hat, Inc.
3
+ *
4
+ * This program and the accompanying materials are made
5
+ * available under the terms of the Eclipse Public License 2.0
6
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
7
+ *
8
+ * SPDX-License-Identifier: EPL-2.0
9
+ ***********************************************************************/
10
+ import { ContainerModule } from 'inversify';
11
+ declare const pluginRegistryModule: ContainerModule;
12
+ export { pluginRegistryModule };
@@ -0,0 +1,17 @@
1
+ /**********************************************************************
2
+ * Copyright (c) 2022 Red Hat, Inc.
3
+ *
4
+ * This program and the accompanying materials are made
5
+ * available under the terms of the Eclipse Public License 2.0
6
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
7
+ *
8
+ * SPDX-License-Identifier: EPL-2.0
9
+ ***********************************************************************/
10
+ /**
11
+ * Resolve plug-ins by grabbing the definition from the plug-in registry.
12
+ */
13
+ export declare class PluginRegistryResolver {
14
+ private pluginRegistryUrl;
15
+ private urlFetcher;
16
+ loadDevfilePlugin(devfileId: string): Promise<any>;
17
+ }
@@ -80,7 +80,7 @@ var url_fetcher_1 = require("../fetch/url-fetcher");
80
80
  var PluginRegistryResolver = /** @class */ (function () {
81
81
  function PluginRegistryResolver() {
82
82
  }
83
- // FQN id (like eclipse/che-theia/next)
83
+ // FQN id (like che-incubator/che-code/next)
84
84
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
85
85
  PluginRegistryResolver.prototype.loadDevfilePlugin = function (devfileId) {
86
86
  return __awaiter(this, void 0, void 0, function () {
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-registry-resolver.js","sourceRoot":"","sources":["../../src/plugin-registry/plugin-registry-resolver.ts"],"names":[],"mappings":";AAAA;;;;;;;;yEAQyE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEzE,8CAAkC;AAElC,uCAAsD;AAEtD,oDAAkD;AAElD;;GAEG;AAEH;IAAA;IAeA,CAAC;IAPC,uCAAuC;IACvC,8DAA8D;IACxD,kDAAiB,GAAvB,UAAwB,SAAiB;;;;;;wBACjC,UAAU,GAAM,IAAI,CAAC,iBAAiB,iBAAY,SAAS,kBAAe,CAAC;wBAC1D,qBAAM,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,EAAA;;wBAA5D,cAAc,GAAG,SAA2C;wBAClE,sBAAO,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,EAAC;;;;KACpC;IAXD;QAFC,IAAA,kBAAM,EAAC,QAAQ,CAAC;QAChB,IAAA,iBAAK,EAAC,qBAAqB,CAAC;6DACK;IAGlC;QADC,IAAA,kBAAM,EAAC,wBAAU,CAAC;sDACY;IANpB,sBAAsB;QADlC,IAAA,sBAAU,GAAE;OACA,sBAAsB,CAelC;IAAD,6BAAC;CAAA,AAfD,IAeC;AAfY,wDAAsB"}
1
+ {"version":3,"file":"plugin-registry-resolver.js","sourceRoot":"","sources":["../../src/plugin-registry/plugin-registry-resolver.ts"],"names":[],"mappings":";AAAA;;;;;;;;yEAQyE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEzE,8CAAkC;AAElC,uCAAsD;AAEtD,oDAAkD;AAElD;;GAEG;AAEH;IAAA;IAeA,CAAC;IAPC,4CAA4C;IAC5C,8DAA8D;IACxD,kDAAiB,GAAvB,UAAwB,SAAiB;;;;;;wBACjC,UAAU,GAAM,IAAI,CAAC,iBAAiB,iBAAY,SAAS,kBAAe,CAAC;wBAC1D,qBAAM,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,EAAA;;wBAA5D,cAAc,GAAG,SAA2C;wBAClE,sBAAO,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,EAAC;;;;KACpC;IAXD;QAFC,IAAA,kBAAM,EAAC,QAAQ,CAAC;QAChB,IAAA,iBAAK,EAAC,qBAAqB,CAAC;6DACK;IAGlC;QADC,IAAA,kBAAM,EAAC,wBAAU,CAAC;sDACY;IANpB,sBAAsB;QADlC,IAAA,sBAAU,GAAE;OACA,sBAAsB,CAelC;IAAD,6BAAC;CAAA,AAfD,IAeC;AAfY,wDAAsB"}
@@ -0,0 +1,5 @@
1
+ import { Url } from './url';
2
+ export declare class GitUrlResolver {
3
+ private resolvers;
4
+ resolve(link: string): Url;
5
+ }
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ exports.__esModule = true;
9
+ exports.GitUrlResolver = void 0;
10
+ /**********************************************************************
11
+ * Copyright (c) 2023 Red Hat, Inc.
12
+ *
13
+ * This program and the accompanying materials are made
14
+ * available under the terms of the Eclipse Public License 2.0
15
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
16
+ *
17
+ * SPDX-License-Identifier: EPL-2.0
18
+ ***********************************************************************/
19
+ var inversify_1 = require("inversify");
20
+ var types_1 = require("../types");
21
+ var Resolver = types_1.TYPES.Resolver;
22
+ var GitUrlResolver = /** @class */ (function () {
23
+ function GitUrlResolver() {
24
+ }
25
+ GitUrlResolver.prototype.resolve = function (link) {
26
+ var resolver = this.resolvers.find(function (r) { return r.isValid(link); });
27
+ if (resolver) {
28
+ return resolver.resolve(link);
29
+ }
30
+ else {
31
+ throw new Error('Can not resolver the URL');
32
+ }
33
+ };
34
+ __decorate([
35
+ (0, inversify_1.multiInject)(Resolver)
36
+ ], GitUrlResolver.prototype, "resolvers");
37
+ GitUrlResolver = __decorate([
38
+ (0, inversify_1.injectable)()
39
+ ], GitUrlResolver);
40
+ return GitUrlResolver;
41
+ }());
42
+ exports.GitUrlResolver = GitUrlResolver;
43
+ //# sourceMappingURL=git-url-resolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-url-resolver.js","sourceRoot":"","sources":["../../src/resolve/git-url-resolver.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;yEAQyE;AACzE,uCAAoD;AAEpD,kCAAiC;AAGzB,IAAA,QAAQ,GAAK,aAAK,SAAV,CAAW;AAG3B;IAAA;IAYA,CAAC;IARC,gCAAO,GAAP,UAAQ,IAAY;QAClB,IAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAf,CAAe,CAAC,CAAC;QAC3D,IAAI,QAAQ,EAAE;YACZ,OAAO,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SAC/B;aAAM;YACL,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;SAC7C;IACH,CAAC;IATD;QADC,IAAA,uBAAW,EAAC,QAAQ,CAAC;6CACQ;IAFnB,cAAc;QAD1B,IAAA,sBAAU,GAAE;OACA,cAAc,CAY1B;IAAD,qBAAC;CAAA,AAZD,IAYC;AAZY,wCAAc"}
@@ -0,0 +1,12 @@
1
+ /**********************************************************************
2
+ * Copyright (c) 2023 Red Hat, Inc.
3
+ *
4
+ * This program and the accompanying materials are made
5
+ * available under the terms of the Eclipse Public License 2.0
6
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
7
+ *
8
+ * SPDX-License-Identifier: EPL-2.0
9
+ ***********************************************************************/
10
+ import { ContainerModule } from 'inversify';
11
+ declare const resolveModule: ContainerModule;
12
+ export { resolveModule };
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ exports.resolveModule = void 0;
4
+ /**********************************************************************
5
+ * Copyright (c) 2023 Red Hat, Inc.
6
+ *
7
+ * This program and the accompanying materials are made
8
+ * available under the terms of the Eclipse Public License 2.0
9
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
10
+ *
11
+ * SPDX-License-Identifier: EPL-2.0
12
+ ***********************************************************************/
13
+ var inversify_1 = require("inversify");
14
+ var git_url_resolver_1 = require("./git-url-resolver");
15
+ var resolveModule = new inversify_1.ContainerModule(function (bind) {
16
+ bind(git_url_resolver_1.GitUrlResolver).toSelf().inSingletonScope();
17
+ });
18
+ exports.resolveModule = resolveModule;
19
+ //# sourceMappingURL=resolve-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-module.js","sourceRoot":"","sources":["../../src/resolve/resolve-module.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;yEAQyE;AACzE,uCAAwD;AAExD,uDAAoD;AAEpD,IAAM,aAAa,GAAG,IAAI,2BAAe,CAAC,UAAC,IAAqB;IAC9D,IAAI,CAAC,iCAAc,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;AACnD,CAAC,CAAC,CAAC;AAEM,sCAAa"}
@@ -0,0 +1,22 @@
1
+ /**********************************************************************
2
+ * Copyright (c) 2023 Red Hat, Inc.
3
+ *
4
+ * This program and the accompanying materials are made
5
+ * available under the terms of the Eclipse Public License 2.0
6
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
7
+ *
8
+ * SPDX-License-Identifier: EPL-2.0
9
+ ***********************************************************************/
10
+ import { Url } from './url';
11
+ export interface Resolver {
12
+ /**
13
+ * Validates the string url for belonging to a specific Git provider.
14
+ * @param url string representation of Url.
15
+ */
16
+ isValid(url: string): boolean;
17
+ /**
18
+ * Resolves repository string URL to a {@class Url} object.
19
+ * @param url string representation of Url.
20
+ */
21
+ resolve(url: string): Url;
22
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ /**********************************************************************
3
+ * Copyright (c) 2023 Red Hat, Inc.
4
+ *
5
+ * This program and the accompanying materials are made
6
+ * available under the terms of the Eclipse Public License 2.0
7
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
8
+ *
9
+ * SPDX-License-Identifier: EPL-2.0
10
+ ***********************************************************************/
11
+ exports.__esModule = true;
12
+ //# sourceMappingURL=resolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolver.js","sourceRoot":"","sources":["../../src/resolve/resolver.ts"],"names":[],"mappings":";AAAA;;;;;;;;yEAQyE"}
@@ -0,0 +1,35 @@
1
+ /**********************************************************************
2
+ * Copyright (c) 2023 Red Hat, Inc.
3
+ *
4
+ * This program and the accompanying materials are made
5
+ * available under the terms of the Eclipse Public License 2.0
6
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
7
+ *
8
+ * SPDX-License-Identifier: EPL-2.0
9
+ ***********************************************************************/
10
+ /**
11
+ * Url object
12
+ */
13
+ export interface Url {
14
+ /**
15
+ * Provides RAW file content url
16
+ * @param path file path
17
+ */
18
+ getContentUrl(path: string): any;
19
+ /**
20
+ * Provides repositories Url
21
+ */
22
+ getUrl(): string;
23
+ /**
24
+ * Provides Git clone url
25
+ */
26
+ getCloneUrl(): string;
27
+ /**
28
+ * Provides repository name
29
+ */
30
+ getRepoName(): string;
31
+ /**
32
+ * Provides branch name if initialised.
33
+ */
34
+ getBranchName(): string;
35
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ /**********************************************************************
3
+ * Copyright (c) 2023 Red Hat, Inc.
4
+ *
5
+ * This program and the accompanying materials are made
6
+ * available under the terms of the Eclipse Public License 2.0
7
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
8
+ *
9
+ * SPDX-License-Identifier: EPL-2.0
10
+ ***********************************************************************/
11
+ exports.__esModule = true;
12
+ //# sourceMappingURL=url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url.js","sourceRoot":"","sources":["../../src/resolve/url.ts"],"names":[],"mappings":";AAAA;;;;;;;;yEAQyE"}
package/lib/types.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ /**********************************************************************
2
+ * Copyright (c) 2023 Red Hat, Inc.
3
+ *
4
+ * This program and the accompanying materials are made
5
+ * available under the terms of the Eclipse Public License 2.0
6
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
7
+ *
8
+ * SPDX-License-Identifier: EPL-2.0
9
+ ***********************************************************************/
10
+ declare const TYPES: {
11
+ Resolver: symbol;
12
+ };
13
+ export { TYPES };
package/lib/types.js ADDED
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ exports.TYPES = void 0;
4
+ /**********************************************************************
5
+ * Copyright (c) 2023 Red Hat, Inc.
6
+ *
7
+ * This program and the accompanying materials are made
8
+ * available under the terms of the Eclipse Public License 2.0
9
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
10
+ *
11
+ * SPDX-License-Identifier: EPL-2.0
12
+ ***********************************************************************/
13
+ var TYPES = {
14
+ Resolver: Symbol["for"]('Resolver')
15
+ };
16
+ exports.TYPES = TYPES;
17
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;yEAQyE;AACzE,IAAM,KAAK,GAAG;IACZ,QAAQ,EAAE,MAAM,CAAC,KAAG,CAAA,CAAC,UAAU,CAAC;CACjC,CAAC;AAEO,sBAAK"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eclipse-che/che-devworkspace-generator",
3
- "version": "0.0.1-d7aefd7",
3
+ "version": "7.69.0-8717dbc",
4
4
  "private": false,
5
5
  "description": "Generates DevWorkspaces by transforming existing devfiles",
6
6
  "main": "lib/entrypoint.js",
@@ -18,13 +18,15 @@
18
18
  "prepare": "yarn run clean && yarn run build",
19
19
  "clean": "rimraf lib",
20
20
  "build": "yarn run format && yarn run compile && yarn run lint && yarn run test",
21
- "compile": "tsc --project .",
21
+ "compile": "tsc --declaration --project .",
22
22
  "format": "if-env SKIP_FORMAT=true && echo 'skip format check' || prettier --check '{src,tests}/**/*.ts' package.json",
23
23
  "format:fix": "prettier --write '{src,tests}/**/*.ts' package.json",
24
24
  "lint": "if-env SKIP_LINT=true && echo 'skip lint check' || eslint --cache=true --no-error-on-unmatched-pattern=true '{src,tests}/(!model|**)/*.ts'",
25
- "lint:fix": "eslint --fix --cache=true --no-error-on-unmatched-pattern=true \"{src,tests}/(!model|**)/*.{ts,tsx}\"",
25
+ "lint:fix": "eslint --fix --cache=true --no-error-on-unmatched-pattern=true \"{src,tests}/(!model|**)/*.ts\"",
26
26
  "test": "if-env SKIP_TEST=true && echo 'skip test' || jest --forceExit",
27
27
  "watch": "tsc -w",
28
+ "license:check": "docker run --rm -t -v ${PWD}/:/workspace/project quay.io/che-incubator/dash-licenses:next --check",
29
+ "license:generate": "docker run --rm -t -v ${PWD}/:/workspace/project quay.io/che-incubator/dash-licenses:next",
28
30
  "publish:next": "yarn publish --registry=https://registry.npmjs.org/ --no-git-tag-version --new-version 0.0.1-\"$(date +%s)\""
29
31
  },
30
32
  "repository": {
@@ -72,7 +74,7 @@
72
74
  "clearMocks": true,
73
75
  "collectCoverage": true,
74
76
  "collectCoverageFrom": [
75
- "src/**/*.{ts,tsx}"
77
+ "src/**/*.ts"
76
78
  ],
77
79
  "coverageThreshold": {
78
80
  "global": {
@@ -0,0 +1,21 @@
1
+ /**********************************************************************
2
+ * Copyright (c) 2023 Red Hat, Inc.
3
+ *
4
+ * This program and the accompanying materials are made
5
+ * available under the terms of the Eclipse Public License 2.0
6
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
7
+ *
8
+ * SPDX-License-Identifier: EPL-2.0
9
+ ***********************************************************************/
10
+ import { ContainerModule, interfaces } from 'inversify';
11
+
12
+ import { BitbucketResolver } from './bitbucket-resolver';
13
+ import { TYPES } from '../types';
14
+
15
+ const { Resolver } = TYPES;
16
+
17
+ const bitbucketModule = new ContainerModule((bind: interfaces.Bind) => {
18
+ bind(Resolver).to(BitbucketResolver).inSingletonScope();
19
+ });
20
+
21
+ export { bitbucketModule };