Skip to content

Commit c0f25f7

Browse files
committed
chore(sandbox): updated sandboxes to use root react-md
1 parent 2da5033 commit c0f25f7

4 files changed

Lines changed: 15 additions & 37 deletions

File tree

‎packages/dev-utils/src/sandbox/constants.ts‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const SANDBOXES_PATH = join(
1010
"sandboxes"
1111
);
1212

13-
export const FORM_PARTS = [
13+
export const FORM_PARTS: readonly string[] = [
1414
"FileInputs",
1515
"SelectFields",
1616
"SelectionControls",
@@ -19,17 +19,13 @@ export const FORM_PARTS = [
1919
"Validation",
2020
];
2121

22-
export const DEPENDENCIES = [
23-
"@react-md/layout",
24-
"@react-md/states",
25-
"@react-md/theme",
26-
"@react-md/typography",
27-
"@react-md/utils",
22+
export const DEPENDENCIES: readonly string[] = [
23+
"react-md",
2824
"react",
2925
"react-dom",
3026
];
3127

32-
export const DEV_DEPENDENCIES = [
28+
export const DEV_DEPENDENCIES: readonly string[] = [
3329
"@types/jest",
3430
"@types/node",
3531
"@types/react",
@@ -86,13 +82,19 @@ export const DEMO_INDEX_HTML = `<!DOCTYPE html>
8682
</html>
8783
`;
8884

89-
export const VARIABLES_SCSS_FILE = `@import "~@react-md/theme/dist/color-palette";
85+
export const VARIABLES_SCSS_FILE = `@import "@react-md/theme/dist/color-palette";
9086
9187
$rmd-theme-light: true;
9288
$rmd-theme-primary: $rmd-teal-500;
9389
$rmd-theme-secondary: $rmd-pink-a-200;
9490
`;
9591

92+
export const STYLES_SCSS_FILE = `@import "./variables";
93+
@import "react-md/dist/everything";
94+
95+
@include react-md-utils";
96+
`;
97+
9698
export const PHONE_INDEX_FILE = `export { default } from "./Phone";
9799
`;
98100

‎packages/dev-utils/src/sandbox/createDemoStyles.ts‎

Lines changed: 0 additions & 25 deletions
This file was deleted.

‎packages/dev-utils/src/sandbox/createSandbox.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import {
1212
DEMO_INDEX_HTML,
1313
FORM_PARTS,
1414
SANDBOXES_PATH,
15+
STYLES_SCSS_FILE,
1516
VARIABLES_SCSS_FILE,
1617
} from "./constants";
17-
import { createDemoStyles } from "./createDemoStyles";
1818
import { createPackageJson } from "./createPackageJson";
1919
import { getAllDependencies } from "./getAllDependencies";
2020
import { getDemoSourceFile } from "./getSourceFile";
@@ -157,7 +157,7 @@ export function createSandbox(
157157
content: DEMO_INDEX,
158158
},
159159
"src/styles.scss": {
160-
content: createDemoStyles(dependencies),
160+
content: STYLES_SCSS_FILE,
161161
},
162162
"src/_variables.scss": {
163163
content: VARIABLES_SCSS_FILE,

‎packages/dev-utils/src/sandbox/getAllDependencies.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ export type ReferencedFiles = Map<string, string>;
1313

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

1819
function isIgnoredDependency(name: string): boolean {
1920
return (

0 commit comments

Comments
 (0)