@eclipse-che/che-devworkspace-generator 0.0.1-96cdbb4 → 0.0.1-99986b8

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 (82) hide show
  1. package/README.md +42 -14
  2. package/lib/bitbucket/bitbucket-module.d.ts +12 -0
  3. package/lib/bitbucket/bitbucket-module.js +21 -0
  4. package/lib/bitbucket/bitbucket-module.js.map +1 -0
  5. package/lib/bitbucket/bitbucket-resolver.d.ts +17 -0
  6. package/lib/bitbucket/bitbucket-resolver.js +56 -0
  7. package/lib/bitbucket/bitbucket-resolver.js.map +1 -0
  8. package/lib/bitbucket/bitbucket-url.d.ts +22 -0
  9. package/lib/bitbucket/bitbucket-url.js +38 -0
  10. package/lib/bitbucket/bitbucket-url.js.map +1 -0
  11. package/lib/bitbucket-server/bitbucket-server-module.d.ts +12 -0
  12. package/lib/bitbucket-server/bitbucket-server-module.js +21 -0
  13. package/lib/bitbucket-server/bitbucket-server-module.js.map +1 -0
  14. package/lib/bitbucket-server/bitbucket-server-resolver.d.ts +17 -0
  15. package/lib/bitbucket-server/bitbucket-server-resolver.js +64 -0
  16. package/lib/bitbucket-server/bitbucket-server-resolver.js.map +1 -0
  17. package/lib/bitbucket-server/bitbucket-server-url.d.ts +24 -0
  18. package/lib/bitbucket-server/bitbucket-server-url.js +43 -0
  19. package/lib/bitbucket-server/bitbucket-server-url.js.map +1 -0
  20. package/lib/devfile/dev-container-component-finder.d.ts +2 -1
  21. package/lib/devfile/dev-container-component-finder.js +20 -7
  22. package/lib/devfile/dev-container-component-finder.js.map +1 -1
  23. package/lib/devfile/dev-container-component-inserter.d.ts +18 -0
  24. package/lib/devfile/dev-container-component-inserter.js +98 -0
  25. package/lib/devfile/dev-container-component-inserter.js.map +1 -0
  26. package/lib/devfile/devfile-module.js +2 -0
  27. package/lib/devfile/devfile-module.js.map +1 -1
  28. package/lib/generate.d.ts +3 -3
  29. package/lib/generate.js +29 -21
  30. package/lib/generate.js.map +1 -1
  31. package/lib/github/github-module.js +3 -1
  32. package/lib/github/github-module.js.map +1 -1
  33. package/lib/github/github-resolver.d.ts +6 -7
  34. package/lib/github/github-resolver.js +10 -5
  35. package/lib/github/github-resolver.js.map +1 -1
  36. package/lib/github/github-url.d.ts +5 -6
  37. package/lib/github/github-url.js +7 -9
  38. package/lib/github/github-url.js.map +1 -1
  39. package/lib/inversify/inversify-binding.js +6 -0
  40. package/lib/inversify/inversify-binding.js.map +1 -1
  41. package/lib/main.d.ts +2 -0
  42. package/lib/main.js +19 -11
  43. package/lib/main.js.map +1 -1
  44. package/lib/plugin-registry/plugin-registry-resolver.js +1 -1
  45. package/lib/plugin-registry/plugin-registry-resolver.js.map +1 -1
  46. package/lib/resolve/git-url-resolver.d.ts +5 -0
  47. package/lib/resolve/git-url-resolver.js +43 -0
  48. package/lib/resolve/git-url-resolver.js.map +1 -0
  49. package/lib/resolve/resolve-module.d.ts +12 -0
  50. package/lib/resolve/resolve-module.js +19 -0
  51. package/lib/resolve/resolve-module.js.map +1 -0
  52. package/lib/resolve/resolver.d.ts +22 -0
  53. package/lib/resolve/resolver.js +12 -0
  54. package/lib/resolve/resolver.js.map +1 -0
  55. package/lib/resolve/url.d.ts +35 -0
  56. package/lib/resolve/url.js +12 -0
  57. package/lib/resolve/url.js.map +1 -0
  58. package/lib/types.d.ts +13 -0
  59. package/lib/types.js +17 -0
  60. package/lib/types.js.map +1 -0
  61. package/package.json +1 -1
  62. package/src/bitbucket/bitbucket-module.ts +21 -0
  63. package/src/bitbucket/bitbucket-resolver.ts +46 -0
  64. package/src/bitbucket/bitbucket-url.ts +41 -0
  65. package/src/bitbucket-server/bitbucket-server-module.ts +21 -0
  66. package/src/bitbucket-server/bitbucket-server-resolver.ts +53 -0
  67. package/src/bitbucket-server/bitbucket-server-url.ts +51 -0
  68. package/src/devfile/dev-container-component-finder.ts +23 -4
  69. package/src/devfile/dev-container-component-inserter.ts +49 -0
  70. package/src/devfile/devfile-module.ts +2 -0
  71. package/src/generate.ts +52 -20
  72. package/src/github/github-module.ts +4 -1
  73. package/src/github/github-resolver.ts +17 -9
  74. package/src/github/github-url.ts +8 -9
  75. package/src/inversify/inversify-binding.ts +6 -0
  76. package/src/main.ts +27 -8
  77. package/src/plugin-registry/plugin-registry-resolver.ts +1 -1
  78. package/src/resolve/git-url-resolver.ts +30 -0
  79. package/src/resolve/resolve-module.ts +18 -0
  80. package/src/resolve/resolver.ts +25 -0
  81. package/src/resolve/url.ts +40 -0
  82. package/src/types.ts +14 -0
package/README.md CHANGED
@@ -1,28 +1,56 @@
1
1
  ## DevWorkspace Generator
2
- The library is used by Devfile registry component to generate the DevWorkspace components and DevWorkspace templates.
2
+ The library is used by Devfile registry component to generate the DevWorkspace components and DevWorkspace templates. It requires editor definitions from the
3
+ [che-plugin-registry](https://github.com/eclipse-che/che-plugin-registry/).
3
4
 
4
5
  ## How to use the library
5
- The library could be used as a standalone library.
6
+ The library can be used as a standalone library.
6
7
 
7
8
  ```
8
9
  USAGE
9
10
  $ node lib/entrypoint.js [OPTIONS]
10
11
 
11
12
  OPTIONS
12
- --devfile-path path to the devfile.yaml file
13
- --devfile-url URL to the git repository that contains devfile.yaml
14
- --plugin-registry-url URL to the plugin registry that contains an editor's definition
15
- --editor-entry editor's ID
16
- --editor-path: path to the editor's devfile.yaml file
17
- --output-file path to the file where the generated content will be stored
18
- --project. describes project entry
13
+ --devfile-url: URL to the git repository that contains devfile.yaml
14
+ or
15
+ --devfile-path: path to the devfile.yaml file
19
16
 
20
- EXAMPLE
17
+ --plugin-registry-url: URL to the plugin registry that contains editor definitions (devfile.yaml)
18
+ --editor-entry: editor ID, found on the <plugin-registry-url>, to resolve the devfile.yaml
19
+ or
20
+ --editor-path: local file path of the editor devfile.yaml
21
+
22
+ --output-file: local file path for the generated devworkspace yaml
23
+
24
+ --project.<project-name> local file path for the sample project zip (for airgapped/offline registry builds)
25
+
26
+ --injectDefaultComponent: inject a default dev container component if no component is defined in the devfile and it doesn't provide a parent, the value can be true or false, default is false
27
+
28
+ --defaultComponentImage: image to use for the default dev container component that will be injected if no componetn is defined in the devfile and it doesn't provide a parent devfile, default is quay.io/devfile/universal-developer-image:ubi8-latest
29
+
30
+ EXAMPLES
31
+
32
+ # online example, using editor definition from https://che-plugin-registry-main.surge.sh/
33
+
34
+ $ node lib/entrypoint.js \
35
+ --devfile-url:https://github.com/che-samples/java-spring-petclinic/tree/main \
36
+ --plugin-registry-url:https://che-plugin-registry-main.surge.sh/v3/ \
37
+ --editor-entry:che-incubator/che-code/latest \
38
+ --output-file:/tmp/devworkspace-che-code-latest.yaml \
39
+ --injectDefaultComponent:true \
40
+ --defaultComponentImage:registry.access.redhat.com/ubi8/openjdk-11:latest
41
+
42
+ # offline example with devfile.yaml files and zipped project available locally
43
+
44
+ $ node lib/entrypoint.js \
45
+ --devfile-path:/remote-source/python-hello-world/app/devfile.yaml \
46
+ --editor-path:/build/plugins/che-incubator/che-code/latest/devfile.yaml \
47
+ --output-file:./devfiles/python__python-hello-world/devworkspace-che-code-latest.yaml \
48
+ --project.python-hello-world='{{_INTERNAL_URL_}}/resources/v2/python-hello-world.zip'
21
49
 
22
- $ node lib/entrypoint.js --devfile-url:https://github.com/che-samples/java-spring-petclinic/tree/main --editor-entry:che-incubator/che-code/insiders --plugin-registry-url:https://che-plugin-registry-main.surge.sh/v3/ --output-file:/tmp/all-in-one.yaml`
23
50
  ```
24
51
 
25
- The file `/tmp/all-in-one.yaml` contains a DevWorkspace based on the repository devfile and a Che-Code DevWorkspaceTemplate.
26
- If DevWorkspace engine is available on the cluster, the following command will create a DevWorkspace:
52
+ The output file `devworkspace-che-code-latest.yaml` contains a DevWorkspace based on the repository devfile and a Che-Code DevWorkspaceTemplate.
53
+
54
+ If the DevWorkspace engine is installed on the cluster, the following command will create a DevWorkspace:
27
55
 
28
- `$ kubectl apply -f /tmp/all-in-one.yaml`
56
+ `$ kubectl apply -f /tmp/devworkspace-che-code-latest.yaml`
@@ -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 bitbucketModule: ContainerModule;
12
+ export { bitbucketModule };
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ exports.bitbucketModule = 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 bitbucket_resolver_1 = require("./bitbucket-resolver");
15
+ var types_1 = require("../types");
16
+ var Resolver = types_1.TYPES.Resolver;
17
+ var bitbucketModule = new inversify_1.ContainerModule(function (bind) {
18
+ bind(Resolver).to(bitbucket_resolver_1.BitbucketResolver).inSingletonScope();
19
+ });
20
+ exports.bitbucketModule = bitbucketModule;
21
+ //# sourceMappingURL=bitbucket-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bitbucket-module.js","sourceRoot":"","sources":["../../src/bitbucket/bitbucket-module.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;yEAQyE;AACzE,uCAAwD;AAExD,2DAAyD;AACzD,kCAAiC;AAEzB,IAAA,QAAQ,GAAK,aAAK,SAAV,CAAW;AAE3B,IAAM,eAAe,GAAG,IAAI,2BAAe,CAAC,UAAC,IAAqB;IAChE,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,sCAAiB,CAAC,CAAC,gBAAgB,EAAE,CAAC;AAC1D,CAAC,CAAC,CAAC;AAEM,0CAAe"}
@@ -0,0 +1,17 @@
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 '../resolve/url';
11
+ import { Resolver } from '../resolve/resolver';
12
+ export declare class BitbucketResolver implements Resolver {
13
+ static readonly BITBUCKET_URL_PATTERN: RegExp;
14
+ isValid(url: string): boolean;
15
+ resolve(url: string): Url;
16
+ private getGroup;
17
+ }
@@ -0,0 +1,56 @@
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
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
12
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
13
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
14
+ 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;
15
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
16
+ };
17
+ exports.__esModule = true;
18
+ exports.BitbucketResolver = void 0;
19
+ var bitbucket_url_1 = require("./bitbucket-url");
20
+ var inversify_1 = require("inversify");
21
+ var BitbucketResolver = /** @class */ (function () {
22
+ function BitbucketResolver() {
23
+ }
24
+ BitbucketResolver_1 = BitbucketResolver;
25
+ BitbucketResolver.prototype.isValid = function (url) {
26
+ return BitbucketResolver_1.BITBUCKET_URL_PATTERN.test(url);
27
+ };
28
+ BitbucketResolver.prototype.resolve = function (url) {
29
+ var match = BitbucketResolver_1.BITBUCKET_URL_PATTERN.exec(url);
30
+ if (!match) {
31
+ throw new Error("Invalid bitbucket URL: " + url);
32
+ }
33
+ var workspaceId = this.getGroup(match, 'workspaceId');
34
+ var repoName = this.getGroup(match, 'repoName');
35
+ if (/^[\w-][\w.-]*?\.git$/.test(repoName)) {
36
+ repoName = repoName.substring(0, repoName.length - 4);
37
+ }
38
+ var branchName = this.getGroup(match, 'branchName', 'HEAD');
39
+ return new bitbucket_url_1.BitbucketUrl(workspaceId, repoName, branchName);
40
+ };
41
+ BitbucketResolver.prototype.getGroup = function (match, groupName, defaultValue) {
42
+ if (match.groups && match.groups[groupName]) {
43
+ return match.groups[groupName];
44
+ }
45
+ return defaultValue;
46
+ };
47
+ var BitbucketResolver_1;
48
+ // eslint-disable-next-line max-len
49
+ BitbucketResolver.BITBUCKET_URL_PATTERN = /^https:\/\/.*@?bitbucket\.org\/(?<workspaceId>[^\/]+)\/(?<repoName>[^\/]+)(\/(src|branch)\/(?<branchName>[^\/]+))?\/?$/;
50
+ BitbucketResolver = BitbucketResolver_1 = __decorate([
51
+ (0, inversify_1.injectable)()
52
+ ], BitbucketResolver);
53
+ return BitbucketResolver;
54
+ }());
55
+ exports.BitbucketResolver = BitbucketResolver;
56
+ //# sourceMappingURL=bitbucket-resolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bitbucket-resolver.js","sourceRoot":"","sources":["../../src/bitbucket/bitbucket-resolver.ts"],"names":[],"mappings":";AAAA;;;;;;;;yEAQyE;;;;;;;;;AAEzE,iDAA+C;AAC/C,uCAAuC;AAKvC;IAAA;IA6BA,CAAC;0BA7BY,iBAAiB;IAK5B,mCAAO,GAAP,UAAQ,GAAW;QACjB,OAAO,mBAAiB,CAAC,qBAAqB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3D,CAAC;IAED,mCAAO,GAAP,UAAQ,GAAW;QACjB,IAAM,KAAK,GAAG,mBAAiB,CAAC,qBAAqB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChE,IAAI,CAAC,KAAK,EAAE;YACV,MAAM,IAAI,KAAK,CAAC,4BAA0B,GAAK,CAAC,CAAC;SAClD;QACD,IAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;QACxD,IAAI,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;QAChD,IAAI,sBAAsB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YACzC,QAAQ,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;SACvD;QACD,IAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;QAC9D,OAAO,IAAI,4BAAY,CAAC,WAAW,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;IAC7D,CAAC;IAEO,oCAAQ,GAAhB,UAAiB,KAAsB,EAAE,SAAiB,EAAE,YAAqB;QAC/E,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE;YAC3C,OAAO,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;SAChC;QACD,OAAO,YAAY,CAAC;IACtB,CAAC;;IA3BD,mCAAmC;IACnB,uCAAqB,GACnC,wHAAyH,CAAA;IAHhH,iBAAiB;QAD7B,IAAA,sBAAU,GAAE;OACA,iBAAiB,CA6B7B;IAAD,wBAAC;CAAA,AA7BD,IA6BC;AA7BY,8CAAiB"}
@@ -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 '../resolve/url';
11
+ export declare class BitbucketUrl implements Url {
12
+ private readonly workspaceId;
13
+ private readonly repoName;
14
+ private readonly branchName;
15
+ private static readonly BITBUCKET_URL;
16
+ constructor(workspaceId: string, repoName: string, branchName: string);
17
+ getContentUrl(path: string): string;
18
+ getUrl(): string;
19
+ getCloneUrl(): string;
20
+ getRepoName(): string;
21
+ getBranchName(): string;
22
+ }
@@ -0,0 +1,38 @@
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
+ exports.BitbucketUrl = void 0;
13
+ var BitbucketUrl = /** @class */ (function () {
14
+ function BitbucketUrl(workspaceId, repoName, branchName) {
15
+ this.workspaceId = workspaceId;
16
+ this.repoName = repoName;
17
+ this.branchName = branchName;
18
+ }
19
+ BitbucketUrl.prototype.getContentUrl = function (path) {
20
+ return BitbucketUrl.BITBUCKET_URL + "/" + this.workspaceId + "/" + this.repoName + "/raw/" + this.branchName + "/" + path;
21
+ };
22
+ BitbucketUrl.prototype.getUrl = function () {
23
+ return BitbucketUrl.BITBUCKET_URL + "/" + this.workspaceId + "/" + this.repoName + "/src/" + this.branchName;
24
+ };
25
+ BitbucketUrl.prototype.getCloneUrl = function () {
26
+ return BitbucketUrl.BITBUCKET_URL + "/" + this.workspaceId + "/" + this.repoName + ".git";
27
+ };
28
+ BitbucketUrl.prototype.getRepoName = function () {
29
+ return this.repoName;
30
+ };
31
+ BitbucketUrl.prototype.getBranchName = function () {
32
+ return this.branchName;
33
+ };
34
+ BitbucketUrl.BITBUCKET_URL = 'https://bitbucket.org';
35
+ return BitbucketUrl;
36
+ }());
37
+ exports.BitbucketUrl = BitbucketUrl;
38
+ //# sourceMappingURL=bitbucket-url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bitbucket-url.js","sourceRoot":"","sources":["../../src/bitbucket/bitbucket-url.ts"],"names":[],"mappings":";AAAA;;;;;;;;yEAQyE;;;AAIzE;IAGE,sBACmB,WAAmB,EACnB,QAAgB,EAChB,UAAkB;QAFlB,gBAAW,GAAX,WAAW,CAAQ;QACnB,aAAQ,GAAR,QAAQ,CAAQ;QAChB,eAAU,GAAV,UAAU,CAAQ;IAClC,CAAC;IAEJ,oCAAa,GAAb,UAAc,IAAY;QACxB,OAAU,YAAY,CAAC,aAAa,SAAI,IAAI,CAAC,WAAW,SAAI,IAAI,CAAC,QAAQ,aAAQ,IAAI,CAAC,UAAU,SAAI,IAAM,CAAC;IAC7G,CAAC;IAED,6BAAM,GAAN;QACE,OAAU,YAAY,CAAC,aAAa,SAAI,IAAI,CAAC,WAAW,SAAI,IAAI,CAAC,QAAQ,aAAQ,IAAI,CAAC,UAAY,CAAC;IACrG,CAAC;IAED,kCAAW,GAAX;QACE,OAAU,YAAY,CAAC,aAAa,SAAI,IAAI,CAAC,WAAW,SAAI,IAAI,CAAC,QAAQ,SAAM,CAAC;IAClF,CAAC;IAED,kCAAW,GAAX;QACE,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,oCAAa,GAAb;QACE,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IA1BuB,0BAAa,GAAG,uBAAuB,CAAC;IA2BlE,mBAAC;CAAA,AA5BD,IA4BC;AA5BY,oCAAY"}
@@ -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 bitbucketServerModule: ContainerModule;
12
+ export { bitbucketServerModule };
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ exports.bitbucketServerModule = 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 bitbucket_server_resolver_1 = require("./bitbucket-server-resolver");
15
+ var types_1 = require("../types");
16
+ var Resolver = types_1.TYPES.Resolver;
17
+ var bitbucketServerModule = new inversify_1.ContainerModule(function (bind) {
18
+ bind(Resolver).to(bitbucket_server_resolver_1.BitbucketServerResolver).inSingletonScope();
19
+ });
20
+ exports.bitbucketServerModule = bitbucketServerModule;
21
+ //# sourceMappingURL=bitbucket-server-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bitbucket-server-module.js","sourceRoot":"","sources":["../../src/bitbucket-server/bitbucket-server-module.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;yEAQyE;AACzE,uCAAwD;AAExD,yEAAsE;AACtE,kCAAiC;AAEzB,IAAA,QAAQ,GAAK,aAAK,SAAV,CAAW;AAE3B,IAAM,qBAAqB,GAAG,IAAI,2BAAe,CAAC,UAAC,IAAqB;IACtE,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,mDAAuB,CAAC,CAAC,gBAAgB,EAAE,CAAC;AAChE,CAAC,CAAC,CAAC;AAEM,sDAAqB"}
@@ -0,0 +1,17 @@
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 '../resolve/url';
11
+ import { Resolver } from '../resolve/resolver';
12
+ export declare class BitbucketServerResolver implements Resolver {
13
+ static readonly BITBUCKET_URL_PATTERNS: RegExp[];
14
+ isValid(url: string): boolean;
15
+ resolve(url: string): Url;
16
+ private getGroup;
17
+ }
@@ -0,0 +1,64 @@
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
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
12
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
13
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
14
+ 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;
15
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
16
+ };
17
+ exports.__esModule = true;
18
+ exports.BitbucketServerResolver = void 0;
19
+ var bitbucket_server_url_1 = require("./bitbucket-server-url");
20
+ var inversify_1 = require("inversify");
21
+ var BitbucketServerResolver = /** @class */ (function () {
22
+ function BitbucketServerResolver() {
23
+ }
24
+ BitbucketServerResolver_1 = BitbucketServerResolver;
25
+ BitbucketServerResolver.prototype.isValid = function (url) {
26
+ return BitbucketServerResolver_1.BITBUCKET_URL_PATTERNS.some(function (p) { return p.test(url); });
27
+ };
28
+ BitbucketServerResolver.prototype.resolve = function (url) {
29
+ var regExp = BitbucketServerResolver_1.BITBUCKET_URL_PATTERNS.find(function (p) { return p.test(url); });
30
+ if (!regExp) {
31
+ throw new Error("Invalid bitbucket-server URL: " + url);
32
+ }
33
+ var match = regExp.exec(url);
34
+ var scheme = this.getGroup(match, 'scheme');
35
+ var hostName = this.getGroup(match, 'host');
36
+ var user = this.getGroup(match, 'user');
37
+ var project = this.getGroup(match, 'project');
38
+ var repo = this.getGroup(match, 'repo');
39
+ var branch = this.getGroup(match, 'branch');
40
+ if (branch !== undefined && branch.startsWith('refs%2Fheads%2F')) {
41
+ branch = branch.substring(15);
42
+ }
43
+ return new bitbucket_server_url_1.BitbucketServerUrl(scheme, hostName, user, project, repo, branch);
44
+ };
45
+ BitbucketServerResolver.prototype.getGroup = function (match, groupName) {
46
+ if (match.groups && match.groups[groupName]) {
47
+ return match.groups[groupName];
48
+ }
49
+ };
50
+ var BitbucketServerResolver_1;
51
+ // eslint-disable-next-line max-len
52
+ BitbucketServerResolver.BITBUCKET_URL_PATTERNS = [
53
+ /^(?<scheme>https?):\/\/(?<host>.*)\/scm\/~(?<user>[^\/]+)\/(?<repo>.*).git$/,
54
+ /^(?<scheme>https?):\/\/(?<host>.*)\/users\/(?<user>[^\/]+)\/repos\/(?<repo>[^\/]+)\/browse(\?at=(?<branch>.*))?$/,
55
+ /^(?<scheme>https?):\/\/(?<host>.*)\/scm\/(?<project>[^\/~]+)\/(?<repo>[^\/]+).git$/,
56
+ /^(?<scheme>https?):\/\/(?<host>.*)\/projects\/(?<project>[^\/]+)\/repos\/(?<repo>[^\/]+)\/browse(\?at=(?<branch>.*))?$/,
57
+ ];
58
+ BitbucketServerResolver = BitbucketServerResolver_1 = __decorate([
59
+ (0, inversify_1.injectable)()
60
+ ], BitbucketServerResolver);
61
+ return BitbucketServerResolver;
62
+ }());
63
+ exports.BitbucketServerResolver = BitbucketServerResolver;
64
+ //# sourceMappingURL=bitbucket-server-resolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bitbucket-server-resolver.js","sourceRoot":"","sources":["../../src/bitbucket-server/bitbucket-server-resolver.ts"],"names":[],"mappings":";AAAA;;;;;;;;yEAQyE;;;;;;;;;AAEzE,+DAA4D;AAC5D,uCAAuC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AM,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IAC/E,CAAC;IAEO,0CAAQ,GAAhB,UAAiB,KAAsB,EAAE,SAAiB;QACxD,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE;YAC3C,OAAO,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;SAChC;IACH,CAAC;;IAlCD,mCAAmC;IACnB,8CAAsB,GAAa;QACjD,6EAA6E;QAC7E,kHAAkH;QAClH,oFAAoF;QACpF,wHAAwH;KACxH,CAAA;IAPS,uBAAuB;QADnC,IAAA,sBAAU,GAAE;OACA,uBAAuB,CAoCnC;IAAD,8BAAC;CAAA,AApCD,IAoCC;AApCY,0DAAuB"}
@@ -0,0 +1,24 @@
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 '../resolve/url';
11
+ export declare class BitbucketServerUrl implements Url {
12
+ private readonly scheme;
13
+ private readonly hostName;
14
+ private readonly user;
15
+ private readonly project;
16
+ private readonly repo;
17
+ private readonly branch;
18
+ constructor(scheme: string, hostName: string, user: string | undefined, project: string | undefined, repo: string, branch: string | undefined);
19
+ getContentUrl(path: string): string;
20
+ getUrl(): string;
21
+ getCloneUrl(): string;
22
+ getRepoName(): string;
23
+ getBranchName(): string;
24
+ }
@@ -0,0 +1,43 @@
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
+ exports.BitbucketServerUrl = void 0;
13
+ var BitbucketServerUrl = /** @class */ (function () {
14
+ function BitbucketServerUrl(scheme, hostName, user, project, repo, branch) {
15
+ this.scheme = scheme;
16
+ this.hostName = hostName;
17
+ this.user = user;
18
+ this.project = project;
19
+ this.repo = repo;
20
+ this.branch = branch;
21
+ }
22
+ BitbucketServerUrl.prototype.getContentUrl = function (path) {
23
+ var isUser = this.user !== undefined;
24
+ return this.scheme + "://" + this.hostName + "/" + (isUser ? 'users' : 'projects') + "/" + (isUser ? this.user : this.project) + "/repos/" + this.repo + "/raw/" + path + (this.branch !== undefined ? '?/at=' + this.branch : '');
25
+ };
26
+ BitbucketServerUrl.prototype.getUrl = function () {
27
+ var isUser = this.user !== undefined;
28
+ return this.scheme + "://" + this.hostName + "/" + (isUser ? 'users' : 'projects') + "/" + (isUser ? this.user : this.project) + "/repos/" + this.repo + (this.branch !== undefined ? '/browse?at=' + this.branch : '');
29
+ };
30
+ BitbucketServerUrl.prototype.getCloneUrl = function () {
31
+ var isUser = this.user !== undefined;
32
+ return this.scheme + "://" + this.hostName + "/scm/" + (isUser ? '~' + this.user : this.project.toLowerCase()) + "/" + this.repo + ".git";
33
+ };
34
+ BitbucketServerUrl.prototype.getRepoName = function () {
35
+ return this.repo;
36
+ };
37
+ BitbucketServerUrl.prototype.getBranchName = function () {
38
+ return this.branch;
39
+ };
40
+ return BitbucketServerUrl;
41
+ }());
42
+ exports.BitbucketServerUrl = BitbucketServerUrl;
43
+ //# sourceMappingURL=bitbucket-server-url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bitbucket-server-url.js","sourceRoot":"","sources":["../../src/bitbucket-server/bitbucket-server-url.ts"],"names":[],"mappings":";AAAA;;;;;;;;yEAQyE;;;AAIzE;IACE,4BACmB,MAAc,EACd,QAAgB,EAChB,IAAwB,EACxB,OAA2B,EAC3B,IAAY,EACZ,MAA0B;QAL1B,WAAM,GAA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M,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,UACnG,IAAI,CAAC,IAAI,SACL,CAAC;IACT,CAAC;IAED,wCAAW,GAAX;QACE,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,0CAAa,GAAb;QACE,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IACH,yBAAC;AAAD,CAAC,AAtCD,IAsCC;AAtCY,gDAAkB"}
@@ -13,5 +13,6 @@ import { V1alpha2DevWorkspaceSpecTemplateComponents } from '@devfile/api';
13
13
  * Need to find dev container from main dev workspace
14
14
  */
15
15
  export declare class DevContainerComponentFinder {
16
- find(devfileContext: DevfileContext): Promise<V1alpha2DevWorkspaceSpecTemplateComponents | undefined>;
16
+ private devContainerComponentInserter;
17
+ find(devfileContext: DevfileContext, injectDefaultComponent?: string, defaultComponentImage?: string): Promise<V1alpha2DevWorkspaceSpecTemplateComponents | undefined>;
17
18
  }
@@ -53,23 +53,33 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
53
53
  exports.__esModule = true;
54
54
  exports.DevContainerComponentFinder = void 0;
55
55
  var inversify_1 = require("inversify");
56
+ var dev_container_component_inserter_1 = require("./dev-container-component-inserter");
56
57
  /**
57
58
  * Need to find dev container from main dev workspace
58
59
  */
59
60
  var DevContainerComponentFinder = /** @class */ (function () {
60
61
  function DevContainerComponentFinder() {
61
62
  }
62
- DevContainerComponentFinder.prototype.find = function (devfileContext) {
63
- var _a, _b, _c;
63
+ DevContainerComponentFinder.prototype.find = function (devfileContext, injectDefaultComponent, defaultComponentImage) {
64
+ var _a, _b, _c, _d;
64
65
  return __awaiter(this, void 0, void 0, function () {
65
- var devComponents;
66
- return __generator(this, function (_d) {
67
- devComponents = (_c = (_b = (_a = devfileContext.devWorkspace.spec) === null || _a === void 0 ? void 0 : _a.template) === null || _b === void 0 ? void 0 : _b.components) === null || _c === void 0 ? void 0 : _c.filter(function (component) { return component.container; }).filter(
66
+ var devComponents, devComponents_1;
67
+ return __generator(this, function (_e) {
68
+ // if a devfile contains a parent, we should not add a default dev container
69
+ if ((_a = devfileContext.devfile) === null || _a === void 0 ? void 0 : _a.parent) {
70
+ return [2 /*return*/, undefined];
71
+ }
72
+ devComponents = (_d = (_c = (_b = devfileContext.devWorkspace.spec) === null || _b === void 0 ? void 0 : _b.template) === null || _c === void 0 ? void 0 : _c.components) === null || _d === void 0 ? void 0 : _d.filter(function (component) { return component.container; }).filter(
68
73
  // we should ignore component that do not mount the sources
69
74
  function (component) { return component.container && component.container.mountSources !== false; });
70
- // only one, fine, else error
71
75
  if (!devComponents || devComponents.length === 0) {
72
- throw new Error('Not able to find any dev container component in DevWorkspace');
76
+ // do not inject a default component if injectDefaultComponent parameter is false
77
+ if (!injectDefaultComponent || injectDefaultComponent !== 'true') {
78
+ return [2 /*return*/, undefined];
79
+ }
80
+ this.devContainerComponentInserter.insert(devfileContext, defaultComponentImage);
81
+ devComponents_1 = devfileContext.devWorkspace.spec.template.components.filter(function (component) { return component.container; });
82
+ return [2 /*return*/, devComponents_1[0]];
73
83
  }
74
84
  else if (devComponents.length === 1) {
75
85
  return [2 /*return*/, devComponents[0]];
@@ -82,6 +92,9 @@ var DevContainerComponentFinder = /** @class */ (function () {
82
92
  });
83
93
  });
84
94
  };
95
+ __decorate([
96
+ (0, inversify_1.inject)(dev_container_component_inserter_1.DevContainerComponentInserter)
97
+ ], DevContainerComponentFinder.prototype, "devContainerComponentInserter");
85
98
  DevContainerComponentFinder = __decorate([
86
99
  (0, inversify_1.injectable)()
87
100
  ], DevContainerComponentFinder);
@@ -1 +1 @@
1
- {"version":3,"file":"dev-container-component-finder.js","sourceRoot":"","sources":["../../src/devfile/dev-container-component-finder.ts"],"names":[],"mappings":";AAAA;;;;;;;;yEAQyE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIzE,uCAAuC;AAEvC;;GAEG;AAEH;IAAA;IAwBA,CAAC;IAvBO,0CAAI,GAAV,UAAW,cAA8B;;;;;gBAEjC,aAAa,GAAG,MAAA,MAAA,MAAA,cAAc,CAAC,YAAY,CAAC,IAAI,0CAAE,QAAQ,0CAAE,UAAU,0CACxE,MAAM,CAAC,UAAA,SAAS,IAAI,OAAA,SAAS,CAAC,SAAS,EAAnB,CAAmB,EACxC,MAAM;gBACL,2DAA2D;gBAC3D,UAAA,SAAS,IAAI,OAAA,SAAS,CAAC,SAAS,IAAI,SAAS,CAAC,SAAS,CAAC,YAAY,KAAK,KAAK,EAAjE,CAAiE,CAC/E,CAAC;gBAEJ,6BAA6B;gBAC7B,IAAI,CAAC,aAAa,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE;oBAChD,MAAM,IAAI,KAAK,CAAC,8DAA8D,CAAC,CAAC;iBACjF;qBAAM,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE;oBACrC,sBAAO,aAAa,CAAC,CAAC,CAAC,EAAC;iBACzB;qBAAM;oBACL,OAAO,CAAC,IAAI,CACV,+FAA6F,aAAa,CAAC,GAAG,CAC5G,UAAA,SAAS,IAAI,OAAA,SAAS,CAAC,IAAI,EAAd,CAAc,CAC1B,CACJ,CAAC;oBACF,sBAAO,aAAa,CAAC,CAAC,CAAC,EAAC;iBACzB;;;;KACF;IAvBU,2BAA2B;QADvC,IAAA,sBAAU,GAAE;OACA,2BAA2B,CAwBvC;IAAD,kCAAC;CAAA,AAxBD,IAwBC;AAxBY,kEAA2B"}
1
+ {"version":3,"file":"dev-container-component-finder.js","sourceRoot":"","sources":["../../src/devfile/dev-container-component-finder.ts"],"names":[],"mappings":";AAAA;;;;;;;;yEAQyE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIzE,uCAA+C;AAC/C,uFAAmF;AAEnF;;GAEG;AAEH;IAAA;IA0CA,CAAC;IAtCO,0CAAI,GAAV,UACE,cAA8B,EAC9B,sBA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;QADC,IAAA,kBAAM,EAAC,gEAA6B,CAAC;8EAC+B;IAF1D,2BAA2B;QADvC,IAAA,sBAAU,GAAE;OACA,2BAA2B,CA0CvC;IAAD,kCAAC;CAAA,AA1CD,IA0CC;AA1CY,kEAA2B"}
@@ -0,0 +1,18 @@
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 { DevfileContext } from '../api/devfile-context';
11
+ /**
12
+ * Adds a new component on empty devfile with specific name and image
13
+ */
14
+ export declare class DevContainerComponentInserter {
15
+ readonly DEFAULT_DEV_CONTAINER_IMAGE = "quay.io/devfile/universal-developer-image:ubi8-latest";
16
+ readonly DEFAULT_DEV_CONTAINER_NAME = "dev";
17
+ insert(devfileContext: DevfileContext, defaultComponentImage?: string): Promise<void>;
18
+ }