Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

chore: remove environment-specific metadata (#6881)

Cindy Zhang9cc70a9d4b82
diff --git a/.changeset/public-package-identifiers.md b/.changeset/public-package-identifiers.md
deleted file mode 100644
index e51a166f88..0000000000
--- a/.changeset/public-package-identifiers.md
+++ /dev/null
@@ -1,7 +0,0 @@
----
-'@astryxdesign/core': patch
----
-
-[fix] Replace an environment-specific example token in published Markdown audit source with a neutral fixed-width token.
-
-@cixzhang
diff --git a/.github/scripts/release-publish-workflow.test.mjs b/.github/scripts/release-publish-workflow.test.mjs
index 2f828ade87..9626f95ad5 100644
--- a/.github/scripts/release-publish-workflow.test.mjs
+++ b/.github/scripts/release-publish-workflow.test.mjs
@@ -71,9 +71,6 @@ describe('stable and canary publication authority', () => {
/^actions\/checkout@/u,
);
expect(step(stable, 'Build all packages').run).toBe('pnpm build');
- expect(step(stable, 'Verify published package contents').run).toBe(
- 'pnpm check:public-package-identifiers',
- );
expect(
stable.steps.some(candidate =>
/download-artifact/u.test(candidate.uses ?? ''),
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index fffdad5c7f..e72cb874d0 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -150,9 +150,6 @@ jobs:
- name: Build all packages
run: pnpm build
- - name: Verify published package contents
- run: pnpm check:public-package-identifiers
-
- name: Publish changed packages
env:
DRY_RUN: ${{ inputs.dry-run }}
diff --git a/apps/storybook/stories/Markdown.stories.tsx b/apps/storybook/stories/Markdown.stories.tsx
index d4d5ea04c1..7bb6f79871 100644
--- a/apps/storybook/stories/Markdown.stories.tsx
+++ b/apps/storybook/stories/Markdown.stories.tsx
@@ -318,8 +318,8 @@ const SHORT_SIX_COLUMN_TABLE = [
const WIDE_TOKEN_TABLE = [
'| Identifier | Endpoint | Status | Accessibility status and remediation owner |',
'|---|---|---|---|',
- '| D116586407 | https://example.com/v2/pipelines/build/runs/1284/logs | `needs_revision_before_landing_v2` | Pass |',
- '| D116586999 | https://example.com/v2/pipelines/docs/runs/97/logs | `ContentNegotiationMiddleware` | Review |',
+ '| [PR #6860](https://github.com/facebook/astryx/pull/6860) | https://example.com/v2/pipelines/build/runs/1284/logs | `needs_revision_before_landing_v2` | Pass |',
+ '| [PR #6852](https://github.com/facebook/astryx/pull/6852) | https://example.com/v2/pipelines/docs/runs/97/logs | `ContentNegotiationMiddleware` | Review |',
].join('\n');
function ReadingColumn({width, children}: {width: string; children: string}) {
diff --git a/package.json b/package.json
index 5bdd54c735..114d97c8b7 100644
--- a/package.json
+++ b/package.json
@@ -13,8 +13,7 @@
"test:a11y-contract": "playwright test --config playwright.config.ts --project chromium",
"test:docsite-browser": "playwright test --config apps/docsite/playwright.config.ts",
"check:package-boundaries": "node scripts/check-package-boundaries.js",
- "check:public-package-identifiers": "vitest run --project node scripts/check-public-package-identifiers.test.mjs && node scripts/check-public-package-identifiers.mjs",
- "check:repo": "pnpm check:visual-owner && pnpm check:sync && pnpm check:knowledge && pnpm check:package-boundaries && pnpm check:changesets && pnpm check:public-package-identifiers && pnpm check:demo-media && pnpm check:executable-bits && pnpm check:cli-structure && pnpm check:use-client && pnpm check:portable-scripts && pnpm check:i18n-runtime && pnpm check:i18n-catalog && pnpm check:cldr-weekdays && pnpm check:fixtures && pnpm check:setup-contract",
+ "check:repo": "pnpm check:visual-owner && pnpm check:sync && pnpm check:knowledge && pnpm check:package-boundaries && pnpm check:changesets && pnpm check:demo-media && pnpm check:executable-bits && pnpm check:cli-structure && pnpm check:use-client && pnpm check:portable-scripts && pnpm check:i18n-runtime && pnpm check:i18n-catalog && pnpm check:cldr-weekdays && pnpm check:fixtures && pnpm check:setup-contract",
"check:visual-owner": "node scripts/check-visual-workflow-owner.mjs",
"check:fixtures": "node internal/vibe-tests/scripts/fixture-suite.mjs verify",
"generate:cldr-weekdays": "node scripts/generate-cldr-weekdays.mjs",
diff --git a/scripts/check-public-package-identifiers.mjs b/scripts/check-public-package-identifiers.mjs
deleted file mode 100644
index 2a5e27a71a..0000000000
--- a/scripts/check-public-package-identifiers.mjs
+++ /dev/null
@@ -1,113 +0,0 @@
-// Copyright (c) Meta Platforms, Inc. and affiliates.
-
-import {execFileSync} from 'node:child_process';
-import fs from 'node:fs';
-import path from 'node:path';
-import {fileURLToPath} from 'node:url';
-
-const INTERNAL_HOST =
- /(?:internalfb\.com|internalmeta\.com|fburl\.com|registry\.facebook\.net)/iu;
-const INTERNAL_DIFF = /(^|[^A-Za-z0-9_])D[0-9]{6,}(?![A-Za-z0-9_])/u;
-
-function publishedPackageDirectories(root) {
- const directories = [];
- for (const parent of ['packages', path.join('packages', 'themes')]) {
- const absoluteParent = path.join(root, parent);
- for (const entry of fs.readdirSync(absoluteParent, {withFileTypes: true})) {
- if (!entry.isDirectory()) continue;
- const packageDirectory = path.join(absoluteParent, entry.name);
- const packageFile = path.join(packageDirectory, 'package.json');
- if (!fs.existsSync(packageFile)) continue;
- const manifest = JSON.parse(fs.readFileSync(packageFile, 'utf8'));
- if (manifest.private || manifest.astryx?.canaryOnly) continue;
- directories.push(packageDirectory);
- }
- }
- return directories.sort();
-}
-
-function packedFiles(root, packageDirectory) {
- const output = execFileSync(
- 'npm',
- [
- 'pack',
- `./${path.relative(root, packageDirectory)}`,
- '--dry-run',
- '--json',
- '--ignore-scripts',
- ],
- {cwd: root, encoding: 'utf8'},
- );
- const result = JSON.parse(output);
- if (
- !Array.isArray(result) ||
- result.length !== 1 ||
- !Array.isArray(result[0].files)
- ) {
- throw new Error(
- `npm pack returned an unexpected manifest for ${path.relative(root, packageDirectory)}`,
- );
- }
- return result[0].files.map(file => file.path);
-}
-
-function findingInLine(line) {
- if (INTERNAL_HOST.test(line)) return 'internal host reference';
- if (INTERNAL_DIFF.test(line)) return 'internal diff identifier';
- return null;
-}
-
-export function scanPackage(root, packageDirectory) {
- const findings = [];
- for (const relativeFile of packedFiles(root, packageDirectory)) {
- const file = path.resolve(packageDirectory, relativeFile);
- if (!file.startsWith(`${path.resolve(packageDirectory)}${path.sep}`)) {
- throw new Error(
- `npm pack listed a file outside ${path.relative(root, packageDirectory)}`,
- );
- }
- const contents = fs.readFileSync(file);
- if (contents.includes(0)) continue;
- const lines = contents.toString('utf8').split(/\r?\n/u);
- for (const [index, line] of lines.entries()) {
- const kind = findingInLine(line);
- if (kind) {
- findings.push({
- file: path.relative(root, file).split(path.sep).join('/'),
- line: index + 1,
- kind,
- });
- }
- }
- }
- return findings;
-}
-
-export function scanPublishedPackages(root) {
- return publishedPackageDirectories(root).flatMap(packageDirectory =>
- scanPackage(root, packageDirectory),
- );
-}
-
-function main() {
- const root = path.resolve(process.cwd());
- const findings = scanPublishedPackages(root);
- if (findings.length > 0) {
- for (const finding of findings) {
- console.error(`${finding.file}:${finding.line}: ${finding.kind}`);
- }
- console.error(
- `Published-package identifier check failed with ${findings.length} finding(s).`,
- );
- process.exitCode = 1;
- return;
- }
- console.log('Published-package identifier check passed.');
-}
-
-if (
- process.argv[1] &&
- fileURLToPath(import.meta.url) === path.resolve(process.argv[1])
-) {
- main();
-}
diff --git a/scripts/check-public-package-identifiers.test.mjs b/scripts/check-public-package-identifiers.test.mjs
deleted file mode 100644
index d11aa44507..0000000000
--- a/scripts/check-public-package-identifiers.test.mjs
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright (c) Meta Platforms, Inc. and affiliates.
-
-import fs from 'node:fs';
-import os from 'node:os';
-import path from 'node:path';
-import {expect, it} from 'vitest';
-import {scanPackage} from './check-public-package-identifiers.mjs';
-
-function fixture() {
- const root = fs.mkdtempSync(
- path.join(os.tmpdir(), 'astryx-package-identifiers-'),
- );
- const packageDirectory = path.join(root, 'packages', 'fixture');
- fs.mkdirSync(packageDirectory, {recursive: true});
- fs.writeFileSync(
- path.join(packageDirectory, 'package.json'),
- JSON.stringify({
- name: '@astryxdesign/fixture',
- version: '1.0.0',
- files: ['published.txt'],
- }),
- );
- return {root, packageDirectory};
-}
-
-it('scans files npm includes and redacts the matched identifier', () => {
- const {root, packageDirectory} = fixture();
- const identifier = ['D', '123456'].join('');
- fs.writeFileSync(
- path.join(packageDirectory, 'published.txt'),
- `before\n${identifier}\nafter\n`,
- );
- fs.writeFileSync(path.join(packageDirectory, 'ignored.txt'), identifier);
-
- expect(scanPackage(root, packageDirectory)).toEqual([
- {
- file: 'packages/fixture/published.txt',
- line: 2,
- kind: 'internal diff identifier',
- },
- ]);
-});
-
-it('accepts public fixed-width example tokens', () => {
- const {root, packageDirectory} = fixture();
- fs.writeFileSync(
- path.join(packageDirectory, 'published.txt'),
- 'REFERENCE1\n',
- );
-
- expect(scanPackage(root, packageDirectory)).toEqual([]);
-});