Skip to content

Commit

Permalink
feat: update package name
Browse files Browse the repository at this point in the history
BREAKING CHANGE: package name ws changed from @react-shader-fiber/renderer to @react-shader/fiber
  • Loading branch information
pavophilip committed Dec 26, 2023
1 parent 99f4683 commit c98c343
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 9 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/npm-publish-github-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:
with:
node-version: 18
registry-url: https://registry.npmjs.org
- run: npm ci -w @react-shader-fiber/renderer
- run: npm run build -w @react-shader-fiber/renderer
- run: npm publish -w @react-shader-fiber/renderer --access public
- run: npm ci -w @react-shader/renderer
- run: npm run build -w @react-shader/renderer
- run: npm publish -w @react-shader/renderer --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

Expand All @@ -38,8 +38,8 @@ jobs:
with:
node-version: 18
registry-url: https://registry.npmjs.org
- run: npm ci -w @react-shader-fiber/renderer
- run: npm run build -w @react-shader-fiber/renderer
- run: npm ci -w @react-shader/renderer
- run: npm run build -w @react-shader/renderer
- run: npm ci -w @react-shader-fiber/stdlib
- run: npm run build -w @react-shader-fiber/stdlib
- run: npm publish -w @react-shader-fiber/stdlib --access public
Expand All @@ -58,8 +58,8 @@ jobs:
with:
node-version: 18
registry-url: https://registry.npmjs.org
- run: npm ci -w @react-shader-fiber/renderer
- run: npm run build -w @react-shader-fiber/renderer
- run: npm ci -w @react-shader/renderer
- run: npm run build -w @react-shader/renderer
- run: npm ci -w react-shader-fiber
- run: npm run build -w react-shader-fiber
- run: npm publish -w react-shader-fiber --access public
Expand Down
30 changes: 30 additions & 0 deletions packages/demo/src/components/Shader.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { FragmentShader } from "react-shader-fiber";

import { Input, Main, Output, Uniform } from "@react-shader-fiber/stdlib";
import ShaderProvider from "../providers/ShaderProvider.jsx";

const Shader = ({ time, coords, color, children }) => {
return (
<FragmentShader>
<Output type={"vec4"} id={"fragColor"} ref={color} />

<Input ref={coords} type={"vec2"} id={"vCoords"} />

<Uniform ref={time} id={"u_time"} type={"float"} />

<Main>
<ShaderProvider
value={{
time: time,
color: color,
coords: coords,
}}
>
{children}
</ShaderProvider>
</Main>
</FragmentShader>
);
};

export default Shader;
27 changes: 27 additions & 0 deletions packages/demo/src/providers/ShaderProvider.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { createContext, useContext } from "react";

const ShaderContext = createContext({
time: null,
coords: null,
color: null,
});

const useTime = () => {
return useContext(ShaderContext).time;
};

const useCoords = () => {
return useContext(ShaderContext).coords;
};

const useColor = () => {
return useContext(ShaderContext).color;
};

const ShaderProvider = ({ value, children }) => {
return (
<ShaderContext.Provider value={value}>{children}</ShaderContext.Provider>
);
};

export default ShaderProvider;
2 changes: 1 addition & 1 deletion packages/react-shader-fiber/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "react-shader-fiber",
"name": "@react-shader/fiber",
"private": false,
"version": "1.1.0",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/renderer/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@react-shader-fiber/renderer",
"name": "@react-shader/renderer",
"private": false,
"version": "1.0.12",
"type": "module",
Expand Down

0 comments on commit c98c343

Please sign in to comment.