-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8d2ba63
Showing
26 changed files
with
13,320 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
dist/ | ||
node_modules/ | ||
storybook-static/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"shared-node-browser": true, | ||
"es6": true, | ||
"node": true | ||
}, | ||
"extends": [ | ||
"prettier", | ||
"plugin:prettier/recommended", | ||
"plugin:react-hooks/recommended", | ||
"plugin:import/errors", | ||
"plugin:import/warnings" | ||
], | ||
"plugins": ["@typescript-eslint", "react", "prettier", "react-hooks", "import"], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaFeatures": { | ||
"ecmaVersion": 2018, | ||
"jsx": true | ||
}, | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
"curly": ["error", "multi-line", "consistent"], | ||
"no-console": "off", | ||
"no-empty-pattern": "error", | ||
"no-duplicate-imports": "error", | ||
"prefer-const": "error", | ||
"import/no-unresolved": ["error", { "commonjs": true, "amd": true }], | ||
"import/export": "error", | ||
"import/named": "off", | ||
"import/no-named-as-default": "off", | ||
"import/no-named-as-default-member": "off", | ||
"import/namespace": "off", | ||
"import/default": "off", | ||
"@typescript-eslint/explicit-module-boundary-types": "off", | ||
"no-unused-vars": ["off"], | ||
"react/jsx-uses-react": "error", | ||
"react/jsx-uses-vars": "error", | ||
"react-hooks/exhaustive-deps": "off", | ||
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }], | ||
"@typescript-eslint/no-use-before-define": "off", | ||
"@typescript-eslint/no-empty-function": "off", | ||
"@typescript-eslint/no-empty-interface": "off", | ||
"@typescript-eslint/no-explicit-any": "off" | ||
}, | ||
"settings": { | ||
"react": { | ||
"version": "detect" | ||
}, | ||
"import/extensions": [".js", ".jsx", ".ts", ".tsx"], | ||
"import/parsers": { | ||
"@typescript-eslint/parser": [".js", ".jsx", ".ts", ".tsx"] | ||
}, | ||
"import/resolver": { | ||
"node": { | ||
"extensions": [".js", ".jsx", ".ts", ".tsx", ".json"], | ||
"paths": ["src"] | ||
} | ||
} | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": ["src"], | ||
"parserOptions": { | ||
"project": ["./tsconfig.json", "./storybook/tsconfig.json"] | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: release | ||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
- 'beta' | ||
- 'alpha' | ||
pull_request: {} | ||
jobs: | ||
main: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
- name: Setup node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14.x' | ||
- name: Install deps | ||
# this runs a build script so there is no dedicated build | ||
run: yarn install | ||
- name: Run storybook build script | ||
run: yarn build-storybook | ||
release: | ||
needs: main | ||
runs-on: ubuntu-latest | ||
if: ${{ github.repository == 'buildwithflux/text-engine' && contains('refs/heads/master,refs/heads/beta,refs/heads/alpha',github.ref) && github.event_name == 'push' }} | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
- name: Setup node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14.x' | ||
- name: Install deps | ||
# this runs a build script so there is no dedicated build | ||
run: yarn install | ||
- name: 🚀 Release | ||
uses: cycjimmy/semantic-release-action@v2 | ||
with: | ||
semantic_version: 17 | ||
extra_plugins: | | ||
@semantic-release/git | ||
branches: | | ||
[ | ||
'master', | ||
{name: 'beta', prerelease: true}, | ||
{name: 'alpha', prerelease: true} | ||
] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
node_modules/ | ||
coverage/ | ||
dist/ | ||
build/ | ||
types/ | ||
storybook-static/ | ||
Thumbs.db | ||
ehthumbs.db | ||
Desktop.ini | ||
$RECYCLE.BIN/ | ||
.DS_Store | ||
.vscode | ||
.docz/ | ||
package-lock.json | ||
coverage/ | ||
.idea | ||
yarn-error.log | ||
.size-snapshot.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx --no-install commitlint --edit $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx --no-install pretty-quick --staged | ||
npm run eslint:ci --quiet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.storybook | ||
storybook-static |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
dist/ | ||
storybook-static/ | ||
*.typeface.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"semi": false, | ||
"trailingComma": "es5", | ||
"singleQuote": true, | ||
"tabWidth": 2, | ||
"printWidth": 120, | ||
"useTabs": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import * as React from 'react' | ||
import { Vector3 } from 'three' | ||
import { Canvas, Props as CanvasProps } from '@react-three/fiber' | ||
|
||
type Props = React.PropsWithChildren< | ||
CanvasProps & { | ||
cameraFov?: number | ||
cameraPosition?: Vector3 | ||
lights?: boolean | ||
} | ||
> | ||
|
||
export const Setup = ({ | ||
children, | ||
cameraFov = 75, | ||
cameraPosition = new Vector3(-5, 5, 5), | ||
lights = true, | ||
...restProps | ||
}: Props) => ( | ||
<Canvas shadows camera={{ position: cameraPosition, fov: cameraFov }} {...restProps}> | ||
{children} | ||
{lights && ( | ||
<> | ||
<ambientLight intensity={0.8} /> | ||
<pointLight intensity={1} position={[0, 6, 0]} /> | ||
</> | ||
)} | ||
</Canvas> | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
html, | ||
body, | ||
#root { | ||
width: 100%; | ||
height: 100%; | ||
margin: 0; | ||
padding: 0; | ||
-webkit-touch-callout: none; | ||
-webkit-user-select: none; | ||
-khtml-user-select: none; | ||
-moz-user-select: none; | ||
-ms-user-select: none; | ||
user-select: none; | ||
overflow: hidden; | ||
background-color: #121212; | ||
} | ||
|
||
#root { | ||
overflow: auto; | ||
} | ||
|
||
.html-story-block { | ||
color: white; | ||
width: 120px; | ||
position: relative; | ||
margin-left: 100px; | ||
} | ||
|
||
.html-story-block.margin300 { | ||
margin-left: 300px; | ||
} | ||
|
||
.html-story-block:before { | ||
content: ''; | ||
display: block; | ||
position: absolute; | ||
|
||
top: 50%; | ||
left: -60px; | ||
|
||
width: 60px; | ||
height: 1px; | ||
background-color: white; | ||
} | ||
|
||
.html-story-label { | ||
background-color: white; | ||
color: black; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
padding: 8px; | ||
} | ||
|
||
.html-story-label-B { | ||
font-size: 50px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { resolve } from 'path' | ||
|
||
export default { | ||
staticDirs: ['./public'], | ||
stories: ['./stories/**/*.stories.{ts,tsx}'], | ||
addons: [ | ||
'@storybook/addon-controls', | ||
'@storybook/addon-knobs', | ||
'@storybook/addon-actions', | ||
'@storybook/addon-storysource', | ||
], | ||
typescript: { | ||
check: true, | ||
}, | ||
// https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#deprecated-implicit-postcss-loader | ||
features: { | ||
postcss: false, | ||
}, | ||
webpackFinal: (config) => { | ||
config.module.rules.push({ | ||
test: /\.(glsl|vs|fs|vert|frag)$/, | ||
exclude: /node_modules/, | ||
use: ['raw-loader', 'glslify-loader'], | ||
include: resolve(__dirname, '../'), | ||
}) | ||
|
||
return config | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { addons } from '@storybook/addons' | ||
import theme from './theme' | ||
|
||
addons.setConfig({ | ||
theme, | ||
panelPosition: 'right', | ||
showPanel: true, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react' | ||
import './index.css' | ||
|
||
export const parameters = { | ||
layout: 'fullscreen', | ||
} | ||
|
||
export const decorators = [ | ||
(Story) => ( | ||
<React.Suspense fallback={null}> | ||
<Story /> | ||
</React.Suspense> | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import * as React from 'react' | ||
import { withKnobs } from '@storybook/addon-knobs' | ||
import { Vector3 } from 'three' | ||
|
||
import { Setup } from '../Setup' | ||
|
||
export default { | ||
title: 'Test', | ||
decorators: [withKnobs, (storyFn) => <Setup cameraPosition={new Vector3(2, 2, 2)}>{storyFn()}</Setup>], | ||
} | ||
|
||
function TestScene() { | ||
return ( | ||
<mesh> | ||
<boxBufferGeometry /> | ||
<meshBasicMaterial /> | ||
</mesh> | ||
) | ||
} | ||
|
||
export const TestSt = () => <TestScene /> | ||
TestSt.storyName = 'Default' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { create } from '@storybook/theming/create' | ||
|
||
export default create({ | ||
base: 'light', | ||
appBg: 'white', | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Flux | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# test-engine | ||
|
||
## Acknowledgements | ||
|
||
- drei for the library setup |
Oops, something went wrong.