From f4c2fb2a0845f13827d2fd360bfdd4548aedc692 Mon Sep 17 00:00:00 2001 From: Aria Minaei Date: Fri, 6 Aug 2021 12:00:19 +0200 Subject: [PATCH] Moved examples to a separate folder --- .eslintrc.js | 1 + .gitignore | 1 + babel.config.js | 2 +- .../basic-dom}/.gitignore | 0 .../basic-dom}/Scene.tsx | 0 .../basic-dom}/index.html | 0 .../basic-dom}/index.tsx | 0 .../basic-dom}/package.json | 3 +- .../basic-dom}/tsconfig.json | 0 .../basic-dom}/useDrag.ts | 5 ++-- package.json | 1 + yarn.lock | 30 +++++++++---------- 12 files changed, 24 insertions(+), 19 deletions(-) rename {packages/example-dom => examples/basic-dom}/.gitignore (100%) rename {packages/example-dom => examples/basic-dom}/Scene.tsx (100%) rename {packages/example-dom => examples/basic-dom}/index.html (100%) rename {packages/example-dom => examples/basic-dom}/index.tsx (100%) rename {packages/example-dom => examples/basic-dom}/package.json (86%) rename {packages/example-dom => examples/basic-dom}/tsconfig.json (100%) rename {packages/example-dom => examples/basic-dom}/useDrag.ts (97%) diff --git a/.eslintrc.js b/.eslintrc.js index 92f1f58..16b1b99 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -27,6 +27,7 @@ module.exports = { './theatre/tsconfig.json', './packages/*/tsconfig.json', './packages/*/devEnv/tsconfig.json', + './examples/*/tsconfig.json', ], }, rules: { diff --git a/.gitignore b/.gitignore index e71270e..11d0e4c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ **/xeno /packages/*/dist /theatre/*/dist +/examples/*/dist *.log *.temp /.vscode diff --git a/babel.config.js b/babel.config.js index 9a41da7..bf24393 100644 --- a/babel.config.js +++ b/babel.config.js @@ -3,7 +3,7 @@ module.exports = function (api) { const config = { presets: [['@babel/preset-react'], ['@babel/preset-typescript']], - babelrcRoots: ['.', './packages/*', './theatre/*'], + babelrcRoots: ['.', './packages/*', './theatre/*', './examples/*'], } if (env === 'test') { config.presets.unshift(['@babel/preset-env', {targets: {node: 'current'}}]) diff --git a/packages/example-dom/.gitignore b/examples/basic-dom/.gitignore similarity index 100% rename from packages/example-dom/.gitignore rename to examples/basic-dom/.gitignore diff --git a/packages/example-dom/Scene.tsx b/examples/basic-dom/Scene.tsx similarity index 100% rename from packages/example-dom/Scene.tsx rename to examples/basic-dom/Scene.tsx diff --git a/packages/example-dom/index.html b/examples/basic-dom/index.html similarity index 100% rename from packages/example-dom/index.html rename to examples/basic-dom/index.html diff --git a/packages/example-dom/index.tsx b/examples/basic-dom/index.tsx similarity index 100% rename from packages/example-dom/index.tsx rename to examples/basic-dom/index.tsx diff --git a/packages/example-dom/package.json b/examples/basic-dom/package.json similarity index 86% rename from packages/example-dom/package.json rename to examples/basic-dom/package.json index 873c519..743a965 100644 --- a/packages/example-dom/package.json +++ b/examples/basic-dom/package.json @@ -1,5 +1,6 @@ { - "name": "theatre-example-dom", + "name": "@examples/basic-dom", + "private": "true", "scripts": { "start": "parcel serve ./index.html" }, diff --git a/packages/example-dom/tsconfig.json b/examples/basic-dom/tsconfig.json similarity index 100% rename from packages/example-dom/tsconfig.json rename to examples/basic-dom/tsconfig.json diff --git a/packages/example-dom/useDrag.ts b/examples/basic-dom/useDrag.ts similarity index 97% rename from packages/example-dom/useDrag.ts rename to examples/basic-dom/useDrag.ts index f4b1703..7f21101 100644 --- a/packages/example-dom/useDrag.ts +++ b/examples/basic-dom/useDrag.ts @@ -37,8 +37,9 @@ export default function useDrag( const optsRef = useRef(opts) optsRef.current = opts - const modeRef = - useRef<'dragStartCalled' | 'dragging' | 'notDragging'>('notDragging') + const modeRef = useRef<'dragStartCalled' | 'dragging' | 'notDragging'>( + 'notDragging', + ) const stateRef = useRef<{ dragHappened: boolean diff --git a/package.json b/package.json index 41e8827..c526724 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "version": "0.4.0-dev.8", "workspaces": [ "packages/*", + "examples/*", "theatre" ], "scripts": { diff --git a/yarn.lock b/yarn.lock index 2881f37..74487f8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2123,6 +2123,21 @@ __metadata: languageName: node linkType: hard +"@examples/basic-dom@workspace:examples/basic-dom": + version: 0.0.0-use.local + resolution: "@examples/basic-dom@workspace:examples/basic-dom" + dependencies: + "@theatre/core": "workspace:*" + "@theatre/studio": "workspace:*" + "@types/react": ^17.0.9 + "@types/react-dom": ^17.0.6 + parcel-bundler: ^1.12.5 + react: ^17.0.2 + react-dom: ^17.0.2 + typescript: ^4.3.2 + languageName: unknown + linkType: soft + "@iarna/toml@npm:^2.2.0": version: 2.2.5 resolution: "@iarna/toml@npm:2.2.5" @@ -16362,21 +16377,6 @@ fsevents@^1.2.7: languageName: node linkType: hard -"theatre-example-dom@workspace:packages/example-dom": - version: 0.0.0-use.local - resolution: "theatre-example-dom@workspace:packages/example-dom" - dependencies: - "@theatre/core": "workspace:*" - "@theatre/studio": "workspace:*" - "@types/react": ^17.0.9 - "@types/react-dom": ^17.0.6 - parcel-bundler: ^1.12.5 - react: ^17.0.2 - react-dom: ^17.0.2 - typescript: ^4.3.2 - languageName: unknown - linkType: soft - "theatre-monorepo@workspace:.": version: 0.0.0-use.local resolution: "theatre-monorepo@workspace:."