Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v13.0.0 #2040

Merged
merged 16 commits into from
Dec 28, 2023
Merged

v13.0.0 #2040

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
6 changes: 6 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
"safari": "11"
}
}
],
[
"@babel/preset-typescript",
{
"allowDeclareFields": true
}
]
],
"env": {
Expand Down
8 changes: 4 additions & 4 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"include": ["src/**/*.js"],
"include": ["src/**/*.js", "src/**/*.ts"],
"exclude": [
"**/test",
"**/mock",
"demo",
"**/*.marko.js",
"**/*.stories.js",
"**/style.js",
"**/*.marko.*",
"**/*.stories.*",
"**/style",
"src/common/test-utils",
"src/components/ebay-icon/icons",
"src/components/ebay-star-rating/icons"
Expand Down
43 changes: 0 additions & 43 deletions .storybook/main.js

This file was deleted.

43 changes: 43 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import fsp from "node:fs/promises";

import { mergeConfig } from "vite";

// This is done because lasso does not work with readme.md?raw
// Lasso is being used to run our browser tests with @marko/test
// If we get rid of lasso we should remove this code and switch all readmes to use ?raw
const markdownMatch = /\.md$/;
const rawMarkdown = {
name: "markdown-loader",
async load(id: string) {
if (markdownMatch.test(id)) {
// raw query, read file and return as string
return `export default ${JSON.stringify(
await fsp.readFile(id, "utf-8"),
)}`;
}
},
};

export default {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
framework: "@storybook/marko-vite",
addons: [
{
name: "@storybook/addon-docs",
options: {
transcludeMarkdown: true,
},
},
"@storybook/addon-essentials",
"@storybook/addon-a11y",
],
docs: {
autodocs: true,
defaultName: "Documentation",
},
async viteFinal(config: any) {
return mergeConfig(config, {
plugins: [rawMarkdown],
});
},
};
File renamed without changes.
File renamed without changes.
76 changes: 0 additions & 76 deletions .storybook/storybook-code-source/index.js

This file was deleted.

80 changes: 80 additions & 0 deletions .storybook/storybook-code-source/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
function tagToString(
tagName: string,
args: any,
plurarls: Record<string, string> = {},
indent = "",
fromAttribute = false
) {
const nextIndex = indent + "\t";
const { body, attrs } = argsToString(args, plurarls, nextIndex);
let formattedTagName = tagName;
if (fromAttribute) {
formattedTagName = `@${plurarls[formattedTagName] || formattedTagName}`;
}
return `<${
formattedTagName +
attrs +
(body
? `>\n${body.replace(
/^|\n/gm,
`$&${nextIndex}`
)}\n</${formattedTagName}>`
: `/>`)
}`;
}

function argsToString(
args: any,
plurarls: Record<string, string>,
indent: string
) {
let attrs = "";
let body = "";
for (const key in args) {
if (
Object.prototype.hasOwnProperty.call(args, key) &&
key !== "renderBody"
) {
const val = args[key];
const dashCaseKey = key.replace(
/([a-z])([A-Z])/g,
(m, m1, m2) => `${m1}-${m2.toLowerCase()}`
);
if (Array.isArray(val)) {
for (const item of val) {
body += tagToString(
dashCaseKey,
item,
plurarls,
indent,
true
);
}
} else if (val && typeof val === "object") {
if (key === "spread") {
Object.keys(val).forEach((spreadKey) => {
attrs += ` ${spreadKey}=${JSON.stringify(
val[spreadKey]
)}`;
});
} else
body += tagToString(
dashCaseKey,
val,
plurarls,
indent,
true
);
} else {
attrs += ` ${dashCaseKey}=${JSON.stringify(val)}`;
}
}
}
if (args.renderBody) {
body += args.renderBody;
}

return { attrs, body };
}

export { tagToString };
18 changes: 0 additions & 18 deletions .storybook/theme.js

This file was deleted.

17 changes: 17 additions & 0 deletions .storybook/theme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { create } from "@storybook/theming";

export default create({
base: "light",

// Typography
fontBase: '"Market Sans", Arial',
colorSecondary: "#97BB59",
appBg: "#F8FBF8",

// Brand assets
brandTitle: "eBayUI Core",
brandUrl: "/",
brandImage:
"https://upload.wikimedia.org/wikipedia/commons/thumb/1/1b/EBay_logo.svg/1280px-EBay_logo.svg.png",
brandTarget: "/",
});
42 changes: 0 additions & 42 deletions .storybook/utils.js

This file was deleted.

Loading
Loading