diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 24f8c11d..a05a514c 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -3,8 +3,7 @@ name: Bug Report about: Create a bug report to help us fix a demonstrable problem with code in the library. title: '' labels: bug -assignees: claviska - +assignees: --- ### Describe the bug diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 1f020ff7..fe22e324 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -3,8 +3,6 @@ name: Feature Request about: Suggest an idea for this project. title: '' labels: feature -assignees: claviska - --- ### What issue are you having? diff --git a/cspell.json b/cspell.json index 087ede4e..1ae87336 100644 --- a/cspell.json +++ b/cspell.json @@ -51,6 +51,7 @@ "erroneou", "errormessage", "esbuild", + "exportmaps", "exportparts", "fieldsets", "formaction", @@ -152,6 +153,7 @@ "tinycolor", "transitionend", "treeitem", + "treeshaking", "Triaging", "turbolinks", "typeof", diff --git a/custom-elements-manifest.config.js b/custom-elements-manifest.config.js index 7a41f759..7fdf455d 100644 --- a/custom-elements-manifest.config.js +++ b/custom-elements-manifest.config.js @@ -1,9 +1,9 @@ -import { generateCustomData } from 'cem-plugin-vs-code-custom-data-generator'; +import * as path from 'path'; +import { customElementVsCodePlugin } from "custom-element-vs-code-integration"; import { parse } from 'comment-parser'; import { pascalCase } from 'pascal-case'; import commandLineArgs from 'command-line-args'; import fs from 'fs'; -import * as path from 'path'; const packageData = JSON.parse(fs.readFileSync('./package.json', 'utf8')); const { name, description, version, author, homepage, license } = packageData; @@ -53,8 +53,10 @@ export default { return; } - const tagName = 'sl-' + path.basename(importPath, '.component.ts'); + const tagNameWithoutPrefix = path.basename(importPath, '.component.ts'); + const tagName = 'sl-' + tagNameWithoutPrefix; + classDoc.tagNameWithoutPrefix = tagNameWithoutPrefix; classDoc.tagName = tagName; // This used to be set to true by @customElement @@ -167,7 +169,7 @@ export default { // const terms = [ { from: /^src\//, to: '' }, // Strip the src/ prefix - { from: /\.(t|j)sx?$/, to: '.js' } // Convert .ts to .js + { from: /\.component.(t|j)sx?$/, to: '.js' } // Convert .ts to .js ]; mod.path = replace(mod.path, terms); @@ -189,9 +191,13 @@ export default { } }, // Generate custom VS Code data - generateCustomData({ + customElementVsCodePlugin({ outdir, - cssFileName: null + cssFileName: null, + referencesTemplate: (_, tag) => [{ + name: "Documentation", + url: `https://shoelace.style/components/${tag.replace('sl-', '')}` + }] }) ] }; diff --git a/docs/_includes/component.njk b/docs/_includes/component.njk index 7160d6a7..f340c93f 100644 --- a/docs/_includes/component.njk +++ b/docs/_includes/component.njk @@ -84,7 +84,7 @@
To import this component as a React component:
-import { {{ component.name }} } from '@shoelace-style/shoelace/{{ meta.npmdir }}/react';
+ import {{ component.name }} from '@shoelace-style/shoelace/{{ meta.npmdir }}/react/{{ component.tagNameWithoutPrefix }}';
diff --git a/docs/assets/scripts/code-previews.js b/docs/assets/scripts/code-previews.js
index 135580c6..8963f564 100644
--- a/docs/assets/scripts/code-previews.js
+++ b/docs/assets/scripts/code-previews.js
@@ -1,9 +1,9 @@
(() => {
function convertModuleLinks(html) {
html = html
- .replace(/@shoelace-style\/shoelace/g, `https://cdn.skypack.dev/@shoelace-style/shoelace@${shoelaceVersion}`)
- .replace(/from 'react'/g, `from 'https://cdn.skypack.dev/react@${reactVersion}'`)
- .replace(/from "react"/g, `from "https://cdn.skypack.dev/react@${reactVersion}"`);
+ .replace(/@shoelace-style\/shoelace/g, `https://esm.sh/@shoelace-style/shoelace@${shoelaceVersion}`)
+ .replace(/from 'react'/g, `from 'https://esm.sh/react@${reactVersion}'`)
+ .replace(/from "react"/g, `from "https://esm.sh/react@${reactVersion}"`);
return html;
}
@@ -191,12 +191,12 @@
if (isReact) {
htmlTemplate = '';
jsTemplate =
- `import React from 'https://cdn.skypack.dev/react@${reactVersion}';\n` +
- `import ReactDOM from 'https://cdn.skypack.dev/react-dom@${reactVersion}';\n` +
- `import { setBasePath } from 'https://cdn.skypack.dev/@shoelace-style/shoelace@${shoelaceVersion}/${cdndir}/utilities/base-path';\n` +
+ `import React from 'https://esm.sh/react@${reactVersion}';\n` +
+ `import ReactDOM from 'https://esm.sh/react-dom@${reactVersion}';\n` +
+ `import { setBasePath } from 'https://esm.sh/@shoelace-style/shoelace@${shoelaceVersion}/${cdndir}/utilities/base-path';\n` +
`\n` +
`// Set the base path for Shoelace assets\n` +
- `setBasePath('https://cdn.skypack.dev/@shoelace-style/shoelace@${shoelaceVersion}/${npmdir}/')\n` +
+ `setBasePath('https://esm.sh/@shoelace-style/shoelace@${shoelaceVersion}/${npmdir}/')\n` +
`\n${convertModuleLinks(reactExample)}\n` +
`\n` +
`ReactDOM.render(