Skip to content

Commit

Permalink
chore: combine core and react storybooks into one under main package
Browse files Browse the repository at this point in the history
  • Loading branch information
isaac-mason committed Dec 3, 2023
1 parent 45ef120 commit 13152b7
Show file tree
Hide file tree
Showing 25 changed files with 1,402 additions and 1,247 deletions.
1 change: 0 additions & 1 deletion packages/arancini-core/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ module.exports = {
'plugin:import/typescript',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:storybook/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
Expand Down
4 changes: 0 additions & 4 deletions packages/arancini-core/.storybook/index.css

This file was deleted.

27 changes: 0 additions & 27 deletions packages/arancini-core/.storybook/main.ts

This file was deleted.

17 changes: 0 additions & 17 deletions packages/arancini-core/.storybook/preview.ts

This file was deleted.

18 changes: 1 addition & 17 deletions packages/arancini-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,13 @@
"test": "vitest run --coverage",
"test:watch": "vitest",
"build": "yarn build:before && rollup --config rollup.config.js --bundleConfigAsCjs",
"build:before": "rm -rf dist",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
"build:before": "rm -rf dist"
},
"devDependencies": {
"@babel/core": "^7.22.11",
"@babel/preset-env": "^7.22.15",
"@babel/preset-typescript": "^7.23.2",
"@mdx-js/react": "^2.3.0",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^11.1.5",
"@storybook/addon-essentials": "^7.5.1",
"@storybook/addon-interactions": "^7.5.1",
"@storybook/addon-links": "^7.5.1",
"@storybook/blocks": "^7.5.1",
"@storybook/react": "^7.5.1",
"@storybook/react-vite": "^7.5.1",
"@storybook/testing-library": "^0.2.2",
"@typescript-eslint/eslint-plugin": "^6.2.0",
"@typescript-eslint/parser": "^6.2.0",
"@vitest/coverage-v8": "^0.34.6",
Expand All @@ -50,16 +37,13 @@
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-storybook": "^0.6.15",
"eslint-plugin-typescript-enum": "^2.1.0",
"prettier": "^3.0.1",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rollup": "^4.4.0",
"rollup-plugin-copy": "^3.5.0",
"rollup-plugin-filesize": "^10.0.0",
"storybook": "^7.5.1",
"typescript": "^5.1.3",
"vitest": "^0.34.3"
},
Expand Down
2 changes: 0 additions & 2 deletions packages/arancini-react/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ module.exports = {
'plugin:import/typescript',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:storybook/recommended',
'plugin:storybook/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
Expand Down
27 changes: 0 additions & 27 deletions packages/arancini-react/.storybook/main.ts

This file was deleted.

27 changes: 1 addition & 26 deletions packages/arancini-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
"test": "vitest run --coverage",
"test:watch": "vitest",
"build": "yarn build:before && rollup --config rollup.config.js --bundleConfigAsCjs",
"build:before": "rm -rf dist",
"storybook": "storybook dev -p 6008",
"build-storybook": "storybook build"
"build:before": "rm -rf dist"
},
"dependencies": {
"@arancini/core": "4.1.3"
Expand All @@ -27,45 +25,22 @@
"react-dom": "^18.0.0"
},
"devDependencies": {
"@babel/core": "^7.22.11",
"@babel/preset-env": "^7.22.15",
"@babel/preset-react": "^7.22.15",
"@babel/preset-typescript": "^7.23.2",
"@mdx-js/react": "^2.3.0",
"@react-three/drei": "^9.88.13",
"@react-three/fiber": "^8.15.11",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^11.1.5",
"@storybook/addon-essentials": "^7.5.1",
"@storybook/addon-interactions": "^7.5.1",
"@storybook/addon-links": "^7.5.1",
"@storybook/blocks": "^7.5.1",
"@storybook/react": "^7.5.1",
"@storybook/react-vite": "^7.5.1",
"@storybook/testing-library": "^0.2.2",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^14.0.0",
"@types/react": "^18.2.36",
"@types/react-dom": "^18.2.15",
"@types/three": "^0.155.0",
"@vitejs/plugin-react": "^4.1.0",
"@vitest/coverage-v8": "^0.34.6",
"babel-loader": "^9.1.3",
"eslint-plugin-storybook": "^0.6.15",
"jsdom": "^22.1.0",
"leva": "^0.9.35",
"p2-es": "^1.2.3",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rollup": "^4.4.0",
"rollup-plugin-copy": "^3.5.0",
"rollup-plugin-filesize": "^10.0.0",
"storybook": "^7.5.1",
"three": "^0.156.1",
"timeline-composer": "^0.1.5",
"typescript": "^5.1.3",
"vitest": "^0.34.3"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ body,
width: 100%;
height: 100%;
margin: 0;
padding: 0!important;
padding: 0 !important;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
Expand Down
31 changes: 31 additions & 0 deletions packages/arancini/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import type { StorybookConfig } from '@storybook/react-vite'

import { join, dirname } from 'path'

/**
* This function is used to resolve the absolute path of a package.
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
*/
function getAbsolutePath(value: string): any {
return dirname(require.resolve(join(value, 'package.json')))
}
const config: StorybookConfig = {
stories: [
'../stories/**/*.mdx',
'../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)',
],
addons: [
getAbsolutePath('@storybook/addon-links'),
getAbsolutePath('@storybook/addon-essentials'),
getAbsolutePath('@storybook/addon-onboarding'),
getAbsolutePath('@storybook/addon-interactions'),
],
framework: {
name: getAbsolutePath('@storybook/react-vite'),
options: {},
},
docs: {
autodocs: 'tag',
},
}
export default config
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ const preview: Preview = {
},
}

export default preview
export default preview
22 changes: 20 additions & 2 deletions packages/arancini/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"scripts": {
"build": "yarn build:before && rollup --config rollup.config.js --bundleConfigAsCjs",
"build:before": "rm -rf dist",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook"
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
"dependencies": {
"@arancini/core": "4.1.3",
Expand All @@ -32,10 +32,21 @@
"@babel/preset-env": "^7.22.15",
"@babel/preset-react": "^7.22.15",
"@babel/preset-typescript": "^7.23.2",
"@react-three/drei": "^9.88.13",
"@react-three/fiber": "^8.15.11",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^11.1.5",
"@storybook/addon-essentials": "^7.6.3",
"@storybook/addon-interactions": "^7.6.3",
"@storybook/addon-links": "^7.6.3",
"@storybook/addon-onboarding": "^1.0.9",
"@storybook/blocks": "^7.6.3",
"@storybook/react": "^7.6.3",
"@storybook/react-vite": "^7.6.3",
"@storybook/testing-library": "^0.2.2",
"@types/three": "^0.155.0",
"@typescript-eslint/eslint-plugin": "^6.2.0",
"@typescript-eslint/parser": "^6.2.0",
"eslint": "^8.48.0",
Expand All @@ -49,10 +60,17 @@
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-storybook": "^0.6.12",
"eslint-plugin-typescript-enum": "^2.1.0",
"leva": "^0.9.35",
"p2-es": "^1.2.3",
"prettier": "^3.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rollup": "^4.4.0",
"rollup-plugin-copy": "^3.5.0",
"rollup-plugin-filesize": "^10.0.0",
"storybook": "^7.6.3",
"three": "^0.156.1",
"timeline-composer": "^0.1.5",
"typescript": "^5.1.3",
"vite": "^4.2.1",
"vite-plugin-dts": "^3.6.3"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { World } from '@arancini/core'
import { createReactAPI } from '@arancini/react'
import { Html } from '@react-three/drei'
import React, { useEffect, useState } from 'react'
import { useEffect, useState } from 'react'
import { Lifetime, Repeat } from 'timeline-composer'
import { Setup } from '../setup'
import { Setup } from './setup'
import React from 'react'

export default {
title: 'Existing World',
title: 'React / Existing World',
}

const world = new World()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@ import { System, World } from '@arancini/core'
import { createReactAPI } from '@arancini/react'
import { Canvas, useFrame } from '@react-three/fiber'
import * as P2 from 'p2-es'
import React, { useMemo } from 'react'
import React from 'react'
import { useMemo } from 'react'
import { Repeat } from 'timeline-composer'

export default {
title: 'React / External Physics Library',
}

const boxMaterial = new P2.Material()
const groundMaterial = new P2.Material()

Expand Down Expand Up @@ -186,6 +191,3 @@ export const Example = () => {
)
}

export default {
title: 'External Physics Library',
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { Bounds, PerspectiveCamera, Text } from '@react-three/drei'
import { useFrame } from '@react-three/fiber'
import React, { useEffect, useMemo, useState } from 'react'
import * as THREE from 'three'
import { Setup } from '../setup'
import { Setup } from './setup'

export default {
title: 'Pong',
title: 'React / Pong',
}

type EntityType = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { System, World } from '@arancini/core'
import { createReactAPI } from '@arancini/react'
import { OrbitControls } from '@react-three/drei'
import { useFrame } from '@react-three/fiber'
import React from 'react'
import { createReactAPI } from '@arancini/react'
import { Setup } from '../setup'
import { Setup } from './setup'

export default {
title: 'Random Walkers',
title: 'React / Random Walkers',
}

type EntityType = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { Bounds, PerspectiveCamera } from '@react-three/drei'
import { Vector3, useFrame } from '@react-three/fiber'
import React, { useState } from 'react'
import * as THREE from 'three'
import { Setup } from '../setup'
import { Setup } from './setup'

export default {
title: 'Selection',
title: 'React / Selection',
}

type EntityType = {
Expand Down
Loading

0 comments on commit 13152b7

Please sign in to comment.