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

[heft-web-rig] Add an "app" profile, upgrade to Webpack 5, implement new CSS rules #3204

Merged
merged 43 commits into from
Feb 11, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
ba04506
Bring over prototype of updated heft-web-rig
octogonz Feb 4, 2022
05a01b4
Sync some changes to heft-node-rig
octogonz Feb 4, 2022
2e691b6
Relink workspaces dependencies
octogonz Feb 4, 2022
44827a2
Sync dependencies
octogonz Feb 5, 2022
bd7212a
rush update --full
octogonz Feb 5, 2022
fd483cc
Fix a Jest test that failed on Windows OS
octogonz Feb 5, 2022
74ec89a
Reenable strictPeerDependencies=true, upgrade PNPM, and solve all the…
octogonz Feb 5, 2022
f0a227e
rush update --full
octogonz Feb 5, 2022
99777c9
Fix up projects so everything builds successfully
octogonz Feb 5, 2022
9b98c7e
Merge remote-tracking branch 'remotes/origin/master' into octogonz/he…
octogonz Feb 5, 2022
4b3547e
rush change
octogonz Feb 5, 2022
c458420
rush change
octogonz Feb 5, 2022
4728061
Merge remote-tracking branch 'remotes/origin/master' into octogonz/he…
octogonz Feb 7, 2022
b00dbe3
PR feedback -- we're not ready to release 1.0.0 yet
octogonz Feb 7, 2022
2824e3c
PR feedback rush-project.json "outputFolderNames" should match heft.j…
octogonz Feb 7, 2022
02e3346
Update rigs/heft-web-rig/profiles/library/config/typescript.json
octogonz Feb 7, 2022
28b938b
Update rigs/heft-web-rig/profiles/app/config/typescript.json
octogonz Feb 7, 2022
6295160
Update rigs/heft-web-rig/shared/webpack-base.config.js
octogonz Feb 7, 2022
7baea3b
Merge branch 'octogonz/heft-web-rig-revamp' of https://github.com/mic…
octogonz Feb 7, 2022
9fa72da
Convert "webpack" to be a peer dependency of "heft-webpack?-plugin". …
octogonz Feb 7, 2022
d6eca76
rush update --full
octogonz Feb 7, 2022
2f44260
rush change
octogonz Feb 7, 2022
7c0aa06
rush rebuild
octogonz Feb 7, 2022
deee2f2
Enable (optional) bundling of library projects
octogonz Feb 7, 2022
57a632d
Add test projects
octogonz Feb 9, 2022
b70867b
rush update
octogonz Feb 9, 2022
e8f1ae8
Fix some issues with the Webpack config
octogonz Feb 9, 2022
a1bab5f
Example app now builds an runs
octogonz Feb 9, 2022
198b595
PR feedback - cosmetic issues
octogonz Feb 9, 2022
5436f15
Regenerate README.md
octogonz Feb 9, 2022
770ff15
PR feedback -- remove @types/webpack-dev-server
octogonz Feb 9, 2022
4d05712
Show how to configure heft-web-rig-app-tutorial to consume the librar…
octogonz Feb 9, 2022
4fed4d3
PR feedback: Replace "file-loader" with asset modules, and update the…
octogonz Feb 11, 2022
9aeadf2
rush update
octogonz Feb 11, 2022
1c3388d
Move src/templates -> src/schemas/templates to make this folder more …
octogonz Feb 11, 2022
f04d5f7
Bring back the template for sass.json, which got inadvertently delete…
octogonz Feb 11, 2022
72ad161
Replace sass-loader with heft-sass-plugin (work in progress, NOT WORK…
octogonz Feb 11, 2022
bccec15
Temporarily revert the sass.json features from 9aeadf28d49c6a9dc19811…
octogonz Feb 11, 2022
5ccbe25
Fix an issue where source maps weren't loaded for library projects
octogonz Feb 11, 2022
da1d200
rush change
octogonz Feb 11, 2022
bb0edf2
Merge remote-tracking branch 'remotes/origin/master' into octogonz/he…
octogonz Feb 11, 2022
06f121a
rush update --full
octogonz Feb 11, 2022
55ef407
Update README.md
octogonz Feb 11, 2022
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
163 changes: 133 additions & 30 deletions rigs/heft-node-rig/profiles/default/config/heft.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,132 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/heft/heft.schema.json",

/**
* Optionally specifies another JSON config file that this file extends from. This provides a way for standard
* settings to be shared across multiple projects.
*/
// "extends": "base-project/config/heft.json",

"eventActions": [
// {
// /**
// * (Required) The kind of built-in operation that should be performed.
// * The "deleteGlobs" action deletes files or folders that match the specified glob patterns.
// */
// "actionKind": "deleteGlobs",
//
// /**
// * (Required) The Heft stage when this action should be performed. Note that heft.json event actions
// * are scheduled after any plugin tasks have processed the event. For example, a "compile" event action
// * will be performed after the TypeScript compiler has been invoked.
// *
// * Options: "clean", "pre-compile", "compile", "bundle", "post-build"
// */
// "heftEvent": "clean",
//
// /**
// * (Required) A user-defined tag whose purpose is to allow configs to replace/delete handlers that
// * were added by other configs.
// */
// "actionId": "my-example-action",
//
// /**
// * (Required) Glob patterns to be deleted. The paths are resolved relative to the project folder.
// * Documentation for supported glob syntaxes: https://www.npmjs.com/package/fast-glob
// */
// "globsToDelete": [
// "dist",
// "lib",
// "lib-esnext",
// "temp"
// ]
// },
//
// {
// /**
// * (Required) The kind of built-in operation that should be performed.
// * The "copyFiles" action copies files that match the specified patterns.
// */
// "actionKind": "copyFiles",
//
// /**
// * (Required) The Heft stage when this action should be performed. Note that heft.json event actions
// * are scheduled after any plugin tasks have processed the event. For example, a "compile" event action
// * will be performed after the TypeScript compiler has been invoked.
// *
// * Options: "pre-compile", "compile", "bundle", "post-build"
// */
// "heftEvent": "pre-compile",
//
// /**
// * (Required) A user-defined tag whose purpose is to allow configs to replace/delete handlers that
// * were added by other configs.
// */
// "actionId": "my-example-action",
//
// /**
// * (Required) An array of copy operations to run perform during the specified Heft event.
// */
// "copyOperations": [
// {
// /**
// * (Required) The base folder that files will be copied from, relative to the project root.
// * Settings such as "includeGlobs" and "excludeGlobs" will be resolved relative
// * to this folder.
// * NOTE: Assigning "sourceFolder" does not by itself select any files to be copied.
// */
// "sourceFolder": "src",
//
// /**
// * (Required) One or more folders that files will be copied into, relative to the project root.
// * If you specify more than one destination folder, Heft will read the input files only once, using
// * streams to efficiently write multiple outputs.
// */
// "destinationFolders": ["dist/assets"],
//
// /**
// * If specified, this option recursively scans all folders under "sourceFolder" and includes any files
// * that match the specified extensions. (If "fileExtensions" and "includeGlobs" are both
// * specified, their selections are added together.)
// */
// "fileExtensions": [".jpg", ".png"],
//
// /**
// * A list of glob patterns that select files to be copied. The paths are resolved relative
// * to "sourceFolder".
// * Documentation for supported glob syntaxes: https://www.npmjs.com/package/fast-glob
// */
// "includeGlobs": ["assets/*.md"],
//
// /**
// * A list of glob patterns that exclude files/folders from being copied. The paths are resolved relative
// * to "sourceFolder". These exclusions eliminate items that were selected by the "includeGlobs"
// * or "fileExtensions" setting.
// */
// "excludeGlobs": [],
//
// /**
// * Normally, when files are selected under a child folder, a corresponding folder will be created in
// * the destination folder. Specify flatten=true to discard the source path and copy all matching files
// * to the same folder. If two files have the same name an error will be reported.
// * The default value is false.
// */
// "flatten": false,
//
// /**
// * If true, filesystem hard links will be created instead of copying the file. Depending on the
// * operating system, this may be faster. (But note that it may cause unexpected behavior if a tool
// * modifies the link.) The default value is false.
// */
// "hardlink": false
// }
// ]
// }

{
/**
* The kind of built-in operation that should be performed.
* The "deleteGlobs" action deletes files or folders that match the
* specified glob patterns.
*/
"actionKind": "deleteGlobs",

/**
* The stage of the Heft run during which this action should occur. Note that actions specified in heft.json
* occur at the end of the stage of the Heft run.
*/
"heftEvent": "clean",

/**
* A user-defined tag whose purpose is to allow configs to replace/delete handlers that were added by other
* configs.
*/
"actionId": "defaultClean",

/**
* Glob patterns to be deleted. The paths are resolved relative to the project folder.
* Recommend exactly matching with "projectOutputFolderNames" in rush-project.json.
*/
"globsToDelete": ["dist", "lib", "temp"]
}
],
Expand All @@ -37,16 +138,18 @@
* The list of Heft plugins to be loaded.
*/
"heftPlugins": [
{
/**
* The path to the plugin package.
*/
"plugin": "@rushstack/heft-jest-plugin"
// {
// /**
// * The path to the plugin package.
// */
// "plugin": "path/to/my-plugin",
//
// /**
// * An optional object that provides additional settings that may be defined by the plugin.
// */
// // "options": { }
// }

/**
* An optional object that provides additional settings that may be defined by the plugin.
*/
// "options": { }
}
{ "plugin": "@rushstack/heft-jest-plugin" }
]
}
19 changes: 18 additions & 1 deletion rigs/heft-node-rig/profiles/default/config/typescript.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/heft/typescript.schema.json",

/**
* Optionally specifies another JSON config file that this file extends from. This provides a way for standard
* settings to be shared across multiple projects.
*/
// "extends": "base-project/config/typescript.json",

/**
* If provided, emit these module kinds in addition to the modules specified in the tsconfig.
* Note that this option only applies to the main tsconfig.json configuration.
Expand All @@ -22,6 +28,16 @@
// }
],

/**
* If true, emit CommonJS module output to the folder specified in the tsconfig "outDir" compiler option with the .cjs extension alongside (or instead of, if TSConfig specifies CommonJS) the default compilation output.
*/
// "emitCjsExtensionForCommonJS": true,

/**
* If true, emit ESNext module output to the folder specified in the tsconfig "outDir" compiler option with the .mjs extension alongside (or instead of, if TSConfig specifies ESNext) the default compilation output.
*/
// "emitMjsExtensionForESModule": true,

/**
* Specifies the intermediary folder that tests will use. Because Jest uses the
* Node.js runtime to execute tests, the module format must be CommonJS.
Expand All @@ -42,7 +58,8 @@
// "maxWriteParallelism": 50,

/**
* Describes the way files should be statically coped from src to TS output folders
* Configures additional file types that should be copied into the TypeScript compiler's emit folders, for example
* so that these files can be resolved by import statements.
*/
"staticAssetsToCopy": {
/**
Expand Down
1 change: 1 addition & 0 deletions rigs/heft-node-rig/profiles/default/tsconfig-base.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"inlineSources": true,
"experimentalDecorators": true,
"strict": true,
"useUnknownInCatchVariables": false,
"esModuleInterop": true,
"noEmitOnError": false,
"allowUnreachableCode": false,
Expand Down
20 changes: 18 additions & 2 deletions rigs/heft-web-rig/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,26 @@
"@microsoft/api-extractor": "workspace:*",
"@rushstack/heft-jest-plugin": "workspace:*",
"@rushstack/heft-sass-plugin": "workspace:*",
"@rushstack/heft-webpack4-plugin": "workspace:*",
"@rushstack/heft-webpack5-plugin": "workspace:*",
"@rushstack/node-core-library": "workspace:*",
"eslint": "~8.7.0",
"jest-environment-jsdom": "~27.4.2",
"typescript": "~4.5.2"
"typescript": "~4.5.5",
"autoprefixer": "~10.4.2",
"css-loader": "~6.6.0",
"css-minimizer-webpack-plugin": "~3.4.1",
"html-webpack-plugin": "~5.5.0",
"mini-css-extract-plugin": "~2.5.3",
"postcss-loader": "~6.2.1",
"postcss": "~8.4.6",
"sass-loader": "~12.4.0",
"sass": "~1.49.7",
"source-map-loader": "~3.0.1",
"style-loader": "~3.3.1",
"terser-webpack-plugin": "~5.3.1",
"url-loader": "~4.1.1",
"webpack-bundle-analyzer": "~4.5.0",
"webpack-merge": "~5.8.0"
},
"devDependencies": {
"@rushstack/heft": "workspace:*"
Expand Down
Loading