@grafana/create-plugin 4.13.0-canary.970.deb7892.0 → 4.13.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/create-plugin",
|
|
3
|
-
"version": "4.13.0
|
|
3
|
+
"version": "4.13.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"directory": "packages/create-plugin",
|
|
6
6
|
"url": "https://github.com/grafana/plugin-tools"
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"engines": {
|
|
88
88
|
"node": ">=20"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "0d126394b9c16cdbd47e3749cb25f258a233ac1a"
|
|
91
91
|
}
|
|
@@ -29,11 +29,6 @@ export function getPluginJson() {
|
|
|
29
29
|
return require(path.resolve(process.cwd(), `${SOURCE_DIR}/plugin.json`));
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
export function getCPConfigVersion() {
|
|
33
|
-
const cprcJson = path.resolve(__dirname, '../', '.cprc.json');
|
|
34
|
-
return fs.existsSync(cprcJson) ? require(cprcJson).version : { version: 'unknown' };
|
|
35
|
-
}
|
|
36
|
-
|
|
37
32
|
export function hasReadme() {
|
|
38
33
|
return fs.existsSync(path.resolve(process.cwd(), SOURCE_DIR, 'README.md'));
|
|
39
34
|
}
|
|
@@ -11,14 +11,12 @@ import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
|
|
|
11
11
|
import LiveReloadPlugin from 'webpack-livereload-plugin';
|
|
12
12
|
import path from 'path';
|
|
13
13
|
import ReplaceInFileWebpackPlugin from 'replace-in-file-webpack-plugin';
|
|
14
|
-
import
|
|
15
|
-
import { type Configuration, BannerPlugin } from 'webpack';
|
|
14
|
+
import { Configuration } from 'webpack';
|
|
16
15
|
|
|
17
|
-
import { getPackageJson, getPluginJson, hasReadme, getEntries, isWSL
|
|
16
|
+
import { getPackageJson, getPluginJson, hasReadme, getEntries, isWSL } from './utils';
|
|
18
17
|
import { SOURCE_DIR, DIST_DIR } from './constants';
|
|
19
18
|
|
|
20
19
|
const pluginJson = getPluginJson();
|
|
21
|
-
const cpVersion = getCPConfigVersion();
|
|
22
20
|
|
|
23
21
|
const config = async (env): Promise<Configuration> => {
|
|
24
22
|
const baseConfig: Configuration = {
|
|
@@ -135,28 +133,6 @@ const config = async (env): Promise<Configuration> => {
|
|
|
135
133
|
],
|
|
136
134
|
},
|
|
137
135
|
|
|
138
|
-
optimization: {
|
|
139
|
-
minimize: Boolean(env.production),
|
|
140
|
-
minimizer: [
|
|
141
|
-
new TerserPlugin({
|
|
142
|
-
terserOptions: {
|
|
143
|
-
format: {
|
|
144
|
-
comments: (_, comment) => /^\**!|@preserve|@license|@cc_on|\[create-plugin\]/i.test(comment.value),
|
|
145
|
-
},
|
|
146
|
-
},
|
|
147
|
-
extractComments: (_, comment) => {
|
|
148
|
-
const { value, type } = comment;
|
|
149
|
-
// Keep `[create-plugin]` comments in the output
|
|
150
|
-
if (type === 'comment2' && value.startsWith('[create-plugin]')) {
|
|
151
|
-
return false;
|
|
152
|
-
}
|
|
153
|
-
// Extract other comments
|
|
154
|
-
return /^\**!|@preserve|@license|@cc_on/i.test(value);
|
|
155
|
-
},
|
|
156
|
-
}),
|
|
157
|
-
],
|
|
158
|
-
},
|
|
159
|
-
|
|
160
136
|
output: {
|
|
161
137
|
clean: {
|
|
162
138
|
keep: new RegExp(`(.*?_(amd64|arm(64)?)(.exe)?|go_plugin_build_manifest)`),
|
|
@@ -171,12 +147,6 @@ const config = async (env): Promise<Configuration> => {
|
|
|
171
147
|
},
|
|
172
148
|
|
|
173
149
|
plugins: [
|
|
174
|
-
// Insert create plugin version information into the bundle
|
|
175
|
-
new BannerPlugin({
|
|
176
|
-
banner: "/* [create-plugin] version: " + cpVersion + "*/",
|
|
177
|
-
raw: true,
|
|
178
|
-
entryOnly: true,
|
|
179
|
-
}),
|
|
180
150
|
new CopyWebpackPlugin({
|
|
181
151
|
patterns: [
|
|
182
152
|
// If src/README.md exists use it; otherwise the root README
|