Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: rename @tutorialkit/components-react to @tutorialkit/react #155

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
run: >
pnpm dlx [email protected] publish --compact --pnpm
./packages/astro
./packages/components/react
./packages/react
./packages/runtime
./packages/theme
./packages/types
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The monorepo consists of multiple packages that are grouped into following group
These packages will be installed by the end-users in their `package.json`.

- `@tutorialkit/astro`
- `@tutorialkit/components-react`
- `@tutorialkit/react`
- `@tutorialkit/runtime`
- `@tutorialkit/theme`
- `@tutorialkit/types`
Expand All @@ -53,7 +53,7 @@ You may wish to test your locally-modified copy of TutorialKit against another p
"pnpm": {
"overrides": {
"@tutorialkit/astro": "file:../tutorialkit/packages/astro",
"@tutorialkit/components-react": "file:../tutorialkit/packages/components/react",
"@tutorialkit/react": "file:../tutorialkit/packages/react",
"@tutorialkit/runtime": "file:../tutorialkit/packages/runtime",
"@tutorialkit/theme": "file:../tutorialkit/packages/theme",
"@tutorialkit/types": "file:../tutorialkit/packages/types"
Expand Down
2 changes: 1 addition & 1 deletion docs/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"preview": "astro preview"
},
"dependencies": {
"@tutorialkit/components-react": "workspace:*",
"@tutorialkit/react": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorialkit.dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"astro": "astro"
},
"dependencies": {
"@tutorialkit/components-react": "workspace:*",
"@tutorialkit/react": "workspace:*",
"@webcontainer/api": "1.2.0",
"classnames": "^2.5.1",
"react": "^18.3.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import { classNames } from '@tutorialkit/components-react';
import { classNames } from '@tutorialkit/react';
import '@tutorialkit/astro/default-theme.css';

interface Props {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { EditorDocument, EditorUpdate, ScrollPosition } from '@tutorialkit/components-react/core';
import CodeMirrorEditor from '@tutorialkit/components-react/core/CodeMirrorEditor';
import type { EditorDocument, EditorUpdate, ScrollPosition } from '@tutorialkit/react/core';
import CodeMirrorEditor from '@tutorialkit/react/core/CodeMirrorEditor';
import { useState } from 'react';
import { useTheme } from './hooks/useTheme';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState } from 'react';
import FileTree from '@tutorialkit/components-react/core/FileTree';
import FileTree from '@tutorialkit/react/core/FileTree';

export default function ExampleFileTree() {
const [selectedFile, setSelectedFile] = useState(FILES[0]);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { EditorDocument, EditorUpdate, ScrollPosition } from '@tutorialkit/components-react/core';
import CodeMirrorEditor from '@tutorialkit/components-react/core/CodeMirrorEditor';
import FileTree from '@tutorialkit/components-react/core/FileTree';
import type { EditorDocument, EditorUpdate, ScrollPosition } from '@tutorialkit/react/core';
import CodeMirrorEditor from '@tutorialkit/react/core/CodeMirrorEditor';
import FileTree from '@tutorialkit/react/core/FileTree';
import type { FileSystemTree, DirectoryNode } from '@webcontainer/api';
import type { Terminal as XTerm } from '@xterm/xterm';
import { Suspense, lazy, useEffect, useState } from 'react';
import { useTheme } from './hooks/useTheme';
import { useWebContainer } from './hooks/useWebcontainer';

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

export default function ExampleSimpleEditor() {
const [domLoaded, setDomLoaded] = useState(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useTheme } from './hooks/useTheme';
import type { Terminal as XTerm } from '@xterm/xterm';
import { useWebContainer } from './hooks/useWebcontainer';

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

export default function ExampleTerminal() {
// only needed in astro because of SSR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ These components use TutorialKit's design system which is based on an atomic CSS
<PackageManagerTabs>
<Fragment slot="npm">
```shell
npm install @tutorialkit/components-react @tutorialkit/theme
npm install @tutorialkit/react @tutorialkit/theme
```
</Fragment>
<Fragment slot="pnpm">
```shell
pnpm install @tutorialkit/components-react @tutorialkit/theme
pnpm install @tutorialkit/react @tutorialkit/theme
```
</Fragment>
<Fragment slot="yarn">
```shell
yarn add @tutorialkit/components-react @tutorialkit/theme
yarn add @tutorialkit/react @tutorialkit/theme
```
</Fragment>
</PackageManagerTabs>
Expand Down
2 changes: 1 addition & 1 deletion e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@iconify-json/svg-spinners": "^1.1.2",
"@playwright/test": "^1.46.0",
"@tutorialkit/astro": "workspace:*",
"@tutorialkit/components-react": "workspace:*",
"@tutorialkit/react": "workspace:*",
"@tutorialkit/runtime": "workspace:*",
"@tutorialkit/theme": "workspace:*",
"@tutorialkit/types": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This **[Astro integration][astro-integration]** adds [TutorialKit](https://tutorialkit.dev/) to your project so that you can use TutorialKit's tutorial format for your astro content.

This integration adds routes to serve your tutorial. It uses `@tutorialkit/components-react` for the dynamic part of the experience.
This integration adds routes to serve your tutorial. It uses `@tutorialkit/react` for the dynamic part of the experience.

## License

Expand Down
2 changes: 1 addition & 1 deletion packages/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@expressive-code/plugin-line-numbers": "^0.35.3",
"@nanostores/react": "0.7.2",
"@stackblitz/sdk": "^1.11.0",
"@tutorialkit/components-react": "workspace:*",
"@tutorialkit/react": "workspace:*",
"@tutorialkit/runtime": "workspace:*",
"@tutorialkit/theme": "workspace:*",
"@tutorialkit/types": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/default/components/LoginButton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useStore } from '@nanostores/react';
import { classNames } from '@tutorialkit/components-react';
import { classNames } from '@tutorialkit/react';
import { useEffect, useRef, useState } from 'react';
import { authStore } from '../stores/auth-store';
import { login, logout } from './webcontainer';
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/default/components/NavWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Nav } from '@tutorialkit/components-react';
import { Nav } from '@tutorialkit/react';
import type { Lesson, NavList } from '@tutorialkit/types';

interface Props {
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/default/components/ResizablePanel.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import { classNames } from '@tutorialkit/components-react';
import { classNames } from '@tutorialkit/react';

export type Type = 'horizontal' | 'vertical';
export type Priority = 'min' | 'max';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect } from 'react';
import { useStore } from '@nanostores/react';
import { WorkspacePanel } from '@tutorialkit/components-react';
import { WorkspacePanel } from '@tutorialkit/react';
import type { Lesson } from '@tutorialkit/types';
import { themeStore } from '../stores/theme-store.js';
import { tutorialStore } from './webcontainer.js';
Expand Down
4 changes: 2 additions & 2 deletions packages/astro/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ export default function createPlugin({
vite: {
optimizeDeps: {
entries: ['!**/src/(content|templates)/**'],
include: process.env.TUTORIALKIT_DEV ? [] : ['@tutorialkit/components-react'],
include: process.env.TUTORIALKIT_DEV ? [] : ['@tutorialkit/react'],
},
define: {
__ENTERPRISE__: `${!!enterprise}`,
__WC_CONFIG__: enterprise ? JSON.stringify(enterprise) : 'undefined',
},
ssr: {
noExternal: ['@tutorialkit/astro', '@tutorialkit/components-react'],
noExternal: ['@tutorialkit/astro', '@tutorialkit/react'],
},
plugins: [
userlandCSS,
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"references": [
{ "path": "../runtime/tsconfig.build.json" },
{ "path": "../types/tsconfig.build.json" },
{ "path": "../components/react/tsconfig.build.json" },
{ "path": "../react/tsconfig.build.json" },
{ "path": "../theme" }
]
}
2 changes: 1 addition & 1 deletion packages/cli/tests/create-tutorial.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ async function runPnpmInstall(dest: string, baseDir: string) {
overrides: {
'@astrojs/language-server': '2.14.1',
'@tutorialkit/astro': `file:${baseDir}/packages/astro`,
'@tutorialkit/components-react': `file:${baseDir}/packages/components/react`,
'@tutorialkit/react': `file:${baseDir}/packages/react`,
'@tutorialkit/runtime': `file:${baseDir}/packages/runtime`,
'@tutorialkit/theme': `file:${baseDir}/packages/theme`,
'@tutorialkit/types': `file:${baseDir}/packages/types`,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tutorialkit/components-react",
"name": "@tutorialkit/react",
"version": "0.1.6",
"description": "TutorialKit's React components",
"description": "TutorialKit's React components and utilities",
"author": "StackBlitz Inc.",
"type": "module",
"bugs": "https://github.com/stackblitz/tutorialkit/issues",
Expand All @@ -10,7 +10,7 @@
"repository": {
"type": "git",
"url": "git+https://github.com/stackblitz/tutorialkit.git",
"directory": "packages/components/react"
"directory": "packages/react"
},
"types": "./dist/index.d.ts",
"exports": {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"include": ["src"],
"exclude": ["src/**/*.spec.ts"],
"references": [
{ "path": "../../runtime/tsconfig.build.json" },
{ "path": "../../theme" },
{ "path": "../../types/tsconfig.build.json" }
{ "path": "../runtime/tsconfig.build.json" },
{ "path": "../theme" },
{ "path": "../types/tsconfig.build.json" }
]
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../tsconfig.json",
"extends": "../../tsconfig.json",
"compilerOptions": {
"jsx": "react-jsx",
"baseUrl": "./",
Expand All @@ -10,8 +10,8 @@
},
"include": ["src"],
"references": [
{ "path": "../../runtime/tsconfig.build.json" },
{ "path": "../../theme" },
{ "path": "../../types/tsconfig.build.json" }
{ "path": "../runtime/tsconfig.build.json" },
{ "path": "../theme" },
{ "path": "../types/tsconfig.build.json" }
]
}
2 changes: 1 addition & 1 deletion packages/template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"start": "astro dev"
},
"dependencies": {
"@tutorialkit/components-react": "workspace:*",
"@tutorialkit/react": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/theme/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function defineConfig(config: UserConfig) {
transformers: [transformerDirectives()],
content: {
inline: getInlineContentForPackage({
name: '@tutorialkit/components-react',
name: '@tutorialkit/react',
pattern: '/dist/**/*.js',
root: process.cwd(),
}),
Expand Down
Loading