Skip to content

Commit

Permalink
fix: path bug + update deps (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
marbemac authored Jan 24, 2020
1 parent d1aa98e commit ea57fd0
Show file tree
Hide file tree
Showing 4 changed files with 6,773 additions and 6,392 deletions.
87 changes: 37 additions & 50 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,72 +20,59 @@
},
"scripts": {
"build": "sl-scripts build",
"build.docs": "build-storybook -c .storybook -o docs-auto",
"commit": "git-cz",
"lint": "sl-scripts lint",
"lint.fix": "yarn lint --fix",
"release": "sl-scripts release",
"release.docs": "sl-scripts release:docs",
"release.dryRun": "sl-scripts release --dry-run --debug",
"storybook": "start-storybook -p 9001 -c .storybook",
"test": "sl-scripts test",
"test.prod": "yarn lint && yarn test --coverage --maxWorkers=2",
"test.prod": "yarn test --coverage --maxWorkers=2",
"test.update": "yarn test --updateSnapshot",
"test.watch": "yarn test --watch"
},
"resolutions": {
"lodash": "^4.17.15"
},
"peerDependencies": {
"react": ">=16.8",
"react-dom": ">=16.8"
"react": ">=16",
"react-dom": ">=16"
},
"dependencies": {
"@babel/core": "7.4.4",
"@storybook/addon-actions": "5.0.11",
"@storybook/addon-knobs": "5.0.11",
"@storybook/addon-links": "5.0.11",
"@storybook/addon-options": "5.0.11",
"@storybook/addons": "5.0.11",
"@storybook/core": "5.0.11",
"@storybook/react": "5.0.11",
"@types/node": "^11.13.8",
"@types/react": "^16.8.15",
"@types/react-dom": "^16.8.4",
"@types/storybook__addon-actions": "3.4.x",
"@types/storybook__addon-knobs": "5.0.0",
"@types/storybook__addon-links": "3.3.x",
"@types/storybook__addon-options": "4.0.x",
"@types/storybook__react": "4.0.x",
"autoprefixer": "^9.5.1",
"babel-loader": "8.x.x",
"css-loader": "^2.1.1",
"node-sass": "^4.12.0",
"node-sass-package-importer": "^5.3.1",
"@babel/core": "^7.8.3",
"@storybook/addon-actions": "^5.3.8",
"@storybook/addon-knobs": "^5.3.8",
"@storybook/addon-links": "^5.3.8",
"@storybook/addon-options": "^5.3.8",
"@storybook/addons": "^5.3.8",
"@storybook/core": "^5.3.8",
"@storybook/react": "^5.3.8",
"@types/node": "^13.5.0",
"@types/react": "^16.9.19",
"@types/react-dom": "^16.9.5",
"@types/storybook__react": "^5.2.1",
"autoprefixer": "^9.7.4",
"babel-loader": "^8.0.6",
"css-loader": "^3.4.2",
"node-sass": "^4.13.1",
"node-sass-package-importer": "^5.3.2",
"postcss-import": "^12.0.1",
"postcss-loader": "^3.0.0",
"resolve-url-loader": "^3.1.0",
"sass-inline-svg": "^1.2.0",
"sass-loader": "^7.1.0",
"style-loader": "^0.23.1",
"ts-loader": "5.4.5",
"webpack": "4.30.0"
"resolve-url-loader": "^3.1.1",
"sass-inline-svg": "^1.2.3",
"sass-loader": "^8.0.2",
"style-loader": "^1.1.3",
"ts-loader": "^6.2.1",
"webpack": "^4.41.5"
},
"devDependencies": {
"@stoplight/scripts": "^5.1.0",
"enzyme": "^3.9.0",
"enzyme-adapter-react-16": "^1.12.1",
"enzyme-to-json": "^3.3.5",
"husky": "^2.2.0",
"jest": "24.7.1",
"jest-enzyme": "^7.0.2",
"@stoplight/scripts": "^5",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.2",
"enzyme-to-json": "^3.4.3",
"husky": "^4.2.1",
"jest": "^25.1.0",
"jest-enzyme": "^7.1.2",
"lodash": "^4.17.15",
"react": "16.8.6",
"react-dom": "16.8.6",
"ts-jest": "24.0.2",
"tslint": "5.16.0",
"tslint-config-stoplight": "^1.2.0",
"typescript": "3.4.5"
"react": "~16.11.0",
"react-dom": "~16.11.0",
"ts-jest": "^25.0.0",
"typescript": "3.7.5"
},
"lint-staged": {
"*.{ts,tsx}$": [
Expand Down
35 changes: 13 additions & 22 deletions src/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ const inliner = require('sass-inline-svg');

const cwd = process.cwd();

const pkg = require.resolve('package.json', {
const pkg = require.resolve(path.join(cwd, 'package.json'), {
paths: [process.cwd()],
}) as any;

module.exports = ({ config }: any) => {
config.context = cwd;
config.mode = 'development';
config.resolve.alias['@project/stories'] = require.resolve('src/__stories__/index.ts', { paths: [cwd] });
config.resolve.alias['@project/stories'] = require.resolve(path.join(cwd, 'src', '__stories__', 'index.ts'), { paths: [cwd] });

config.plugins.push(
new webpack.DefinePlugin({
Expand Down Expand Up @@ -41,21 +41,16 @@ module.exports = ({ config }: any) => {
use: [
{
loader: require.resolve('style-loader'),
options: {
sourceMap: true,
},
},
{
loader: require.resolve('css-loader'),
options: {
sourceMap: true,
importLoaders: 1,
},
},
{
loader: require.resolve('postcss-loader'),
options: {
sourceMap: true,
plugins: [
require('autoprefixer')({
env: 'last 2 Chrome versions, last 2 Firefox versions, last 1 Safari version',
Expand All @@ -72,21 +67,16 @@ module.exports = ({ config }: any) => {
use: [
{
loader: require.resolve('style-loader'),
options: {
sourceMap: true,
},
},
{
loader: require.resolve('css-loader'),
options: {
sourceMap: true,
importLoaders: 2,
},
},
{
loader: require.resolve('postcss-loader'),
options: {
sourceMap: true,
plugins: [
require('postcss-import'),
require('autoprefixer')({
Expand All @@ -99,16 +89,17 @@ module.exports = ({ config }: any) => {
{
loader: require.resolve('sass-loader'),
options: {
sourceMap: true,
importer: [PackageImporter()],
functions: {
'svg-icon': inliner(path.resolve('node_modules', '@stoplight', 'ui-kit', 'styles', 'icons'), {
// run through SVGO first
optimize: true,
// minimal "uri" encoding is smaller than base64
encodingFormat: 'uri',
}),
},
sassOptions: {
importer: [PackageImporter()],
functions: {
'svg-icon': inliner(path.resolve('node_modules', '@stoplight', 'ui-kit', 'styles', 'icons'), {
// run through SVGO first
optimize: true,
// minimal "uri" encoding is smaller than base64
encodingFormat: 'uri',
}),
},
}
},
},
],
Expand Down
5 changes: 0 additions & 5 deletions tslint.json

This file was deleted.

Loading

0 comments on commit ea57fd0

Please sign in to comment.