Skip to content

Commit 4104ee9

Browse files
committed
refactor: extracted from monorepo
0 parents  commit 4104ee9

Some content is hidden

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

50 files changed

+3511
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Deploy @es-js/docs-components Documentation
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
# Allows you to run this workflow manually from the Actions tab
8+
workflow_dispatch:
9+
10+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
17+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
18+
concurrency:
19+
group: pages
20+
cancel-in-progress: false
21+
22+
jobs:
23+
build:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 0
29+
30+
- uses: actions/setup-node@v3
31+
with:
32+
registry-url: https://registry.npmjs.org/
33+
node-version: 18
34+
35+
- uses: pnpm/action-setup@v2
36+
name: Install pnpm
37+
id: pnpm-install
38+
with:
39+
version: 8
40+
run_install: false
41+
42+
- name: Install dependencies
43+
run: pnpm install
44+
45+
- name: Build
46+
run: pnpm run docs:build
47+
48+
- name: Set CNAME
49+
shell: bash
50+
run: |
51+
echo "docs-components.esjs.dev" > docs/.vitepress/dist/CNAME
52+
53+
- name: Upload artifact
54+
uses: actions/upload-pages-artifact@v2
55+
with:
56+
path: docs/.vitepress/dist
57+
58+
deploy:
59+
environment:
60+
name: github-pages
61+
url: ${{ steps.deployment.outputs.page_url }}
62+
needs: build
63+
runs-on: ubuntu-latest
64+
name: Deploy
65+
steps:
66+
- name: Deploy to GitHub Pages
67+
id: deployment
68+
uses: actions/deploy-pages@v2

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules
2+
.DS_Store
3+
dist
4+
dist-ssr
5+
*.local
6+
docs/.vitepress/cache
7+
types
8+
.idea

docs/.vitepress/config.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { resolve } from 'path'
2+
3+
export default {
4+
title: 'EsJS Docs Components',
5+
description: 'Componentes para interactuar con Editor EsJS y Ejecutar EsJS',
6+
themeConfig: {
7+
repo: 'https://github.com/es-js/docs-components',
8+
outline: [1, 3],
9+
sidebar: [
10+
{
11+
text: '@es-js/docs-components',
12+
items: [
13+
{ text: 'Introduction', link: '/' },
14+
{ text: 'Getting Started', link: '/guide/' },
15+
],
16+
},
17+
{
18+
text: 'Componentes',
19+
items: [
20+
{ text: 'EsEditor', link: '/components/es-editor' },
21+
{ text: 'EsEjecutar', link: '/components/es-ejecutar' },
22+
],
23+
},
24+
],
25+
},
26+
vite: {
27+
resolve: {
28+
alias: {
29+
'@es-js/docs-components': resolve(__dirname, '../../src'),
30+
},
31+
dedupe: ['vue'], // avoid error when using dependencies that also use Vue
32+
},
33+
},
34+
}

docs/.vitepress/theme/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import DefaultTheme from 'vitepress/theme'
2+
import DocsComponents from '@es-js/docs-components'
3+
4+
export default {
5+
...DefaultTheme,
6+
enhanceApp({ app }) {
7+
app.use(DocsComponents)
8+
},
9+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<EmbedPlayground />
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<EmbedPlayground src="https://editor.esjs.dev/?code=PTAEBEFMDcFdIDbUqWA7AhqAthgLgE4CWAXqAMYD2aoClAzqDQA7HaQENMBf7njAExQIs9DkRRDQAMSIAjahnLkiAOgBQAM3QrqoTfMXKiACjQBKUAG91oUNAwFQY4igC8oANoBddbfuOoFgeAAz%2BLhKqGADmBJDRjiYY5n52Dk5yoB4AjOHikFGx8YlyKf7pFNR4GAKUTh4ATP7%2B2BJohBiMJlTtNXWgADxMljZ2aYHkWUGgANSgcv52EQUxcQkE3Slj0x4L25ke5IuVvbUEMzP%2BAL6poHF4dZhOy%2Bo36gAqHK2YCKqQ9ORiHIiBt-AByAAyXGyIVArCIfC4aF4HC4UhEoAAyvlQFJZApMMZnNQAFxggA0oFU1IMBKUKhMMJSZR69EoIj%2BAKBIJM4KhjBhcLYqMYyMRgmEWGxrlxKHxRhUxLQZMp1NUtIVpiZ6jKQA&tests=A4JwrgpgRghgzgCgN4CgAEaDkBGADG0ASwFsIQB7ONAOwC-SK5MAuNAMzGoGNDzq0EASjSoMGGG0IhiMEAEkA5mBgAbCInRiMAbVwAaNNgNG0AJgMBmAwFYDADmNWzJiwBYAuns1bJUPjC4eBDxBbzRQjABfFEjQoA&layout=horizontal&hidePreview=true&hideEditor=false&hideConsole=false&hideTests=false&readonlyCode=false&readonlyTests=false&preview=%7B%22terminal%22%3Atrue%7D&previewTab=%7B%22console%22%3Atrue%2C%22flowchart%22%3Afalse%2C%22hidden%22%3Atrue%7D&language=esjs&hideOptions=false" show-open-button />
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<EsEditor>
2+
3+
```esjs
4+
consola.escribir("Hola mundo desde EsJS!")
5+
```
6+
7+
</EsEditor>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<EsEditor hide-console="true" hide-preview="false">
2+
3+
```esjs
4+
importar { Terminal } from '@es-js/terminal'
5+
6+
Terminal.escribir('test')
7+
```
8+
9+
</EsEditor>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<EsEditor hide-open-button="true">
2+
3+
</EsEditor>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<EsEditor hide-slot="true">
2+
3+
```esjs
4+
importar { Terminal } from '@es-js/terminal'
5+
6+
Terminal.escribir('test')
7+
```
8+
9+
</EsEditor>

0 commit comments

Comments
 (0)