-
Notifications
You must be signed in to change notification settings - Fork 6
chore: Include missing folders needed for themeable artifact #85
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| import { GlobalValue, ThemePreset, TypedModeValueOverride } from "@cloudscape-design/theming-build"; | ||
|
|
||
| export interface TypedOverride { | ||
| tokens: Partial<Record<string, GlobalValue | TypedModeValueOverride>>; | ||
| } | ||
| export const preset: ThemePreset; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| import { join } from "node:path"; | ||
|
|
||
| import { buildThemedComponents as themingCoreBuild } from "@cloudscape-design/theming-build"; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as components package |
||
|
|
||
| // eslint-disable-next-line import/no-useless-path-segments | ||
| import { preset, TypedOverride } from "./internal/template/internal/generated/theming/index.cjs"; | ||
|
|
||
| const internalDir = join(__dirname, "./internal"); | ||
| const scssDir = join(internalDir, "./scss"); | ||
| const templateDir = join(internalDir, "./template"); | ||
| const designTokensTemplateDir = join(internalDir, "./template-tokens"); | ||
|
|
||
| export type Theme = TypedOverride; | ||
| export interface BuildThemedComponentsParams { | ||
| theme: Theme; | ||
| outputDir: string; | ||
| baseThemeId?: string; | ||
| } | ||
|
|
||
| export function buildThemedComponents({ theme, outputDir, baseThemeId }: BuildThemedComponentsParams): Promise<void> { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We might want to consider an option to allow overriding the specific component imports so this can use the themed components as its peer dependency. |
||
| return themingCoreBuild({ | ||
| override: theme, | ||
| preset, | ||
| baseThemeId, | ||
| componentsOutputDir: join(outputDir, "components"), | ||
| designTokensOutputDir: join(outputDir, "design-tokens"), | ||
| templateDir, | ||
| designTokensTemplateDir, | ||
| scssDir, | ||
| }); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "lib": ["es2019", "dom", "dom.iterable"], | ||
| "target": "ES2019", | ||
| "module": "ESNext", | ||
| "moduleResolution": "nodenext", | ||
| "rootDir": "src-themeable", | ||
| "declaration": true, | ||
| "incremental": true, | ||
| "outDir": "lib/components-themeable", | ||
| "skipLibCheck": true, | ||
| "strict": true, | ||
| "tsBuildInfoFile": "./.cache/themeable-source.tsbuildinfo" | ||
| }, | ||
| "include": ["src-themeable"], | ||
| "exclude": ["**/__tests__/**", "src/test-utils/**"] | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as components package