From 22298781c5c61e53d461a665617b7ac01618a34d Mon Sep 17 00:00:00 2001 From: Cory LaViska Date: Thu, 8 May 2025 13:58:26 -0400 Subject: [PATCH] Remove alpha flags (#913) * remove alpha flags * revert isPro flag * update scripts --- .github/workflows/client_tests.js.yml | 2 +- .github/workflows/ssr_tests.js.yml | 2 +- docs/.eleventy.js | 16 ---------- docs/_includes/preset-theme-selector.njk | 2 +- docs/_includes/sidebar-link.njk | 2 +- docs/_utils/filters.js | 10 +------ docs/_utils/remove-data-alpha-elements.js | 23 --------------- docs/docs/components/code-demo.md | 1 - docs/docs/components/viewport-demo.md | 1 - docs/docs/experimental/themer.md | 14 ++++----- docs/docs/native/callout.md | 1 - docs/docs/patterns/patterns.json | 1 - package.json | 4 +-- publish-alpha-cdn.sh | 2 +- scripts/build.js | 36 +---------------------- vercel.sh | 4 +-- 16 files changed, 17 insertions(+), 104 deletions(-) delete mode 100644 docs/_utils/remove-data-alpha-elements.js diff --git a/.github/workflows/client_tests.js.yml b/.github/workflows/client_tests.js.yml index 3a69e45df..0ae6f75a2 100644 --- a/.github/workflows/client_tests.js.yml +++ b/.github/workflows/client_tests.js.yml @@ -31,7 +31,7 @@ jobs: - name: Lint run: npm run prettier - name: Build - run: npm run build:alpha + run: npm run build - name: Install Playwright run: npx playwright install --with-deps - name: Run CSR tests diff --git a/.github/workflows/ssr_tests.js.yml b/.github/workflows/ssr_tests.js.yml index a5944d604..85ea40f79 100644 --- a/.github/workflows/ssr_tests.js.yml +++ b/.github/workflows/ssr_tests.js.yml @@ -31,7 +31,7 @@ jobs: run: npm run prettier - name: Build - run: npm run build:alpha + run: npm run build - name: Install Playwright run: npx playwright install --with-deps diff --git a/docs/.eleventy.js b/docs/.eleventy.js index 51f228d24..50d40f039 100644 --- a/docs/.eleventy.js +++ b/docs/.eleventy.js @@ -5,7 +5,6 @@ import { copyCodePlugin } from './_utils/copy-code.js'; import { currentLink } from './_utils/current-link.js'; import { highlightCodePlugin } from './_utils/highlight-code.js'; import { markdown } from './_utils/markdown.js'; -import { removeDataAlphaElements } from './_utils/remove-data-alpha-elements.js'; // import { formatCodePlugin } from './_utils/format-code.js'; // import litPlugin from '@lit-labs/eleventy-plugin-lit'; import { readFile } from 'fs/promises'; @@ -22,12 +21,10 @@ import * as url from 'url'; const __dirname = url.fileURLToPath(new URL('.', import.meta.url)); const packageData = JSON.parse(await readFile(path.join(__dirname, '..', 'package.json'), 'utf-8')); -const isAlpha = process.argv.includes('--alpha'); const isDev = process.argv.includes('--develop'); const globalData = { package: packageData, - isAlpha, layout: 'page.njk', server: { head: '', @@ -51,16 +48,6 @@ export default function (eleventyConfig) { */ const serverBuild = process.env.WEBAWESOME_SERVER === 'true'; - // NOTE - alpha setting removes certain pages - if (isAlpha) { - eleventyConfig.ignores.add('**/experimental/**'); - eleventyConfig.ignores.add('**/layout/**'); - eleventyConfig.ignores.add('**/patterns/**'); - eleventyConfig.ignores.add('**/style-utilities/**'); - eleventyConfig.ignores.add('**/components/code-demo.md'); - eleventyConfig.ignores.add('**/components/viewport-demo.md'); - } - // Add template data for (let name in globalData) { eleventyConfig.addGlobalData(name, globalData[name]); @@ -115,9 +102,6 @@ export default function (eleventyConfig) { // Helpers - // Remove elements that have [data-alpha="remove"] - eleventyConfig.addPlugin(removeDataAlphaElements({ isAlpha })); - // Use our own markdown instance eleventyConfig.setLibrary('md', markdown); diff --git a/docs/_includes/preset-theme-selector.njk b/docs/_includes/preset-theme-selector.njk index 2b57b1389..0a6527d76 100644 --- a/docs/_includes/preset-theme-selector.njk +++ b/docs/_includes/preset-theme-selector.njk @@ -2,7 +2,7 @@ {% for theme in collections.theme | sort %} - + {{ theme.data.title }} {% endfor %} diff --git a/docs/_includes/sidebar-link.njk b/docs/_includes/sidebar-link.njk index d44628b07..a7629c1d6 100644 --- a/docs/_includes/sidebar-link.njk +++ b/docs/_includes/sidebar-link.njk @@ -1,4 +1,4 @@ -{% if page | show -%} +{% if page -%}
  • {{ page.data.title }} {% if page.data.status == 'experimental' %}{% endif %} diff --git a/docs/_utils/filters.js b/docs/_utils/filters.js index 9747a78b3..c943c17a8 100644 --- a/docs/_utils/filters.js +++ b/docs/_utils/filters.js @@ -178,10 +178,6 @@ export function sort(arr, by = { 'data.order': 1, 'data.title': '' }) { }); } -export function show(page) { - return !(page.data.noAlpha && page.data.isAlpha) && !page.data.unlisted; -} - /** * Group an 11ty collection (or any array of objects with a `data.tags` property) by certain tags. * @param {object[]} collection @@ -202,7 +198,7 @@ export function groupPages(collection, options = {}, page) { options = { tags: options }; } - let { tags, groups, titles = {}, other = 'Other', filter = show } = options; + let { tags, groups, titles = {}, other = 'Other' } = options; if (groups === undefined && Array.isArray(tags)) { groups = tags; @@ -241,10 +237,6 @@ export function groupPages(collection, options = {}, page) { let byUrl = {}; let byParentUrl = {}; - if (filter) { - collection = collection.filter(filter); - } - for (let item of collection) { let url = item.page.url; let parentUrl = item.data.parentUrl; diff --git a/docs/_utils/remove-data-alpha-elements.js b/docs/_utils/remove-data-alpha-elements.js deleted file mode 100644 index b93f3d1f5..000000000 --- a/docs/_utils/remove-data-alpha-elements.js +++ /dev/null @@ -1,23 +0,0 @@ -import { parse } from 'node-html-parser'; - -/** - * Eleventy plugin to add remove elements with
    from the alpha build. - */ -export function removeDataAlphaElements(options = {}) { - options = { - isAlpha: false, - ...options, - }; - - return function (eleventyConfig) { - eleventyConfig.addTransform('remove-data-alpha-elements', content => { - const doc = parse(content, { blockTextElements: { code: true } }); - - if (options.isAlpha) { - doc.querySelectorAll('[data-alpha="remove"]').forEach(el => el.remove()); - } - - return doc.toString(); - }); - }; -} diff --git a/docs/docs/components/code-demo.md b/docs/docs/components/code-demo.md index c91851382..f606a0fb9 100644 --- a/docs/docs/components/code-demo.md +++ b/docs/docs/components/code-demo.md @@ -2,7 +2,6 @@ title: Code Demo description: Code demos can be used to render code examples as inline live demos. tags: component -noAlpha: true isPro: true --- diff --git a/docs/docs/components/viewport-demo.md b/docs/docs/components/viewport-demo.md index a6a8c24c5..b4612add6 100644 --- a/docs/docs/components/viewport-demo.md +++ b/docs/docs/components/viewport-demo.md @@ -2,7 +2,6 @@ title: Viewport Demo description: Viewport demos can be used to display an iframe as a resizable, zoomable preview. tags: component -noAlpha: true isPro: true --- diff --git a/docs/docs/experimental/themer.md b/docs/docs/experimental/themer.md index b2f351211..3772181bf 100644 --- a/docs/docs/experimental/themer.md +++ b/docs/docs/experimental/themer.md @@ -501,13 +501,13 @@ hasOutline: false
    Default - Awesome - Premium - Playful - Brutalist - Tailspin - Glossy - Active + Awesome + Premium + Playful + Brutalist + Tailspin + Glossy + Active Classic diff --git a/docs/docs/native/callout.md b/docs/docs/native/callout.md index ae8a5cdbf..4b06b6e3c 100644 --- a/docs/docs/native/callout.md +++ b/docs/docs/native/callout.md @@ -4,7 +4,6 @@ description: Callouts are used to display important messages inline. component: callout icon: callout snippets: '.wa-callout' -noAlpha: true file: styles/native/callout.css --- diff --git a/docs/docs/patterns/patterns.json b/docs/docs/patterns/patterns.json index aa20eb01a..331d39614 100644 --- a/docs/docs/patterns/patterns.json +++ b/docs/docs/patterns/patterns.json @@ -2,6 +2,5 @@ "layout": "patterns.njk", "tags": ["patterns"], "wide": true, - "noAlpha": true, "isPro": true } diff --git a/package.json b/package.json index 070b6af40..50491dbec 100644 --- a/package.json +++ b/package.json @@ -45,11 +45,9 @@ }, "scripts": { "start": "node scripts/build.js --develop", + "start:alpha": "echo 'This command has been deprecated. Use: \"npm start\"\n'", "build": "node scripts/build.js", "build:serve": "npm run build && npx http-server _site -p 4000", - "build:alpha": "node scripts/build.js --alpha", - "build:alpha:serve": "npm run build:alpha && npx http-server _site -p 4000", - "start:alpha": "node scripts/build.js --alpha --develop", "publish-alpha-cdn": "./publish-alpha-cdn.sh", "create": "plop --plopfile scripts/plop/plopfile.js", "test": "CSR_ONLY=\"true\" web-test-runner --group default", diff --git a/publish-alpha-cdn.sh b/publish-alpha-cdn.sh index 51418e656..4bcb24abc 100755 --- a/publish-alpha-cdn.sh +++ b/publish-alpha-cdn.sh @@ -20,7 +20,7 @@ then echo "🚀 OK, blasting off..." # build it - npm run build:alpha + npm run build # copy dist-cdn to the CDN aws --profile early-webawesome-com --endpoint-url https://c0c64e1b38a89d8ae060d40170ceef46.r2.cloudflarestorage.com s3 cp ./dist-cdn s3://early-webawesome-com/webawesome@$version/dist --recursive diff --git a/scripts/build.js b/scripts/build.js index d87c7818b..30ff1ea25 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -17,7 +17,6 @@ import { cdnDir, distDir, docsDir, rootDir, runScript, siteDir } from './utils.j const __dirname = dirname(fileURLToPath(import.meta.url)); const isDeveloping = process.argv.includes('--develop'); -const isAlpha = process.argv.includes('--alpha'); const spinner = ora({ text: 'Web Awesome', color: 'cyan' }).start(); const packageData = JSON.parse(await readFile(join(rootDir, 'package.json'), 'utf-8')); const version = JSON.stringify(packageData.version.toString()); @@ -112,39 +111,7 @@ function generateReactWrappers() { async function generateStyles() { spinner.start('Copying stylesheets'); - // - // NOTE - alpha setting omits certain stylesheets that are pro-only - // - if (isAlpha) { - // Copy all styles - await copy(join(rootDir, 'src/styles'), join(cdnDir, 'styles'), { overwrite: true }); - - // Remove pro themes - const allThemes = await globby(join(cdnDir, 'styles/themes/**/*.css')); - const proThemes = allThemes.filter(file => { - if ( - file.includes('themes/classic') || - file.includes('themes/default') || - file.includes('themes/awesome') || - file.includes('themes/active') || - file.includes('themes/glossy') || - file.includes('themes/matter') || - file.includes('themes/mellow') || - file.includes('themes/playful') || - file.includes('themes/premium') || - file.includes('themes/tailspin') || - file.includes('themes/brutalist') - ) { - return false; - } - return true; - }); - - // Delete pro themes that shouldn't be in alpha - await Promise.all(proThemes.map(file => deleteAsync(file))); - } else { - await copy(join(rootDir, 'src/styles'), join(cdnDir, 'styles'), { overwrite: true }); - } + await copy(join(rootDir, 'src/styles'), join(cdnDir, 'styles'), { overwrite: true }); spinner.succeed(); @@ -277,7 +244,6 @@ async function generateDocs() { spinner.start('Writing the docs'); const args = []; - if (isAlpha) args.push('--alpha'); if (isDeveloping) args.push('--develop'); let output; diff --git a/vercel.sh b/vercel.sh index 6e6dccd19..ef734c290 100644 --- a/vercel.sh +++ b/vercel.sh @@ -1,8 +1,8 @@ #!/bin/bash # if [[ $VERCEL_GIT_COMMIT_REF == "alpha" ]] ; then - echo "Running the alpha build!" - npm run build:alpha + echo "Running the build!" + npm run build # else # npm run build # fi