Skip to content

Commit

Permalink
update cli to fix it from deleting JSX types in dist/, delete unused …
Browse files Browse the repository at this point in the history
…src/lib/ files, re-export classy-solid from lume for convenience
  • Loading branch information
trusktr committed May 14, 2024
1 parent 7209c2c commit 1fb808c
Show file tree
Hide file tree
Showing 68 changed files with 643 additions and 1,027 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ jobs:
run: |
npm run test:all
- name: check repo is clean
# skip this check in windows for now, as the build outputs may get slightly modified in Windows, which we want to fix.
# Skip this check in windows for now, as the build outputs may get slightly modified in Windows, which we want to fix.
# Also skip checking docsify emoji files which may get updated by github API.
if: runner.os != 'Windows'
run: |
cd packages/docsifyjs+docsify/ && git checkout docs/emoji.md src/core/render/emoji-data.js && cd .. && cd ..
git status && git submodule foreach git --no-pager diff && git add . && git diff --quiet && git diff --cached --quiet
env:
CI: true
10 changes: 8 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ git commit --no-verify -m "TMP_COMMIT_HOOK_COMMIT"
git stash save -u COMMIT_HOOK_STASH
git reset --soft HEAD~

# NOTE: The post-commit hook will unstash the COMMIT_HOOK_STASH
echo ""
echo "Status after stash:"
echo ""
git status

# See .lintstagedrc.js for the steps that will run at this point.
npx lint-staged --verbose

npx lint-staged
# NOTE: After this, the post-commit hook will unstash the COMMIT_HOOK_STASH. See .husky/post-commit.
9 changes: 8 additions & 1 deletion .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
const buildSteps = ['npm run build:clean', 'git add dist']
const buildSteps = [
"echo 'Building src/'",
'npm run build:clean',
"echo 'Staging dist/'",
'git add dist',
"echo 'Status after staging:'",
'git status',
]

export default {
'./src/**/*': () => buildSteps,
Expand Down
16 changes: 16 additions & 0 deletions dist/behaviors/mesh-behaviors/materials/types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// TODO port to TypeScript
declare module 'three-projected-material' {
import type {Camera, MeshPhysicalMaterial, MeshPhysicalMaterialParameters, Texture, Vector2} from 'three'

type ProjectedMaterialparameters = {
camera?: Camera
texture?: Texture
textureScale?: number
textureOffset?: Vector2
cover?: boolean
} & MeshPhysicalMaterialParameters

export default class ProjectedMaterial extends MeshPhysicalMaterial {
constructor(options: ProjectedMaterialparameters)
}
}
11 changes: 11 additions & 0 deletions dist/cameras/CameraRig.react-jsx.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type {CameraRig, CameraRigAttributes} from './CameraRig'
import type {ReactElementAttributes} from '@lume/element/src/react'

// React users can import this to have appropriate types for the element in their JSX markup.
declare global {
namespace JSX {
interface IntrinsicElements {
'lume-camera-rig': ReactElementAttributes<CameraRig, CameraRigAttributes>
}
}
}
11 changes: 11 additions & 0 deletions dist/cameras/PerspectiveCamera.react-jsx.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type {PerspectiveCamera, PerspectiveCameraAttributes} from './PerspectiveCamera'
import type {ReactElementAttributes} from '@lume/element/src/react'

// React users can import this to have appropriate types for the element in their JSX markup.
declare global {
namespace JSX {
interface IntrinsicElements {
'lume-perspective-camera': ReactElementAttributes<PerspectiveCamera, PerspectiveCameraAttributes>
}
}
}
2 changes: 2 additions & 0 deletions dist/cameras/index.react-jsx.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import type {} from './CameraRig.react-jsx'
import type {} from './PerspectiveCamera.react-jsx'
21 changes: 21 additions & 0 deletions dist/core/ClipPlane.react-jsx.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import type {ClipPlane, ClipPlaneAttributes} from './ClipPlane'
import type {ReactElementAttributes} from '@lume/element/src/react'

// React users can import this to have appropriate types for the element in their JSX markup.
declare global {
namespace JSX {
interface IntrinsicElements {
'lume-clip-plane': ReactElementAttributes<ClipPlane, ClipPlaneAttributes>
}
}
}

// TODO move this to the elemet-behaviors package.
declare global {
namespace React {
// Attributes for all elements.
interface HTMLAttributes<T> extends AriaAttributes, DOMAttributes<T> {
has?: string
}
}
}
21 changes: 21 additions & 0 deletions dist/core/Element3D.react-jsx.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import type {Element3D, Element3DAttributes} from './Element3D'
import type {ReactElementAttributes} from '@lume/element/src/react'

// React users can import this to have appropriate types for the element in their JSX markup.
declare global {
namespace JSX {
interface IntrinsicElements {
'lume-element3d': ReactElementAttributes<Element3D, Element3DAttributes>
}
}
}

// TODO move this to the elemet-behaviors package.
declare global {
namespace React {
// Attributes for all elements.
interface HTMLAttributes<T> extends AriaAttributes, DOMAttributes<T> {
has?: string
}
}
}
12 changes: 12 additions & 0 deletions dist/core/Node.react-jsx.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import type {Node, NodeAttributes} from './Node'
import type {ReactElementAttributes} from '@lume/element/src/react'

// React users can import this to have appropriate types for the element in their JSX markup.
declare global {
namespace JSX {
interface IntrinsicElements {
/** @deprecated Use `<lume-element3d>` instead. */
'lume-node': ReactElementAttributes<Node, NodeAttributes>
}
}
}
11 changes: 11 additions & 0 deletions dist/core/Scene.react-jsx.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type {Scene, SceneAttributes} from './Scene'
import type {ReactElementAttributes} from '@lume/element/src/react'

// React users can import this to have appropriate types for the element in their JSX markup.
declare global {
namespace JSX {
interface IntrinsicElements {
'lume-scene': ReactElementAttributes<Scene, SceneAttributes>
}
}
}
4 changes: 4 additions & 0 deletions dist/core/index.react-jsx.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import type {} from './ClipPlane.react-jsx'
import type {} from './Element3D.react-jsx'
import type {} from './Node.react-jsx'
import type {} from './Scene.react-jsx'
11 changes: 11 additions & 0 deletions dist/examples/FlickeringOrb.react-jsx.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type {FlickeringOrb, FlickeringOrbAttributes} from './FlickeringOrb'
import type {ReactElementAttributes} from '@lume/element/src/react'

// React users can import this to have appropriate types for the element in their JSX markup.
declare global {
namespace JSX {
interface IntrinsicElements {
'flickering-orb': ReactElementAttributes<FlickeringOrb, FlickeringOrbAttributes>
}
}
}
11 changes: 11 additions & 0 deletions dist/examples/FlickeringOrbs.react-jsx.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type {FlickeringOrbs, FlickeringOrbsAttributes} from './FlickeringOrbs'
import type {ReactElementAttributes} from '@lume/element/src/react'

// React users can import this to have appropriate types for the element in their JSX markup.
declare global {
namespace JSX {
interface IntrinsicElements {
'flickering-orbs': ReactElementAttributes<FlickeringOrbs, FlickeringOrbsAttributes>
}
}
}
14 changes: 14 additions & 0 deletions dist/examples/LoadingIcon.react-jsx.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type React from 'react'
import type {LoadingIcon} from './LoadingIcon'

// React users can import this to have appropriate types for the element in their JSX markup.
declare global {
namespace JSX {
interface IntrinsicElements {
// LoadingIcon has no props currently, so this is how to provide the default set in React.
'loading-icon': React.DetailedHTMLProps<React.HTMLAttributes<LoadingIcon>, LoadingIcon>
// Otherwise use the following if we add props:
// 'loading-icon': ReactElementAttributes<LoadingIcon, LoadingIconAttributes>
}
}
}
3 changes: 3 additions & 0 deletions dist/examples/index.react-jsx.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import type {} from './FlickeringOrb.react-jsx'
import type {} from './FlickeringOrbs.react-jsx'
import type {} from './LoadingIcon.react-jsx'
1 change: 1 addition & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export { $DEVCOMP, $PROXY, $TRACK, ErrorBoundary, For, Index, Match, Show, type
export { render } from 'solid-js/web';
export { default as html } from 'solid-js/html';
export * from '@lume/element';
export * from 'classy-solid';
export * from './behaviors/index.js';
export * from './cameras/index.js';
export * from './core/index.js';
Expand Down
2 changes: 1 addition & 1 deletion dist/index.d.ts.map

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

1 change: 1 addition & 0 deletions dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

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

8 changes: 8 additions & 0 deletions dist/index.react-jsx.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import type {} from './cameras/index.react-jsx'
import type {} from './core/index.react-jsx'
import type {} from './examples/index.react-jsx'
import type {} from './layouts/index.react-jsx'
import type {} from './lights/index.react-jsx'
import type {} from './meshes/index.react-jsx'
import type {} from './models/index.react-jsx'
import type {} from './textures/index.react-jsx'
15 changes: 15 additions & 0 deletions dist/layouts/AutoLayoutNode.react-jsx.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type {AutoLayoutNode, AutoLayoutNodeAttributes} from './AutoLayoutNode'
import type {ReactElementAttributes} from '@lume/element/src/react'

// React users can import this to have appropriate types for the element in their JSX markup.
declare global {
namespace JSX {
interface IntrinsicElements {
/**
* @deprecated `AutoLayoutNode` and `<lume-autolayout-node>` have been renamed
* to [`Autolayout`](./Autolayout) and `<lume-autolayout>`.
*/
'lume-autolayout-node': ReactElementAttributes<AutoLayoutNode, AutoLayoutNodeAttributes>
}
}
}
11 changes: 11 additions & 0 deletions dist/layouts/Autolayout.react-jsx.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type {Autolayout, AutolayoutAttributes} from './Autolayout'
import type {ReactElementAttributes} from '@lume/element/src/react'

// React users can import this to have appropriate types for the element in their JSX markup.
declare global {
namespace JSX {
interface IntrinsicElements {
'lume-autolayout': ReactElementAttributes<Autolayout, AutolayoutAttributes>
}
}
}
11 changes: 11 additions & 0 deletions dist/layouts/CubeLayout.react-jsx.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type {CubeLayout, CubeLayoutAttributes} from './CubeLayout'
import type {ReactElementAttributes} from '@lume/element/src/react'

// React users can import this to have appropriate types for the element in their JSX markup.
declare global {
namespace JSX {
interface IntrinsicElements {
'lume-cube-layout': ReactElementAttributes<CubeLayout, CubeLayoutAttributes>
}
}
}
3 changes: 3 additions & 0 deletions dist/layouts/index.react-jsx.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import type {} from './AutoLayoutNode.react-jsx'
import type {} from './Autolayout.react-jsx'
import type {} from './CubeLayout.react-jsx'
22 changes: 0 additions & 22 deletions dist/lib/three/examples/jsm/curves/NURBSCurve.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion dist/lib/three/examples/jsm/curves/NURBSCurve.d.ts.map

This file was deleted.

48 changes: 0 additions & 48 deletions dist/lib/three/examples/jsm/curves/NURBSCurve.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/lib/three/examples/jsm/curves/NURBSCurve.js.map

This file was deleted.

0 comments on commit 1fb808c

Please sign in to comment.