Skip to content

Commit

Permalink
Merge pull request #5 from cloudquery/feat/switch-to-rollup
Browse files Browse the repository at this point in the history
Switch to rollup
  • Loading branch information
jackcloudquery authored Sep 23, 2024
2 parents fd71ae4 + 38f5f11 commit a7d8013
Show file tree
Hide file tree
Showing 8 changed files with 1,286 additions and 2,690 deletions.
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

0 comments on commit a7d8013

Please sign in to comment.