0.9.1 • Published 1 month ago

@kinvolk/headlamp-plugin v0.9.1

Weekly downloads
-
License
Apache 2.0
Repository
-
Last release
1 month ago

@kinvolk/headlamp-plugin

The needed infrastructure for building Headlamp plugins. Headlamp plugins depend on this package.

See the Headlamp plugins documentation on the web

This package is published to the npm package index separately from Headlamp.

Commands

headlamp-plugin --help

  headlamp-plugin.js build [package]        Build the plugin, or folder of
                                            plugins. <package> defaults to
                                            current working directory.
  headlamp-plugin.js start                  Watch for changes and build plugin.
  headlamp-plugin.js create <name>          Create a new plugin folder.
  headlamp-plugin.js extract                Copies folders of packages from plug
  <pluginPackages> <outputPlugins>          inPackages/packageName/dist/main.js
                                            to
                                            outputPlugins/packageName/main.js.
  headlamp-plugin.js format [package]       format the plugin code with
                                            prettier. <package> defaults to
                                            current working directory. Can also
                                            be a folder of packages.
  headlamp-plugin.js lint [package]         Lint the plugin for coding issues
                                            with eslint. <package> defaults to
                                            current working directory. Can also
                                            be a folder of packages.
  headlamp-plugin.js tsc [package]          Type check the plugin for coding
                                            issues with tsc. <package> defaults
                                            to current working directory. Can
                                            also be a folder of packages.
  headlamp-plugin.js storybook [package]    Start storybook. <package> defaults
                                            to current working directory.
  headlamp-plugin.js storybook-build        Build static storybook. <package>
  [package]                                 defaults to current working
                                            directory. Can also be a folder of
                                            packages.
  headlamp-plugin.js upgrade [package]      Upgrade the plugin to latest
  <skip-package-updates>                    headlamp-plugin; audits, formats,
  <headlamp-plugin-version>                 lints and type checks.<package>
                                            defaults to current working
                                            directory. Can also be a folder of
                                            packages.
  headlamp-plugin.js test [package]         Test. <package> defaults to current
                                            working directory. Can also be a
                                            folder of packages.

Development notes

Generate types

@kinvolk/headlamp-plugin ships type declarations from the frontend module. To generate the declarations, run npm run build.

How to test local changes to headlamp-plugin

Developing headlamp-plugin itself? Want to test your changes?

Integration tests

See test-headlamp-plugin.js for some basic integration tests.

See test-headlamp-plugin-published.js for testing published packages.

linking to use local version of headlamp-plugin

Use your changes inside a plugin with an npm feature called linking:

  1. Run npm link within the src/plugins/headlamp-plugins folder.
  2. Create the plugin with link: npx --yes @kinvolk/headlamp-plugin create myplugin --link
  3. Develop your plugin using your local headlamp-plugin changes.

This internally does a npm link @kinvolk/headlamp-plugin, so the development version is linked rather than using a released version from npm.

Why is this needed? Whilst npx uses linked packages by default, npm install requires that you first use npm link packageName. See the npm link docs for more info on npm link.

Testing "headlamp-plugin create" changes

For the "create" command npx and linking doesn't work. Instead, for this one command, you can call the script directly.

cd plugins/headlamp-plugin
node ./bin/headlamp-plugin.js create myplugin --link

Keep the dependencies in sync with the frontend/

Run npm run update-dependencies so the packages are kept up to date with there.

A lot of the packages are shared between the two, but some are not. See dependencies-sync.js for lists of dependencies which are shared/not-shared. You may need to update these lists when adding/removing packages.

Run npm run check-dependencies to see if frontend/package.json and headlamp-plugin/package.json are synced. This is run in CI to make sure when dependencies are changed, they are synced appropriately.

Upgrading to an alpha release

You can try an alpha release for testing with the following command.

npx @kinvolk/headlamp-plugin@alpha upgrade --headlamp-plugin-version=alpha your-plugin-folder

Making an alpha release of headlamp-plugin

You can bump the version to do a new alpha release like so:

cd plugins/headlamp-plugin
npm version preminor --preid=alpha
v0.6.0-alpha.0

Then to do another prerelease do...

npm version prerelease --preid=alpha
v0.6.0-alpha.1

To set the "alpha" tag when publishing do the following.

npm run build && npm pack
npm publish kinvolk-headlamp-plugin-0.6.0-alpha.0.tgz --tag alpha

If you don't specify a tag, npm publish uses the "latest" tag.

@apidevtools/json-schema-ref-parser@apidevtools/swagger-parser@axe-core/react@babel/cli@babel/core@babel/plugin-proposal-class-properties@babel/plugin-transform-react-jsx@babel/preset-env@babel/preset-react@babel/preset-typescript@emotion/react@emotion/styled@iconify/icons-mdi@iconify/react@kinvolk/eslint-config@monaco-editor/react@mui/lab@mui/material@mui/styles@mui/system@mui/x-tree-view@octokit/core@reduxjs/toolkit@remix-run/router@storybook/addon-actions@storybook/addon-essentials@storybook/addon-links@storybook/addon-storyshots@storybook/node-logger@storybook/preset-create-react-app@storybook/react@storybook/react-webpack5@svgr/webpack@testing-library/jest-dom@testing-library/react@testing-library/user-event@types/glob@types/humanize-duration@types/js-yaml@types/json-patch@types/lodash@types/node@types/react@types/react-dom@types/react-redux@types/react-router-dom@types/react-window@types/redux-mock-store@types/semver@types/webpack-env@typescript-eslint/eslint-plugin@typescript-eslint/parserbabel-loaderbase64-arraybufferbufferconsole-browserifycronstruecross-envcrypto-browserifycss-loaderenv-pathseslinteslint-config-prettiereslint-plugin-importeslint-plugin-jsx-a11yeslint-plugin-reacteslint-plugin-react-hookseslint-plugin-simple-import-sorteslint-plugin-unused-importsfake-indexeddbfetch-mockfile-loaderfilemanager-webpack-pluginfs-extragithub-markdown-csshttp-proxy-middlewarehttps-browserifyhumanize-durationi18nexti18next-browser-languagedetectori18next-parserif-envimports-loaderis-plain-objectjest-canvas-mockjs-base64js-yamljsonpath-pluslint-stagedlodashmonaco-editormonaco-editor-webpack-pluginmswmsw-storybook-addonnotistackopenapi-typespatch-packagepostcsspostcss-flexbugs-fixesprettierprocessreactreact-domreact-dropzonereact-hotkeys-hookreact-i18nextreact-jwtreact-markdownreact-reduxreact-routerreact-router-domreact-scriptsreact-windowrechartsredux-mock-storeresize-observer-polyfillsemvershxspacetimestorybookstream-browserifystream-httpstyle-loadertsconfig-paths-webpack-plugintypescripturlurl-loaderutilvalidate-npm-package-namevfilevm-browserifywebpackwebpack-clixtermxterm-addon-fitxterm-addon-searchyargs
0.9.1

1 month ago

0.9.0

1 month ago

0.9.0-alpha.2

4 months ago

0.9.0-alpha.1

4 months ago

0.8.0

4 months ago

0.8.0-alpha.11

4 months ago

0.8.0-alpha.10

4 months ago

0.8.0-alpha.13

4 months ago

0.8.0-alpha.12

4 months ago

0.8.0-alpha.9

4 months ago

0.8.0-alpha.6

4 months ago

0.8.0-alpha.8

4 months ago

0.8.0-alpha.7

4 months ago

0.7.2

6 months ago

0.7.1

7 months ago

0.7.4

6 months ago

0.7.3

6 months ago

0.7.0

7 months ago

0.8.0-alpha.5

5 months ago

0.8.0-alpha.2

6 months ago

0.8.0-alpha.4

5 months ago

0.8.0-alpha.3

6 months ago

0.8.0-alpha.0

6 months ago

0.6.1

9 months ago

0.6.0-alpha.28

11 months ago

0.6.0-alpha.27

11 months ago

0.6.0-alpha.29

11 months ago

0.6.0-alpha.20

12 months ago

0.6.0-alpha.22

12 months ago

0.6.0-alpha.21

12 months ago

0.6.0-alpha.24

12 months ago

0.6.0-alpha.23

12 months ago

0.6.0-alpha.26

11 months ago

0.6.0-alpha.25

12 months ago

0.5.6

12 months ago

0.6.0-alpha.19

12 months ago

0.6.0-alpha.18

12 months ago

0.6.0

11 months ago

0.5.6-alpha.0

1 year ago

0.5.6-alpha.1

1 year ago

0.5.6-alpha.2

1 year ago

0.6.0-alpha.17

1 year ago

0.6.0-alpha.16

1 year ago

0.6.0-alpha.15

1 year ago

0.5.5

1 year ago

0.6.0-alpha.1

1 year ago

0.6.0-alpha.2

1 year ago

0.6.0-alpha.0

1 year ago

0.6.0-alpha.9

1 year ago

0.6.0-alpha.7

1 year ago

0.6.0-alpha.8

1 year ago

0.6.0-alpha.5

1 year ago

0.6.0-alpha.6

1 year ago

0.6.0-alpha.3

1 year ago

0.6.0-alpha.4

1 year ago

0.6.0-alpha.11

1 year ago

0.6.0-alpha.10

1 year ago

0.6.0-alpha.13

1 year ago

0.6.0-alpha.12

1 year ago

0.6.0-alpha.14

1 year ago

0.5.4

1 year ago

0.5.3

2 years ago

0.4.9

2 years ago

0.5.0

2 years ago

0.5.2

2 years ago

0.5.1

2 years ago

0.4.8

2 years ago

0.4.5

2 years ago

0.4.4

2 years ago

0.4.7

2 years ago

0.4.6

2 years ago

0.4.3

2 years ago

0.4.2

2 years ago

0.4.1-rc1

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.3.2

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.0

4 years ago