Skip to content
Draft
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
2 changes: 1 addition & 1 deletion .stylelintrc
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@
"stylelint-use-logical",
"stylelint-order",
"stylelint-no-unsupported-browser-features",
"@cloudscape-design/build-tools/stylelint"
"@cloudscape-design/build-tools/src/stylelint"
]
}
16 changes: 16 additions & 0 deletions build-tools/tasks/copy-shared-utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
const { cpSync } = require('node:fs');
const path = require('path');
const { mkdirSync, existsSync } = require('fs');

module.exports = function copySharedUtils() {
const targetPath = path.join('lib', 'dev-pages', 'pages', 'shared-utils');

if (!existsSync(targetPath)) {
mkdirSync(targetPath, { recursive: true });
}

cpSync('node_modules/@cloudscape-design/build-tools/src/test-pages-util', targetPath, { recursive: true });
return Promise.resolve();
};
1 change: 1 addition & 0 deletions build-tools/tasks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module.exports = {
integ: require('./integ'),
motion: require('./motion'),
copyFiles: require('./copy-files'),
copySharedUtils: require('./copy-shared-utils'),
themeableSource: require('./themeable-source'),
bundleVendorFiles: require('./bundle-vendor-files'),
sizeLimit: require('./size-limit'),
Expand Down
6 changes: 3 additions & 3 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import globals from 'globals';
import path from 'node:path';
import tsEslint from 'typescript-eslint';

import cloudscapeCommonRules from '@cloudscape-design/build-tools/eslint/index.js';
import cloudscapeCommonRules from '@cloudscape-design/build-tools/src/eslint/index.js';

import cloudscapeComponentsRules from './build-tools/eslint/index.js';

Expand Down Expand Up @@ -48,7 +48,7 @@ export default tsEslint.config(
plugins: {
'simple-import-sort': simpleImportSortPlugin,
'@cloudscape-design/components': cloudscapeComponentsRules,
'@cloudscape-design/build-tools': cloudscapeCommonRules,
'git-build-tools': cloudscapeCommonRules,
unicorn: unicornPlugin,
header: headerPlugin,
},
Expand All @@ -64,7 +64,7 @@ export default tsEslint.config(
'react/no-unstable-nested-components': ['error', { allowAsProps: true }],
'react/prop-types': 'off',
'react/jsx-boolean-value': ['error', 'always'],
'@cloudscape-design/build-tools/react-server-components-directive': 'error',
'git-build-tools/react-server-components-directive': 'error',
'@cloudscape-design/components/ban-files': [
'error',
[
Expand Down
11 changes: 10 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,23 @@ const {
integ,
motion,
copyFiles,
copySharedUtils,
themeableSource,
bundleVendorFiles,
sizeLimit,
} = require('./build-tools/tasks');

const quickBuild = series(
clean,
parallel(packageJSON, generateI18nMessages, generateEnvironment, generateIcons, generateIndexFile, copyFiles),
parallel(
packageJSON,
generateI18nMessages,
generateEnvironment,
generateIcons,
generateIndexFile,
copySharedUtils,
copyFiles
),
parallel(generateCustomCssPropertiesMap, styles, typescript, testUtils),
bundleVendorFiles
);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"@babel/core": "^7.23.7",
"@babel/plugin-syntax-typescript": "^7.23.3",
"@cloudscape-design/browser-test-tools": "^3.0.0",
"@cloudscape-design/build-tools": "^3.0.0",
"@cloudscape-design/build-tools": "github:cloudscape-design/build-tools#add-test-pages-util-permutation-view",
"@cloudscape-design/documenter": "^1.0.0",
"@cloudscape-design/global-styles": "^1.0.0",
"@cloudscape-design/jest-preset": "^2.0.0",
Expand Down
5 changes: 3 additions & 2 deletions pages/alert/permutations.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
// SPDX-License-Identifier: Apache-2.0
import React from 'react';

import { createPermutations } from '@cloudscape-design/build-tools/src/test-pages-util';
import { PermutationsView } from '@cloudscape-design/build-tools/src/test-pages-util';

import Alert, { AlertProps } from '~components/alert';
import Button from '~components/button';
import ExpandableSection from '~components/expandable-section';
import Link from '~components/link';

import createPermutations from '../utils/permutations';
import PermutationsView from '../utils/permutations-view';
import ScreenshotArea from '../utils/screenshot-area';
import { i18nStrings } from './common';

Expand Down
5 changes: 3 additions & 2 deletions pages/alert/runtime-action.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
// SPDX-License-Identifier: Apache-2.0
import React from 'react';

import { createPermutations } from '@cloudscape-design/build-tools/src/test-pages-util';
import { PermutationsView } from '@cloudscape-design/build-tools/src/test-pages-util';

import Alert, { AlertProps } from '~components/alert';
import Button from '~components/button';
import awsuiPlugins from '~components/internal/plugins';
import SpaceBetween from '~components/space-between';
import { mount, unmount } from '~mount';

import createPermutations from '../utils/permutations';
import PermutationsView from '../utils/permutations-view';
import ScreenshotArea from '../utils/screenshot-area';
import { i18nStrings } from './common';

Expand Down
5 changes: 3 additions & 2 deletions pages/area-chart/permutations.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
// SPDX-License-Identifier: Apache-2.0
import React from 'react';

import { createPermutations } from '@cloudscape-design/build-tools/src/test-pages-util';
import { PermutationsView } from '@cloudscape-design/build-tools/src/test-pages-util';

import { AreaChartProps } from '~components/area-chart';

import createPermutations from '../utils/permutations';
import PermutationsView from '../utils/permutations-view';
import ScreenshotArea from '../utils/screenshot-area';
import Example, { ExampleProps } from './example';

Expand Down
5 changes: 3 additions & 2 deletions pages/attribute-editor/permutations.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
// SPDX-License-Identifier: Apache-2.0
import React from 'react';

import { createPermutations } from '@cloudscape-design/build-tools/src/test-pages-util';
import { PermutationsView } from '@cloudscape-design/build-tools/src/test-pages-util';

import AttributeEditor, { AttributeEditorProps } from '~components/attribute-editor';
import Box from '~components/box';
import Input from '~components/input';
import StatusIndicator from '~components/status-indicator';

import createPermutations from '../utils/permutations';
import PermutationsView from '../utils/permutations-view';
import ScreenshotArea from '../utils/screenshot-area';

interface Item {
Expand Down
5 changes: 3 additions & 2 deletions pages/autosuggest/permutations-async.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
// SPDX-License-Identifier: Apache-2.0
import React from 'react';

import { createPermutations } from '@cloudscape-design/build-tools/src/test-pages-util';
import { PermutationsView } from '@cloudscape-design/build-tools/src/test-pages-util';

import Autosuggest, { AutosuggestProps } from '~components/autosuggest';

import createPermutations from '../utils/permutations';
import PermutationsView from '../utils/permutations-view';
import ScreenshotArea from '../utils/screenshot-area';

const enteredTextLabel = (value: string) => `Use: ${value}`;
Expand Down
5 changes: 3 additions & 2 deletions pages/autosuggest/permutations.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
import React from 'react';
import range from 'lodash/range';

import { createPermutations } from '@cloudscape-design/build-tools/src/test-pages-util';
import { PermutationsView } from '@cloudscape-design/build-tools/src/test-pages-util';

import Autosuggest, { AutosuggestProps } from '~components/autosuggest';

import createPermutations from '../utils/permutations';
import PermutationsView from '../utils/permutations-view';
import ScreenshotArea from '../utils/screenshot-area';
import img from './images/icon.png';

Expand Down
5 changes: 3 additions & 2 deletions pages/autosuggest/style-permutations.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
// SPDX-License-Identifier: Apache-2.0
import React from 'react';

import { createPermutations } from '@cloudscape-design/build-tools/src/test-pages-util';
import { PermutationsView } from '@cloudscape-design/build-tools/src/test-pages-util';

import Autosuggest, { AutosuggestProps } from '~components/autosuggest';

import createPermutations from '../utils/permutations';
import PermutationsView from '../utils/permutations-view';
import ScreenshotArea from '../utils/screenshot-area';

const style1 = {
Expand Down
5 changes: 3 additions & 2 deletions pages/badge/permutations.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
// SPDX-License-Identifier: Apache-2.0
import * as React from 'react';

import { createPermutations } from '@cloudscape-design/build-tools/src/test-pages-util';
import { PermutationsView } from '@cloudscape-design/build-tools/src/test-pages-util';

import Badge, { BadgeProps } from '~components/badge';

import createPermutations from '../utils/permutations';
import PermutationsView from '../utils/permutations-view';
import ScreenshotArea from '../utils/screenshot-area';

const permutations = createPermutations<BadgeProps>([
Expand Down
5 changes: 3 additions & 2 deletions pages/bar-chart/horizontal-bars-permutations.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
// SPDX-License-Identifier: Apache-2.0
import React from 'react';

import { createPermutations } from '@cloudscape-design/build-tools/src/test-pages-util';
import { PermutationsView } from '@cloudscape-design/build-tools/src/test-pages-util';

import BarChart, { BarChartProps } from '~components/bar-chart';

import { commonProps, multipleBarsData } from '../mixed-line-bar-chart/common';
import createPermutations from '../utils/permutations';
import PermutationsView from '../utils/permutations-view';
import ScreenshotArea from '../utils/screenshot-area';

const permutations = createPermutations<BarChartProps<string>>([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
// SPDX-License-Identifier: Apache-2.0
import React from 'react';

import { createPermutations } from '@cloudscape-design/build-tools/src/test-pages-util';
import { PermutationsView } from '@cloudscape-design/build-tools/src/test-pages-util';

import BarChart, { BarChartProps } from '~components/bar-chart';

import { commonProps, multipleBarsData } from '../mixed-line-bar-chart/common';
import createPermutations from '../utils/permutations';
import PermutationsView from '../utils/permutations-view';
import ScreenshotArea from '../utils/screenshot-area';

const permutations = createPermutations<BarChartProps<string>>([
Expand Down
5 changes: 3 additions & 2 deletions pages/bar-chart/other-permutations.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// SPDX-License-Identifier: Apache-2.0
import React from 'react';

import { createPermutations } from '@cloudscape-design/build-tools/src/test-pages-util';
import { PermutationsView } from '@cloudscape-design/build-tools/src/test-pages-util';

import BarChart, { BarChartProps } from '~components/bar-chart';
import { colorChartsThresholdInfo, colorChartsThresholdNeutral } from '~design-tokens';

Expand All @@ -14,8 +17,6 @@ import {
multipleNegativeBarsData,
negativeData,
} from '../mixed-line-bar-chart/common';
import createPermutations from '../utils/permutations';
import PermutationsView from '../utils/permutations-view';
import ScreenshotArea from '../utils/screenshot-area';
import { smallBarsData } from './common';

Expand Down
5 changes: 3 additions & 2 deletions pages/bar-chart/stacked-permutations.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
// SPDX-License-Identifier: Apache-2.0
import React from 'react';

import { createPermutations } from '@cloudscape-design/build-tools/src/test-pages-util';
import { PermutationsView } from '@cloudscape-design/build-tools/src/test-pages-util';

import BarChart, { BarChartProps } from '~components/bar-chart';

import { commonProps, multipleNegativeBarsData as data } from '../mixed-line-bar-chart/common';
import createPermutations from '../utils/permutations';
import PermutationsView from '../utils/permutations-view';
import ScreenshotArea from '../utils/screenshot-area';

const thresholdSeries = { type: 'threshold', title: 'Limit', y: 4 } as const;
Expand Down
5 changes: 3 additions & 2 deletions pages/bar-chart/threshold-permutations.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
// SPDX-License-Identifier: Apache-2.0
import React from 'react';

import { createPermutations } from '@cloudscape-design/build-tools/src/test-pages-util';
import { PermutationsView } from '@cloudscape-design/build-tools/src/test-pages-util';

import BarChart, { BarChartProps } from '~components/bar-chart';

import { commonProps, multipleNegativeBarsDataWithThreshold } from '../mixed-line-bar-chart/common';
import createPermutations from '../utils/permutations';
import PermutationsView from '../utils/permutations-view';
import ScreenshotArea from '../utils/screenshot-area';

const permutations = createPermutations<BarChartProps<string>>([
Expand Down
5 changes: 3 additions & 2 deletions pages/bar-chart/vertical-bars-permutations.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
// SPDX-License-Identifier: Apache-2.0
import React from 'react';

import { createPermutations } from '@cloudscape-design/build-tools/src/test-pages-util';
import { PermutationsView } from '@cloudscape-design/build-tools/src/test-pages-util';

import BarChart, { BarChartProps } from '~components/bar-chart';

import { commonProps, multipleBarsData } from '../mixed-line-bar-chart/common';
import createPermutations from '../utils/permutations';
import PermutationsView from '../utils/permutations-view';
import ScreenshotArea from '../utils/screenshot-area';

const permutations = createPermutations<BarChartProps<string>>([
Expand Down
5 changes: 3 additions & 2 deletions pages/bar-chart/vertical-stacked-bars-permutations.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
// SPDX-License-Identifier: Apache-2.0
import React from 'react';

import { createPermutations } from '@cloudscape-design/build-tools/src/test-pages-util';
import { PermutationsView } from '@cloudscape-design/build-tools/src/test-pages-util';

import BarChart, { BarChartProps } from '~components/bar-chart';

import { commonProps, multipleBarsData } from '../mixed-line-bar-chart/common';
import createPermutations from '../utils/permutations';
import PermutationsView from '../utils/permutations-view';
import ScreenshotArea from '../utils/screenshot-area';

const permutations = createPermutations<BarChartProps<string>>([
Expand Down
5 changes: 3 additions & 2 deletions pages/box/elements-with-extra-defaults.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
// SPDX-License-Identifier: Apache-2.0
import React from 'react';

import { createPermutations } from '@cloudscape-design/build-tools/src/test-pages-util';
import { PermutationsView } from '@cloudscape-design/build-tools/src/test-pages-util';

import Box, { BoxProps } from '~components/box';

import createPermutations from '../utils/permutations';
import PermutationsView from '../utils/permutations-view';
import ScreenshotArea from '../utils/screenshot-area';

import styles from './style.scss';
Expand Down
5 changes: 3 additions & 2 deletions pages/box/float-align.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
// SPDX-License-Identifier: Apache-2.0
import React from 'react';

import { createPermutations } from '@cloudscape-design/build-tools/src/test-pages-util';
import { PermutationsView } from '@cloudscape-design/build-tools/src/test-pages-util';

import Box, { BoxProps } from '~components/box';

import createPermutations from '../utils/permutations';
import PermutationsView from '../utils/permutations-view';
import ScreenshotArea from '../utils/screenshot-area';

import styles from './style.scss';
Expand Down
5 changes: 3 additions & 2 deletions pages/box/margins.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
// SPDX-License-Identifier: Apache-2.0
import React from 'react';

import { createPermutations } from '@cloudscape-design/build-tools/src/test-pages-util';
import { PermutationsView } from '@cloudscape-design/build-tools/src/test-pages-util';

import Box, { BoxProps } from '~components/box';

import createPermutations from '../utils/permutations';
import PermutationsView from '../utils/permutations-view';
import ScreenshotArea from '../utils/screenshot-area';
import spacings from './spacings';

Expand Down
5 changes: 3 additions & 2 deletions pages/box/paddings.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
// SPDX-License-Identifier: Apache-2.0
import React from 'react';

import { createPermutations } from '@cloudscape-design/build-tools/src/test-pages-util';
import { PermutationsView } from '@cloudscape-design/build-tools/src/test-pages-util';

import Box, { BoxProps } from '~components/box';

import createPermutations from '../utils/permutations';
import PermutationsView from '../utils/permutations-view';
import ScreenshotArea from '../utils/screenshot-area';
import spacings from './spacings';

Expand Down
5 changes: 3 additions & 2 deletions pages/box/variants.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
// SPDX-License-Identifier: Apache-2.0
import React from 'react';

import { createPermutations } from '@cloudscape-design/build-tools/src/test-pages-util';
import { PermutationsView } from '@cloudscape-design/build-tools/src/test-pages-util';

import Box, { BoxProps } from '~components/box';

import createPermutations from '../utils/permutations';
import PermutationsView from '../utils/permutations-view';
import ScreenshotArea from '../utils/screenshot-area';

import styles from './style.scss';
Expand Down
Loading
Loading