Updates the online tutorial experience - Adds a landing page at [/tutorials](https://nx-dev-git-docs-tutorial-landing-page-nrwl.vercel.app/tutorials) - Terminal code blocks get a "run in terminal" button - Code blocks get an "Apply file changes" button - The apply file changes button currently only works for code blocks that are showing the new file results (not showing the old file with lines marked for deletion). There is nothing technical blocking this, just time. - Previous and next buttons do not go between tutorials - The preview panel can be completely minimized - Git is stubbed out
57 lines
1.5 KiB
TypeScript
57 lines
1.5 KiB
TypeScript
import tutorialkit from '@tutorialkit/astro';
|
|
import { defineConfig, envField } from 'astro/config';
|
|
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
|
|
import { runInTerminalPlugin } from './src/code-block-button/run-in-terminal-plugin';
|
|
import { applyFileChangesPlugin } from './src/code-block-button/apply-file-changes-plugin';
|
|
|
|
export const config = defineConfig({
|
|
base: '/tutorials',
|
|
devToolbar: {
|
|
enabled: false,
|
|
},
|
|
experimental: {
|
|
env: {
|
|
schema: {
|
|
NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA: envField.string({
|
|
context: 'client',
|
|
access: 'public',
|
|
optional: true,
|
|
}),
|
|
NEXT_PUBLIC_FARO_URL: envField.string({
|
|
context: 'client',
|
|
access: 'public',
|
|
optional: true,
|
|
}),
|
|
NEXT_PUBLIC_VERCEL_ENV: envField.string({
|
|
context: 'client',
|
|
access: 'public',
|
|
optional: true,
|
|
}),
|
|
},
|
|
},
|
|
},
|
|
vite: {
|
|
plugins: [nxViteTsPaths() as any],
|
|
ssr: {
|
|
noExternal: [
|
|
'@tutorialkit/astro',
|
|
'@astrojs/mdx',
|
|
'@astrojs/react',
|
|
'astro-expressive-code',
|
|
],
|
|
},
|
|
},
|
|
integrations: [
|
|
tutorialkit({
|
|
components: {
|
|
HeadTags: './src/components/HeadTags.astro',
|
|
TopBar: './src/components/TopBar.astro',
|
|
},
|
|
defaultRoutes: 'tutorial-only',
|
|
expressiveCodePlugins: [runInTerminalPlugin(), applyFileChangesPlugin()],
|
|
}),
|
|
],
|
|
});
|
|
|
|
export default config;
|