@rushstack/heft-web-rig 0.15.2 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rushstack/heft-web-rig",
3
- "version": "0.15.2",
3
+ "version": "0.16.0",
4
4
  "description": "A rig package for web browser projects that build using Heft",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -9,9 +9,10 @@
9
9
  "directory": "rigs/heft-web-rig"
10
10
  },
11
11
  "peerDependencies": {
12
- "@rushstack/heft": "^0.50.7"
12
+ "@rushstack/heft": "^0.51.0"
13
13
  },
14
14
  "dependencies": {
15
+ "@types/heft-jest": "1.0.1",
15
16
  "autoprefixer": "~10.4.2",
16
17
  "css-loader": "~6.6.0",
17
18
  "css-minimizer-webpack-plugin": "~3.4.1",
@@ -32,12 +33,15 @@
32
33
  "webpack-merge": "~5.8.0",
33
34
  "webpack": "~5.80.0",
34
35
  "@microsoft/api-extractor": "7.35.1",
35
- "@rushstack/heft-jest-plugin": "0.5.13",
36
- "@rushstack/heft-sass-plugin": "0.10.0",
37
- "@rushstack/heft-webpack5-plugin": "0.6.12"
36
+ "@rushstack/heft-api-extractor-plugin": "0.1.0",
37
+ "@rushstack/heft-jest-plugin": "0.6.0",
38
+ "@rushstack/heft-lint-plugin": "0.1.0",
39
+ "@rushstack/heft-sass-plugin": "0.11.0",
40
+ "@rushstack/heft-typescript-plugin": "0.1.0",
41
+ "@rushstack/heft-webpack5-plugin": "0.7.0"
38
42
  },
39
43
  "devDependencies": {
40
- "@rushstack/heft": "0.50.7"
44
+ "@rushstack/heft": "0.51.0"
41
45
  },
42
46
  "scripts": {
43
47
  "build": "",
@@ -10,147 +10,58 @@
10
10
  */
11
11
  // "extends": "base-project/config/heft.json",
12
12
 
13
- "eventActions": [
14
- // {
15
- // /**
16
- // * (Required) The kind of built-in operation that should be performed.
17
- // * The "deleteGlobs" action deletes files or folders that match the specified glob patterns.
18
- // */
19
- // "actionKind": "deleteGlobs",
20
- //
21
- // /**
22
- // * (Required) The Heft stage when this action should be performed. Note that heft.json event actions
23
- // * are scheduled after any plugin tasks have processed the event. For example, a "compile" event action
24
- // * will be performed after the TypeScript compiler has been invoked.
25
- // *
26
- // * Options: "clean", "pre-compile", "compile", "bundle", "post-build"
27
- // */
28
- // "heftEvent": "clean",
29
- //
30
- // /**
31
- // * (Required) A user-defined tag whose purpose is to allow configs to replace/delete handlers that
32
- // * were added by other configs.
33
- // */
34
- // "actionId": "my-example-action",
35
- //
36
- // /**
37
- // * (Required) Glob patterns to be deleted. The paths are resolved relative to the project folder.
38
- // * Documentation for supported glob syntaxes: https://www.npmjs.com/package/fast-glob
39
- // */
40
- // "globsToDelete": [
41
- // "dist",
42
- // "lib",
43
- // "lib-esnext",
44
- // "temp"
45
- // ]
46
- // },
47
- //
48
- // {
49
- // /**
50
- // * (Required) The kind of built-in operation that should be performed.
51
- // * The "copyFiles" action copies files that match the specified patterns.
52
- // */
53
- // "actionKind": "copyFiles",
54
- //
55
- // /**
56
- // * (Required) The Heft stage when this action should be performed. Note that heft.json event actions
57
- // * are scheduled after any plugin tasks have processed the event. For example, a "compile" event action
58
- // * will be performed after the TypeScript compiler has been invoked.
59
- // *
60
- // * Options: "pre-compile", "compile", "bundle", "post-build"
61
- // */
62
- // "heftEvent": "pre-compile",
63
- //
64
- // /**
65
- // * (Required) A user-defined tag whose purpose is to allow configs to replace/delete handlers that
66
- // * were added by other configs.
67
- // */
68
- // "actionId": "my-example-action",
69
- //
70
- // /**
71
- // * (Required) An array of copy operations to run perform during the specified Heft event.
72
- // */
73
- // "copyOperations": [
74
- // {
75
- // /**
76
- // * (Required) The base folder that files will be copied from, relative to the project root.
77
- // * Settings such as "includeGlobs" and "excludeGlobs" will be resolved relative
78
- // * to this folder.
79
- // * NOTE: Assigning "sourceFolder" does not by itself select any files to be copied.
80
- // */
81
- // "sourceFolder": "src",
82
- //
83
- // /**
84
- // * (Required) One or more folders that files will be copied into, relative to the project root.
85
- // * If you specify more than one destination folder, Heft will read the input files only once, using
86
- // * streams to efficiently write multiple outputs.
87
- // */
88
- // "destinationFolders": ["dist/assets"],
89
- //
90
- // /**
91
- // * If specified, this option recursively scans all folders under "sourceFolder" and includes any files
92
- // * that match the specified extensions. (If "fileExtensions" and "includeGlobs" are both
93
- // * specified, their selections are added together.)
94
- // */
95
- // "fileExtensions": [".jpg", ".png"],
96
- //
97
- // /**
98
- // * A list of glob patterns that select files to be copied. The paths are resolved relative
99
- // * to "sourceFolder".
100
- // * Documentation for supported glob syntaxes: https://www.npmjs.com/package/fast-glob
101
- // */
102
- // "includeGlobs": ["assets/*.md"],
103
- //
104
- // /**
105
- // * A list of glob patterns that exclude files/folders from being copied. The paths are resolved relative
106
- // * to "sourceFolder". These exclusions eliminate items that were selected by the "includeGlobs"
107
- // * or "fileExtensions" setting.
108
- // */
109
- // "excludeGlobs": [],
110
- //
111
- // /**
112
- // * Normally, when files are selected under a child folder, a corresponding folder will be created in
113
- // * the destination folder. Specify flatten=true to discard the source path and copy all matching files
114
- // * to the same folder. If two files have the same name an error will be reported.
115
- // * The default value is false.
116
- // */
117
- // "flatten": false,
118
- //
119
- // /**
120
- // * If true, filesystem hard links will be created instead of copying the file. Depending on the
121
- // * operating system, this may be faster. (But note that it may cause unexpected behavior if a tool
122
- // * modifies the link.) The default value is false.
123
- // */
124
- // "hardlink": false
125
- // }
126
- // ]
127
- // }
13
+ // TODO: Add comments
14
+ "phasesByName": {
15
+ "build": {
16
+ "cleanFiles": [
17
+ { "sourcePath": "dist" },
18
+ { "sourcePath": "lib" },
19
+ { "sourcePath": "lib-amd" },
20
+ { "sourcePath": "lib-commonjs" },
21
+ { "sourcePath": "lib-es6" }
22
+ ],
23
+ "tasksByName": {
24
+ "sass": {
25
+ "taskPlugin": {
26
+ "pluginPackage": "@rushstack/heft-sass-plugin"
27
+ }
28
+ },
29
+ "typescript": {
30
+ "taskDependencies": ["sass"],
31
+ "taskPlugin": {
32
+ "pluginPackage": "@rushstack/heft-typescript-plugin"
33
+ }
34
+ },
35
+ "lint": {
36
+ "taskDependencies": ["typescript"],
37
+ "taskPlugin": {
38
+ "pluginPackage": "@rushstack/heft-lint-plugin"
39
+ }
40
+ },
41
+ "api-extractor": {
42
+ "taskDependencies": ["typescript"],
43
+ "taskPlugin": {
44
+ "pluginPackage": "@rushstack/heft-api-extractor-plugin"
45
+ }
46
+ },
47
+ "webpack": {
48
+ "taskDependencies": ["typescript"],
49
+ "taskPlugin": {
50
+ "pluginPackage": "@rushstack/heft-webpack5-plugin"
51
+ }
52
+ }
53
+ }
54
+ },
128
55
 
129
- {
130
- "actionKind": "deleteGlobs",
131
- "heftEvent": "clean",
132
- "actionId": "defaultClean",
133
- "globsToDelete": ["dist", "lib", "lib-amd", "lib-commonjs", "lib-es6", "temp"]
56
+ "test": {
57
+ "phaseDependencies": ["build"],
58
+ "tasksByName": {
59
+ "jest": {
60
+ "taskPlugin": {
61
+ "pluginPackage": "@rushstack/heft-jest-plugin"
62
+ }
63
+ }
64
+ }
134
65
  }
135
- ],
136
-
137
- /**
138
- * The list of Heft plugins to be loaded.
139
- */
140
- "heftPlugins": [
141
- // {
142
- // /**
143
- // * The path to the plugin package.
144
- // */
145
- // "plugin": "path/to/my-plugin",
146
- //
147
- // /**
148
- // * An optional object that provides additional settings that may be defined by the plugin.
149
- // */
150
- // // "options": { }
151
- // }
152
- { "plugin": "@rushstack/heft-jest-plugin" },
153
- { "plugin": "@rushstack/heft-sass-plugin" },
154
- { "plugin": "@rushstack/heft-webpack5-plugin" }
155
- ]
66
+ }
156
67
  }
@@ -1,5 +1,20 @@
1
1
  {
2
2
  "extends": "@rushstack/heft-jest-plugin/includes/jest-shared.config.json",
3
3
 
4
- "testEnvironment": "jest-environment-jsdom"
4
+ "testEnvironment": "jest-environment-jsdom",
5
+
6
+ // "Adding '<rootDir>/lib-commonjs' here enables lib-commonjs/__mocks__ to be used for mocking Node.js system modules
7
+ "roots": ["<rootDir>/lib-commonjs"],
8
+
9
+ "testMatch": ["<rootDir>/lib-commonjs/**/*.test.js"],
10
+
11
+ "collectCoverageFrom": [
12
+ "lib-commonjs/**/*.js",
13
+ "!lib-commonjs/**/*.d.ts",
14
+ "!lib-commonjs/**/*.test.js",
15
+ "!lib-commonjs/**/test/**",
16
+ "!lib-commonjs/**/__tests__/**",
17
+ "!lib-commonjs/**/__fixtures__/**",
18
+ "!lib-commonjs/**/__mocks__/**"
19
+ ]
5
20
  }
@@ -44,23 +44,9 @@
44
44
  // "emitMjsExtensionForESModule": true,
45
45
 
46
46
  /**
47
- * Specifies the intermediary folder that tests will use. Because Jest uses the
48
- * Node.js runtime to execute tests, the module format must be CommonJS.
49
- *
50
- * The default value is "lib".
47
+ * If true and "isolatedModules" is configured in tsconfig.json, use a worker thread to run transpilation concurrently with type checking and declaration emit.
51
48
  */
52
- "emitFolderNameForTests": "lib-commonjs",
53
-
54
- /**
55
- * If set to "true", the TSlint task will not be invoked.
56
- */
57
- // "disableTslint": true,
58
-
59
- /**
60
- * Set this to change the maximum number of file handles that will be opened concurrently for writing.
61
- * The default is 50.
62
- */
63
- // "maxWriteParallelism": 50,
49
+ // "useTranspilerWorker": true
64
50
 
65
51
  /**
66
52
  * Configures additional file types that should be copied into the TypeScript compiler's emit folders, for example
@@ -20,12 +20,15 @@
20
20
  "allowUnreachableCode": false,
21
21
  "importHelpers": true,
22
22
 
23
- "types": [],
23
+ "types": ["heft-jest"],
24
+ "typeRoots": ["../../../../../node_modules/@types", "../../node_modules/@types"],
24
25
 
25
26
  "module": "esnext",
26
27
  "moduleResolution": "node",
27
28
  "target": "es5",
28
- "lib": ["es5", "scripthost", "es2015.collection", "es2015.promise", "es2015.iterable", "dom"]
29
+ "lib": ["es5", "scripthost", "es2015.collection", "es2015.promise", "es2015.iterable", "dom"],
30
+
31
+ "incremental": true
29
32
  },
30
33
  "include": ["../../../../../src/**/*.ts", "../../../../../src/**/*.tsx"]
31
34
  }
@@ -10,147 +10,58 @@
10
10
  */
11
11
  // "extends": "base-project/config/heft.json",
12
12
 
13
- "eventActions": [
14
- // {
15
- // /**
16
- // * (Required) The kind of built-in operation that should be performed.
17
- // * The "deleteGlobs" action deletes files or folders that match the specified glob patterns.
18
- // */
19
- // "actionKind": "deleteGlobs",
20
- //
21
- // /**
22
- // * (Required) The Heft stage when this action should be performed. Note that heft.json event actions
23
- // * are scheduled after any plugin tasks have processed the event. For example, a "compile" event action
24
- // * will be performed after the TypeScript compiler has been invoked.
25
- // *
26
- // * Options: "clean", "pre-compile", "compile", "bundle", "post-build"
27
- // */
28
- // "heftEvent": "clean",
29
- //
30
- // /**
31
- // * (Required) A user-defined tag whose purpose is to allow configs to replace/delete handlers that
32
- // * were added by other configs.
33
- // */
34
- // "actionId": "my-example-action",
35
- //
36
- // /**
37
- // * (Required) Glob patterns to be deleted. The paths are resolved relative to the project folder.
38
- // * Documentation for supported glob syntaxes: https://www.npmjs.com/package/fast-glob
39
- // */
40
- // "globsToDelete": [
41
- // "dist",
42
- // "lib",
43
- // "lib-esnext",
44
- // "temp"
45
- // ]
46
- // },
47
- //
48
- // {
49
- // /**
50
- // * (Required) The kind of built-in operation that should be performed.
51
- // * The "copyFiles" action copies files that match the specified patterns.
52
- // */
53
- // "actionKind": "copyFiles",
54
- //
55
- // /**
56
- // * (Required) The Heft stage when this action should be performed. Note that heft.json event actions
57
- // * are scheduled after any plugin tasks have processed the event. For example, a "compile" event action
58
- // * will be performed after the TypeScript compiler has been invoked.
59
- // *
60
- // * Options: "pre-compile", "compile", "bundle", "post-build"
61
- // */
62
- // "heftEvent": "pre-compile",
63
- //
64
- // /**
65
- // * (Required) A user-defined tag whose purpose is to allow configs to replace/delete handlers that
66
- // * were added by other configs.
67
- // */
68
- // "actionId": "my-example-action",
69
- //
70
- // /**
71
- // * (Required) An array of copy operations to run perform during the specified Heft event.
72
- // */
73
- // "copyOperations": [
74
- // {
75
- // /**
76
- // * (Required) The base folder that files will be copied from, relative to the project root.
77
- // * Settings such as "includeGlobs" and "excludeGlobs" will be resolved relative
78
- // * to this folder.
79
- // * NOTE: Assigning "sourceFolder" does not by itself select any files to be copied.
80
- // */
81
- // "sourceFolder": "src",
82
- //
83
- // /**
84
- // * (Required) One or more folders that files will be copied into, relative to the project root.
85
- // * If you specify more than one destination folder, Heft will read the input files only once, using
86
- // * streams to efficiently write multiple outputs.
87
- // */
88
- // "destinationFolders": ["dist/assets"],
89
- //
90
- // /**
91
- // * If specified, this option recursively scans all folders under "sourceFolder" and includes any files
92
- // * that match the specified extensions. (If "fileExtensions" and "includeGlobs" are both
93
- // * specified, their selections are added together.)
94
- // */
95
- // "fileExtensions": [".jpg", ".png"],
96
- //
97
- // /**
98
- // * A list of glob patterns that select files to be copied. The paths are resolved relative
99
- // * to "sourceFolder".
100
- // * Documentation for supported glob syntaxes: https://www.npmjs.com/package/fast-glob
101
- // */
102
- // "includeGlobs": ["assets/*.md"],
103
- //
104
- // /**
105
- // * A list of glob patterns that exclude files/folders from being copied. The paths are resolved relative
106
- // * to "sourceFolder". These exclusions eliminate items that were selected by the "includeGlobs"
107
- // * or "fileExtensions" setting.
108
- // */
109
- // "excludeGlobs": [],
110
- //
111
- // /**
112
- // * Normally, when files are selected under a child folder, a corresponding folder will be created in
113
- // * the destination folder. Specify flatten=true to discard the source path and copy all matching files
114
- // * to the same folder. If two files have the same name an error will be reported.
115
- // * The default value is false.
116
- // */
117
- // "flatten": false,
118
- //
119
- // /**
120
- // * If true, filesystem hard links will be created instead of copying the file. Depending on the
121
- // * operating system, this may be faster. (But note that it may cause unexpected behavior if a tool
122
- // * modifies the link.) The default value is false.
123
- // */
124
- // "hardlink": false
125
- // }
126
- // ]
127
- // }
13
+ // TODO: Add comments
14
+ "phasesByName": {
15
+ "build": {
16
+ "cleanFiles": [
17
+ { "sourcePath": "dist" },
18
+ { "sourcePath": "lib" },
19
+ { "sourcePath": "lib-amd" },
20
+ { "sourcePath": "lib-commonjs" },
21
+ { "sourcePath": "lib-es6" }
22
+ ],
23
+ "tasksByName": {
24
+ "sass-typings": {
25
+ "taskPlugin": {
26
+ "pluginPackage": "@rushstack/heft-sass-plugin"
27
+ }
28
+ },
29
+ "typescript": {
30
+ "taskDependencies": ["sass-typings"],
31
+ "taskPlugin": {
32
+ "pluginPackage": "@rushstack/heft-typescript-plugin"
33
+ }
34
+ },
35
+ "lint": {
36
+ "taskDependencies": ["typescript"],
37
+ "taskPlugin": {
38
+ "pluginPackage": "@rushstack/heft-lint-plugin"
39
+ }
40
+ },
41
+ "api-extractor": {
42
+ "taskDependencies": ["typescript"],
43
+ "taskPlugin": {
44
+ "pluginPackage": "@rushstack/heft-api-extractor-plugin"
45
+ }
46
+ },
47
+ "webpack": {
48
+ "taskDependencies": ["typescript"],
49
+ "taskPlugin": {
50
+ "pluginPackage": "@rushstack/heft-webpack5-plugin"
51
+ }
52
+ }
53
+ }
54
+ },
128
55
 
129
- {
130
- "actionKind": "deleteGlobs",
131
- "heftEvent": "clean",
132
- "actionId": "defaultClean",
133
- "globsToDelete": ["dist", "lib", "lib-amd", "lib-commonjs", "lib-es6", "temp"]
56
+ "test": {
57
+ "phaseDependencies": ["build"],
58
+ "tasksByName": {
59
+ "jest": {
60
+ "taskPlugin": {
61
+ "pluginPackage": "@rushstack/heft-jest-plugin"
62
+ }
63
+ }
64
+ }
134
65
  }
135
- ],
136
-
137
- /**
138
- * The list of Heft plugins to be loaded.
139
- */
140
- "heftPlugins": [
141
- // {
142
- // /**
143
- // * The path to the plugin package.
144
- // */
145
- // "plugin": "path/to/my-plugin",
146
- //
147
- // /**
148
- // * An optional object that provides additional settings that may be defined by the plugin.
149
- // */
150
- // // "options": { }
151
- // }
152
- { "plugin": "@rushstack/heft-jest-plugin" },
153
- { "plugin": "@rushstack/heft-sass-plugin" },
154
- { "plugin": "@rushstack/heft-webpack5-plugin" }
155
- ]
66
+ }
156
67
  }
@@ -1,5 +1,20 @@
1
1
  {
2
2
  "extends": "@rushstack/heft-jest-plugin/includes/jest-shared.config.json",
3
3
 
4
- "testEnvironment": "jest-environment-jsdom"
4
+ "testEnvironment": "jest-environment-jsdom",
5
+
6
+ // "Adding '<rootDir>/lib-commonjs' here enables lib-commonjs/__mocks__ to be used for mocking Node.js system modules
7
+ "roots": ["<rootDir>/lib-commonjs"],
8
+
9
+ "testMatch": ["<rootDir>/lib-commonjs/**/*.test.js"],
10
+
11
+ "collectCoverageFrom": [
12
+ "lib-commonjs/**/*.js",
13
+ "!lib-commonjs/**/*.d.ts",
14
+ "!lib-commonjs/**/*.test.js",
15
+ "!lib-commonjs/**/test/**",
16
+ "!lib-commonjs/**/__tests__/**",
17
+ "!lib-commonjs/**/__fixtures__/**",
18
+ "!lib-commonjs/**/__mocks__/**"
19
+ ]
5
20
  }
@@ -44,23 +44,9 @@
44
44
  // "emitMjsExtensionForESModule": true,
45
45
 
46
46
  /**
47
- * Specifies the intermediary folder that tests will use. Because Jest uses the
48
- * Node.js runtime to execute tests, the module format must be CommonJS.
49
- *
50
- * The default value is "lib".
47
+ * If true and "isolatedModules" is configured in tsconfig.json, use a worker thread to run transpilation concurrently with type checking and declaration emit.
51
48
  */
52
- "emitFolderNameForTests": "lib-commonjs",
53
-
54
- /**
55
- * If set to "true", the TSlint task will not be invoked.
56
- */
57
- // "disableTslint": true,
58
-
59
- /**
60
- * Set this to change the maximum number of file handles that will be opened concurrently for writing.
61
- * The default is 50.
62
- */
63
- // "maxWriteParallelism": 50,
49
+ // "useTranspilerWorker": true
64
50
 
65
51
  /**
66
52
  * Configures additional file types that should be copied into the TypeScript compiler's emit folders, for example
@@ -20,12 +20,15 @@
20
20
  "allowUnreachableCode": false,
21
21
  "importHelpers": true,
22
22
 
23
- "types": [],
23
+ "types": ["heft-jest"],
24
+ "typeRoots": ["../../../../../node_modules/@types", "../../node_modules/@types"],
24
25
 
25
26
  "module": "esnext",
26
27
  "moduleResolution": "node",
27
28
  "target": "es5",
28
- "lib": ["es5", "scripthost", "es2015.collection", "es2015.promise", "es2015.iterable", "dom"]
29
+ "lib": ["es5", "scripthost", "es2015.collection", "es2015.promise", "es2015.iterable", "dom"],
30
+
31
+ "incremental": true
29
32
  },
30
33
  "include": ["../../../../../src/**/*.ts", "../../../../../src/**/*.tsx"]
31
34
  }