Skip to content

Commit a5f16cc

Browse files
committed
Extract default sass plugin from heft to its own heft-sass-plugin
1 parent 6bcb88c commit a5f16cc

File tree

25 files changed

+273
-102
lines changed

25 files changed

+273
-102
lines changed

apps/heft/package.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@
4242
"fast-glob": "~3.2.4",
4343
"glob": "~7.0.5",
4444
"glob-escape": "~0.0.2",
45-
"node-sass": "5.0.0",
46-
"postcss": "7.0.32",
47-
"postcss-modules": "~1.5.0",
4845
"prettier": "~2.3.0",
4946
"semver": "~7.3.0",
5047
"tapable": "1.1.3",
@@ -60,7 +57,6 @@
6057
"@types/glob": "7.1.1",
6158
"@types/heft-jest": "1.0.1",
6259
"@types/node": "10.17.13",
63-
"@types/node-sass": "4.11.1",
6460
"@types/semver": "7.3.5",
6561
"colors": "~1.2.1",
6662
"tslint": "~5.20.1",

apps/heft/src/pluginFramework/PluginManager.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import { DeleteGlobsPlugin } from '../plugins/DeleteGlobsPlugin';
2020
import { CopyStaticAssetsPlugin } from '../plugins/CopyStaticAssetsPlugin';
2121
import { RunScriptPlugin } from '../plugins/RunScriptPlugin';
2222
import { ApiExtractorPlugin } from '../plugins/ApiExtractorPlugin/ApiExtractorPlugin';
23-
import { SassTypingsPlugin } from '../plugins/SassTypingsPlugin/SassTypingsPlugin';
2423
import { ProjectValidatorPlugin } from '../plugins/ProjectValidatorPlugin';
2524
import { ToolPackageResolver } from '../utilities/ToolPackageResolver';
2625
import { NodeServicePlugin } from '../plugins/NodeServicePlugin';
@@ -53,7 +52,6 @@ export class PluginManager {
5352
this._applyPlugin(new DeleteGlobsPlugin());
5453
this._applyPlugin(new RunScriptPlugin());
5554
this._applyPlugin(new ApiExtractorPlugin(taskPackageResolver));
56-
this._applyPlugin(new SassTypingsPlugin());
5755
this._applyPlugin(new ProjectValidatorPlugin());
5856
this._applyPlugin(new NodeServicePlugin());
5957
}

apps/heft/src/templates/sass.json

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

apps/heft/src/utilities/CoreConfigFiles.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { IApiExtractorPluginConfiguration } from '../plugins/ApiExtractorPlugin/
1313
import { ITypeScriptConfigurationJson } from '../plugins/TypeScriptPlugin/TypeScriptPlugin';
1414
import { HeftConfiguration } from '../configuration/HeftConfiguration';
1515
import { Terminal } from '@rushstack/node-core-library';
16-
import { ISassConfigurationJson } from '../plugins/SassTypingsPlugin/SassTypingsPlugin';
1716
import { INodeServicePluginConfiguration } from '../plugins/NodeServicePlugin';
1817

1918
export enum HeftEvent {
@@ -125,7 +124,6 @@ export class CoreConfigFiles {
125124
private static _nodeServiceConfigurationLoader:
126125
| ConfigurationFile<INodeServicePluginConfiguration>
127126
| undefined;
128-
private static _sassConfigurationFileLoader: ConfigurationFile<ISassConfigurationJson> | undefined;
129127

130128
/**
131129
* Returns the loader for the `config/heft.json` config file.
@@ -283,27 +281,6 @@ export class CoreConfigFiles {
283281
return CoreConfigFiles._nodeServiceConfigurationLoader;
284282
}
285283

286-
public static get sassConfigurationFileLoader(): ConfigurationFile<ISassConfigurationJson> {
287-
const schemaPath: string = path.resolve(__dirname, '..', 'schemas', 'sass.schema.json');
288-
CoreConfigFiles._sassConfigurationFileLoader = new ConfigurationFile<ISassConfigurationJson>({
289-
projectRelativeFilePath: 'config/sass.json',
290-
jsonSchemaPath: schemaPath,
291-
jsonPathMetadata: {
292-
'$.importIncludePaths.*': {
293-
pathResolutionMethod: PathResolutionMethod.resolvePathRelativeToProjectRoot
294-
},
295-
'$.generatedTsFolder.*': {
296-
pathResolutionMethod: PathResolutionMethod.resolvePathRelativeToProjectRoot
297-
},
298-
'$.srcFolder.*': {
299-
pathResolutionMethod: PathResolutionMethod.resolvePathRelativeToProjectRoot
300-
}
301-
}
302-
});
303-
304-
return CoreConfigFiles._sassConfigurationFileLoader;
305-
}
306-
307284
private static _addEventActionToMap<TEventAction extends IHeftConfigurationJsonEventActionBase>(
308285
eventAction: TEventAction,
309286
map: Map<HeftEvent, TEventAction[]>

apps/heft/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"typeRoots": ["./custom-typings", "./node_modules/@types/"],
66
"types": ["heft-jest", "node"]
77
},
8-
"include": ["src/**/*.ts", "src/**/*.tsx", "./custom-typings/**/*.ts"]
8+
"include": ["src/**/*.ts", "src/**/*.tsx"]
99
}

build-tests/heft-sass-test/config/heft.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@
5252
* The path to the plugin package.
5353
*/
5454
"plugin": "@rushstack/heft-jest-plugin"
55+
},
56+
{
57+
/**
58+
* The path to the plugin package.
59+
*/
60+
"plugin": "@rushstack/heft-sass-plugin"
5561
}
5662
]
5763
}

build-tests/heft-sass-test/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"@rushstack/eslint-config": "workspace:*",
1212
"@rushstack/heft": "workspace:*",
1313
"@rushstack/heft-jest-plugin": "workspace:*",
14+
"@rushstack/heft-sass-plugin": "workspace:*",
1415
"@rushstack/heft-webpack4-plugin": "workspace:*",
1516
"@types/heft-jest": "1.0.1",
1617
"@types/react-dom": "16.9.8",

common/config/rush/browser-approved-packages.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
{
33
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/approved-packages.schema.json",
44
"packages": [
5+
{
6+
"name": "@rushstack/heft-sass-plugin",
7+
"allowedCategories": [ "tests" ]
8+
},
59
{
610
"name": "react",
711
"allowedCategories": [ "tests" ]

common/config/rush/pnpm-lock.yaml

Lines changed: 37 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common/config/rush/repo-state.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush.
22
{
3-
"pnpmShrinkwrapHash": "f45464cdd2ef1f79ab3446b3edd2384175b1e967",
3+
"pnpmShrinkwrapHash": "90d9a6f48b14750485b141fc7547965bcb69bb9f",
44
"preferredVersionsHash": "1fbc26d2c5b3248616b9edccd6bef064075243bc"
55
}

0 commit comments

Comments
 (0)