Skip to content

Commit

Permalink
removed storybook bs
Browse files Browse the repository at this point in the history
  • Loading branch information
bateman001 committed Dec 5, 2024
1 parent aff32a1 commit 50e918c
Show file tree
Hide file tree
Showing 32 changed files with 3,908 additions and 9,163 deletions.
14 changes: 14 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/src
/dist
/node_modules

.gitignore
.prettierrc
.prettierrc.js
.prettierrc.json
babel.config.cjs
jest.config.cjs
package.lock.json
README.md
tsconfig.json
rollup.config.json
12,208 changes: 3,872 additions & 8,336 deletions package-lock.json

Large diffs are not rendered by default.

22 changes: 5 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
{
"name": "fullstory-react-library",
"version": "1.0.0",
"name": "@fullstory/react-library",
"version": "0.1.0",
"description": "This component library assists in fullstory set up for react apps",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"scripts": {
"clean": "rm -rf dist types",
"build": "npm run clean && tsc && rollup -c",
"test": "jest",
"pub": "npm run rollup && npm publish",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
"pub": "npm run rollup && npm publish"
},
"author": "Michaela Bateman",
"license": "ISC",
"author": "Fullstory",
"license": "MIT",
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.3",
Expand All @@ -24,15 +22,6 @@
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^11.1.6",
"@storybook/addon-essentials": "^8.2.9",
"@storybook/addon-interactions": "^8.2.9",
"@storybook/addon-links": "^8.2.9",
"@storybook/addon-onboarding": "^8.2.9",
"@storybook/addon-webpack5-compiler-swc": "^1.0.5",
"@storybook/blocks": "^8.2.9",
"@storybook/react": "^8.2.9",
"@storybook/react-webpack5": "^8.2.9",
"@storybook/test": "^8.2.9",
"@testing-library/react": "^16.0.0",
"@types/jest": "^29.5.12",
"@types/react": "^18.3.4",
Expand All @@ -42,7 +31,6 @@
"jest-environment-jsdom": "^29.7.0",
"rollup": "^4.21.0",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-postcss": "^4.0.2",
"storybook": "^8.2.9",
"typescript": "^5.5.4"
},
Expand Down
10 changes: 1 addition & 9 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import typescript from "@rollup/plugin-typescript";
import peerDepsExternal from "rollup-plugin-peer-deps-external";
import postcss from "rollup-plugin-postcss";

import packageJson from "./package.json" assert { type: "json" };
import terser from "@rollup/plugin-terser";
Expand All @@ -22,13 +21,6 @@ export default [
sourcemap: false
}
],
plugins: [
resolve(),
commonjs(),
typescript({ tsconfig: "./tsconfig.json" }),
postcss(),
peerDepsExternal(),
terser()
]
plugins: [resolve(), commonjs(), typescript({ tsconfig: "./tsconfig.json" }), peerDepsExternal(), terser()]
}
];
18 changes: 14 additions & 4 deletions src/components/FullStoryProvider/FullStoryProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useCallback, useContext, useEffect, useRef } from "react";
import { FullStoryContext } from "./FullStoryContext";
import { setPage } from "../../utils/fullstory";
import { combineObjects, getPageName, getPageProperties } from "../../utils/helpers";
import { getPageName, getPageProperties } from "../../utils/helpers";
import { FullStoryProviderProps } from "./types";
import { useLocation, useNavigate } from "react-router-dom";

Expand All @@ -15,7 +15,11 @@ export const useFSNavigate = () => {
return context.useFSNavigate;
};

export const FullStoryProvider: React.FC<FullStoryProviderProps> = ({ children, capture = ["all"], rules = {} }) => {
export const FullStoryProvider: React.FC<FullStoryProviderProps> = ({
children,
defaultCaptureRules = ["all"],
pageCaptureRules = {}
}) => {
// VARIABLES
const navigationTriggeredRef = useRef<boolean>(false);
const pageNameRef = useRef<string>("");
Expand All @@ -31,10 +35,16 @@ export const FullStoryProvider: React.FC<FullStoryProviderProps> = ({ children,
const { pathname, search } = location;

// Find PageName
const name = getPageName(pathname, capture, rules, pageNameRef.current);
const name = getPageName(pathname, defaultCaptureRules, pageCaptureRules, pageNameRef.current);

// Find the default properties according to capture rules
const properties = getPageProperties(pathname, search, capture, rules, propertiesRef.current);
const properties = getPageProperties(
pathname,
search,
defaultCaptureRules,
pageCaptureRules,
propertiesRef.current
);

// if pageName does not exist on properties or name is not empty add pageName
if (!properties.pageName && name !== "") {
Expand Down
4 changes: 2 additions & 2 deletions src/components/FullStoryProvider/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export interface CaptureRules {
// Prop types for FullStoryProvider
export interface FullStoryProviderProps {
children: ReactNode;
capture?: CaptureOptions;
rules?: CaptureRules;
defaultCaptureRules?: CaptureOptions;
pageCaptureRules?: CaptureRules;
}

export interface SchemaType {
Expand Down
53 changes: 0 additions & 53 deletions src/stories/Button.stories.ts

This file was deleted.

48 changes: 0 additions & 48 deletions src/stories/Button.tsx

This file was deleted.

Loading

0 comments on commit 50e918c

Please sign in to comment.