Skip to content

Commit

Permalink
more updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Rogin Farrer committed May 23, 2024
1 parent c10616e commit 4abaee6
Show file tree
Hide file tree
Showing 16 changed files with 119 additions and 104 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'pnpm'
cache: "pnpm"

- name: Install Dependencies
run: pnpm install
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@main
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
node-version-file: ".nvmrc"
cache: "pnpm"

- name: Install dependencies
run: pnpm i
Expand Down
24 changes: 12 additions & 12 deletions example/index.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import * as React from 'react'
import * as ReactDOM from 'react-dom/client'
import { useCollapse } from '@collapsed/react'
import * as React from "react";
import * as ReactDOM from "react-dom/client";
import { useCollapse } from "@collapsed/react";

const collapseStyles = { background: 'blue', color: 'white' }
const collapseStyles = { background: "blue", color: "white" };

export const Uncontrolled = () => {
const { getCollapseProps, getToggleProps, isExpanded } = useCollapse({
defaultExpanded: true,
})
});

return (
<div>
<button {...getToggleProps({ style: { marginRight: 4 } })}>
{isExpanded ? 'Close' : 'Open'}
{isExpanded ? "Close" : "Open"}
</button>
<div
{...getCollapseProps({
Expand All @@ -29,16 +29,16 @@ export const Uncontrolled = () => {
and people going to work.
</div>
</div>
)
}
);
};

const App = () => {
return (
<div>
<Uncontrolled />
</div>
)
}
);
};

const root = ReactDOM.createRoot(document.getElementById('root')!)
root.render(<App />)
const root = ReactDOM.createRoot(document.getElementById("root")!);
root.render(<App />);
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"np": "^6.4.0",
"prettier": "^3",
"process": "^0.11.10",
"turbo": "^1.8.8",
"turbo": "^1.13.3",
"typescript": "^5.4.5"
},
"alias": {
Expand Down
10 changes: 5 additions & 5 deletions packages/core/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['<rootDir>/jest-setup.ts'],
testMatch: ['<rootDir>/**/*.(spec|test).{ts,tsx,js,jsx}'],
}
preset: "ts-jest",
testEnvironment: "jsdom",
setupFilesAfterEnv: ["<rootDir>/jest-setup.ts"],
testMatch: ["<rootDir>/**/*.(spec|test).{ts,tsx,js,jsx}"],
};
9 changes: 5 additions & 4 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@
"release": "np --no-2fa"
},
"devDependencies": {
"@collapsed-internal/tsconfig": "workspace:*",
"@collapsed-internal/build": "workspace:*",
"eslint-config-collapsed": "workspace:*",
"@collapsed-internal/tsconfig": "workspace:*",
"@testing-library/jest-dom": "^5.16.0",
"@types/testing-library__jest-dom": "^5.14.5",
"@types/jest": "^27.0.2",
"@types/testing-library__jest-dom": "^5.14.5",
"eslint-config-collapsed": "workspace:*",
"jest": "^29.3.1",
"jest-environment-jsdom": "^29.3.1",
"ts-jest": "^29.0.3",
"tslib": "^2.4.1"
"tslib": "^2.4.1",
"tsup": "^8"
},
"dependencies": {
"tiny-warning": "^1.0.3"
Expand Down
12 changes: 6 additions & 6 deletions packages/react-collapsed/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import { dirname, join } from "path";
module.exports = {
stories: ['../stories/**/*.stories.@(js|jsx|ts|tsx)'],
stories: ["../stories/**/*.stories.@(js|jsx|ts|tsx)"],

addons: [
getAbsolutePath("@storybook/addon-links"),
getAbsolutePath("@storybook/addon-essentials"),
getAbsolutePath("@storybook/addon-a11y"),
"@chromatic-com/storybook"
"@chromatic-com/storybook",
],

framework: {
name: getAbsolutePath("@storybook/react-vite"),
options: {}
options: {},
},

docs: {},

typescript: {
reactDocgen: "react-docgen-typescript"
}
}
reactDocgen: "react-docgen-typescript",
},
};

function getAbsolutePath(value) {
return dirname(require.resolve(join(value, "package.json")));
Expand Down
2 changes: 1 addition & 1 deletion packages/react-collapsed/.storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export const parameters = {
date: /Date$/,
},
},
}
};
export const tags = ["autodocs"];
10 changes: 5 additions & 5 deletions packages/react-collapsed/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['<rootDir>/jest-setup.ts'],
testMatch: ['<rootDir>/**/*.(spec|test).{ts,tsx,js,jsx}'],
}
preset: "ts-jest",
testEnvironment: "jsdom",
setupFilesAfterEnv: ["<rootDir>/jest-setup.ts"],
testMatch: ["<rootDir>/**/*.(spec|test).{ts,tsx,js,jsx}"],
};
7 changes: 5 additions & 2 deletions packages/react/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
module.exports = {
extends: ['../../internal/eslint-config-collapsed/index.cjs', '../../internal/eslint-config-collapsed/react.cjs'],
}
extends: [
"../../internal/eslint-config-collapsed/index.cjs",
"../../internal/eslint-config-collapsed/react.cjs",
],
};
10 changes: 5 additions & 5 deletions packages/react/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { dirname, join } from "path";
module.exports = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],

addons: [
getAbsolutePath("@storybook/addon-links"),
getAbsolutePath("@storybook/addon-essentials"),
getAbsolutePath("@storybook/addon-a11y"),
"@chromatic-com/storybook"
"@chromatic-com/storybook",
],

framework: {
name: getAbsolutePath("@storybook/react-vite"),
options: {}
options: {},
},

docs: {}
}
docs: {},
};

function getAbsolutePath(value) {
return dirname(require.resolve(join(value, "package.json")));
Expand Down
2 changes: 1 addition & 1 deletion packages/react/.storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export const parameters = {
date: /Date$/,
},
},
}
};
export const tags = ["autodocs"];
10 changes: 5 additions & 5 deletions packages/react/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['<rootDir>/jest-setup.ts'],
testMatch: ['<rootDir>/**/*.(spec|test).{ts,tsx,js,jsx}'],
}
preset: "ts-jest",
testEnvironment: "jsdom",
setupFilesAfterEnv: ["<rootDir>/jest-setup.ts"],
testMatch: ["<rootDir>/**/*.(spec|test).{ts,tsx,js,jsx}"],
};
2 changes: 2 additions & 0 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
"@types/react": "^18",
"@types/react-dom": "^18",
"@types/styled-components": "^5.0.1",
"@types/testing-library__jest-dom": "^5.14.5",
"@types/testing-library__react": "^10.2.0",
"@vitejs/plugin-react": "^4.3.0",
"babel-loader": "^8.2.2",
"cypress": "^12.9.0",
Expand Down
67 changes: 38 additions & 29 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4abaee6

Please sign in to comment.