mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
update docs to Svelte 5
This commit is contained in:
parent
128da10475
commit
c5f28033c2
4 changed files with 599 additions and 283 deletions
859
docs/package-lock.json
generated
859
docs/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -11,7 +11,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@sveltech/routify": "^1.9.10",
|
||||
"@sveltejs/vite-plugin-svelte": "^3.1.2",
|
||||
"@sveltejs/vite-plugin-svelte": "^4.0.0",
|
||||
"carbon-components-svelte": "file:..",
|
||||
"carbon-icons-svelte": "^12.13.0",
|
||||
"clipboard-copy": "^4.0.1",
|
||||
|
@ -19,12 +19,13 @@
|
|||
"mdsvex": "^0.12.3",
|
||||
"minisearch": "^7.1.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "^2.8.8",
|
||||
"prettier-plugin-svelte": "^2.10.1",
|
||||
"prettier": "^3.3.3",
|
||||
"@prettier/sync": "0.5.2",
|
||||
"prettier-plugin-svelte": "^3.2.7",
|
||||
"prism-svelte": "^0.5.0",
|
||||
"prismjs": "^1.29.0",
|
||||
"remark-slug": "^6.1.0",
|
||||
"svelte": "^4.2.19",
|
||||
"svelte": "^5.1.13",
|
||||
"vite": "^5.4.9"
|
||||
},
|
||||
"routify": {
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import App from "./App.svelte";
|
||||
import { mount } from "svelte";
|
||||
import "../../css/all.css";
|
||||
import "./global.css";
|
||||
|
||||
const app = new App({ target: document.body });
|
||||
const app = mount(App, { target: document.body });
|
||||
|
||||
export default app;
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
import path from "node:path";
|
||||
import { mdsvex } from "mdsvex";
|
||||
import { parse, walk } from "svelte/compiler";
|
||||
import { parse } from "svelte/compiler";
|
||||
import { walk } from 'estree-walker'
|
||||
import slug from "remark-slug";
|
||||
import visit from "unist-util-visit";
|
||||
import { format } from "prettier";
|
||||
import synchronizedPrettier from "@prettier/sync";
|
||||
import pkg from "../package.json" assert { type: "json" };
|
||||
import component_api from "./src/COMPONENT_API.json" assert { type: "json" };
|
||||
import fs from "node:fs";
|
||||
|
@ -81,8 +82,9 @@ function plugin() {
|
|||
!node.value.match(/svx-ignore/g)
|
||||
) {
|
||||
const scriptBlock = createImports(node.value);
|
||||
const formattedCode = format(scriptBlock + node.value, {
|
||||
const formattedCode = synchronizedPrettier.format(scriptBlock + node.value, {
|
||||
parser: "svelte",
|
||||
plugins: ["prettier-plugin-svelte"],
|
||||
svelteSortOrder: "scripts-markup-styles-options",
|
||||
});
|
||||
const highlightedCode = Prism.highlight(
|
||||
|
@ -113,8 +115,9 @@ function plugin() {
|
|||
path.join("src/pages", `${src}.svelte`),
|
||||
"utf-8",
|
||||
);
|
||||
const formattedCode = format(sourceCode, {
|
||||
const formattedCode = synchronizedPrettier.format(sourceCode, {
|
||||
parser: "svelte",
|
||||
plugins: ["prettier-plugin-svelte"],
|
||||
});
|
||||
const highlightedCode = Prism.highlight(
|
||||
formattedCode,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue