@grafana/create-plugin 3.3.0-canary.710.2bb43c7.0 → 3.3.0
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 +12 -0
- package/dist/commands/generate.command.js +0 -2
- package/dist/utils/utils.config.js +0 -1
- package/dist/utils/utils.templates.js +1 -3
- package/package.json +2 -2
- package/src/commands/generate.command.ts +0 -2
- package/src/commands/types.ts +0 -2
- package/src/utils/utils.config.ts +0 -5
- package/src/utils/utils.templates.ts +1 -3
- package/templates/app/src/components/App/App.tsx +8 -7
- package/templates/common/.config/webpack/webpack.config.ts +2 -2
- package/templates/common/.cprc.json +0 -2
- package/templates/common/_package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
# v3.3.0 (Fri Feb 02 2024)
|
|
2
|
+
|
|
3
|
+
#### 🚀 Enhancement
|
|
4
|
+
|
|
5
|
+
- Create-plugin: Check if inside a plugin directory [#706](https://github.com/grafana/plugin-tools/pull/706) ([@leventebalogh](https://github.com/leventebalogh))
|
|
6
|
+
|
|
7
|
+
#### Authors: 1
|
|
8
|
+
|
|
9
|
+
- Levente Balogh ([@leventebalogh](https://github.com/leventebalogh))
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
1
13
|
# v3.2.0 (Thu Feb 01 2024)
|
|
2
14
|
|
|
3
15
|
#### 🚀 Enhancement
|
|
@@ -57,8 +57,6 @@ function getTemplateData(answers) {
|
|
|
57
57
|
isNPM: packageManagerName === 'npm',
|
|
58
58
|
version: currentVersion,
|
|
59
59
|
bundleGrafanaUI: features.bundleGrafanaUI,
|
|
60
|
-
useReactRouterV6: features.useReactRouterV6 && pluginType === PLUGIN_TYPES.app,
|
|
61
|
-
reactRouterVersion: features.useReactRouterV6 && pluginType === PLUGIN_TYPES.app ? '6.22.0' : '5.2.0',
|
|
62
60
|
};
|
|
63
61
|
return templateData;
|
|
64
62
|
}
|
|
@@ -5,7 +5,7 @@ import mkdirp from 'mkdirp';
|
|
|
5
5
|
import { filterOutCommonFiles, isFile, isFileStartingWith } from './utils.files.js';
|
|
6
6
|
import { renderHandlebarsTemplate } from './utils.handlebars.js';
|
|
7
7
|
import { getPluginJson } from './utils.plugin.js';
|
|
8
|
-
import { TEMPLATE_PATHS, EXPORT_PATH_PREFIX, EXTRA_TEMPLATE_VARIABLES
|
|
8
|
+
import { TEMPLATE_PATHS, EXPORT_PATH_PREFIX, EXTRA_TEMPLATE_VARIABLES } from '../constants.js';
|
|
9
9
|
import { getPackageManagerWithFallback } from './utils.packageManager.js';
|
|
10
10
|
import { getExportFileName } from '../utils/utils.files.js';
|
|
11
11
|
import { getVersion } from './utils.version.js';
|
|
@@ -69,7 +69,5 @@ export function getTemplateData() {
|
|
|
69
69
|
packageManagerVersion,
|
|
70
70
|
version: currentVersion,
|
|
71
71
|
bundleGrafanaUI: features.bundleGrafanaUI,
|
|
72
|
-
useReactRouterV6: features.useReactRouterV6 && pluginJson.type === PLUGIN_TYPES.app,
|
|
73
|
-
reactRouterVersion: features.useReactRouterV6 ? '6.22.0' : '5.2.0',
|
|
74
72
|
};
|
|
75
73
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/create-plugin",
|
|
3
|
-
"version": "3.3.0
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"directory": "packages/create-plugin",
|
|
6
6
|
"url": "https://github.com/grafana/plugin-tools"
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"engines": {
|
|
87
87
|
"node": ">=20"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "46c7ec2fd92c02ad7089085a330f63fc61d27d89"
|
|
90
90
|
}
|
|
@@ -69,8 +69,6 @@ function getTemplateData(answers: CliArgs) {
|
|
|
69
69
|
isNPM: packageManagerName === 'npm',
|
|
70
70
|
version: currentVersion,
|
|
71
71
|
bundleGrafanaUI: features.bundleGrafanaUI,
|
|
72
|
-
useReactRouterV6: features.useReactRouterV6 && pluginType === PLUGIN_TYPES.app,
|
|
73
|
-
reactRouterVersion: features.useReactRouterV6 && pluginType === PLUGIN_TYPES.app ? '6.22.0' : '5.2.0',
|
|
74
72
|
};
|
|
75
73
|
|
|
76
74
|
return templateData;
|
package/src/commands/types.ts
CHANGED
|
@@ -4,10 +4,6 @@ import { getVersion } from './utils.version.js';
|
|
|
4
4
|
|
|
5
5
|
type FeatureFlags = {
|
|
6
6
|
bundleGrafanaUI: boolean;
|
|
7
|
-
|
|
8
|
-
// If set to true, the plugin will be scaffolded with React Router v6. Defaults to true.
|
|
9
|
-
// (Attention! We always scaffold new projects with React Router v6, so if you are changing this to `false` manually you will need to make changes to the React code as well.)
|
|
10
|
-
useReactRouterV6: boolean;
|
|
11
7
|
};
|
|
12
8
|
|
|
13
9
|
type CreatePluginConfig = UserConfig & {
|
|
@@ -70,7 +66,6 @@ function readRCFileSync(path: string): CreatePluginConfig | undefined {
|
|
|
70
66
|
|
|
71
67
|
function createFeatureFlags(flags?: FeatureFlags): FeatureFlags {
|
|
72
68
|
return {
|
|
73
|
-
useReactRouterV6: true,
|
|
74
69
|
bundleGrafanaUI: false,
|
|
75
70
|
...flags,
|
|
76
71
|
};
|
|
@@ -5,7 +5,7 @@ import mkdirp from 'mkdirp';
|
|
|
5
5
|
import { filterOutCommonFiles, isFile, isFileStartingWith } from './utils.files.js';
|
|
6
6
|
import { renderHandlebarsTemplate } from './utils.handlebars.js';
|
|
7
7
|
import { getPluginJson } from './utils.plugin.js';
|
|
8
|
-
import { TEMPLATE_PATHS, EXPORT_PATH_PREFIX, EXTRA_TEMPLATE_VARIABLES
|
|
8
|
+
import { TEMPLATE_PATHS, EXPORT_PATH_PREFIX, EXTRA_TEMPLATE_VARIABLES } from '../constants.js';
|
|
9
9
|
import { getPackageManagerWithFallback } from './utils.packageManager.js';
|
|
10
10
|
import { getExportFileName } from '../utils/utils.files.js';
|
|
11
11
|
import { getVersion } from './utils.version.js';
|
|
@@ -97,7 +97,5 @@ export function getTemplateData() {
|
|
|
97
97
|
packageManagerVersion,
|
|
98
98
|
version: currentVersion,
|
|
99
99
|
bundleGrafanaUI: features.bundleGrafanaUI,
|
|
100
|
-
useReactRouterV6: features.useReactRouterV6 && pluginJson.type === PLUGIN_TYPES.app,
|
|
101
|
-
reactRouterVersion: features.useReactRouterV6 ? '6.22.0' : '5.2.0',
|
|
102
100
|
};
|
|
103
101
|
}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Route,
|
|
2
|
+
import { Route, Switch } from 'react-router-dom';
|
|
3
3
|
import { AppRootProps } from '@grafana/data';
|
|
4
4
|
import { ROUTES } from '../../constants';
|
|
5
5
|
import { PageFour, PageOne, PageThree, PageTwo } from '../../pages';
|
|
6
|
+
import { prefixRoute } from '../../utils/utils.routing';
|
|
6
7
|
|
|
7
8
|
export function App(props: AppRootProps) {
|
|
8
9
|
return (
|
|
9
|
-
<
|
|
10
|
-
<Route path={ROUTES.Two}
|
|
11
|
-
<Route path={`${ROUTES.Three}/:id?`}
|
|
10
|
+
<Switch>
|
|
11
|
+
<Route exact path={prefixRoute(ROUTES.Two)} component={PageTwo} />
|
|
12
|
+
<Route exact path={prefixRoute(`${ROUTES.Three}/:id?`)} component={PageThree} />
|
|
12
13
|
|
|
13
14
|
{/* Full-width page (this page will have no side navigation) */}
|
|
14
|
-
<Route path={ROUTES.Four}
|
|
15
|
+
<Route exact path={prefixRoute(ROUTES.Four)} component={PageFour} />
|
|
15
16
|
|
|
16
17
|
{/* Default page */}
|
|
17
|
-
<Route
|
|
18
|
-
</
|
|
18
|
+
<Route component={PageOne} />
|
|
19
|
+
</Switch>
|
|
19
20
|
);
|
|
20
21
|
}
|
|
@@ -49,8 +49,8 @@ const config = async (env): Promise<Configuration> => {
|
|
|
49
49
|
'react-redux',
|
|
50
50
|
'redux',
|
|
51
51
|
'rxjs',
|
|
52
|
-
'react-router',
|
|
53
|
-
'react-router-dom',
|
|
52
|
+
'react-router',
|
|
53
|
+
'react-router-dom',
|
|
54
54
|
'd3',
|
|
55
55
|
'angular',{{#unless bundleGrafanaUI}}
|
|
56
56
|
'@grafana/ui',{{/unless}}
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"@testing-library/react": "14.0.0",
|
|
31
31
|
"@types/jest": "^29.5.0",
|
|
32
32
|
"@types/lodash": "^4.14.194",
|
|
33
|
-
"@types/node": "^20.8.7",{{#
|
|
34
|
-
"@types/react-router-dom": "^
|
|
33
|
+
"@types/node": "^20.8.7",{{#if isAppType}}
|
|
34
|
+
"@types/react-router-dom": "^5.3.3",{{/if}}
|
|
35
35
|
"@types/testing-library__jest-dom": "5.14.8",
|
|
36
36
|
"copy-webpack-plugin": "^11.0.0",
|
|
37
37
|
"css-loader": "^6.7.3",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"@grafana/scenes": "^1.28.0",{{/if_eq}}
|
|
68
68
|
"react": "18.2.0",
|
|
69
69
|
"react-dom": "18.2.0",{{#if isAppType}}
|
|
70
|
-
"react-router-dom": "
|
|
70
|
+
"react-router-dom": "5.3.3",
|
|
71
71
|
"rxjs": "7.8.0",{{/if}}
|
|
72
72
|
"tslib": "2.5.3"
|
|
73
73
|
},
|