open-nomad/ui/package.json
Buck Doyle 576bcf554f
UI: Migrate to Storybook (#6507)
I originally planned to add component documentation, but as this dragged on and I found that JSDoc-to-Markdown sometimes needed hand-tuning, I decided to skip it and focus on replicating what was already present in Freestyle. Adding documentation is a finite task that can be revisited in the future.

My goal was to migrate everything from Freestyle with as few changes as possible. Some adaptations that I found necessary:
• the DelayedArray and DelayedTruth utilities that delay component rendering until slightly after initial render because without them:
  ◦ charts were rendering with zero width
  ◦ the JSON viewer was rendering with empty content
• Storybook in Ember renders components in a routerless/controllerless context by default, so some component stories needed changes:
  ◦ table pagination/sorting stories access to query params, which necessitates some reaching into Ember internals to start routing and dynamically generate a Storybook route/controller to render components into
  ◦ some stories have a faux controller as part of their Storybook context that hosts setInterval-linked dynamic computed properties
• some jiggery-pokery with anchor tags
  ◦ inert href='#' had to become href='javascript:;
  ◦ links that are actually meant to navigate need target='_parent' so they don’t navigate inside the Storybook iframe

Maybe some of these could be addressed by fixes in ember-cli-storybook but I’m wary of digging around in there any more than I already have, as I’ve lost a lot of time to Storybook confusion and frustrations already 😞

The STORYBOOK=true environment variable tweaks some environment settings to get things working as expected in the Storybook context.

I chose to:
• use angle bracket invocation within stories rather than have to migrate them soon after having moved to Storybook
• keep Freestyle around for now for its palette and typeface components
2020-01-21 15:46:32 -06:00

139 lines
4.1 KiB
JSON

{
"name": "nomad-ui",
"version": "0.0.0",
"description": "The web ui for Nomad, by HashiCorp.",
"repository": "",
"directories": {
"doc": "doc",
"test": "tests"
},
"scripts": {
"build": "./node_modules/ember-cli/bin/ember build -prod",
"precommit": "lint-staged",
"lint:hbs": "ember-template-lint .",
"lint:js": "eslint .",
"start": "./node_modules/ember-cli/bin/ember server",
"build-storybook": "STORYBOOK=true ember build && build-storybook -s dist",
"storybook": "STORYBOOK=true ember serve & start-storybook -p 6006 -s dist",
"test": "./node_modules/ember-cli/bin/ember test"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"{app,tests,config,lib,mirage,stories}/**/*.js": [
"prettier --write",
"git add"
],
"app/styles/**/*.*": [
"prettier --write",
"git add"
]
},
"devDependencies": {
"@babel/plugin-proposal-object-rest-spread": "^7.4.3",
"@ember/jquery": "^0.6.0",
"@ember/optional-features": "^0.7.0",
"@hashicorp/structure-icons": "^1.3.0",
"@storybook/ember-cli-storybook": "^0.2.0",
"anser": "^1.4.8",
"broccoli-asset-rev": "^3.0.0",
"bulma": "0.6.1",
"core-js": "^2.4.1",
"d3-array": "^1.2.0",
"d3-axis": "^1.0.0",
"d3-format": "^1.3.0",
"d3-scale": "^1.0.0",
"d3-selection": "^1.1.0",
"d3-shape": "^1.2.0",
"d3-time-format": "^2.1.0",
"d3-transition": "^1.1.0",
"ember-ajax": "^5.0.0",
"ember-auto-import": "^1.2.21",
"ember-can": "^2.0.0",
"ember-cli": "~3.12.0",
"ember-cli-babel": "^7.7.3",
"ember-cli-clipboard": "^0.13.0",
"ember-cli-dependency-checker": "^3.1.0",
"ember-cli-deprecation-workflow": "^1.0.1",
"ember-cli-eslint": "^5.1.0",
"ember-cli-funnel": "^0.6.1",
"ember-cli-htmlbars": "^3.0.1",
"ember-cli-htmlbars-inline-precompile": "^2.1.0",
"ember-cli-inject-live-reload": "^2.0.1",
"ember-cli-mirage": "^1.1.2",
"ember-cli-moment-shim": "^3.5.0",
"ember-cli-page-object": "^1.15.1",
"ember-cli-sass": "^10.0.0",
"ember-cli-sri": "^2.1.1",
"ember-cli-string-helpers": "^1.5.0",
"ember-cli-template-lint": "^1.0.0-beta.1",
"ember-cli-uglify": "^2.1.0",
"ember-composable-helpers": "^2.0.3",
"ember-concurrency": "^1.0.0",
"ember-copy": "^1.0.0",
"ember-data": "~3.12.0",
"ember-data-model-fragments": "4.0.0",
"ember-export-application-global": "^2.0.0",
"ember-fetch": "^6.5.0",
"ember-freestyle": "~0.10.0",
"ember-inflector": "^3.0.0",
"ember-inline-svg": "^0.3.0",
"ember-load-initializers": "^2.0.0",
"ember-maybe-import-regenerator": "^0.1.6",
"ember-moment": "^7.8.1",
"ember-overridable-computed": "^1.0.0",
"ember-page-title": "^5.0.2",
"ember-power-select": "^3.0.4",
"ember-qunit": "^4.4.1",
"ember-qunit-nice-errors": "^1.2.0",
"ember-resolver": "^5.0.1",
"ember-responsive": "^3.0.4",
"ember-sinon": "^4.0.0",
"ember-source": "~3.12.0",
"ember-test-selectors": "^2.1.0",
"ember-truth-helpers": "^2.0.0",
"eslint": "^5.16.0",
"eslint-plugin-node": "^9.0.1",
"faker": "^4.1.0",
"flat": "^4.0.0",
"fuse.js": "^3.4.4",
"husky": "^1.3.1",
"is-ip": "^3.1.0",
"ivy-codemirror": "IvyApp/ivy-codemirror#c3b7f49f8e6492878619f8055695581240cce21a",
"lint-staged": "^8.1.5",
"loader.js": "^4.7.0",
"lodash.intersection": "^4.4.0",
"pretender": "^3.0.1",
"prettier": "^1.4.4",
"query-string": "^5.0.0",
"qunit-dom": "^0.9.0",
"sass": "^1.17.3"
},
"optionalDependencies": {
"@babel/plugin-transform-member-expression-literals": "^7.2.0",
"@storybook/addon-knobs": "^5.2.5",
"@storybook/addon-storysource": "^5.2.5",
"@storybook/addon-viewport": "^5.2.5",
"@storybook/addons": "^5.2.5",
"@storybook/ember": "^5.2.5",
"babel-loader": "^8.0.6",
"ember-cli-get-component-path-option": "^1.0.0",
"ember-cli-string-utils": "^1.1.0"
},
"engines": {
"node": "8.* || >= 10.*"
},
"private": true,
"ember-addon": {
"paths": [
"lib/bulma"
]
},
"dependencies": {
"lru_map": "^0.3.3"
}
}