Skip to content
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

chore: setup compat-stylesheet schematic #1972

Merged
merged 1 commit into from
Jan 30, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,15 @@
"factory": "./noop/noop.schematic",
"description": "Update all SKY UX component packages"
},
"update-angular-tree-component": {
"version": "9.0.0-0",
"factory": "./update-9/update-angular-tree-component/update-angular-tree-component.schematic",
"description": "Update the Angular tree component package to point to the Blackbaud forked version"
},
"add-forms-popovers-peer-dependency": {
"version": "9.0.0-0",
"factory": "./update-9/add-forms-popovers-peer-dependency/add-forms-popovers-peer-dependency.schematic",
"description": "Add @skyux/popovers peer dependency for @skyux/forms"
},
"add-compat-stylesheets": {
"version": "9.0.0-0",
"factory": "./update-9/add-compat-stylesheets/add-compat-stylesheet.schematic",
"description": "Add a backwards-compatible stylesheet with styles that have been removed from components in SKY UX 9."
},
"ag-grid-29": {
"version": "9.0.0-0",
"factory": "./update-9/ag-grid-29/ag-grid-29.schematic",
"description": "Apply changes to support AG Grid 29"
},
"legacy-services": {
"version": "9.0.0-0",
"factory": "./update-9/legacy-services/legacy-services.schematic",
"description": "Modal and flyout services were previously provided in 'any' but are now provided in 'root'. Replace with a 'legacy' version for backward compatibility."
"version": "10.0.0-0",
"factory": "./update-10/add-compat-stylesheets/add-compat-stylesheet.schematic",
"description": "Add a backwards-compatible stylesheet with styles that have been removed from components in SKY UX 10."
},
"i18n-resources-module": {
"version": "9.0.0-0",
"factory": "./update-9/i18n-resources-module/i18n-resources-module.schematic",
"version": "10.0.0-0",
"factory": "./update-10/i18n-resources-module/i18n-resources-module.schematic",
"description": "Regenerate i18n resources modules for libraries."
},
"move-page-component": {
"version": "9.0.0-0",
"factory": "./update-9/move-page-component/move-page-component.schematic",
"description": "Move SkyPageComponent from @skyux/layout to @skyux/pages."
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,16 @@ exports[`Migrations > Add compat stylesheets should add a compat stylesheet for
* angular.json file.
*******************************************************************************/

/*******************************************************************************
* COMPONENT: INPUT BOX
*******************************************************************************/

/*******************************************************************************
* The bottom margin has been removed from the \`sky-input-box\`. To address
* this, remove this block of CSS and use \`stacked="true"\` to automatically
* have the latest vertical spacing added.
*******************************************************************************/

:root {
--sky-compat-sky-form-group-margin-bottom: 10px
}

/*******************************************************************************
* COMPONENT: STYLES
*******************************************************************************/

/*******************************************************************************
* The bottom margin has been removed from \`sky-form-group\` style class. To
* address this, remove this block of css and change \`sky-form-group\` to
* \`sky-margin-stacked-sm\` or other appropriate spacing classes. See
* https://developer.blackbaud.com/skyux/design/styles/spacing for a list of
* supported spacing classes.
* This is an example and should be removed.
*******************************************************************************/

:root {
--sky-compat-sky-form-group-margin-bottom: 10px
--sky-compat-example: 0;
}
"
`;
Expand All @@ -58,34 +40,16 @@ exports[`Migrations > Add compat stylesheets should add a compat stylesheet for
* angular.json file.
*******************************************************************************/

/*******************************************************************************
* COMPONENT: INPUT BOX
*******************************************************************************/

/*******************************************************************************
* The bottom margin has been removed from the \`sky-input-box\`. To address
* this, remove this block of CSS and use \`stacked="true"\` to automatically
* have the latest vertical spacing added.
*******************************************************************************/

:root {
--sky-compat-sky-form-group-margin-bottom: 10px
}

/*******************************************************************************
* COMPONENT: STYLES
*******************************************************************************/

/*******************************************************************************
* The bottom margin has been removed from \`sky-form-group\` style class. To
* address this, remove this block of css and change \`sky-form-group\` to
* \`sky-margin-stacked-sm\` or other appropriate spacing classes. See
* https://developer.blackbaud.com/skyux/design/styles/spacing for a list of
* supported spacing classes.
* This is an example and should be removed.
*******************************************************************************/

:root {
--sky-compat-sky-form-group-margin-bottom: 10px
--sky-compat-example: 0;
}
"
`;
Expand All @@ -103,34 +67,16 @@ exports[`Migrations > Add compat stylesheets should handle missing styles array
* angular.json file.
*******************************************************************************/

/*******************************************************************************
* COMPONENT: INPUT BOX
*******************************************************************************/

/*******************************************************************************
* The bottom margin has been removed from the \`sky-input-box\`. To address
* this, remove this block of CSS and use \`stacked="true"\` to automatically
* have the latest vertical spacing added.
*******************************************************************************/

:root {
--sky-compat-sky-form-group-margin-bottom: 10px
}

/*******************************************************************************
* COMPONENT: STYLES
*******************************************************************************/

/*******************************************************************************
* The bottom margin has been removed from \`sky-form-group\` style class. To
* address this, remove this block of css and change \`sky-form-group\` to
* \`sky-margin-stacked-sm\` or other appropriate spacing classes. See
* https://developer.blackbaud.com/skyux/design/styles/spacing for a list of
* supported spacing classes.
* This is an example and should be removed.
*******************************************************************************/

:root {
--sky-compat-sky-form-group-margin-bottom: 10px
--sky-compat-example: 0;
}
"
`;
Expand All @@ -148,34 +94,16 @@ exports[`Migrations > Add compat stylesheets should overwrite an existing compat
* angular.json file.
*******************************************************************************/

/*******************************************************************************
* COMPONENT: INPUT BOX
*******************************************************************************/

/*******************************************************************************
* The bottom margin has been removed from the \`sky-input-box\`. To address
* this, remove this block of CSS and use \`stacked="true"\` to automatically
* have the latest vertical spacing added.
*******************************************************************************/

:root {
--sky-compat-sky-form-group-margin-bottom: 10px
}

/*******************************************************************************
* COMPONENT: STYLES
*******************************************************************************/

/*******************************************************************************
* The bottom margin has been removed from \`sky-form-group\` style class. To
* address this, remove this block of css and change \`sky-form-group\` to
* \`sky-margin-stacked-sm\` or other appropriate spacing classes. See
* https://developer.blackbaud.com/skyux/design/styles/spacing for a list of
* supported spacing classes.
* This is an example and should be removed.
*******************************************************************************/

:root {
--sky-compat-sky-form-group-margin-bottom: 10px
--sky-compat-example: 0;
}
"
`;
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { join } from 'path';
import { createTestApp, createTestLibrary } from '../../../testing/scaffold';

describe('Migrations > Add compat stylesheets', () => {
const compatStylesheetPath = 'src/app/skyux9-compat.css';
const compatStylesheetPath = 'src/app/skyux10-compat.css';

const runner = new SchematicTestRunner(
'migrations',
Expand Down Expand Up @@ -155,7 +155,7 @@ describe('Migrations > Add compat stylesheets', () => {
);

const libShowcaseCompatStylesheetPath =
'projects/my-lib-showcase/src/app/skyux9-compat.css';
'projects/my-lib-showcase/src/app/skyux10-compat.css';

angularJson = JSON.parse(updatedTree.readContent('/angular.json'));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,20 @@ import { Rule, Tree, chain } from '@angular-devkit/schematics';
import { readRequiredFile } from '../../../utility/tree';
import { getWorkspace, updateWorkspace } from '../../../utility/workspace';

const COMPAT_CSS_FILE_NAME = 'skyux9-compat.css';
const COMPAT_CSS_FILE_NAME = 'skyux10-compat.css';

type CompatStyle = {
libraries: {
name: string;
components: {
name: string;
styles: { css: string; instructions: string }[];
}[];
}[];
};

const compatStyles = {
const compatStyles: CompatStyle = {
libraries: [
{
name: '@skyux/forms',
components: [
{
name: 'input box',
styles: [
{
css: `
:root {
--sky-compat-sky-form-group-margin-bottom: 10px
}
`,
instructions: `
The bottom margin has been removed from the \`sky-input-box\`. To address this, remove this block of CSS and use \`stacked="true"\` to automatically have the latest vertical spacing added.`,
},
],
},
],
},
{
name: '@skyux/theme',
components: [
Expand All @@ -36,11 +27,11 @@ The bottom margin has been removed from the \`sky-input-box\`. To address this,
{
css: `
:root {
--sky-compat-sky-form-group-margin-bottom: 10px
--sky-compat-example: 0;
}
`,
instructions: `
The bottom margin has been removed from \`sky-form-group\` style class. To address this, remove this block of css and change \`sky-form-group\` to \`sky-margin-stacked-sm\` or other appropriate spacing classes. See https://developer.blackbaud.com/skyux/design/styles/spacing for a list of supported spacing classes.`,
This is an example and should be removed.`,
},
],
},
Expand Down

This file was deleted.

This file was deleted.

Loading
Loading