Skip to content

Commit

Permalink
chore(sandbox): updated sandboxes to use root react-md
Browse files Browse the repository at this point in the history
  • Loading branch information
mlaursen committed Aug 13, 2021
1 parent 2da5033 commit c0f25f7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 37 deletions.
20 changes: 11 additions & 9 deletions packages/dev-utils/src/sandbox/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const SANDBOXES_PATH = join(
"sandboxes"
);

export const FORM_PARTS = [
export const FORM_PARTS: readonly string[] = [
"FileInputs",
"SelectFields",
"SelectionControls",
Expand All @@ -19,17 +19,13 @@ export const FORM_PARTS = [
"Validation",
];

export const DEPENDENCIES = [
"@react-md/layout",
"@react-md/states",
"@react-md/theme",
"@react-md/typography",
"@react-md/utils",
export const DEPENDENCIES: readonly string[] = [
"react-md",
"react",
"react-dom",
];

export const DEV_DEPENDENCIES = [
export const DEV_DEPENDENCIES: readonly string[] = [
"@types/jest",
"@types/node",
"@types/react",
Expand Down Expand Up @@ -86,13 +82,19 @@ export const DEMO_INDEX_HTML = `<!DOCTYPE html>
</html>
`;

export const VARIABLES_SCSS_FILE = `@import "~@react-md/theme/dist/color-palette";
export const VARIABLES_SCSS_FILE = `@import "@react-md/theme/dist/color-palette";
$rmd-theme-light: true;
$rmd-theme-primary: $rmd-teal-500;
$rmd-theme-secondary: $rmd-pink-a-200;
`;

export const STYLES_SCSS_FILE = `@import "./variables";
@import "react-md/dist/everything";
@include react-md-utils";
`;

export const PHONE_INDEX_FILE = `export { default } from "./Phone";
`;

Expand Down
25 changes: 0 additions & 25 deletions packages/dev-utils/src/sandbox/createDemoStyles.ts

This file was deleted.

4 changes: 2 additions & 2 deletions packages/dev-utils/src/sandbox/createSandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import {
DEMO_INDEX_HTML,
FORM_PARTS,
SANDBOXES_PATH,
STYLES_SCSS_FILE,
VARIABLES_SCSS_FILE,
} from "./constants";
import { createDemoStyles } from "./createDemoStyles";
import { createPackageJson } from "./createPackageJson";
import { getAllDependencies } from "./getAllDependencies";
import { getDemoSourceFile } from "./getSourceFile";
Expand Down Expand Up @@ -157,7 +157,7 @@ export function createSandbox(
content: DEMO_INDEX,
},
"src/styles.scss": {
content: createDemoStyles(dependencies),
content: STYLES_SCSS_FILE,
},
"src/_variables.scss": {
content: VARIABLES_SCSS_FILE,
Expand Down
3 changes: 2 additions & 1 deletion packages/dev-utils/src/sandbox/getAllDependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ export type ReferencedFiles = Map<string, string>;

// since I don't want to include markdown stuff
const IGNORED_MODULES = ["marked", "prismjs"];
const IGNORED_FILE_REGEXP = /Markdown|Code|constants\/(github|packages)/;
const IGNORED_FILE_REGEXP =
/Markdown|Code|constants\/(github|packages)|@react-md/;

function isIgnoredDependency(name: string): boolean {
return (
Expand Down

0 comments on commit c0f25f7

Please sign in to comment.