diff --git a/package-lock.json b/package-lock.json index da671b2e9..983d06034 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "13.0.0-1", "license": "MIT", "dependencies": { - "@floating-ui/core": "^1.5.2", + "@floating-ui/dom": "^1.5.2", "@marko-tags/subscribe": "^0.5.1", "makeup-active-descendant": "0.6.1", "makeup-expander": "~0.10.1", @@ -3377,7 +3377,6 @@ "version": "1.5.3", "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.5.3.tgz", "integrity": "sha512-ClAbQnEqJAKCJOEbbLo5IUlZHkNszqhuxS4fHAVxRPXPya6Ysf2G8KypnYcOTpx6I8xcgF9bbHb6g/2KpbV8qA==", - "dev": true, "dependencies": { "@floating-ui/core": "^1.4.2", "@floating-ui/utils": "^0.1.3" diff --git a/package.json b/package.json index a6f33f1ef..40561355e 100644 --- a/package.json +++ b/package.json @@ -142,7 +142,7 @@ }, "dependencies": { "@marko-tags/subscribe": "^0.5.1", - "@floating-ui/core": "^1.5.2", + "@floating-ui/dom": "^1.5.2", "makeup-active-descendant": "0.6.1", "makeup-expander": "~0.10.1", "makeup-floating-label": "~0.3.2", diff --git a/scripts/generate-cdn.js b/scripts/generate-cdn.js index 80133a381..f7a5a9396 100644 --- a/scripts/generate-cdn.js +++ b/scripts/generate-cdn.js @@ -5,12 +5,12 @@ import * as https from "https"; // or 'https' for https:// URLs import { fileURLToPath } from "url"; import * as fs from "fs"; import * as path from "path"; -import rimraf from "rimraf"; +import * as rimraf from "rimraf"; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); const rootDir = path.join(__dirname, ".."); -const versionPath = "src/common/cdn/versions.json"; +const versionPath = "src/common/cdn/versions.ts"; const cdnConfig = { shaka: { @@ -37,9 +37,11 @@ function updateVersionFile(version) { { "//": "This is a generated file. Run generateCDN script file to update", }, - version + version, ); - const newVersion = JSON.stringify(versionObject); + const newVersion = `export const versions = ${JSON.stringify( + versionObject, + )};`; fs.writeFileSync(versionFile, newVersion); } @@ -70,29 +72,29 @@ async function shakaGenerator({ version, cdnVersionPath }) { await download(getShakaCSSUrl(version), cdnVersionPath, "controls.css"); // Remove define execSync( - `sed -i '' -e 's/typeof define=="function"/typeof define=="w"/' ${cdnVersionPath}/shaka-player.ui.js` + `sed -i '' -e 's/typeof define=="function"/typeof define=="w"/' ${cdnVersionPath}/shaka-player.ui.js`, ); } async function threeDPlayerGenerator({ cdnVersionPath }) { await fs.promises.cp( `${rootDir}/node_modules/@google/model-viewer/dist/model-viewer.min.js`, - `${cdnVersionPath}/model-viewer.min.js` + `${cdnVersionPath}/model-viewer.min.js`, ); } async function highchartsGenerator({ cdnVersionPath }) { await fs.promises.cp( `${rootDir}/node_modules/highcharts/highcharts.js`, - `${cdnVersionPath}/highcharts.js` + `${cdnVersionPath}/highcharts.js`, ); await fs.promises.cp( `${rootDir}/node_modules/highcharts/modules/accessibility.js`, - `${cdnVersionPath}/accessibility.js` + `${cdnVersionPath}/accessibility.js`, ); await fs.promises.cp( `${rootDir}/node_modules/highcharts/modules/pattern-fill.js`, - `${cdnVersionPath}/pattern-fill.js` + `${cdnVersionPath}/pattern-fill.js`, ); } diff --git a/scripts/prepublish.js b/scripts/prepublish.js index 2e33b6a82..7aed45e1f 100644 --- a/scripts/prepublish.js +++ b/scripts/prepublish.js @@ -10,7 +10,10 @@ const componentInputDir = path.join(rootDir, "src/components"); // run typescript compiler execSync("mtc"); -execSync("babel --env-name prod dist --out-dir dist --copy-files"); +// Rename all exports.default to module.exports +execSync( + "find dist -type f -name 'component*.js' | xargs sed -i '' 's/exports.default =/module.exports =/g'", +); // create top level browser.json files to map to nested ones fs.readdirSync(componentInputDir) diff --git a/src/common/cdn/index.ts b/src/common/cdn/index.ts index 6bfe1ca8d..b386845c5 100644 --- a/src/common/cdn/index.ts +++ b/src/common/cdn/index.ts @@ -1,5 +1,5 @@ import { loader } from "../loader"; -import versions from "./versions.json"; +import { versions } from "./versions"; const MAX_RETRIES = 3; interface CDNLoaderConfig { diff --git a/src/common/cdn/versions.json b/src/common/cdn/versions.ts similarity index 85% rename from src/common/cdn/versions.json rename to src/common/cdn/versions.ts index 832d7473f..f24e53bf7 100644 --- a/src/common/cdn/versions.json +++ b/src/common/cdn/versions.ts @@ -1,4 +1,4 @@ -{ +export const versions = { "//": "This is a generated file. Run generateCDN script file to update", "shaka": "4.3.2", "highcharts": "10.2.1", diff --git a/src/components/components/ebay-tooltip-overlay/component-browser.ts b/src/components/components/ebay-tooltip-overlay/component-browser.ts index a3117a01f..241cfcd1f 100644 --- a/src/components/components/ebay-tooltip-overlay/component-browser.ts +++ b/src/components/components/ebay-tooltip-overlay/component-browser.ts @@ -1,9 +1,5 @@ import type { AttrClass } from "marko/tags-html"; -export const typeRoles = { - tourtip: "region", - tooltip: "tooltip", - infotip: "tooltip", -} as const; +import {typeRoles} from './constants' interface TooltipOverlayInput { toJSON?: any; diff --git a/src/components/components/ebay-tooltip-overlay/constants.ts b/src/components/components/ebay-tooltip-overlay/constants.ts new file mode 100644 index 000000000..5fb91fa0c --- /dev/null +++ b/src/components/components/ebay-tooltip-overlay/constants.ts @@ -0,0 +1,5 @@ +export const typeRoles = { + tourtip: "region", + tooltip: "tooltip", + infotip: "tooltip", +} as const; diff --git a/src/components/components/ebay-tooltip-overlay/index.marko b/src/components/components/ebay-tooltip-overlay/index.marko index a739735fa..b8c69a2bf 100644 --- a/src/components/components/ebay-tooltip-overlay/index.marko +++ b/src/components/components/ebay-tooltip-overlay/index.marko @@ -1,5 +1,5 @@ import { processHtmlAttributes } from "../../../common/html-attributes"; -import { typeRoles } from "./component-browser"; +import { typeRoles } from "./constants"; static function noop() {} diff --git a/src/components/ebay-button/component-browser.ts b/src/components/ebay-button/component-browser.ts index 443c8ff87..30b7f25e2 100644 --- a/src/components/ebay-button/component-browser.ts +++ b/src/components/ebay-button/component-browser.ts @@ -1,6 +1,5 @@ import * as eventUtils from "../../common/event-utils"; - -export const validSizes = ["large", "small"] as const; +import { validSizes } from "./constants"; export interface ButtonEvent { originalEvent: T; diff --git a/src/components/ebay-button/constants.ts b/src/components/ebay-button/constants.ts new file mode 100644 index 000000000..89a10fc9d --- /dev/null +++ b/src/components/ebay-button/constants.ts @@ -0,0 +1 @@ +export const validSizes = ["large", "small"] as const; diff --git a/src/components/ebay-button/index.marko b/src/components/ebay-button/index.marko index 8bced0f15..3cd220509 100644 --- a/src/components/ebay-button/index.marko +++ b/src/components/ebay-button/index.marko @@ -1,5 +1,5 @@ import { processHtmlAttributes } from "../../common/html-attributes" -import { validSizes } from "./component-browser" +import {validSizes} from "./constants" static function toJSON(this: any) { return { diff --git a/src/components/ebay-carousel/index.marko b/src/components/ebay-carousel/index.marko index 6fbccfab0..1adfc700d 100644 --- a/src/components/ebay-carousel/index.marko +++ b/src/components/ebay-carousel/index.marko @@ -58,7 +58,6 @@ $ var config = data.config; class=item.class style=item.style aria-hidden=!item.fullyVisible && 'true' - no-update-body-if=!!config.preserveItems > <${item.renderBody}/> diff --git a/src/components/ebay-filter-menu-button/index.marko b/src/components/ebay-filter-menu-button/index.marko index 88fe91bb4..668f648cd 100644 --- a/src/components/ebay-filter-menu-button/index.marko +++ b/src/components/ebay-filter-menu-button/index.marko @@ -13,7 +13,7 @@ $ const { formAction, formMethod, items, - type, + type: inputType, ...htmlInput } = input; @@ -40,7 +40,7 @@ $ const { - + <@footer ...footer a11yFooterText=(a11yFooterText || footer.a11yFooterText)> <${footer.renderBody}/> - + diff --git a/src/components/ebay-listbox/index.marko b/src/components/ebay-listbox/index.marko index 830605d51..abfbbf7cb 100644 --- a/src/components/ebay-listbox/index.marko +++ b/src/components/ebay-listbox/index.marko @@ -10,7 +10,7 @@ $ const { ...htmlInput } = input; -$ var selectedOption = (options as Option[])?.[state.selectedIndex]; +$ var selectedOption = (options as Option[])[state.selectedIndex];