Skip to content

Commit e3c0fee

Browse files
authored
feat!: rename @tutorialkit/components-react to @tutorialkit/react (#155)
1 parent 8d49ef8 commit e3c0fee

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+161
-170
lines changed

.github/workflows/publish-commit.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
run: >
6262
pnpm dlx [email protected] publish --compact --pnpm
6363
./packages/astro
64-
./packages/components/react
64+
./packages/react
6565
./packages/runtime
6666
./packages/theme
6767
./packages/types

CONTRIBUTING.md

+2-2

docs/demo/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"preview": "astro preview"
1212
},
1313
"dependencies": {
14-
"@tutorialkit/components-react": "workspace:*",
14+
"@tutorialkit/react": "workspace:*",
1515
"react": "^18.3.1",
1616
"react-dom": "^18.3.1"
1717
},

docs/tutorialkit.dev/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"astro": "astro"
1212
},
1313
"dependencies": {
14-
"@tutorialkit/components-react": "workspace:*",
14+
"@tutorialkit/react": "workspace:*",
1515
"@webcontainer/api": "1.2.0",
1616
"classnames": "^2.5.1",
1717
"react": "^18.3.1",

docs/tutorialkit.dev/src/components/react-examples/Example.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
import { classNames } from '@tutorialkit/components-react';
2+
import { classNames } from '@tutorialkit/react';
33
import '@tutorialkit/astro/default-theme.css';
44
55
interface Props {

docs/tutorialkit.dev/src/components/react-examples/ExampleCodeMirrorEditor.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { EditorDocument, EditorUpdate, ScrollPosition } from '@tutorialkit/components-react/core';
2-
import CodeMirrorEditor from '@tutorialkit/components-react/core/CodeMirrorEditor';
1+
import type { EditorDocument, EditorUpdate, ScrollPosition } from '@tutorialkit/react/core';
2+
import CodeMirrorEditor from '@tutorialkit/react/core/CodeMirrorEditor';
33
import { useState } from 'react';
44
import { useTheme } from './hooks/useTheme';
55

docs/tutorialkit.dev/src/components/react-examples/ExampleFileTree.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useState } from 'react';
2-
import FileTree from '@tutorialkit/components-react/core/FileTree';
2+
import FileTree from '@tutorialkit/react/core/FileTree';
33

44
export default function ExampleFileTree() {
55
const [selectedFile, setSelectedFile] = useState(FILES[0]);

docs/tutorialkit.dev/src/components/react-examples/ExampleSimpleEditor.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import type { EditorDocument, EditorUpdate, ScrollPosition } from '@tutorialkit/components-react/core';
2-
import CodeMirrorEditor from '@tutorialkit/components-react/core/CodeMirrorEditor';
3-
import FileTree from '@tutorialkit/components-react/core/FileTree';
1+
import type { EditorDocument, EditorUpdate, ScrollPosition } from '@tutorialkit/react/core';
2+
import CodeMirrorEditor from '@tutorialkit/react/core/CodeMirrorEditor';
3+
import FileTree from '@tutorialkit/react/core/FileTree';
44
import type { FileSystemTree, DirectoryNode } from '@webcontainer/api';
55
import type { Terminal as XTerm } from '@xterm/xterm';
66
import { Suspense, lazy, useEffect, useState } from 'react';
77
import { useTheme } from './hooks/useTheme';
88
import { useWebContainer } from './hooks/useWebcontainer';
99

10-
const Terminal = lazy(() => import('@tutorialkit/components-react/core/Terminal'));
10+
const Terminal = lazy(() => import('@tutorialkit/react/core/Terminal'));
1111

1212
export default function ExampleSimpleEditor() {
1313
const [domLoaded, setDomLoaded] = useState(false);

docs/tutorialkit.dev/src/components/react-examples/ExampleTerminal.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useTheme } from './hooks/useTheme';
33
import type { Terminal as XTerm } from '@xterm/xterm';
44
import { useWebContainer } from './hooks/useWebcontainer';
55

6-
const Terminal = lazy(() => import('@tutorialkit/components-react/core/Terminal'));
6+
const Terminal = lazy(() => import('@tutorialkit/react/core/Terminal'));
77

88
export default function ExampleTerminal() {
99
// only needed in astro because of SSR

docs/tutorialkit.dev/src/content/docs/reference/react-components.mdx

+3-3

e2e/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"@iconify-json/svg-spinners": "^1.1.2",
1515
"@playwright/test": "^1.46.0",
1616
"@tutorialkit/astro": "workspace:*",
17-
"@tutorialkit/components-react": "workspace:*",
17+
"@tutorialkit/react": "workspace:*",
1818
"@tutorialkit/runtime": "workspace:*",
1919
"@tutorialkit/theme": "workspace:*",
2020
"@tutorialkit/types": "workspace:*",

packages/astro/README.md

+1-1

packages/astro/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"@expressive-code/plugin-line-numbers": "^0.35.3",
3838
"@nanostores/react": "0.7.2",
3939
"@stackblitz/sdk": "^1.11.0",
40-
"@tutorialkit/components-react": "workspace:*",
40+
"@tutorialkit/react": "workspace:*",
4141
"@tutorialkit/runtime": "workspace:*",
4242
"@tutorialkit/theme": "workspace:*",
4343
"@tutorialkit/types": "workspace:*",

packages/astro/src/default/components/LoginButton.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useStore } from '@nanostores/react';
2-
import { classNames } from '@tutorialkit/components-react';
2+
import { classNames } from '@tutorialkit/react';
33
import { useEffect, useRef, useState } from 'react';
44
import { authStore } from '../stores/auth-store';
55
import { login, logout } from './webcontainer';

packages/astro/src/default/components/NavWrapper.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Nav } from '@tutorialkit/components-react';
1+
import { Nav } from '@tutorialkit/react';
22
import type { Lesson, NavList } from '@tutorialkit/types';
33

44
interface Props {

packages/astro/src/default/components/ResizablePanel.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
import { classNames } from '@tutorialkit/components-react';
2+
import { classNames } from '@tutorialkit/react';
33
44
export type Type = 'horizontal' | 'vertical';
55
export type Priority = 'min' | 'max';

packages/astro/src/default/components/WorkspacePanelWrapper.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useEffect } from 'react';
22
import { useStore } from '@nanostores/react';
3-
import { WorkspacePanel } from '@tutorialkit/components-react';
3+
import { WorkspacePanel } from '@tutorialkit/react';
44
import type { Lesson } from '@tutorialkit/types';
55
import { themeStore } from '../stores/theme-store.js';
66
import { tutorialStore } from './webcontainer.js';

packages/astro/src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,14 @@ export default function createPlugin({
8787
vite: {
8888
optimizeDeps: {
8989
entries: ['!**/src/(content|templates)/**'],
90-
include: process.env.TUTORIALKIT_DEV ? [] : ['@tutorialkit/components-react'],
90+
include: process.env.TUTORIALKIT_DEV ? [] : ['@tutorialkit/react'],
9191
},
9292
define: {
9393
__ENTERPRISE__: `${!!enterprise}`,
9494
__WC_CONFIG__: enterprise ? JSON.stringify(enterprise) : 'undefined',
9595
},
9696
ssr: {
97-
noExternal: ['@tutorialkit/astro', '@tutorialkit/components-react'],
97+
noExternal: ['@tutorialkit/astro', '@tutorialkit/react'],
9898
},
9999
plugins: [
100100
userlandCSS,

packages/astro/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"references": [
1212
{ "path": "../runtime/tsconfig.build.json" },
1313
{ "path": "../types/tsconfig.build.json" },
14-
{ "path": "../components/react/tsconfig.build.json" },
14+
{ "path": "../react/tsconfig.build.json" },
1515
{ "path": "../theme" }
1616
]
1717
}

packages/cli/tests/create-tutorial.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ async function runPnpmInstall(dest: string, baseDir: string) {
242242
overrides: {
243243
'@astrojs/language-server': '2.14.1',
244244
'@tutorialkit/astro': `file:${baseDir}/packages/astro`,
245-
'@tutorialkit/components-react': `file:${baseDir}/packages/components/react`,
245+
'@tutorialkit/react': `file:${baseDir}/packages/react`,
246246
'@tutorialkit/runtime': `file:${baseDir}/packages/runtime`,
247247
'@tutorialkit/theme': `file:${baseDir}/packages/theme`,
248248
'@tutorialkit/types': `file:${baseDir}/packages/types`,

packages/components/react/package.json renamed to packages/react/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "@tutorialkit/components-react",
2+
"name": "@tutorialkit/react",
33
"version": "0.1.6",
4-
"description": "TutorialKit's React components",
4+
"description": "TutorialKit's React components and utilities",
55
"author": "StackBlitz Inc.",
66
"type": "module",
77
"bugs": "https://github.com/stackblitz/tutorialkit/issues",
@@ -10,7 +10,7 @@
1010
"repository": {
1111
"type": "git",
1212
"url": "git+https://github.com/stackblitz/tutorialkit.git",
13-
"directory": "packages/components/react"
13+
"directory": "packages/react"
1414
},
1515
"types": "./dist/index.d.ts",
1616
"exports": {
File renamed without changes.
File renamed without changes.
File renamed without changes.

packages/components/react/tsconfig.build.json renamed to packages/react/tsconfig.build.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"include": ["src"],
99
"exclude": ["src/**/*.spec.ts"],
1010
"references": [
11-
{ "path": "../../runtime/tsconfig.build.json" },
12-
{ "path": "../../theme" },
13-
{ "path": "../../types/tsconfig.build.json" }
11+
{ "path": "../runtime/tsconfig.build.json" },
12+
{ "path": "../theme" },
13+
{ "path": "../types/tsconfig.build.json" }
1414
]
1515
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../../../tsconfig.json",
2+
"extends": "../../tsconfig.json",
33
"compilerOptions": {
44
"jsx": "react-jsx",
55
"baseUrl": "./",
@@ -10,8 +10,8 @@
1010
},
1111
"include": ["src"],
1212
"references": [
13-
{ "path": "../../runtime/tsconfig.build.json" },
14-
{ "path": "../../theme" },
15-
{ "path": "../../types/tsconfig.build.json" }
13+
{ "path": "../runtime/tsconfig.build.json" },
14+
{ "path": "../theme" },
15+
{ "path": "../types/tsconfig.build.json" }
1616
]
1717
}

packages/template/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"start": "astro dev"
1212
},
1313
"dependencies": {
14-
"@tutorialkit/components-react": "workspace:*",
14+
"@tutorialkit/react": "workspace:*",
1515
"react": "^18.3.1",
1616
"react-dom": "^18.3.1"
1717
},

packages/theme/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function defineConfig(config: UserConfig) {
2020
transformers: [transformerDirectives()],
2121
content: {
2222
inline: getInlineContentForPackage({
23-
name: '@tutorialkit/components-react',
23+
name: '@tutorialkit/react',
2424
pattern: '/dist/**/*.js',
2525
root: process.cwd(),
2626
}),

0 commit comments

Comments
 (0)