Skip to content

Commit

Permalink
Rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
dkmyta committed Jan 8, 2025
2 parents 6dd5ddc + e94e9a9 commit 1cc3b62
Show file tree
Hide file tree
Showing 318 changed files with 3,614 additions and 4,335 deletions.
4,165 changes: 1,181 additions & 2,984 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions projects/github-actions/repo-gardening/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"@actions/github": "6.0.0",
"@slack/web-api": "7.7.0",
"compare-versions": "6.1.1",
"glob": "10.4.1",
"moment": "2.29.4",
"glob": "11.0.0",
"moment": "2.30.1",
"openai": "4.56.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion projects/github-actions/required-review/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@actions/github": "6.0.0",
"error": "10.4.0",
"js-yaml": "4.1.0",
"picomatch": "2.2.3"
"picomatch": "4.0.2"
},
"devDependencies": {
"@vercel/ncc": "0.36.1"
Expand Down
2 changes: 1 addition & 1 deletion projects/github-actions/test-results-to-slack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@actions/core": "1.10.1",
"@actions/github": "6.0.0",
"@slack/web-api": "7.3.2",
"glob": "10.4.1",
"glob": "11.0.0",
"minimatch": "5.1.0"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

AI Client: add style parameter to first logo generator so it doesn't fall in a dall-e situation
18 changes: 9 additions & 9 deletions projects/js-packages/ai-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
},
"type": "module",
"devDependencies": {
"@storybook/addon-actions": "8.3.5",
"@storybook/blocks": "8.3.5",
"@storybook/preview-api": "8.3.5",
"@storybook/react": "8.3.5",
"@storybook/addon-actions": "8.4.7",
"@storybook/blocks": "8.4.7",
"@storybook/preview-api": "8.4.7",
"@storybook/react": "8.4.7",
"@types/markdown-it": "14.1.2",
"@types/turndown": "5.0.5",
"jest": "^29.6.2",
"jest-environment-jsdom": "29.7.0",
"storybook": "8.3.5",
"storybook": "8.4.7",
"typescript": "5.0.4"
},
"exports": {
Expand All @@ -49,8 +49,8 @@
"@automattic/jetpack-connection": "workspace:*",
"@automattic/jetpack-shared-extension-utils": "workspace:*",
"@microsoft/fetch-event-source": "2.0.1",
"@types/react": "18.3.12",
"@types/wordpress__block-editor": "11.5.15",
"@types/react": "18.3.18",
"@types/wordpress__block-editor": "11.5.16",
"@wordpress/api-fetch": "7.14.0",
"@wordpress/base-styles": "5.14.0",
"@wordpress/blob": "4.14.0",
Expand All @@ -62,8 +62,8 @@
"@wordpress/i18n": "5.14.0",
"@wordpress/icons": "10.14.0",
"clsx": "2.1.1",
"debug": "4.3.4",
"markdown-it": "14.0.0",
"debug": "4.4.0",
"markdown-it": "14.1.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"turndown": "7.1.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const GeneratorModal: React.FC< GeneratorModalProps > = ( {

// Then generate the logo based on the prompt.
setLoadingState( 'generating' );
await generateLogo( { prompt } );
await generateLogo( { prompt, style: 'none' } );
setLoadingState( null );
} catch ( error ) {
debug( 'Error generating first logo', error );
Expand Down
5 changes: 5 additions & 0 deletions projects/js-packages/analytics/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

### This is a list detailing changes for the Jetpack RNA Analytics package releases.

## [0.1.34] - 2025-01-06
### Changed
- Updated package dependencies. [#40810]

## [0.1.33] - 2024-11-14
### Changed
- Update dependencies.
Expand Down Expand Up @@ -132,6 +136,7 @@
### Added
- Initial release of jetpack-api package.

[0.1.34]: https://github.com/Automattic/jetpack-analytics/compare/v0.1.33...v0.1.34
[0.1.33]: https://github.com/Automattic/jetpack-analytics/compare/v0.1.32...v0.1.33
[0.1.32]: https://github.com/Automattic/jetpack-analytics/compare/v0.1.31...v0.1.32
[0.1.31]: https://github.com/Automattic/jetpack-analytics/compare/v0.1.30...v0.1.31
Expand Down
4 changes: 2 additions & 2 deletions projects/js-packages/analytics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@automattic/jetpack-analytics",
"version": "0.1.33",
"version": "0.1.34",
"description": "Jetpack Analytics Package",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/analytics/#readme",
"bugs": {
Expand All @@ -15,7 +15,7 @@
"license": "GPL-2.0-or-later",
"dependencies": {},
"devDependencies": {
"debug": "4.3.4",
"debug": "4.4.0",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0"
},
Expand Down
6 changes: 6 additions & 0 deletions projects/js-packages/charts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.2.2] - 2025-01-03
### Changed
- Switching esbuild to rollup for better treeshaking. [#40817]
- Updated package dependencies. [#40798]

## [0.2.1] - 2024-12-31
### Added
- Added dist to mirror repo [#40776]
Expand Down Expand Up @@ -37,5 +42,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed lints following ESLint rule changes for TS [#40584]
- Fixing a bug in Chart storybook data. [#40640]

[0.2.2]: https://github.com/Automattic/charts/compare/v0.2.1...v0.2.2
[0.2.1]: https://github.com/Automattic/charts/compare/v0.2.0...v0.2.1
[0.2.0]: https://github.com/Automattic/charts/compare/v0.1.0...v0.2.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Updated package dependencies.
55 changes: 38 additions & 17 deletions projects/js-packages/charts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@automattic/charts",
"version": "0.2.1",
"version": "0.2.2",
"description": "Display charts within Automattic products.",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/charts/#readme",
"bugs": {
Expand All @@ -19,8 +19,10 @@
"test-coverage": "pnpm run test --coverage",
"storybook": "cd ../storybook && pnpm run storybook:dev",
"compile-ts": "tsc --pretty",
"build": "pnpm run clean-build && pnpm run compile-ts",
"build:prod": "tsup src/index.ts --minify --dts",
"build": "rollup -c",
"build:prod": "rollup -c --environment NODE_ENV:production",
"build:dev": "rollup -c --environment NODE_ENV:development",
"build:watch": "rollup -c -w",
"clean-build": "rm -rf dist/"
},
"dependencies": {
Expand All @@ -36,25 +38,33 @@
"@visx/text": "3.12.0",
"@visx/tooltip": "^3.8.0",
"@visx/xychart": "3.12.0",
"clsx": "2.1.1"
"clsx": "2.1.1",
"tslib": "2.5.0"
},
"devDependencies": {
"@storybook/blocks": "8.4.6",
"@storybook/react": "8.4.6",
"@types/react": "18.3.13",
"@types/react-dom": "18.3.1",
"esbuild": "0.24.2",
"esbuild-sass-plugin": "3.3.1",
"@rollup/plugin-commonjs": "26.0.1",
"@rollup/plugin-json": "6.1.0",
"@rollup/plugin-node-resolve": "15.3.0",
"@rollup/plugin-terser": "0.4.3",
"@rollup/plugin-typescript": "12.1.0",
"@storybook/blocks": "8.4.7",
"@storybook/react": "8.4.7",
"@types/react": "18.3.18",
"@types/react-dom": "18.3.5",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"jest-extended": "4.0.2",
"postcss": "8.4.47",
"postcss-modules": "6.0.1",
"react": "18.3.1",
"react-dom": "18.3.1",
"rollup": "3.29.5",
"rollup-plugin-dts": "6.1.1",
"rollup-plugin-peer-deps-external": "2.2.4",
"rollup-plugin-postcss": "4.0.2",
"sass": "1.64.1",
"sass-embedded": "1.83.0",
"storybook": "8.4.6",
"tsup": "8.3.5",
"storybook": "8.4.7",
"typescript": "5.7.2"
},
"peerDependencies": {
Expand All @@ -63,11 +73,22 @@
},
"exports": {
".": {
"jetpack:src": "./src/index.ts",
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"types": "./dist/index.d.ts"
},
"./components/*": {
"import": "./dist/components/*/index.js",
"require": "./dist/components/*/index.cjs.js",
"types": "./dist/components/*/index.d.ts"
},
"./style.css": "./dist/style.css"
},
"main": "./dist/index.js",
"types": "./dist/index.d.ts"
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"sideEffects": [
"*.css",
"*.scss"
]
}
142 changes: 142 additions & 0 deletions projects/js-packages/charts/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
// Import necessary plugins for building the library
import commonjs from '@rollup/plugin-commonjs';
import json from '@rollup/plugin-json';
import resolve from '@rollup/plugin-node-resolve';
import terser from '@rollup/plugin-terser';
import typescript from '@rollup/plugin-typescript';
import { defineConfig } from 'rollup';
import dts from 'rollup-plugin-dts';
import peerDepsExternal from 'rollup-plugin-peer-deps-external';
import postcss from 'rollup-plugin-postcss';

// Common plugins used across all build configurations
const commonPlugins = [
// Automatically externalize peer dependencies
peerDepsExternal( {
includeDependencies: true,
} ),
// Locate and bundle third-party dependencies from node_modules
resolve( {
preferBuiltins: true,
extensions: [ '.tsx', '.ts', '.js', '.jsx' ],
} ),
// Convert CommonJS modules to ES6
commonjs(),
// Allow importing JSON files
json(),
// Process SCSS/CSS modules
postcss( {
// Configure CSS modules with scoped names
modules: {
generateScopedName: '[name]__[local]__[hash:base64:5]',
},
extract: 'style.css',
autoModules: false,
use: [ 'sass' ],
} ),
];

// Main bundle configuration for the entire library
const mainConfig = {
// Entry point for the bundle
input: 'src/index.ts',
// Output configuration for different module formats
output: [
{
file: './dist/index.js',
format: 'cjs', // CommonJS format for Node.js
sourcemap: true,
sourcemapPathTransform: relativeSourcePath => {
return `/@automattic/charts/${ relativeSourcePath }`;
},
},
{
file: './dist/index.mjs',
format: 'esm', // ES modules for modern bundlers
sourcemap: true,
},
],
// Mark all dependencies as external to avoid bundling them
external: [ 'react', 'react-dom', /^@visx\/.*/, '@react-spring/web', 'clsx', 'tslib' ],
plugins: [
...commonPlugins,
// TypeScript compilation
typescript( {
tsconfig: './tsconfig.json',
declaration: false, // Declarations handled by dts plugin
sourceMap: true,
compilerOptions: {
verbatimModuleSyntax: true,
},
} ),
terser(),
],
// Handle circular dependencies warning
onwarn( warning, warn ) {
if ( warning.code === 'CIRCULAR_DEPENDENCY' ) {
return;
}
warn( warning );
},
};

// List of components to build individually
const components = [
'components/bar-chart',
'components/line-chart',
'components/pie-chart',
'components/pie-semi-circle-chart',
'components/tooltip',
'components/legend',
'components/grid-control',
'providers/theme',
];

// Generate individual bundles for each component
const componentConfigs = components.map( component => ( {
// Component entry point - try both .tsx and .ts extensions
input: `src/${ component }/index`,
// Output both ESM and CJS formats
output: [
{
file: `dist/${ component }/index.js`,
format: 'esm',
sourcemap: true,
},
{
file: `dist/${ component }/index.cjs.js`,
format: 'cjs',
sourcemap: true,
},
],
// Same external config as main bundle
external: [ 'react', 'react-dom', /^@visx\/.*/, '@react-spring/web', 'clsx', 'tslib' ],
plugins: [
...commonPlugins,
typescript( {
tsconfig: './tsconfig.json',
declaration: false,
sourceMap: true,
compilerOptions: {
verbatimModuleSyntax: true,
},
} ),
terser(),
],
} ) );

// Configuration for generating TypeScript declaration files
const typesConfig = {
input: 'src/index.ts',
output: [ { file: 'dist/index.d.ts', format: 'es' } ],
plugins: [
dts( {
respectExternal: true,
} ),
],
// Don't include style imports in type definitions
external: [ /\.scss$/, /\.css$/, 'react', '@types/react' ],
};

// Export all configurations to be built in parallel
export default defineConfig( [ mainConfig, ...componentConfigs, typesConfig ] );
Loading

0 comments on commit 1cc3b62

Please sign in to comment.