Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to rollup #5

Merged
merged 5 commits into from
Sep 23, 2024
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
110 changes: 89 additions & 21 deletions etc/cloud-ui.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

import { BreakpointOverrides } from '@mui/system/createBreakpoints/createBreakpoints';
import { Components } from '@mui/material/styles';
import { PaletteColor } from '@mui/material/styles/createPalette';
import { PaletteColor as PaletteColor_2 } from '@mui/material/styles';
import { PaletteOptions } from '@mui/material/styles/createPalette';
import { Shadows } from '@mui/material/styles';
import { ThemeOptions } from '@mui/material/styles';
Expand Down Expand Up @@ -76,8 +74,22 @@ export const createThemePaletteOptions: () => {
white: "#fff";
};
divider: string;
error: PaletteColor_2;
info: PaletteColor_2;
error: {
contrastText: string;
dark: string;
darkest: string;
light: string;
lightest: string;
main: string;
};
info: {
contrastText: string;
dark: string;
darkest: string;
light: string;
lightest: string;
main: string;
};
mode: PaletteOptions["mode"];
neutral: {
100: string;
Expand All @@ -93,31 +105,44 @@ export const createThemePaletteOptions: () => {
};
primary: {
hovered: string;
contrastText: string;
dark: string;
darkest: string;
darkestBg: string;
light: string;
lightest: string;
main: string;
dark: string;
contrastText: string;
darkest?: string;
lightest?: string;
darkestBg?: string;
};
secondary: {
hovered: string;
contrastText: string;
dark: string;
darkest: string;
light: string;
lightest: string;
main: string;
dark: string;
};
success: {
contrastText: string;
darkest?: string;
lightest?: string;
darkestBg?: string;
dark: string;
darkest: string;
light: string;
lightest: string;
main: string;
};
success: PaletteColor_2;
text: {
disabled: string;
primary: string;
secondary: string;
};
warning: PaletteColor_2;
warning: {
contrastText: string;
dark: string;
darkest: string;
light: string;
lightest: string;
main: string;
};
};

// @public
Expand All @@ -127,10 +152,24 @@ export const createThemeShadows: () => Shadows;
export const createTypographyOptions: () => TypographyOptions;

// @public
const error: PaletteColor;
const error: {
contrastText: string;
dark: string;
darkest: string;
light: string;
lightest: string;
main: string;
};

// @public
const info: PaletteColor;
const info: {
contrastText: string;
dark: string;
darkest: string;
light: string;
lightest: string;
main: string;
};

// @public
const neutral: {
Expand All @@ -147,16 +186,45 @@ const neutral: {
};

// @public
const primary: PaletteColor;
const primary: {
contrastText: string;
dark: string;
darkest: string;
darkestBg: string;
light: string;
lightest: string;
main: string;
};

// @public
const secondary: PaletteColor;
const secondary: {
contrastText: string;
dark: string;
darkest: string;
light: string;
lightest: string;
main: string;
};

// @public
const success: PaletteColor;
const success: {
contrastText: string;
dark: string;
darkest: string;
light: string;
lightest: string;
main: string;
};

// @public
const warning: PaletteColor;
const warning: {
contrastText: string;
dark: string;
darkest: string;
light: string;
lightest: string;
main: string;
};

// (No @packageDocumentation comment for this package)

Expand Down
48 changes: 19 additions & 29 deletions merge-files-plugin.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,22 @@
const fs = require('fs');
const path = require('path');
// mergeFilesPlugin.js
import fs from 'fs';
import path from 'path';

class MergeFilesPlugin {
constructor(options) {
this.options = options;
}
export default function mergeFilesPlugin(options) {
return {
name: 'merge-files-plugin',
generateBundle(outputOptions) {
const { sourceFile, targetFile } = options;
const sourceFilePath = path.resolve(process.cwd(), sourceFile);
const outputDir = outputOptions.dir || path.dirname(outputOptions.file);
const targetFilePath = path.resolve(outputDir, targetFile);

apply(compiler) {
compiler.hooks.emit.tapAsync('MergeFilesPlugin', (compilation, callback) => {
const { sourceFile, targetFile } = this.options;
const sourceFilePath = path.resolve(compiler.options.context, sourceFile);
const targetFilePath = path.resolve(compiler.options.output.path, targetFile);

fs.readFile(sourceFilePath, 'utf8', (err, sourceContent) => {
if (err) {
compilation.errors.push(err);
return callback();
}

fs.appendFile(targetFilePath, sourceContent, 'utf8', appendErr => {
if (appendErr) {
compilation.errors.push(appendErr);
}
callback();
});
});
});
}
try {
const sourceContent = fs.readFileSync(sourceFilePath, 'utf8');
fs.appendFileSync(targetFilePath, sourceContent, 'utf8');
} catch (err) {
this.error(`Error in mergeFilesPlugin: ${err.message}`);
}
},
};
}

module.exports = MergeFilesPlugin;
Loading
Loading