Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/publish-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,14 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
# Create a unique version using the commit SHA as a prerelease identifier
# This ensures we can publish multiple times from the same codebase with unique versions
npm version --no-git-tag-version 1.0.1-$COMMIT_SHA
# Publish the package to the npm registry with public access flag
pnpm publish --access public --no-git-checks

# Check if a custom publish script exists in package.json
if jq -e '.scripts.publish' package.json > /dev/null; then
pnpm run publish
else
pnpm publish --access public --no-git-checks
fi

- name: Notify on Manual Release
if: ${{ github.event_name == 'workflow_dispatch' }}
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ apps/site/public/blog-data.json
junit.xml
lcov.info

# Distributed Files
dist

# Storybook
storybook-static
build-storybook.log
Expand Down
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ CODEOWNERS
# Public Folders
apps/site/public

# Distributed Files
dist

# Prettier's Handlebar parser is limited and chokes on some syntax features
# https://github.com/prettier/prettier/issues/11834
scripts/release-post/template.hbs
1 change: 1 addition & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export default [
'**/.open-next',
'test-results',
'playwright-report',
'dist',
],
},
{
Expand Down
1 change: 1 addition & 0 deletions packages/ui-components/.stylelintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
storybook-static
dist
13 changes: 9 additions & 4 deletions packages/ui-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
]
},
"scripts": {
"compile:ts": "tsc",
"compile:css": "postcss --dir dist --base src \"src/**/*.module.css\" src/styles/index.css",
"compile": "node --run compile:ts && node --run compile:css",
"publish": "node --run compile && node scripts/publish.mjs",
"lint": "turbo run lint:js lint:css",
"lint:css": "stylelint \"**/*.css\" --allow-empty-input --cache --cache-strategy=content --cache-location=.stylelintcache",
"lint:fix": "node --run lint -- -- --fix",
Expand All @@ -33,13 +37,13 @@
"@radix-ui/react-tabs": "~1.1.12",
"@radix-ui/react-toast": "~1.2.14",
"@radix-ui/react-tooltip": "~1.2.7",
"@tailwindcss/postcss": "~4.1.11",
"@vcarl/remark-headings": "~0.1.0",
"classnames": "catalog:",
"postcss-calc": "^10.1.1",
"tailwindcss": "catalog:"
"classnames": "catalog:"
},
"devDependencies": {
"@tailwindcss/postcss": "~4.1.11",
"postcss-calc": "^10.1.1",
"tailwindcss": "catalog:",
"@storybook/addon-styling-webpack": "^2.0.0",
"@storybook/addon-themes": "^9.0.15",
"@storybook/addon-webpack5-compiler-swc": "^3.0.0",
Expand All @@ -53,6 +57,7 @@
"eslint-plugin-react": "~7.37.4",
"eslint-plugin-storybook": "~9.0.3",
"global-jsdom": "^26.0.0",
"postcss-cli": "^11.0.1",
"postcss-loader": "~8.1.1",
"react": "catalog:",
"storybook": "^9.0.15",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import assert from 'node:assert/strict';

import { render, screen } from '@testing-library/react';

// @ts-ignore this file is intentionally stored outside of the `rootDir`
import { isVisible } from '../../../../../../../tests/utilities.mjs';

import PaginationListItem from '#ui/Common/BasePagination/PaginationListItem';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import assert from 'node:assert/strict';

import { render, screen } from '@testing-library/react';

// @ts-ignore this file is intentionally stored outside of the `rootDir`
import { isVisible } from '../../../../../../tests/utilities.mjs';

import BasePagination from '#ui/Common/BasePagination';
Expand Down
21 changes: 21 additions & 0 deletions packages/ui-components/src/scripts/publish.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { spawnSync } from 'node:child_process';
import { writeFile } from 'node:fs/promises';

import pkg from '../package.json' with { type: 'json' };

// Strip the devDependencies, since they aren't needed for publish
// Strip the exports, since we don't want to reference './src'
/* eslint-disable @typescript-eslint/no-unused-vars */
const { devDependencies, exports, ...cleanedPkg } = pkg;
// Change `#ui` to `./` from `./src`, since we are publishing
// from the same directory as the source code (rather, the compiled code).
cleanedPkg.imports['#ui/*'] = ['./*'];

await writeFile(
'dist/package.json',
JSON.stringify(cleanedPkg, null, 2),
'utf8'
);

// Now, publish the generated `dist` folder
spawnSync('pnpm', ['publish'], { cwd: 'dist', stdio: 'inherit' });
7 changes: 4 additions & 3 deletions packages/ui-components/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "Bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"jsx": "react-jsx",
"incremental": true,
"baseUrl": "."
"baseUrl": "./src",
"rootDir": "./src",
"outDir": "./dist"
},
"include": ["src"]
}
Loading
Loading