This is the rendering system for the Optomancy grammar of graphics.
- Currently
npm linked to spellbook; clone the spellbook repo,cd spellbookandnpm link,cd ../wizualizationandnpm link spellbook - after
npm linkyou must opennode_modules/react-scripts/config/webpack.config.jsand remove the lineinclude: paths.appSrc; you must do this again every time younpm installa new package because react-scripts transpilers are traaaaaaash when paired withnpm link. See https://stackoverflow.com/questions/65893787/create-react-app-with-typescript-and-npm-link-enums-causing-module-parse-failed - You must also, to get react-speech-recognition to work, modify
node_modules/react-scripts/config/webpack.config.jsto includesourceType: 'unambiguous'as part of babel loader'options'element object, e.g., as follows:
// Process application JS with Babel.
// The preset includes JSX, Flow, TypeScript, and some ESnext features.
{
test: /\.(js|mjs|jsx|ts|tsx)$/,
loader: require.resolve('babel-loader'),
options: {
customize: require.resolve(
'babel-preset-react-app/webpack-overrides'
),
presets: [
[
require.resolve('babel-preset-react-app'),
{
runtime: hasJsxRuntime ? 'automatic' : 'classic',
},
],
],
sourceType: 'unambiguous',
[...]
}
}
solution credit: https://stackoverflow.com/a/57912572
Added our config for posterity.
Finally, to avoid package dependency issues,
npm linkthe following dependencies from the spellbook repo (runnpm linkin spellbook/node_modules dirs for the corresponding packages)
npm link react
npm link react-dom
npm link @types/react
npm link @types/react-dom
npm link three
npm link @types/three
npm link react-three-fiber
npm link @react-three/fiber
npm link @react-three/drei
npm link @react-three/cannon
npm link @react-three/xr