docbrown/package.json
Jacob Herrington 3e99fb527f Add StimulusJS and Refactor Internal article_script (#5539) deploy]
* Add StimulusJS 1.1.1

Because:
- Internal will likely need more interactivity going forward
- Vanilla JS and jQuery are great, but aren't quite as organized as we
might like
- Stimulus fits our model of what internal should be (imo)
- Adopting Preact or something with templating would require rewriting a
bunch of erb (that is currently working just fine)

Stimulus is a JavaScript framework that directly compliments turbolinks
and the approach vanilla Rails takes to JavaScript. I've set it up to
specifically be used in the internal views where we are currently using
jQuery and vanilla JS. I think we should chip away at the vanilla JS
currently in place with this, which appears to be both scalable and
pragmatic exactly the sort of tool we want for building our internal
tools.

* Replace crufty article JS with Stimulus

I'm swapping out some of the stuff going on in article_script.erb with
some StimulusJS, it seems like a good test case for Stimulus.

This lets us organize the code a little more intentionally and hopefully
fixes a small performance complaint that Michael had.

* Rename uncommunicative methods

* Add unit tests for Stimulus classes

* Move Stimulus code to javascript/internal
2020-01-24 16:00:24 -05:00

118 lines
3.4 KiB
JSON

{
"name": "dev.to",
"version": "1.0.0",
"description": "Where programmers share ideas and help each other grow",
"main": "index.js",
"directories": {
"doc": "docs",
"lib": "lib",
"test": "test"
},
"scripts": {
"test": "jest app/javascript/ --coverage",
"test:watch": "jest app/javascript/ --watch",
"storybook": "start-storybook -p 6006 -c app/javascript/.storybook -s app/javascript/.storybook/assets",
"build-storybook": "build-storybook -c app/javascript/.storybook -s app/javascript/.storybook/assets",
"api-docs:serve": "yarn redoc-cli serve docs/api_v0.yml --options.pathInMiddlePanel --options.jsonSampleExpandLevel=all --options.menuToggle -t docs/api_template.hbs --watch"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{js,jsx}": [
"prettier --write",
"eslint --fix"
],
"{app,spec,config,lib}/**/*.rb": [
"bundle exec rubocop --require rubocop-rspec --safe-auto-correct"
],
"Gemfile": [
"bundle exec rubocop --require rubocop-rspec --safe-auto-correct"
],
"app/**/*.html.erb": [
"bundle exec erblint"
],
"*.json": [
"prettier --write"
],
"*.md": [
"prettier --write --prose-wrap always"
]
},
"prettier": {
"singleQuote": true,
"trailingComma": "all",
"printWidth": 80
},
"repository": {
"type": "git",
"url": "git+https://github.com/thepracticaldev/dev.to.git"
},
"author": "",
"license": "AGPL-3.0-or-later",
"bugs": {
"url": "https://github.com/thepracticaldev/dev.to/issues"
},
"homepage": "https://github.com/thepracticaldev/dev.to#readme",
"devDependencies": {
"@storybook/addon-actions": "^5.1.9",
"@storybook/addon-links": "^5.1.9",
"@storybook/addons": "^5.1.8",
"@storybook/react": "^3.4.11",
"babel-eslint": "^10.0.3",
"babel-jest": "^23.4.2",
"eslint": "^5.16.0",
"eslint-config-airbnb": "^17.1.1",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-config-prettier": "^6.9.0",
"eslint-plugin-babel": "^5.3.0",
"eslint-plugin-ignore-erb": "^0.1.1",
"eslint-plugin-import": "^2.20.0",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.18.0",
"faker": "^4.1.0",
"husky": "^4.0.10",
"jest": "^23.5.0",
"jest-axe": "^3.3.0",
"jest-fetch-mock": "^3.0.1",
"jsdom": "^15.2.1",
"lint-staged": "^10.0.0",
"mutationobserver-shim": "^0.3.3",
"preact-render-spy": "1.3.0",
"preact-render-to-json": "^3.6.6",
"prettier": "^1.19.1",
"redoc-cli": "0.9.5",
"webpack-dev-server": "^2.11.3"
},
"dependencies": {
"@github/clipboard-copy-element": "^1.1.1",
"@rails/webpacker": "^3.5.5",
"babel-plugin-transform-react-jsx": "^6.24.1",
"babel-preset-preact": "^1.1.0",
"chart.js": "^2.9.3",
"clipboard-polyfill": "^2.8.6",
"codemirror": "^5.50.2",
"focus-visible": "^5.0.2",
"honeybadger-js": "2.0.2",
"intersection-observer": "^0.7.0",
"linkstate": "^1.1.1",
"lodash.debounce": "4.0.8",
"marked": "^0.8.0",
"postscribe": "^2.0.8",
"preact": "^8.5.3",
"preact-compat": "^3.19.0",
"preact-textarea-autosize": "^4.0.7",
"prop-types": "^15.7.2",
"pusher-js": "^5.0.3",
"stimulus": "^1.1.1",
"twilio-video": "^2.0.0",
"web-share-wrapper": "^0.2.1"
},
"jest": {
"setupFiles": [
"jest-localstorage-mock"
]
}
}