@backstage-community/plugin-analytics-module-matomo 1.28.1 → 1.28.2

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,24 @@
1
1
  # @backstage-community/plugin-analytics-module-matomo
2
2
 
3
+ ## 1.28.2
4
+
5
+ ### Patch Changes
6
+
7
+ - f3dcef4: Register the Matomo analytics API factory in the plugin object so it auto-registers when the plugin loads
8
+ - f3dcef4: Added support for Backstage's New Frontend System.
9
+
10
+ If you're migrating to the new frontend system, you no longer need to wire up an API implementation in `apis.ts`. Instead, pass the plugin in to the `createApp()` function:
11
+
12
+ ```tsx
13
+ import analyticsProviderMatomoPlugin from '@backstage-community/plugin-analytics-module-matomo/alpha';
14
+
15
+ const app = createApp({
16
+ features: [analyticsProviderMatomoPlugin],
17
+ });
18
+ ```
19
+
20
+ This can be skipped if you have feature discovery enabled.
21
+
3
22
  ## 1.28.1
4
23
 
5
24
  ### Patch Changes
package/README.md CHANGED
@@ -18,13 +18,13 @@ yarn workspace app add @backstage-community/plugin-analytics-module-matomo
18
18
  2. Wire up the API implementation to your App:
19
19
 
20
20
  If your App is built using the New Frontend System, it's enough to supply this
21
- module to `createApp()`:
21
+ plugin to `createApp()`:
22
22
 
23
23
  ```tsx
24
- import matomoModule from '@backstage-community/plugin-analytics-module-matomo/alpha';
24
+ import analyticsProviderMatomoPlugin from '@backstage-community/plugin-analytics-module-matomo/alpha';
25
25
 
26
26
  const app = createApp({
27
- features: [matomoModule],
27
+ features: [analyticsProviderMatomoPlugin],
28
28
  });
29
29
  ```
30
30
 
package/dist/alpha.d.ts CHANGED
@@ -1,8 +1,5 @@
1
- import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
2
-
3
- /**
4
- * @public
5
- */
6
- declare const matomoModule: _backstage_frontend_plugin_api.FrontendModule;
7
-
8
- export { matomoModule as default };
1
+ export { a as default } from './index.js';
2
+ import '@backstage/plugin-app-react';
3
+ import '@backstage/frontend-plugin-api';
4
+ import '@backstage/config';
5
+ import '@backstage/core-plugin-api';
package/dist/alpha.esm.js CHANGED
@@ -1,2 +1,2 @@
1
- export { matomoModule as default } from './module.esm.js';
1
+ export { analyticsProviderMatomoPlugin as default } from './plugin.esm.js';
2
2
  //# sourceMappingURL=alpha.esm.js.map
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import * as _backstage_plugin_app_react from '@backstage/plugin-app-react';
1
2
  import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
2
3
  import { AnalyticsImplementation, AnalyticsEvent } from '@backstage/frontend-plugin-api';
3
4
  import * as _backstage_config from '@backstage/config';
@@ -30,17 +31,28 @@ declare class MatomoAnalytics implements AnalyticsApi, AnalyticsImplementation {
30
31
  private hash;
31
32
  }
32
33
 
33
- /** @public */
34
- declare const analyticsModuleMatomoPlugin: _backstage_core_plugin_api.BackstagePlugin<{}, {}, {}>;
35
-
36
34
  /**
37
- * API factory method for matomo
38
- *
39
35
  * @public
40
36
  */
41
37
  declare const MatomoAnalyticsApi: _backstage_frontend_plugin_api.ApiFactory<_backstage_core_plugin_api.AnalyticsApi, MatomoAnalytics, {
42
38
  configApi: _backstage_config.Config;
43
39
  identityApi: _backstage_frontend_plugin_api.IdentityApi;
44
40
  }>;
41
+ /** @public */
42
+ declare const analyticsModuleMatomoPlugin: _backstage_core_plugin_api.BackstagePlugin<{}, {}, {}>;
43
+ /**
44
+ * @public
45
+ */
46
+ declare const analyticsProviderMatomoPlugin: _backstage_frontend_plugin_api.OverridableFrontendPlugin<{}, {}, {
47
+ "analytics:analytics-module-matomo": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
48
+ kind: "analytics";
49
+ name: undefined;
50
+ config: {};
51
+ configInput: {};
52
+ output: _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_plugin_app_react.AnalyticsImplementationFactory<{}>, "core.analytics.factory", {}>;
53
+ inputs: {};
54
+ params: <TDeps extends { [name in string]: unknown; }>(params: _backstage_plugin_app_react.AnalyticsImplementationFactory<TDeps>) => _backstage_frontend_plugin_api.ExtensionBlueprintParams<_backstage_plugin_app_react.AnalyticsImplementationFactory<{}>>;
55
+ }>;
56
+ }>;
45
57
 
46
- export { MatomoAnalytics, MatomoAnalyticsApi, analyticsModuleMatomoPlugin };
58
+ export { MatomoAnalytics, MatomoAnalyticsApi, analyticsProviderMatomoPlugin as a, analyticsModuleMatomoPlugin };
package/dist/index.esm.js CHANGED
@@ -1,14 +1,3 @@
1
- import { createApiFactory, identityApiRef, configApiRef, analyticsApiRef } from '@backstage/core-plugin-api';
2
- import { MatomoAnalytics } from './api/Matomo.esm.js';
3
- export { analyticsModuleMatomoPlugin } from './plugin.esm.js';
4
-
5
- const MatomoAnalyticsApi = createApiFactory({
6
- api: analyticsApiRef,
7
- deps: { configApi: configApiRef, identityApi: identityApiRef },
8
- factory: ({ configApi, identityApi }) => MatomoAnalytics.fromConfig(configApi, {
9
- identityApi
10
- })
11
- });
12
-
13
- export { MatomoAnalytics, MatomoAnalyticsApi };
1
+ export { MatomoAnalyticsApi, analyticsModuleMatomoPlugin } from './plugin.esm.js';
2
+ export { MatomoAnalytics } from './api/Matomo.esm.js';
14
3
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../src/index.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 {\n analyticsApiRef,\n configApiRef,\n createApiFactory,\n identityApiRef,\n} from '@backstage/core-plugin-api';\nimport { MatomoAnalytics } from './api';\n\nexport { analyticsModuleMatomoPlugin } from './plugin';\nexport * from './api';\n/**\n * API factory method for matomo\n *\n * @public\n */\nexport const MatomoAnalyticsApi = createApiFactory({\n api: analyticsApiRef,\n deps: { configApi: configApiRef, identityApi: identityApiRef },\n factory: ({ configApi, identityApi }) =>\n MatomoAnalytics.fromConfig(configApi, {\n identityApi,\n }),\n});\n"],"names":[],"mappings":";;;;AA8BO,MAAM,qBAAqB,gBAAA,CAAiB;AAAA,EACjD,GAAA,EAAK,eAAA;AAAA,EACL,IAAA,EAAM,EAAE,SAAA,EAAW,YAAA,EAAc,aAAa,cAAA,EAAe;AAAA,EAC7D,OAAA,EAAS,CAAC,EAAE,SAAA,EAAW,aAAY,KACjC,eAAA,CAAgB,WAAW,SAAA,EAAW;AAAA,IACpC;AAAA,GACD;AACL,CAAC;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,8 +1,27 @@
1
- import { createPlugin } from '@backstage/core-plugin-api';
1
+ import { createApiFactory, analyticsApiRef, createPlugin } from '@backstage/core-plugin-api';
2
+ import { identityApiRef, configApiRef, createFrontendPlugin } from '@backstage/frontend-plugin-api';
3
+ import { AnalyticsImplementationBlueprint } from '@backstage/plugin-app-react';
4
+ import { MatomoAnalytics } from './api/Matomo.esm.js';
2
5
 
6
+ const MatomoAnalyticsApi = createApiFactory({
7
+ api: analyticsApiRef,
8
+ deps: { configApi: configApiRef, identityApi: identityApiRef },
9
+ factory: ({ configApi, identityApi }) => MatomoAnalytics.fromConfig(configApi, { identityApi })
10
+ });
3
11
  const analyticsModuleMatomoPlugin = createPlugin({
4
- id: "analytics-module-matomo"
12
+ id: "analytics-module-matomo",
13
+ apis: [MatomoAnalyticsApi]
14
+ });
15
+ const matomoImplementation = AnalyticsImplementationBlueprint.make({
16
+ params: (defineParams) => defineParams({
17
+ deps: { configApi: configApiRef, identityApi: identityApiRef },
18
+ factory: ({ configApi, identityApi }) => MatomoAnalytics.fromConfig(configApi, { identityApi })
19
+ })
20
+ });
21
+ const analyticsProviderMatomoPlugin = createFrontendPlugin({
22
+ pluginId: "analytics-module-matomo",
23
+ extensions: [matomoImplementation]
5
24
  });
6
25
 
7
- export { analyticsModuleMatomoPlugin };
26
+ export { MatomoAnalyticsApi, analyticsModuleMatomoPlugin, analyticsProviderMatomoPlugin };
8
27
  //# sourceMappingURL=plugin.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.esm.js","sources":["../src/plugin.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 { createPlugin } from '@backstage/core-plugin-api';\n\n/** @public */\nexport const analyticsModuleMatomoPlugin = createPlugin({\n id: 'analytics-module-matomo',\n});\n"],"names":[],"mappings":";;AAkBO,MAAM,8BAA8B,YAAA,CAAa;AAAA,EACtD,EAAA,EAAI;AACN,CAAC;;;;"}
1
+ {"version":3,"file":"plugin.esm.js","sources":["../src/plugin.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\nimport {\n analyticsApiRef,\n createApiFactory,\n createPlugin,\n} from '@backstage/core-plugin-api';\nimport {\n configApiRef,\n createFrontendPlugin,\n identityApiRef,\n} from '@backstage/frontend-plugin-api';\nimport { AnalyticsImplementationBlueprint } from '@backstage/plugin-app-react';\nimport { MatomoAnalytics } from './api';\n\n/**\n * @public\n */\nexport const MatomoAnalyticsApi = createApiFactory({\n api: analyticsApiRef,\n deps: { configApi: configApiRef, identityApi: identityApiRef },\n factory: ({ configApi, identityApi }) =>\n MatomoAnalytics.fromConfig(configApi, { identityApi }),\n});\n\n/** @public */\nexport const analyticsModuleMatomoPlugin = createPlugin({\n id: 'analytics-module-matomo',\n apis: [MatomoAnalyticsApi],\n});\n\nconst matomoImplementation = AnalyticsImplementationBlueprint.make({\n params: defineParams =>\n defineParams({\n deps: { configApi: configApiRef, identityApi: identityApiRef },\n factory: ({ configApi, identityApi }) =>\n MatomoAnalytics.fromConfig(configApi, { identityApi }),\n }),\n});\n\n/**\n * @public\n */\nexport const analyticsProviderMatomoPlugin = createFrontendPlugin({\n pluginId: 'analytics-module-matomo',\n extensions: [matomoImplementation],\n});\n"],"names":[],"mappings":";;;;;AAgCO,MAAM,qBAAqB,gBAAA,CAAiB;AAAA,EACjD,GAAA,EAAK,eAAA;AAAA,EACL,IAAA,EAAM,EAAE,SAAA,EAAW,YAAA,EAAc,aAAa,cAAA,EAAe;AAAA,EAC7D,OAAA,EAAS,CAAC,EAAE,SAAA,EAAW,WAAA,EAAY,KACjC,eAAA,CAAgB,UAAA,CAAW,SAAA,EAAW,EAAE,WAAA,EAAa;AACzD,CAAC;AAGM,MAAM,8BAA8B,YAAA,CAAa;AAAA,EACtD,EAAA,EAAI,yBAAA;AAAA,EACJ,IAAA,EAAM,CAAC,kBAAkB;AAC3B,CAAC;AAED,MAAM,oBAAA,GAAuB,iCAAiC,IAAA,CAAK;AAAA,EACjE,MAAA,EAAQ,kBACN,YAAA,CAAa;AAAA,IACX,IAAA,EAAM,EAAE,SAAA,EAAW,YAAA,EAAc,aAAa,cAAA,EAAe;AAAA,IAC7D,OAAA,EAAS,CAAC,EAAE,SAAA,EAAW,WAAA,EAAY,KACjC,eAAA,CAAgB,UAAA,CAAW,SAAA,EAAW,EAAE,WAAA,EAAa;AAAA,GACxD;AACL,CAAC,CAAA;AAKM,MAAM,gCAAgC,oBAAA,CAAqB;AAAA,EAChE,QAAA,EAAU,yBAAA;AAAA,EACV,UAAA,EAAY,CAAC,oBAAoB;AACnC,CAAC;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage-community/plugin-analytics-module-matomo",
3
- "version": "1.28.1",
3
+ "version": "1.28.2",
4
4
  "main": "./dist/index.esm.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "license": "Apache-2.0",
@@ -14,7 +14,7 @@
14
14
  "default": "./dist/index.esm.js"
15
15
  },
16
16
  "./alpha": {
17
- "backstage": "@backstage/FrontendModule",
17
+ "backstage": "@backstage/FrontendPlugin",
18
18
  "import": "./dist/alpha.esm.js",
19
19
  "types": "./dist/alpha.d.ts",
20
20
  "default": "./dist/alpha.esm.js"
@@ -32,11 +32,14 @@
32
32
  }
33
33
  },
34
34
  "backstage": {
35
- "role": "frontend-plugin-module",
36
- "pluginId": "app",
37
- "pluginPackage": "@backstage/plugin-app",
35
+ "role": "frontend-plugin",
36
+ "pluginId": "analytics-module-matomo",
37
+ "pluginPackage": "@backstage-community/plugin-analytics-module-matomo",
38
+ "pluginPackages": [
39
+ "@backstage-community/plugin-analytics-module-matomo"
40
+ ],
38
41
  "features": {
39
- "./alpha": "@backstage/FrontendModule"
42
+ "./alpha": "@backstage/FrontendPlugin"
40
43
  }
41
44
  },
42
45
  "sideEffects": false,
@@ -68,7 +71,6 @@
68
71
  },
69
72
  "devDependencies": {
70
73
  "@backstage/cli": "^0.36.1",
71
- "@backstage/core-app-api": "^1.20.0",
72
74
  "@backstage/core-components": "^0.18.9",
73
75
  "@backstage/dev-utils": "^1.1.22",
74
76
  "@testing-library/jest-dom": "6.9.1",
@@ -1,18 +0,0 @@
1
- import { identityApiRef, configApiRef, createFrontendModule } from '@backstage/frontend-plugin-api';
2
- import { AnalyticsImplementationBlueprint } from '@backstage/plugin-app-react';
3
- import { MatomoAnalytics } from './api/Matomo.esm.js';
4
-
5
- const matomoImplementation = AnalyticsImplementationBlueprint.make({
6
- name: "matomo",
7
- params: (defineParams) => defineParams({
8
- deps: { configApi: configApiRef, identityApi: identityApiRef },
9
- factory: ({ configApi, identityApi }) => MatomoAnalytics.fromConfig(configApi, { identityApi })
10
- })
11
- });
12
- const matomoModule = createFrontendModule({
13
- pluginId: "app",
14
- extensions: [matomoImplementation]
15
- });
16
-
17
- export { matomoModule };
18
- //# sourceMappingURL=module.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"module.esm.js","sources":["../src/module.ts"],"sourcesContent":["/*\n * Copyright 2025 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 {\n configApiRef,\n createFrontendModule,\n identityApiRef,\n} from '@backstage/frontend-plugin-api';\nimport { AnalyticsImplementationBlueprint } from '@backstage/plugin-app-react';\n\nimport { MatomoAnalytics } from './api';\n\nconst matomoImplementation = AnalyticsImplementationBlueprint.make({\n name: 'matomo',\n params: defineParams =>\n defineParams({\n deps: { configApi: configApiRef, identityApi: identityApiRef },\n factory: ({ configApi, identityApi }) =>\n MatomoAnalytics.fromConfig(configApi, { identityApi }),\n }),\n});\n\n/**\n * @public\n */\nexport const matomoModule = createFrontendModule({\n pluginId: 'app',\n extensions: [matomoImplementation],\n});\n"],"names":[],"mappings":";;;;AAwBA,MAAM,oBAAA,GAAuB,iCAAiC,IAAA,CAAK;AAAA,EACjE,IAAA,EAAM,QAAA;AAAA,EACN,MAAA,EAAQ,kBACN,YAAA,CAAa;AAAA,IACX,IAAA,EAAM,EAAE,SAAA,EAAW,YAAA,EAAc,aAAa,cAAA,EAAe;AAAA,IAC7D,OAAA,EAAS,CAAC,EAAE,SAAA,EAAW,WAAA,EAAY,KACjC,eAAA,CAAgB,UAAA,CAAW,SAAA,EAAW,EAAE,WAAA,EAAa;AAAA,GACxD;AACL,CAAC,CAAA;AAKM,MAAM,eAAe,oBAAA,CAAqB;AAAA,EAC/C,QAAA,EAAU,KAAA;AAAA,EACV,UAAA,EAAY,CAAC,oBAAoB;AACnC,CAAC;;;;"}