Skip to content

Commit

Permalink
feat(libs/movex-react-local-master): ✨ add storybook to test the inte…
Browse files Browse the repository at this point in the history
…raactions easier
  • Loading branch information
GabrielCTroia committed Jul 17, 2024
1 parent 2fc5f8f commit e0347fc
Show file tree
Hide file tree
Showing 26 changed files with 8,601 additions and 145 deletions.
12 changes: 12 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import type { StorybookConfig } from '@storybook/core-common';

export const rootMain: StorybookConfig = {
stories: [],
addons: ['@storybook/addon-essentials'],
// webpackFinal: async (config, { configType }) => {
// // Make whatever fine-grained changes you need that should apply to all storybook configs

// // Return the altered config
// return config;
// },
};
14 changes: 14 additions & 0 deletions .storybook/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "../tsconfig.base.json",
"exclude": [
"../**/*.spec.js",
"../**/*.test.js",
"../**/*.spec.ts",
"../**/*.test.ts",
"../**/*.spec.tsx",
"../**/*.test.tsx",
"../**/*.spec.jsx",
"../**/*.test.jsx"
],
"include": ["../**/*"]
}
27 changes: 27 additions & 0 deletions libs/movex-react-local-master/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { rootMain } from '../../../.storybook/main';
import type { StorybookConfig, Options } from '@storybook/core-common';

const config: StorybookConfig = {
...rootMain,

core: { ...rootMain.core, builder: 'webpack5' },

stories: [
...rootMain.stories,
'../src/stories/**/*.stories.mdx',
'../src/stories/**/*.stories.@(js|jsx|ts|tsx)',
],
addons: [...(rootMain.addons || []), '@nrwl/react/plugins/storybook'],
webpackFinal: async (config, { configType }: Options) => {
// apply any global webpack configs that might have been specified in .storybook/main.ts
if (rootMain.webpackFinal) {
config = await rootMain.webpackFinal(config, { configType } as Options);
}

// add your own webpack tweaks if needed

return config;
},
};

module.exports = config;
Empty file.
27 changes: 27 additions & 0 deletions libs/movex-react-local-master/.storybook/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"emitDecoratorMetadata": true,
"outDir": ""
},
"files": [
"../../../node_modules/@nrwl/react/typings/styled-jsx.d.ts",
"../../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
"../../../node_modules/@nrwl/react/typings/image.d.ts"
],
"exclude": [
"../**/*.spec.ts",
"../**/*.spec.js",
"../**/*.spec.tsx",
"../**/*.spec.jsx"
],
"include": [
"../src/**/*.stories.ts",
"../src/**/*.stories.js",
"../src/**/*.stories.jsx",
"../src/**/*.stories.tsx",
"../src/**/*.stories.mdx",
"*.ts",
"*.js"
]
}
1 change: 0 additions & 1 deletion libs/movex-react-local-master/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"app",
"framework"
],
"type": "commonjs",
"engines": {
"node": ">= 16.0.0"
},
Expand Down
15 changes: 15 additions & 0 deletions libs/movex-react-local-master/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const { join } = require('path');

// Note: If you use library-specific PostCSS/Tailwind configuration then you should remove the `postcssConfig` build
// option from your application's configuration (i.e. project.json).
//
// See: https://nx.dev/guides/using-tailwind-css-in-react#step-4:-applying-configuration-to-libraries

module.exports = {
plugins: {
tailwindcss: {
config: join(__dirname, 'tailwind.config.js'),
},
autoprefixer: {},
},
};
44 changes: 38 additions & 6 deletions libs/movex-react-local-master/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
"tsc": {
"executor": "nx:run-commands",
"options": {
"commands": [
{
"command": "tsc --noEmit -p libs/movex-react-local-master/tsconfig.lib.json"
}
]
"commands": [
{
"command": "tsc --noEmit -p libs/movex-react-local-master/tsconfig.lib.json"
}
]
}
}, "build": {
},
"build": {
"executor": "@nrwl/web:rollup",
"outputs": ["{options.outputPath}"],
"options": {
Expand Down Expand Up @@ -50,6 +51,37 @@
"jestConfig": "libs/movex-react-local-master/jest.config.ts",
"passWithNoTests": true
}
},
"storybook": {
"executor": "@nrwl/storybook:storybook",
"options": {
"uiFramework": "@storybook/react",
"port": 4400,
"config": {
"configFolder": "libs/movex-react-local-master/.storybook"
}
},
"configurations": {
"ci": {
"quiet": true
}
}
},
"build-storybook": {
"executor": "@nrwl/storybook:build",
"outputs": ["{options.outputPath}"],
"options": {
"uiFramework": "@storybook/react",
"outputPath": "dist/storybook/movex-react-local-master",
"config": {
"configFolder": "libs/movex-react-local-master/.storybook"
}
},
"configurations": {
"ci": {
"quiet": true
}
}
}
}
}
7 changes: 7 additions & 0 deletions libs/movex-react-local-master/src/stories/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

@import 'tailwindcss/base';
@import 'tailwindcss/components';
@import 'tailwindcss/utilities';
Loading

0 comments on commit e0347fc

Please sign in to comment.