@backstage/plugin-scaffolder-common 0.3.0 → 1.0.1

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @backstage/plugin-scaffolder-common
2
2
 
3
+ ## 1.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @backstage/catalog-model@1.0.1
9
+
10
+ ## 1.0.1-next.0
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+ - @backstage/catalog-model@1.0.1-next.0
16
+
17
+ ## 1.0.0
18
+
19
+ ### Major Changes
20
+
21
+ - b58c70c223: This package has been promoted to v1.0! To understand how this change affects the package, please check out our [versioning policy](https://backstage.io/docs/overview/versioning-policy).
22
+
23
+ ### Patch Changes
24
+
25
+ - c8475ab3bb: Adding some documentation for exported things
26
+ - Updated dependencies
27
+ - @backstage/catalog-model@1.0.0
28
+ - @backstage/types@1.0.0
29
+
3
30
  ## 0.3.0
4
31
 
5
32
  ### Minor Changes
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../src/TemplateEntityV1beta3.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Entity,\n entityKindSchemaValidator,\n KindValidator,\n} from '@backstage/catalog-model';\nimport { JsonObject } from '@backstage/types';\nimport schema from './Template.v1beta3.schema.json';\n\n/**\n * Backstage catalog Template kind Entity. Templates are used by the Scaffolder\n * plugin to create new entities, such as Components.\n *\n * @public\n */\nexport interface TemplateEntityV1beta3 extends Entity {\n apiVersion: 'scaffolder.backstage.io/v1beta3';\n kind: 'Template';\n spec: {\n type: string;\n parameters?: JsonObject | JsonObject[];\n steps: Array<{\n id?: string;\n name?: string;\n action: string;\n input?: JsonObject;\n if?: string | boolean;\n }>;\n output?: { [name: string]: string };\n owner?: string;\n };\n}\n\nconst validator = entityKindSchemaValidator(schema);\n\n/**\n * Entity data validator for {@link TemplateEntityV1beta3}.\n *\n * @public\n */\nexport const templateEntityV1beta3Validator: KindValidator = {\n // TODO(freben): Emulate the old KindValidator until we fix that type\n async check(data: Entity) {\n return validator(data) === data;\n },\n};\n"],"names":["entityKindSchemaValidator"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,MAAM,YAAYA,uCAA0B;MAO/B,iCAAgD;AAAA,QAErD,MAAM,MAAc;AACxB,WAAO,UAAU,UAAU;AAAA;AAAA;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../src/TemplateEntityV1beta3.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Entity,\n entityKindSchemaValidator,\n KindValidator,\n} from '@backstage/catalog-model';\nimport { JsonObject } from '@backstage/types';\nimport schema from './Template.v1beta3.schema.json';\n\n/**\n * Backstage catalog Template kind Entity. Templates are used by the Scaffolder\n * plugin to create new entities, such as Components.\n *\n * @public\n */\nexport interface TemplateEntityV1beta3 extends Entity {\n /**\n * The apiVersion string of the TaskSpec.\n */\n apiVersion: 'scaffolder.backstage.io/v1beta3';\n /**\n * The kind of the entity\n */\n kind: 'Template';\n /**\n * The specification of the Template Entity\n */\n spec: {\n /**\n * The type that the Template will create. For example service, website or library.\n */\n type: string;\n /**\n * This is a JSONSchema or an array of JSONSchema's which is used to render a form in the frontend\n * to collect user input and validate it against that schema. This can then be used in the `steps` part below to template\n * variables passed from the user into each action in the template.\n */\n parameters?: JsonObject | JsonObject[];\n /**\n * A list of steps to be executed in sequence which are defined by the template. These steps are a list of the underlying\n * javascript action and some optional input parameters that may or may not have been collected from the end user.\n */\n steps: Array<{\n id?: string;\n name?: string;\n action: string;\n input?: JsonObject;\n if?: string | boolean;\n }>;\n /**\n * The output is an object where template authors can pull out information from template actions and return them in a known standard way.\n */\n output?: { [name: string]: string };\n /**\n * The owner entityRef of the TemplateEntity\n */\n owner?: string;\n };\n}\n\nconst validator = entityKindSchemaValidator(schema);\n\n/**\n * Entity data validator for {@link TemplateEntityV1beta3}.\n *\n * @public\n */\nexport const templateEntityV1beta3Validator: KindValidator = {\n // TODO(freben): Emulate the old KindValidator until we fix that type\n async check(data: Entity) {\n return validator(data) === data;\n },\n};\n"],"names":["entityKindSchemaValidator"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,MAAM,SAAS,GAAGA,sCAAyB,CAAC,MAAM,CAAC,CAAC;AACxC,MAAC,8BAA8B,GAAG;AAC9C,EAAE,MAAM,KAAK,CAAC,IAAI,EAAE;AACpB,IAAI,OAAO,SAAS,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;AACpC,GAAG;AACH;;;;"}
package/dist/index.d.ts CHANGED
@@ -8,7 +8,13 @@ import { Entity, KindValidator } from '@backstage/catalog-model';
8
8
  * @public
9
9
  */
10
10
  declare type TemplateInfo = {
11
+ /**
12
+ * The entityRef of the template
13
+ */
11
14
  entityRef: string;
15
+ /**
16
+ * Where the template is stored, so we can resolve relative paths for things like `fetch:template` paths.
17
+ */
12
18
  baseUrl?: string;
13
19
  };
14
20
  /**
@@ -17,10 +23,25 @@ declare type TemplateInfo = {
17
23
  * @public
18
24
  */
19
25
  interface TaskStep {
26
+ /**
27
+ * A unqiue identifier for this step.
28
+ */
20
29
  id: string;
30
+ /**
31
+ * A display name to show the user.
32
+ */
21
33
  name: string;
34
+ /**
35
+ * The underlying action ID that will be called as part of running this step.
36
+ */
22
37
  action: string;
38
+ /**
39
+ * Additional data that will be passed to the action.
40
+ */
23
41
  input?: JsonObject;
42
+ /**
43
+ * When this is false, or if the templated value string evaluates to something that is falsy the step will be skipped.
44
+ */
24
45
  if?: string | boolean;
25
46
  }
26
47
  /**
@@ -30,12 +51,30 @@ interface TaskStep {
30
51
  * @public
31
52
  */
32
53
  interface TaskSpecV1beta3 {
54
+ /**
55
+ * The apiVersion string of the TaskSpec.
56
+ */
33
57
  apiVersion: 'scaffolder.backstage.io/v1beta3';
58
+ /**
59
+ * This is a JSONSchema which is used to render a form in the frontend
60
+ * to collect user input and validate it against that schema. This can then be used in the `steps` part below to template
61
+ * variables passed from the user into each action in the template.
62
+ */
34
63
  parameters: JsonObject;
64
+ /**
65
+ * A list of steps to be executed in sequence which are defined by the template. These steps are a list of the underlying
66
+ * javascript action and some optional input parameters that may or may not have been collected from the end user.
67
+ */
35
68
  steps: TaskStep[];
69
+ /**
70
+ * The output is an object where template authors can pull out information from template actions and return them in a known standard way.
71
+ */
36
72
  output: {
37
73
  [name: string]: JsonValue;
38
74
  };
75
+ /**
76
+ * Some information about the template that is stored on the task spec.
77
+ */
39
78
  templateInfo?: TemplateInfo;
40
79
  }
41
80
  /**
@@ -52,11 +91,32 @@ declare type TaskSpec = TaskSpecV1beta3;
52
91
  * @public
53
92
  */
54
93
  interface TemplateEntityV1beta3 extends Entity {
94
+ /**
95
+ * The apiVersion string of the TaskSpec.
96
+ */
55
97
  apiVersion: 'scaffolder.backstage.io/v1beta3';
98
+ /**
99
+ * The kind of the entity
100
+ */
56
101
  kind: 'Template';
102
+ /**
103
+ * The specification of the Template Entity
104
+ */
57
105
  spec: {
106
+ /**
107
+ * The type that the Template will create. For example service, website or library.
108
+ */
58
109
  type: string;
110
+ /**
111
+ * This is a JSONSchema or an array of JSONSchema's which is used to render a form in the frontend
112
+ * to collect user input and validate it against that schema. This can then be used in the `steps` part below to template
113
+ * variables passed from the user into each action in the template.
114
+ */
59
115
  parameters?: JsonObject | JsonObject[];
116
+ /**
117
+ * A list of steps to be executed in sequence which are defined by the template. These steps are a list of the underlying
118
+ * javascript action and some optional input parameters that may or may not have been collected from the end user.
119
+ */
60
120
  steps: Array<{
61
121
  id?: string;
62
122
  name?: string;
@@ -64,9 +124,15 @@ interface TemplateEntityV1beta3 extends Entity {
64
124
  input?: JsonObject;
65
125
  if?: string | boolean;
66
126
  }>;
127
+ /**
128
+ * The output is an object where template authors can pull out information from template actions and return them in a known standard way.
129
+ */
67
130
  output?: {
68
131
  [name: string]: string;
69
132
  };
133
+ /**
134
+ * The owner entityRef of the TemplateEntity
135
+ */
70
136
  owner?: string;
71
137
  };
72
138
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../src/TemplateEntityV1beta3.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Entity,\n entityKindSchemaValidator,\n KindValidator,\n} from '@backstage/catalog-model';\nimport { JsonObject } from '@backstage/types';\nimport schema from './Template.v1beta3.schema.json';\n\n/**\n * Backstage catalog Template kind Entity. Templates are used by the Scaffolder\n * plugin to create new entities, such as Components.\n *\n * @public\n */\nexport interface TemplateEntityV1beta3 extends Entity {\n apiVersion: 'scaffolder.backstage.io/v1beta3';\n kind: 'Template';\n spec: {\n type: string;\n parameters?: JsonObject | JsonObject[];\n steps: Array<{\n id?: string;\n name?: string;\n action: string;\n input?: JsonObject;\n if?: string | boolean;\n }>;\n output?: { [name: string]: string };\n owner?: string;\n };\n}\n\nconst validator = entityKindSchemaValidator(schema);\n\n/**\n * Entity data validator for {@link TemplateEntityV1beta3}.\n *\n * @public\n */\nexport const templateEntityV1beta3Validator: KindValidator = {\n // TODO(freben): Emulate the old KindValidator until we fix that type\n async check(data: Entity) {\n return validator(data) === data;\n },\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,MAAM,YAAY,0BAA0B;MAO/B,iCAAgD;AAAA,QAErD,MAAM,MAAc;AACxB,WAAO,UAAU,UAAU;AAAA;AAAA;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../src/TemplateEntityV1beta3.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Entity,\n entityKindSchemaValidator,\n KindValidator,\n} from '@backstage/catalog-model';\nimport { JsonObject } from '@backstage/types';\nimport schema from './Template.v1beta3.schema.json';\n\n/**\n * Backstage catalog Template kind Entity. Templates are used by the Scaffolder\n * plugin to create new entities, such as Components.\n *\n * @public\n */\nexport interface TemplateEntityV1beta3 extends Entity {\n /**\n * The apiVersion string of the TaskSpec.\n */\n apiVersion: 'scaffolder.backstage.io/v1beta3';\n /**\n * The kind of the entity\n */\n kind: 'Template';\n /**\n * The specification of the Template Entity\n */\n spec: {\n /**\n * The type that the Template will create. For example service, website or library.\n */\n type: string;\n /**\n * This is a JSONSchema or an array of JSONSchema's which is used to render a form in the frontend\n * to collect user input and validate it against that schema. This can then be used in the `steps` part below to template\n * variables passed from the user into each action in the template.\n */\n parameters?: JsonObject | JsonObject[];\n /**\n * A list of steps to be executed in sequence which are defined by the template. These steps are a list of the underlying\n * javascript action and some optional input parameters that may or may not have been collected from the end user.\n */\n steps: Array<{\n id?: string;\n name?: string;\n action: string;\n input?: JsonObject;\n if?: string | boolean;\n }>;\n /**\n * The output is an object where template authors can pull out information from template actions and return them in a known standard way.\n */\n output?: { [name: string]: string };\n /**\n * The owner entityRef of the TemplateEntity\n */\n owner?: string;\n };\n}\n\nconst validator = entityKindSchemaValidator(schema);\n\n/**\n * Entity data validator for {@link TemplateEntityV1beta3}.\n *\n * @public\n */\nexport const templateEntityV1beta3Validator: KindValidator = {\n // TODO(freben): Emulate the old KindValidator until we fix that type\n async check(data: Entity) {\n return validator(data) === data;\n },\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,MAAM,SAAS,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAC;AACxC,MAAC,8BAA8B,GAAG;AAC9C,EAAE,MAAM,KAAK,CAAC,IAAI,EAAE;AACpB,IAAI,OAAO,SAAS,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;AACpC,GAAG;AACH;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@backstage/plugin-scaffolder-common",
3
3
  "description": "Common functionalities for the scaffolder, to be shared between scaffolder and scaffolder-backend plugin",
4
- "version": "0.3.0",
4
+ "version": "1.0.1",
5
5
  "main": "dist/index.cjs.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -39,12 +39,12 @@
39
39
  "url": "https://github.com/backstage/backstage/issues"
40
40
  },
41
41
  "dependencies": {
42
- "@backstage/catalog-model": "^0.13.0",
43
- "@backstage/types": "^0.1.3"
42
+ "@backstage/catalog-model": "^1.0.1",
43
+ "@backstage/types": "^1.0.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@backstage/cli": "^0.15.2"
46
+ "@backstage/cli": "^0.17.0"
47
47
  },
48
- "gitHead": "60c4e39d1fcaeb10d6488ada1d907f34dc2a105a",
48
+ "gitHead": "e0e44c433319711c2fb8b175db411a621f7aaec2",
49
49
  "module": "dist/index.esm.js"
50
50
  }