Skip to content

Commit 20a561a

Browse files
committed
Use single quotes, improve general configuration, improve ci."
1 parent 2745a80 commit 20a561a

File tree

12 files changed

+179
-226
lines changed

12 files changed

+179
-226
lines changed

.eslintignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
node_modules
22
.docusaurus
33
build
4-
public
4+
static

.eslintrc.js

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,47 @@
22
module.exports = {
33
root: true,
44
extends: [
5-
"plugin:@docusaurus/recommended",
6-
"plugin:mdx/recommended",
7-
"plugin:import/recommended",
5+
'plugin:@docusaurus/recommended',
6+
'plugin:mdx/recommended',
7+
'plugin:import/recommended',
88
],
9-
plugins: ["@docusaurus", "mdx", "import"],
9+
plugins: ['@docusaurus', 'mdx', 'import'],
1010
parserOptions: {
1111
ecmaVersion: 2021,
12-
sourceType: "module",
12+
sourceType: 'module',
1313
ecmaFeatures: {
1414
jsx: true,
1515
},
1616
},
1717

1818
settings: {
1919
react: {
20-
version: "detect",
20+
version: 'detect',
2121
},
2222
// Fix for import resolution if you keep getting import errors
23-
"import/resolver": {
23+
'import/resolver': {
2424
node: {
25-
extensions: [".js", ".jsx", ".ts", ".tsx"],
25+
extensions: ['.js', '.jsx', '.ts', '.tsx'],
2626
},
2727
},
2828
},
2929
rules: {
30-
"@docusaurus/no-untranslated-text": "off",
31-
"@docusaurus/string-literal-i18n-messages": "error",
30+
'@docusaurus/no-untranslated-text': 'off',
31+
'@docusaurus/string-literal-i18n-messages': 'error',
3232

3333
// Suggest using Docusaurus headings, but don't error out
34-
"@docusaurus/prefer-docusaurus-heading": "warn",
34+
'@docusaurus/prefer-docusaurus-heading': 'warn',
3535

3636
// Import rules
37-
"import/no-unresolved": [
38-
"error",
39-
{ ignore: ["^@theme", "^@docusaurus", "^@site"] },
37+
'import/no-unresolved': [
38+
'error',
39+
{ ignore: ['^@theme', '^@docusaurus', '^@site'] },
40+
],
41+
'import/no-named-as-default': 'off',
42+
quotes: [
43+
'error',
44+
'single',
45+
{ avoidEscape: true, allowTemplateLiterals: true },
4046
],
41-
"import/no-named-as-default": "off",
4247
},
4348
};

.github/workflows/deploy.yml

Lines changed: 7 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches: [master]
66
pull_request:
7-
types: [ opened, synchronize, reopened, closed ]
7+
types: [opened, synchronize, reopened, closed]
88

99
permissions:
1010
contents: write
@@ -13,62 +13,8 @@ permissions:
1313
pull-requests: write
1414

1515
jobs:
16-
17-
format-check:
18-
name: Prettier Check
19-
runs-on: ubuntu-latest
20-
21-
steps:
22-
- uses: actions/checkout@v4
23-
24-
- uses: actions/setup-node@v4
25-
with:
26-
node-version: 22
27-
28-
- name: Cache npm dependencies
29-
uses: actions/cache@v4
30-
with:
31-
path: ~/.npm
32-
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
33-
restore-keys: |
34-
${{ runner.os }}-node-
35-
36-
- name: Install dependencies
37-
run: npm ci --prefer-offline
38-
39-
- name: Check Formatting (Prettier)
40-
run: npm run format:check
41-
42-
lint-check:
43-
name: ESLint Check
44-
runs-on: ubuntu-latest
45-
46-
steps:
47-
- uses: actions/checkout@v4
48-
49-
- uses: actions/setup-node@v4
50-
with:
51-
node-version: 22
52-
53-
- name: Cache npm dependencies
54-
uses: actions/cache@v4
55-
with:
56-
path: ~/.npm
57-
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
58-
restore-keys: |
59-
${{ runner.os }}-node-
60-
61-
- name: Install dependencies
62-
run: npm ci --prefer-offline
63-
64-
- name: Lint Code (ESLint)
65-
run: npm run lint
66-
67-
68-
6916
build:
7017
name: Build Site
71-
needs: [ format-check, lint-check ]
7218
if: github.event.action != 'closed'
7319
runs-on: ubuntu-latest
7420

@@ -94,6 +40,12 @@ jobs:
9440
- name: Install dependencies
9541
run: npm ci --prefer-offline
9642

43+
- name: Lint Code (ESLint)
44+
run: npm run lint
45+
46+
- name: Check Formatting (Prettier)
47+
run: npm run format
48+
9749
- name: Inject correct baseUrl into docusaurus.config.js
9850
id: inject
9951
run: |
@@ -117,8 +69,6 @@ jobs:
11769
name: docusaurus-build
11870
path: build
11971

120-
121-
12272
deploy:
12373
name: Deploy Preview
12474
needs: build
@@ -161,7 +111,6 @@ jobs:
161111
🚀 **Preview Deployed**
162112
🔗 [View Preview](${{ steps.vars.outputs.url }})
163113
164-
165114
cleanup:
166115
name: Cleanup Preview
167116
if: github.event_name == 'pull_request' && github.event.action == 'closed'

docs/tutorials/treetraversal.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import DocusaurusTreeVisualization from "@site/src/components/TreeTraversal/DocusaurusWrapper";
1+
import DocusaurusTreeVisualization from '@site/src/components/TreeTraversal/DocusaurusWrapper';
22

33
# Traversing a Polyglot Tree with MetaCall
44
import StarRepo from '@site/src/components/StarRepo';

docusaurus.config.js

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -4,44 +4,44 @@
44
// There are various equivalent ways to declare your Docusaurus config.
55
// See: https://docusaurus.io/docs/api/docusaurus-config
66

7-
import { themes as prismThemes } from "prism-react-renderer";
7+
import { themes as prismThemes } from 'prism-react-renderer';
88

99
/** @type {import('@docusaurus/types').Config} */
1010
const config = {
11-
title: "MetaCall Docs",
12-
tagline: "Documentation for MetaCall",
13-
favicon: "img/metacall-logo.png",
11+
title: 'MetaCall Docs',
12+
tagline: 'Documentation for MetaCall',
13+
favicon: 'img/metacall-logo.png',
1414

1515
// Set the production url of your site here
16-
url: "https://github.com",
16+
url: 'https://github.com',
1717
// Set the /<baseUrl>/ pathname under which your site is served
18-
baseUrl: "/doc/",
18+
baseUrl: '/doc/',
1919

2020
// GitHub pages deployment config.
21-
organizationName: "metacall", // your GitHub user/org
22-
projectName: "doc", // repo name
23-
deploymentBranch: "gh-pages",
21+
organizationName: 'metacall', // your GitHub user/org
22+
projectName: 'doc', // repo name
23+
deploymentBranch: 'gh-pages',
2424

25-
onBrokenLinks: "warn",
26-
onBrokenMarkdownLinks: "warn",
25+
onBrokenLinks: 'warn',
26+
onBrokenMarkdownLinks: 'warn',
2727

2828
i18n: {
29-
defaultLocale: "en",
30-
locales: ["en"],
29+
defaultLocale: 'en',
30+
locales: ['en'],
3131
},
3232

3333
presets: [
3434
[
35-
"classic",
35+
'classic',
3636
/** @type {import('@docusaurus/preset-classic').Options} */
3737
({
3838
docs: {
39-
sidebarPath: "./sidebars.js",
40-
tagsBasePath: "tags",
39+
sidebarPath: './sidebars.js',
40+
tagsBasePath: 'tags',
4141
breadcrumbs: true,
4242
},
4343
theme: {
44-
customCss: "./src/css/custom.css",
44+
customCss: './src/css/custom.css',
4545
},
4646
}),
4747
],
@@ -50,86 +50,86 @@ const config = {
5050
themeConfig:
5151
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
5252
({
53-
customCss: "./src/css/custom.css",
54-
image: "img/docusaurus-social-card.jpg",
53+
customCss: './src/css/custom.css',
54+
image: 'img/docusaurus-social-card.jpg',
5555
navbar: {
56-
title: "Metacall Docs",
56+
title: 'Metacall Docs',
5757
logo: {
58-
alt: "My Site Logo",
59-
src: "img/metacall-logo.png",
58+
alt: 'My Site Logo',
59+
src: 'img/metacall-logo.png',
6060
},
6161
items: [
6262
{
63-
type: "docSidebar",
64-
sidebarId: "tutorialSidebar",
65-
position: "left",
66-
label: "Documentation",
63+
type: 'docSidebar',
64+
sidebarId: 'tutorialSidebar',
65+
position: 'left',
66+
label: 'Documentation',
6767
},
6868
// Use "to" for internal Docusaurus routes
6969
{
70-
label: "Install",
71-
to: "/docs/category/installating-metacall-cli",
72-
position: "left",
70+
label: 'Install',
71+
to: '/docs/category/installating-metacall-cli',
72+
position: 'left',
7373
},
7474
{
75-
label: "Tutorials",
76-
to: "/docs/category/tutorials",
77-
position: "left",
75+
label: 'Tutorials',
76+
to: '/docs/category/tutorials',
77+
position: 'left',
7878
},
7979
{
80-
href: "/starred",
81-
label: "⭐ Stars",
82-
position: "right",
80+
href: '/starred',
81+
label: '⭐ Stars',
82+
position: 'right',
8383
},
8484
{
85-
href: "https://github.com/metacall",
86-
label: "GitHub",
87-
position: "right",
85+
href: 'https://github.com/metacall',
86+
label: 'GitHub',
87+
position: 'right',
8888
},
8989
],
9090
},
9191

9292
footer: {
93-
style: "dark",
93+
style: 'dark',
9494
links: [
9595
{
96-
title: "Intro",
96+
title: 'Intro',
9797
items: [
98-
{ label: "Getting Started", to: "/docs/getting-started" },
98+
{ label: 'Getting Started', to: '/docs/getting-started' },
9999
{
100-
label: "Install",
101-
to: "/docs/category/installating-metacall-cli",
100+
label: 'Install',
101+
to: '/docs/category/installating-metacall-cli',
102102
},
103103
],
104104
},
105105
{
106-
title: "Use MetaCall",
106+
title: 'Use MetaCall',
107107
items: [
108-
{ label: "Tutorials", to: "/docs/category/tutorials" },
109-
{ label: "Deployment", to: "/docs/deployment" },
108+
{ label: 'Tutorials', to: '/docs/category/tutorials' },
109+
{ label: 'Deployment', to: '/docs/deployment' },
110110
],
111111
},
112112
{
113-
title: "Community",
113+
title: 'Community',
114114
items: [
115-
{ label: "Discord", href: "https://discord.gg/upwP4mwJWa" },
115+
{ label: 'Discord', href: 'https://discord.gg/upwP4mwJWa' },
116116
{
117-
label: "Telegram",
118-
href: "https://t.me/joinchat/BMSVbBatp0Vi4s5l4VgUgg",
117+
label: 'Telegram',
118+
href: 'https://t.me/joinchat/BMSVbBatp0Vi4s5l4VgUgg',
119119
},
120120
{
121-
label: "Matrix",
122-
href: "https://matrix.to/#/#metacall:matrix.org",
121+
label: 'Matrix',
122+
href: 'https://matrix.to/#/#metacall:matrix.org',
123123
},
124124
],
125125
},
126126
{
127-
title: "More",
127+
title: 'More',
128128
items: [
129-
{ label: "GitHub", href: "https://github.com/metacall/" },
129+
{ label: 'GitHub', href: 'https://github.com/metacall/' },
130130
{
131-
label: "Changelog",
132-
href: "https://github.com/metacall/core/releases",
131+
label: 'Changelog',
132+
href: 'https://github.com/metacall/core/releases',
133133
},
134134
],
135135
},

package.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
2-
"name": "metacall-tutorial",
3-
"version": "0.0.0",
4-
"private": true,
2+
"name": "metacall-doc",
3+
"version": "0.0.1",
54
"scripts": {
65
"docusaurus": "docusaurus",
76
"dev": "docusaurus dev",
@@ -15,8 +14,8 @@
1514
"write-heading-ids": "docusaurus write-heading-ids",
1615
"lint": "eslint . --ext .js,.jsx,.ts,.tsx,.mdx",
1716
"lint:fix": "eslint . --ext .js,.jsx,.ts,.tsx,.mdx --fix",
18-
"format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,json,md,mdx}\"",
19-
"format:check": "prettier --check \"src/**/*.{js,jsx,ts,tsx,json,md,mdx}\"",
17+
"format": "prettier --check \"src/**/*.{js,jsx,ts,tsx,json,md,mdx}\"",
18+
"format:fix": "prettier --write \"src/**/*.{js,jsx,ts,tsx,json,md,mdx}\"",
2019
"prepare": "husky"
2120
},
2221
"dependencies": {
@@ -70,6 +69,6 @@
7069
]
7170
},
7271
"engines": {
73-
"node": ">=18.0"
72+
"node": ">=20.0"
7473
}
75-
}
74+
}

0 commit comments

Comments
 (0)