diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bfdf758..7f6e94a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -55,9 +55,9 @@ importers: site: dependencies: - codice: - specifier: workspace:* - version: link:.. + '@sugar-high/react': + specifier: ^1.0.0 + version: 1.0.0(react@19.0.0)(sugar-high@2.0.0) html-to-image: specifier: ^1.11.13 version: 1.11.13 @@ -70,6 +70,9 @@ importers: react-dom: specifier: ^19.0.0 version: 19.0.0(react@19.0.0) + sugar-high: + specifier: ^2.0.0 + version: 2.0.0 devDependencies: '@types/node': specifier: ^22.10.7 @@ -799,6 +802,12 @@ packages: cpu: [x64] os: [win32] + '@sugar-high/react@1.0.0': + resolution: {integrity: sha512-ExYFFuhHPQAjkaThzhCv5Uiktr0/Lpd7V/tfIB86Ottg21Z/rDxU7DmhjR/OIg1XvqRMPhqs2S6c8k0vbFx9qw==} + peerDependencies: + react: ^19.0.0 + sugar-high: ^2.0.0 + '@swc/core-darwin-arm64@1.15.21': resolution: {integrity: sha512-SA8SFg9dp0qKRH8goWsax6bptFE2EdmPf2YRAQW9WoHGf3XKM1bX0nd5UdwxmC5hXsBUZAYf7xSciCler6/oyA==} engines: {node: '>=10'} @@ -1510,6 +1519,9 @@ packages: sugar-high@1.0.0: resolution: {integrity: sha512-QXI5DHWxBI4kph38jBgfq0a8859NxA1fZMpkbiUmd332/SMdBKOQ+8f6gdCfEWg0ZY2216Oh8OqS5lC0IOTQmA==} + sugar-high@2.0.0: + resolution: {integrity: sha512-qZQaa+3vbmKSx00G465bY1LqVUU0RaUkY/7xDV63cQzezD6dF/DJCthztRQqYLGA7HXdObvCEtcCRpvoIrrbCg==} + supports-preserve-symlinks-flag@1.0.0: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} @@ -2112,6 +2124,11 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.60.0': optional: true + '@sugar-high/react@1.0.0(react@19.0.0)(sugar-high@2.0.0)': + dependencies: + react: 19.0.0 + sugar-high: 2.0.0 + '@swc/core-darwin-arm64@1.15.21': optional: true @@ -2810,6 +2827,8 @@ snapshots: sugar-high@1.0.0: {} + sugar-high@2.0.0: {} + supports-preserve-symlinks-flag@1.0.0: {} tailwindcss@4.1.8: {} diff --git a/site/app/code-example.tsx b/site/app/code-example.tsx index d784ca3..47bc663 100644 --- a/site/app/code-example.tsx +++ b/site/app/code-example.tsx @@ -1,4 +1,4 @@ -import { Code } from 'codice' +import { Code } from '@sugar-high/react' const CODE_SIMPLE_SNIPPET_HTML = `\ # Here is a simple function @@ -10,7 +10,7 @@ hello() ` const CODE_ULTIMATE_SNIPPET_HTML = `\ -import { Code } from 'codice' +import { Code } from '@sugar-high/react' import { highlight } from 'sugar-high' function renderMarkup() { diff --git a/site/app/editor-example.tsx b/site/app/editor-example.tsx index 364a7db..93350a0 100644 --- a/site/app/editor-example.tsx +++ b/site/app/editor-example.tsx @@ -2,7 +2,7 @@ import { LiveEditor } from './live-editor' const defaultCode = `\ import { useState } from 'react' -import { Editor } from 'codice' +import { Editor } from '@sugar-high/react' const defaultText = 'console.log("hello world")' diff --git a/site/app/live-editor.tsx b/site/app/live-editor.tsx index 03b8e1b..d31ae7b 100644 --- a/site/app/live-editor.tsx +++ b/site/app/live-editor.tsx @@ -1,6 +1,6 @@ 'use client' -import { Editor } from 'codice' +import { Editor } from '@sugar-high/react' import React, { startTransition, useActionState, useEffect, useRef, useState } from 'react' import { format as prettierFormat } from 'prettier/standalone' import { toPng } from 'html-to-image' diff --git a/site/app/page.tsx b/site/app/page.tsx index fb72068..3587387 100644 --- a/site/app/page.tsx +++ b/site/app/page.tsx @@ -1,6 +1,6 @@ import { EditorExample } from './editor-example' import { CodeExamples } from './code-example' -import { Code } from 'codice' +import { Code } from '@sugar-high/react' type SearchParams = { c?: string // default code diff --git a/site/app/studio/editor-manager.tsx b/site/app/studio/editor-manager.tsx index e649390..fe81b50 100644 --- a/site/app/studio/editor-manager.tsx +++ b/site/app/studio/editor-manager.tsx @@ -1,6 +1,6 @@ 'use client' -import { Editor } from 'codice' +import { Editor } from '@sugar-high/react' import { EditorConfig } from './page' import './studio.css' @@ -49,4 +49,3 @@ export function EditorManager({ editor, onUpdate, editorRef, onTakeScreenshot }: ) } - diff --git a/site/next.config.ts b/site/next.config.ts new file mode 100644 index 0000000..d85e9f0 --- /dev/null +++ b/site/next.config.ts @@ -0,0 +1,15 @@ +import type { NextConfig } from 'next' + +const nextConfig: NextConfig = { + async redirects() { + return [ + { + source: '/:path*', + destination: 'https://sugar-high.vercel.app/react', + permanent: true, + }, + ] + }, +} + +export default nextConfig diff --git a/site/package.json b/site/package.json index edabb9f..9f31e3d 100644 --- a/site/package.json +++ b/site/package.json @@ -7,11 +7,12 @@ "start": "next start" }, "dependencies": { - "codice": "workspace:*", + "@sugar-high/react": "^1.0.0", "html-to-image": "^1.11.13", "prettier": "^3.6.2", "react": "^19.2.1", - "react-dom": "^19.2.1" + "react-dom": "^19.2.1", + "sugar-high": "^2.0.0" }, "devDependencies": { "@types/node": "^22.10.7", diff --git a/site/tsconfig.json b/site/tsconfig.json index 808c57f..18ae62c 100644 --- a/site/tsconfig.json +++ b/site/tsconfig.json @@ -13,7 +13,7 @@ "incremental": true, "module": "esnext", "esModuleInterop": true, - "moduleResolution": "node", + "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, "jsx": "react-jsx",