@backstage-community/plugin-npm-common 1.20.0 → 1.21.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 +8 -0
- package/README.md +6 -23
- package/dist/NpmRegistryClient.cjs.js +1 -1
- package/dist/NpmRegistryClient.cjs.js.map +1 -1
- package/dist/NpmRegistryClient.esm.js +1 -1
- package/dist/NpmRegistryClient.esm.js.map +1 -1
- package/dist/annotations.cjs.js.map +1 -1
- package/dist/annotations.esm.js.map +1 -1
- package/dist/utils.cjs.js.map +1 -1
- package/dist/utils.esm.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -93,17 +93,15 @@ you must install also the backend plugin and [configure it](./registries.md).
|
|
|
93
93
|
|
|
94
94
|
### Load plugin via the new frontend system (alpha)
|
|
95
95
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
Your Backstage frontend app must use that new frontend system which isn't the default at the moment.
|
|
96
|
+
Ensure that your Backstage frontend app is using that new frontend system.
|
|
99
97
|
|
|
100
98
|
1. Install the frontend dependency:
|
|
101
99
|
|
|
102
100
|
```sh
|
|
103
|
-
yarn workspace app
|
|
101
|
+
yarn workspace app add @backstage-community/plugin-npm
|
|
104
102
|
```
|
|
105
103
|
|
|
106
|
-
2. Add the package to your `packages/app
|
|
104
|
+
2. Add the package to your `packages/app/src/App.tsx`.
|
|
107
105
|
|
|
108
106
|
```tsx
|
|
109
107
|
import npmPlugin from '@backstage-community/plugin-npm/alpha';
|
|
@@ -120,35 +118,20 @@ Your Backstage frontend app must use that new frontend system which isn't the de
|
|
|
120
118
|
});
|
|
121
119
|
```
|
|
122
120
|
|
|
123
|
-
3.
|
|
121
|
+
3. Optionally enable translation via an `app` module that adds one `TranslationBlueprint` extension:
|
|
124
122
|
|
|
125
123
|
```tsx
|
|
126
|
-
import { TranslationBlueprint } from '@backstage/plugin-app-react';
|
|
127
|
-
|
|
128
124
|
import npmPlugin, {
|
|
129
|
-
|
|
125
|
+
npmTranslationsModule,
|
|
130
126
|
} from '@backstage-community/plugin-npm/alpha';
|
|
131
127
|
```
|
|
132
128
|
|
|
133
129
|
```tsx
|
|
134
|
-
const npmTranslation = TranslationBlueprint.make({
|
|
135
|
-
name: 'npmTranslation',
|
|
136
|
-
params: {
|
|
137
|
-
resource: npmTranslations,
|
|
138
|
-
},
|
|
139
|
-
});
|
|
140
|
-
|
|
141
130
|
export default createApp({
|
|
142
131
|
features: [
|
|
143
|
-
createFrontendModule({
|
|
144
|
-
pluginId: 'app',
|
|
145
|
-
extensions: [
|
|
146
|
-
// ...other extensions
|
|
147
|
-
npmTranslation,
|
|
148
|
-
],
|
|
149
|
-
}),
|
|
150
132
|
// ...other plugins
|
|
151
133
|
npmPlugin,
|
|
134
|
+
npmTranslationsModule,
|
|
152
135
|
],
|
|
153
136
|
});
|
|
154
137
|
```
|
|
@@ -21,7 +21,7 @@ class NpmRegistryClient {
|
|
|
21
21
|
const response = await this.fetch(url, {
|
|
22
22
|
headers: {
|
|
23
23
|
...this.extraRequestHeaders,
|
|
24
|
-
...this.token ? { Authorization: this.token } :
|
|
24
|
+
...this.token ? { Authorization: this.token } : void 0
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
if (!response.ok) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NpmRegistryClient.cjs.js","sources":["../src/NpmRegistryClient.ts"],"sourcesContent":["/*\n * Copyright 2024 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 */\nimport { ResponseError } from '@backstage/errors';\n\nimport { NpmRegistryPackageInfo } from './types';\n\n/**\n * @public\n */\nexport class NpmRegistryClient {\n private readonly fetch: typeof fetch;\n private readonly baseUrl: string;\n private readonly token?: string;\n private readonly extraRequestHeaders?: Record<string, string>;\n\n constructor(options: {\n fetch?: typeof fetch;\n baseUrl?: string;\n token?: string;\n extraRequestHeaders?: Record<string, string>;\n }) {\n this.fetch = options?.fetch || global.fetch.bind(global);\n this.baseUrl = options.baseUrl || 'https://registry.npmjs.com';\n this.token = options.token;\n this.extraRequestHeaders = options.extraRequestHeaders;\n }\n\n async getPackageInfo(packageName: string): Promise<NpmRegistryPackageInfo> {\n if (!packageName) {\n throw new Error('No package name provided');\n }\n\n const url = `${this.baseUrl}/${encodeURIComponent(packageName)}`;\n\n const response = await this.fetch(url, {\n headers: {\n ...this.extraRequestHeaders,\n ...(this.token ? { Authorization: this.token } : undefined),\n },\n });\n\n if (!response.ok) {\n throw await ResponseError.fromResponse(response);\n }\n return response.json();\n }\n}\n"],"names":["ResponseError"],"mappings":";;;;AAsBO,MAAM,
|
|
1
|
+
{"version":3,"file":"NpmRegistryClient.cjs.js","sources":["../src/NpmRegistryClient.ts"],"sourcesContent":["/*\n * Copyright 2024 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 */\nimport { ResponseError } from '@backstage/errors';\n\nimport { NpmRegistryPackageInfo } from './types';\n\n/**\n * @public\n */\nexport class NpmRegistryClient {\n private readonly fetch: typeof fetch;\n private readonly baseUrl: string;\n private readonly token?: string;\n private readonly extraRequestHeaders?: Record<string, string>;\n\n constructor(options: {\n fetch?: typeof fetch;\n baseUrl?: string;\n token?: string;\n extraRequestHeaders?: Record<string, string>;\n }) {\n this.fetch = options?.fetch || global.fetch.bind(global);\n this.baseUrl = options.baseUrl || 'https://registry.npmjs.com';\n this.token = options.token;\n this.extraRequestHeaders = options.extraRequestHeaders;\n }\n\n async getPackageInfo(packageName: string): Promise<NpmRegistryPackageInfo> {\n if (!packageName) {\n throw new Error('No package name provided');\n }\n\n const url = `${this.baseUrl}/${encodeURIComponent(packageName)}`;\n\n const response = await this.fetch(url, {\n headers: {\n ...this.extraRequestHeaders,\n ...(this.token ? { Authorization: this.token } : undefined),\n },\n });\n\n if (!response.ok) {\n throw await ResponseError.fromResponse(response);\n }\n return response.json();\n }\n}\n"],"names":["ResponseError"],"mappings":";;;;AAsBO,MAAM,iBAAA,CAAkB;AAAA,EACZ,KAAA;AAAA,EACA,OAAA;AAAA,EACA,KAAA;AAAA,EACA,mBAAA;AAAA,EAEjB,YAAY,OAAA,EAKT;AACD,IAAA,IAAA,CAAK,QAAQ,OAAA,EAAS,KAAA,IAAS,MAAA,CAAO,KAAA,CAAM,KAAK,MAAM,CAAA;AACvD,IAAA,IAAA,CAAK,OAAA,GAAU,QAAQ,OAAA,IAAW,4BAAA;AAClC,IAAA,IAAA,CAAK,QAAQ,OAAA,CAAQ,KAAA;AACrB,IAAA,IAAA,CAAK,sBAAsB,OAAA,CAAQ,mBAAA;AAAA,EACrC;AAAA,EAEA,MAAM,eAAe,WAAA,EAAsD;AACzE,IAAA,IAAI,CAAC,WAAA,EAAa;AAChB,MAAA,MAAM,IAAI,MAAM,0BAA0B,CAAA;AAAA,IAC5C;AAEA,IAAA,MAAM,MAAM,CAAA,EAAG,IAAA,CAAK,OAAO,CAAA,CAAA,EAAI,kBAAA,CAAmB,WAAW,CAAC,CAAA,CAAA;AAE9D,IAAA,MAAM,QAAA,GAAW,MAAM,IAAA,CAAK,KAAA,CAAM,GAAA,EAAK;AAAA,MACrC,OAAA,EAAS;AAAA,QACP,GAAG,IAAA,CAAK,mBAAA;AAAA,QACR,GAAI,IAAA,CAAK,KAAA,GAAQ,EAAE,aAAA,EAAe,IAAA,CAAK,OAAM,GAAI;AAAA;AACnD,KACD,CAAA;AAED,IAAA,IAAI,CAAC,SAAS,EAAA,EAAI;AAChB,MAAA,MAAM,MAAMA,oBAAA,CAAc,YAAA,CAAa,QAAQ,CAAA;AAAA,IACjD;AACA,IAAA,OAAO,SAAS,IAAA,EAAK;AAAA,EACvB;AACF;;;;"}
|
|
@@ -19,7 +19,7 @@ class NpmRegistryClient {
|
|
|
19
19
|
const response = await this.fetch(url, {
|
|
20
20
|
headers: {
|
|
21
21
|
...this.extraRequestHeaders,
|
|
22
|
-
...this.token ? { Authorization: this.token } :
|
|
22
|
+
...this.token ? { Authorization: this.token } : void 0
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
if (!response.ok) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NpmRegistryClient.esm.js","sources":["../src/NpmRegistryClient.ts"],"sourcesContent":["/*\n * Copyright 2024 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 */\nimport { ResponseError } from '@backstage/errors';\n\nimport { NpmRegistryPackageInfo } from './types';\n\n/**\n * @public\n */\nexport class NpmRegistryClient {\n private readonly fetch: typeof fetch;\n private readonly baseUrl: string;\n private readonly token?: string;\n private readonly extraRequestHeaders?: Record<string, string>;\n\n constructor(options: {\n fetch?: typeof fetch;\n baseUrl?: string;\n token?: string;\n extraRequestHeaders?: Record<string, string>;\n }) {\n this.fetch = options?.fetch || global.fetch.bind(global);\n this.baseUrl = options.baseUrl || 'https://registry.npmjs.com';\n this.token = options.token;\n this.extraRequestHeaders = options.extraRequestHeaders;\n }\n\n async getPackageInfo(packageName: string): Promise<NpmRegistryPackageInfo> {\n if (!packageName) {\n throw new Error('No package name provided');\n }\n\n const url = `${this.baseUrl}/${encodeURIComponent(packageName)}`;\n\n const response = await this.fetch(url, {\n headers: {\n ...this.extraRequestHeaders,\n ...(this.token ? { Authorization: this.token } : undefined),\n },\n });\n\n if (!response.ok) {\n throw await ResponseError.fromResponse(response);\n }\n return response.json();\n }\n}\n"],"names":[],"mappings":";;AAsBO,MAAM,
|
|
1
|
+
{"version":3,"file":"NpmRegistryClient.esm.js","sources":["../src/NpmRegistryClient.ts"],"sourcesContent":["/*\n * Copyright 2024 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 */\nimport { ResponseError } from '@backstage/errors';\n\nimport { NpmRegistryPackageInfo } from './types';\n\n/**\n * @public\n */\nexport class NpmRegistryClient {\n private readonly fetch: typeof fetch;\n private readonly baseUrl: string;\n private readonly token?: string;\n private readonly extraRequestHeaders?: Record<string, string>;\n\n constructor(options: {\n fetch?: typeof fetch;\n baseUrl?: string;\n token?: string;\n extraRequestHeaders?: Record<string, string>;\n }) {\n this.fetch = options?.fetch || global.fetch.bind(global);\n this.baseUrl = options.baseUrl || 'https://registry.npmjs.com';\n this.token = options.token;\n this.extraRequestHeaders = options.extraRequestHeaders;\n }\n\n async getPackageInfo(packageName: string): Promise<NpmRegistryPackageInfo> {\n if (!packageName) {\n throw new Error('No package name provided');\n }\n\n const url = `${this.baseUrl}/${encodeURIComponent(packageName)}`;\n\n const response = await this.fetch(url, {\n headers: {\n ...this.extraRequestHeaders,\n ...(this.token ? { Authorization: this.token } : undefined),\n },\n });\n\n if (!response.ok) {\n throw await ResponseError.fromResponse(response);\n }\n return response.json();\n }\n}\n"],"names":[],"mappings":";;AAsBO,MAAM,iBAAA,CAAkB;AAAA,EACZ,KAAA;AAAA,EACA,OAAA;AAAA,EACA,KAAA;AAAA,EACA,mBAAA;AAAA,EAEjB,YAAY,OAAA,EAKT;AACD,IAAA,IAAA,CAAK,QAAQ,OAAA,EAAS,KAAA,IAAS,MAAA,CAAO,KAAA,CAAM,KAAK,MAAM,CAAA;AACvD,IAAA,IAAA,CAAK,OAAA,GAAU,QAAQ,OAAA,IAAW,4BAAA;AAClC,IAAA,IAAA,CAAK,QAAQ,OAAA,CAAQ,KAAA;AACrB,IAAA,IAAA,CAAK,sBAAsB,OAAA,CAAQ,mBAAA;AAAA,EACrC;AAAA,EAEA,MAAM,eAAe,WAAA,EAAsD;AACzE,IAAA,IAAI,CAAC,WAAA,EAAa;AAChB,MAAA,MAAM,IAAI,MAAM,0BAA0B,CAAA;AAAA,IAC5C;AAEA,IAAA,MAAM,MAAM,CAAA,EAAG,IAAA,CAAK,OAAO,CAAA,CAAA,EAAI,kBAAA,CAAmB,WAAW,CAAC,CAAA,CAAA;AAE9D,IAAA,MAAM,QAAA,GAAW,MAAM,IAAA,CAAK,KAAA,CAAM,GAAA,EAAK;AAAA,MACrC,OAAA,EAAS;AAAA,QACP,GAAG,IAAA,CAAK,mBAAA;AAAA,QACR,GAAI,IAAA,CAAK,KAAA,GAAQ,EAAE,aAAA,EAAe,IAAA,CAAK,OAAM,GAAI;AAAA;AACnD,KACD,CAAA;AAED,IAAA,IAAI,CAAC,SAAS,EAAA,EAAI;AAChB,MAAA,MAAM,MAAM,aAAA,CAAc,YAAA,CAAa,QAAQ,CAAA;AAAA,IACjD;AACA,IAAA,OAAO,SAAS,IAAA,EAAK;AAAA,EACvB;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotations.cjs.js","sources":["../src/annotations.ts"],"sourcesContent":["/*\n * Copyright 2024 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\n/**\n * @public\n */\nexport enum NpmAnnotation {\n PACKAGE_NAME = 'npm/package',\n REGISTRY_NAME = 'npm/registry',\n STABLE_TAG = 'npm/stable-tag',\n SHOW_TAGS = 'npm/show-tags',\n}\n"],"names":["NpmAnnotation"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"annotations.cjs.js","sources":["../src/annotations.ts"],"sourcesContent":["/*\n * Copyright 2024 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\n/**\n * @public\n */\nexport enum NpmAnnotation {\n PACKAGE_NAME = 'npm/package',\n REGISTRY_NAME = 'npm/registry',\n STABLE_TAG = 'npm/stable-tag',\n SHOW_TAGS = 'npm/show-tags',\n}\n"],"names":["NpmAnnotation"],"mappings":";;AAmBO,IAAK,aAAA,qBAAAA,cAAAA,KAAL;AACL,EAAAA,eAAA,cAAA,CAAA,GAAe,aAAA;AACf,EAAAA,eAAA,eAAA,CAAA,GAAgB,cAAA;AAChB,EAAAA,eAAA,YAAA,CAAA,GAAa,gBAAA;AACb,EAAAA,eAAA,WAAA,CAAA,GAAY,eAAA;AAJF,EAAA,OAAAA,cAAAA;AAAA,CAAA,EAAA,aAAA,IAAA,EAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotations.esm.js","sources":["../src/annotations.ts"],"sourcesContent":["/*\n * Copyright 2024 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\n/**\n * @public\n */\nexport enum NpmAnnotation {\n PACKAGE_NAME = 'npm/package',\n REGISTRY_NAME = 'npm/registry',\n STABLE_TAG = 'npm/stable-tag',\n SHOW_TAGS = 'npm/show-tags',\n}\n"],"names":["NpmAnnotation"],"mappings":"
|
|
1
|
+
{"version":3,"file":"annotations.esm.js","sources":["../src/annotations.ts"],"sourcesContent":["/*\n * Copyright 2024 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\n/**\n * @public\n */\nexport enum NpmAnnotation {\n PACKAGE_NAME = 'npm/package',\n REGISTRY_NAME = 'npm/registry',\n STABLE_TAG = 'npm/stable-tag',\n SHOW_TAGS = 'npm/show-tags',\n}\n"],"names":["NpmAnnotation"],"mappings":"AAmBO,IAAK,aAAA,qBAAAA,cAAAA,KAAL;AACL,EAAAA,eAAA,cAAA,CAAA,GAAe,aAAA;AACf,EAAAA,eAAA,eAAA,CAAA,GAAgB,cAAA;AAChB,EAAAA,eAAA,YAAA,CAAA,GAAa,gBAAA;AACb,EAAAA,eAAA,WAAA,CAAA,GAAY,eAAA;AAJF,EAAA,OAAAA,cAAAA;AAAA,CAAA,EAAA,aAAA,IAAA,EAAA;;;;"}
|
package/dist/utils.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.cjs.js","sources":["../src/utils.ts"],"sourcesContent":["/*\n * Copyright 2024 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 */\nimport { type Entity } from '@backstage/catalog-model';\n\nimport { NpmAnnotation } from './annotations';\n\n/**\n * Function that returns true if the given entity contains at least one\n * npm related annotations.\n *\n * @public\n */\nexport const isNpmAvailable = (entity: Entity): boolean => {\n return Boolean(entity.metadata.annotations?.[NpmAnnotation.PACKAGE_NAME]);\n};\n"],"names":["NpmAnnotation"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"utils.cjs.js","sources":["../src/utils.ts"],"sourcesContent":["/*\n * Copyright 2024 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 */\nimport { type Entity } from '@backstage/catalog-model';\n\nimport { NpmAnnotation } from './annotations';\n\n/**\n * Function that returns true if the given entity contains at least one\n * npm related annotations.\n *\n * @public\n */\nexport const isNpmAvailable = (entity: Entity): boolean => {\n return Boolean(entity.metadata.annotations?.[NpmAnnotation.PACKAGE_NAME]);\n};\n"],"names":["NpmAnnotation"],"mappings":";;;;AAyBO,MAAM,cAAA,GAAiB,CAAC,MAAA,KAA4B;AACzD,EAAA,OAAO,QAAQ,MAAA,CAAO,QAAA,CAAS,WAAA,GAAcA,yBAAA,CAAc,YAAY,CAAC,CAAA;AAC1E;;;;"}
|
package/dist/utils.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.esm.js","sources":["../src/utils.ts"],"sourcesContent":["/*\n * Copyright 2024 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 */\nimport { type Entity } from '@backstage/catalog-model';\n\nimport { NpmAnnotation } from './annotations';\n\n/**\n * Function that returns true if the given entity contains at least one\n * npm related annotations.\n *\n * @public\n */\nexport const isNpmAvailable = (entity: Entity): boolean => {\n return Boolean(entity.metadata.annotations?.[NpmAnnotation.PACKAGE_NAME]);\n};\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"utils.esm.js","sources":["../src/utils.ts"],"sourcesContent":["/*\n * Copyright 2024 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 */\nimport { type Entity } from '@backstage/catalog-model';\n\nimport { NpmAnnotation } from './annotations';\n\n/**\n * Function that returns true if the given entity contains at least one\n * npm related annotations.\n *\n * @public\n */\nexport const isNpmAvailable = (entity: Entity): boolean => {\n return Boolean(entity.metadata.annotations?.[NpmAnnotation.PACKAGE_NAME]);\n};\n"],"names":[],"mappings":";;AAyBO,MAAM,cAAA,GAAiB,CAAC,MAAA,KAA4B;AACzD,EAAA,OAAO,QAAQ,MAAA,CAAO,QAAA,CAAS,WAAA,GAAc,aAAA,CAAc,YAAY,CAAC,CAAA;AAC1E;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage-community/plugin-npm-common",
|
|
3
3
|
"description": "Common functionalities for the npm plugin",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.21.1",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"postpack": "backstage-cli package postpack"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@backstage/catalog-model": "^1.
|
|
39
|
-
"@backstage/errors": "^1.
|
|
38
|
+
"@backstage/catalog-model": "^1.8.0",
|
|
39
|
+
"@backstage/errors": "^1.3.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@backstage/cli": "^0.36.
|
|
42
|
+
"@backstage/cli": "^0.36.1"
|
|
43
43
|
},
|
|
44
44
|
"files": [
|
|
45
45
|
"dist"
|