@grafana/create-plugin 0.4.0 → 0.4.1-canary.127.d97b07a.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.
@@ -120,8 +120,15 @@ function replacePatternWithTemplateInReadme(pattern, partialsFile, exportPath) {
120
120
  function getActionsForTemplateFolder(_a) {
121
121
  var folderPath = _a.folderPath, exportPath = _a.exportPath;
122
122
  var files = glob_1["default"].sync("".concat(folderPath, "/**"), { dot: true });
123
- var getExportFileName = function (f) { return (path_1["default"].extname(f) === '.hbs' ? path_1["default"].basename(f, '.hbs') : path_1["default"].basename(f)); };
124
- var getExportPath = function (f) { return path_1["default"].relative(folderPath, path_1["default"].dirname(f)); };
123
+ function getExportFileName(f) {
124
+ if (path_1["default"].basename(f) === 'gitignore') {
125
+ return '.gitignore';
126
+ }
127
+ return path_1["default"].extname(f) === '.hbs' ? path_1["default"].basename(f, '.hbs') : path_1["default"].basename(f);
128
+ }
129
+ function getExportPath(f) {
130
+ return path_1["default"].relative(folderPath, path_1["default"].dirname(f));
131
+ }
125
132
  return files.filter(isFile).map(function (f) { return ({
126
133
  type: 'add',
127
134
  templateFile: f,
package/package.json CHANGED
@@ -1,14 +1,18 @@
1
1
  {
2
2
  "name": "@grafana/create-plugin",
3
- "version": "0.4.0",
3
+ "version": "0.4.1-canary.127.d97b07a.0",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "directory": "packages/create-plugin",
7
- "url": "git@github.com:grafana/plugin-tools.git"
7
+ "url": "https://github.com/grafana/plugin-tools"
8
8
  },
9
9
  "author": "Grafana",
10
10
  "license": "Apache-2.0",
11
11
  "bin": "./dist/bin/run.js",
12
+ "publishConfig": {
13
+ "registry": "https://registry.npmjs.org/",
14
+ "access": "public"
15
+ },
12
16
  "scripts": {
13
17
  "clean": "rm -rf ./dist ./generated",
14
18
  "clean-generated": "find ./generated -not -path \"./generated/node_modules*\" -not -path \"./generated\" -not -path \"./generated/yarn.lock\" -print0 | xargs -0 -I {} rm -rf {}",
@@ -54,5 +58,6 @@
54
58
  },
55
59
  "engines": {
56
60
  "node": ">=16"
57
- }
61
+ },
62
+ "gitHead": "d97b07a16ec94d275c069eecf5033977bbf7f965"
58
63
  }
@@ -165,8 +165,17 @@ function replacePatternWithTemplateInReadme(
165
165
  // TODO<use Plop action `addMany` instead>
166
166
  function getActionsForTemplateFolder({ folderPath, exportPath }: { folderPath: string; exportPath: string }) {
167
167
  const files = glob.sync(`${folderPath}/**`, { dot: true });
168
- const getExportFileName = (f: string) => (path.extname(f) === '.hbs' ? path.basename(f, '.hbs') : path.basename(f));
169
- const getExportPath = (f: string) => path.relative(folderPath, path.dirname(f));
168
+ function getExportFileName(f: string) {
169
+ // yarn and npm packing will not include `.gitignore` files
170
+ // so we have to manually rename them to add the dot prefix
171
+ if (path.basename(f) === 'gitignore') {
172
+ return '.gitignore';
173
+ }
174
+ return path.extname(f) === '.hbs' ? path.basename(f, '.hbs') : path.basename(f);
175
+ }
176
+ function getExportPath(f: string) {
177
+ return path.relative(folderPath, path.dirname(f));
178
+ }
170
179
 
171
180
  return files.filter(isFile).map((f) => ({
172
181
  type: 'add',
@@ -5,8 +5,6 @@ import { AppConfig } from './components/AppConfig';
5
5
  export const plugin = new AppPlugin<{}>().setRootPage(App).addConfigPage({
6
6
  title: 'Configuration',
7
7
  icon: 'cog',
8
- // @ts-ignore - Would expect a Class component, however works absolutely fine with a functional one
9
- // Implementation: https://github.com/grafana/grafana/blob/fd44c01675e54973370969dfb9e78f173aff7910/public/app/features/plugins/PluginPage.tsx#L157
10
8
  body: AppConfig,
11
9
  id: 'configuration',
12
10
  });
@@ -0,0 +1,34 @@
1
+ # Logs
2
+ logs
3
+ *.log
4
+ npm-debug.log*
5
+ yarn-debug.log*
6
+ yarn-error.log*
7
+
8
+ node_modules/
9
+
10
+ # Runtime data
11
+ pids
12
+ *.pid
13
+ *.seed
14
+ *.pid.lock
15
+
16
+ # Directory for instrumented libs generated by jscoverage/JSCover
17
+ lib-cov
18
+
19
+ # Coverage directory used by tools like istanbul
20
+ coverage
21
+
22
+ # Compiled binary addons (https://nodejs.org/api/addons.html)
23
+ dist/
24
+ artifacts/
25
+ work/
26
+ ci/
27
+ e2e-results/
28
+ **/cypress/videos
29
+ **/cypress/report.json
30
+
31
+ # Editor
32
+ .idea
33
+
34
+ .eslintcache