mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
chore(docs): upgrade deps
Modernize the docs set-up to use Vite 5 so that the exports map works.
This commit is contained in:
parent
64b39be524
commit
42519690b7
4 changed files with 442 additions and 252 deletions
|
@ -1,14 +1,14 @@
|
|||
const path = require("path");
|
||||
const { mdsvex } = require("mdsvex");
|
||||
const { parse, walk } = require("svelte/compiler");
|
||||
const slug = require("remark-slug");
|
||||
const visit = require("unist-util-visit");
|
||||
const { format } = require("prettier");
|
||||
const pkg = require("../package.json");
|
||||
const component_api = require("./src/COMPONENT_API.json");
|
||||
const fs = require("fs");
|
||||
const Prism = require("prismjs");
|
||||
require("prism-svelte");
|
||||
import path from "path";
|
||||
import { mdsvex } from "mdsvex";
|
||||
import { parse, walk } from "svelte/compiler";
|
||||
import slug from "remark-slug";
|
||||
import visit from "unist-util-visit";
|
||||
import { format } from "prettier";
|
||||
import pkg from "../package.json" assert { type: "json" };
|
||||
import component_api from "./src/COMPONENT_API.json" assert { type: "json" };
|
||||
import fs from "fs";
|
||||
import Prism from "prismjs";
|
||||
import "prism-svelte";
|
||||
|
||||
const component_api_by_name = component_api.components.reduce((a, c) => {
|
||||
return {
|
||||
|
@ -110,7 +110,7 @@ function plugin() {
|
|||
});
|
||||
|
||||
const sourceCode = fs.readFileSync(
|
||||
path.join(__dirname, "src/pages", `${src}.svelte`),
|
||||
path.join("src/pages", `${src}.svelte`),
|
||||
"utf-8"
|
||||
);
|
||||
const formattedCode = format(sourceCode, {
|
||||
|
@ -139,7 +139,7 @@ function carbonify() {
|
|||
};
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
extensions: [".svelte", ".svx"],
|
||||
preprocess: [
|
||||
{
|
||||
|
@ -158,7 +158,7 @@ module.exports = {
|
|||
smartypants: false,
|
||||
remarkPlugins: [plugin, slug, carbonify],
|
||||
layout: {
|
||||
_: path.join(__dirname, "src/layouts/ComponentLayout.svelte"),
|
||||
_: path.join("src/layouts/ComponentLayout.svelte"),
|
||||
},
|
||||
}),
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue