@microsoft/sp-build-web 1.21.0-beta.0 → 1.21.0-beta.2
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/lib-commonjs/BuildRigConstants.js +23 -0
- package/lib-commonjs/SPBuildRig.js +286 -0
- package/lib-commonjs/SPWebBuildRig.js +250 -0
- package/lib-commonjs/WebBuildRigConstants.js +25 -0
- package/lib-commonjs/index.js +56 -0
- package/{lib → lib-esm}/BuildRigConstants.js +3 -5
- package/lib-esm/SPBuildRig.js +227 -0
- package/lib-esm/SPWebBuildRig.js +186 -0
- package/{lib → lib-esm}/WebBuildRigConstants.js +3 -5
- package/lib-esm/index.js +19 -0
- package/package.json +28 -7
- package/lib/BuildRigConstants.d.ts.map +0 -1
- package/lib/SPBuildRig.d.ts.map +0 -1
- package/lib/SPBuildRig.js +0 -258
- package/lib/SPWebBuildRig.d.ts.map +0 -1
- package/lib/SPWebBuildRig.js +0 -212
- package/lib/WebBuildRigConstants.d.ts.map +0 -1
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -39
- /package/{lib → lib-dts}/BuildRigConstants.d.ts +0 -0
- /package/{lib → lib-dts}/SPBuildRig.d.ts +0 -0
- /package/{lib → lib-dts}/SPWebBuildRig.d.ts +0 -0
- /package/{lib → lib-dts}/WebBuildRigConstants.d.ts +0 -0
- /package/{lib → lib-dts}/index.d.ts +0 -0
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
function _define_property(obj, key, value) {
|
|
2
|
+
if (key in obj) {
|
|
3
|
+
Object.defineProperty(obj, key, {
|
|
4
|
+
value: value,
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true
|
|
8
|
+
});
|
|
9
|
+
} else {
|
|
10
|
+
obj[key] = value;
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
import * as fs from 'fs';
|
|
15
|
+
import * as yargs from 'yargs';
|
|
16
|
+
import * as semver from 'semver';
|
|
17
|
+
import * as coreBuild from '@microsoft/gulp-core-build';
|
|
18
|
+
import { tscCmd, lintCmd, apiExtractor } from '@microsoft/gulp-core-build-typescript';
|
|
19
|
+
import { BuildRigConstants } from './BuildRigConstants';
|
|
20
|
+
export const preCopy = new coreBuild.CopyTask();
|
|
21
|
+
export const postCopy = new coreBuild.CopyTask();
|
|
22
|
+
/**
|
|
23
|
+
* This class represents the basic shared build rig for all SPFx Rigs. It defines a few
|
|
24
|
+
* simple sub-tasks, and only registers a "build" task.
|
|
25
|
+
*/ export class SPBuildRig {
|
|
26
|
+
initialize(gulp) {
|
|
27
|
+
if (!semver.satisfies(process.version, this.nodeSupportedVersionRange)) {
|
|
28
|
+
const nodeVersionMessage = `Your dev environment is running NodeJS version ${process.version} which does` + ' not meet the requirements for running this tool. This tool requires a version of NodeJS' + ` that matches "${this.nodeSupportedVersionRange}".`;
|
|
29
|
+
if (process.env.SPFX_OVERRIDE_NODE_VERSION_CHECK === 'true') {
|
|
30
|
+
// This environment variable is when testing new versions of NodeJS for compatibility.
|
|
31
|
+
// eslint-disable-next-line no-console
|
|
32
|
+
console.warn(nodeVersionMessage + ' Proceeding with execution due to override.');
|
|
33
|
+
} else {
|
|
34
|
+
throw new Error(nodeVersionMessage);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
// Initialize yargs & figure out which command we are running
|
|
38
|
+
const yargsArgs = this.getYargs();
|
|
39
|
+
const command = yargsArgs.argv._[0];
|
|
40
|
+
this.args = yargsArgs.argv;
|
|
41
|
+
// Collect the tasks which need to be registered
|
|
42
|
+
const tasks = this.getTasks();
|
|
43
|
+
// Reset the args and reconfigure based on the selected command
|
|
44
|
+
yargsArgs.reset();
|
|
45
|
+
if (tasks.has(command)) {
|
|
46
|
+
const task = tasks.get(command);
|
|
47
|
+
if (task && task.arguments) {
|
|
48
|
+
task.arguments(yargsArgs);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
// Note this overrides the getters for ship and production on args
|
|
52
|
+
this.args.ship = this.args.production = this.args.production || this.args.ship;
|
|
53
|
+
// Since gulp-core-build doesn't recognize the --ship flag, ensure it gets the right state
|
|
54
|
+
coreBuild.mergeConfig({
|
|
55
|
+
production: this.args.ship,
|
|
56
|
+
shouldWarningsFailBuild: this.args.ship
|
|
57
|
+
});
|
|
58
|
+
// Register all the tasks with gulp-core-build
|
|
59
|
+
tasks.forEach((definition, name)=>{
|
|
60
|
+
coreBuild.task(name, definition.executable);
|
|
61
|
+
});
|
|
62
|
+
// If they are just looking for the task list, save time by not reading config files
|
|
63
|
+
if (!this.args.tasks) {
|
|
64
|
+
// Configure tasks for a normal build
|
|
65
|
+
// eslint-disable-next-line no-console
|
|
66
|
+
console.log('Build target: ' + (this.args.ship ? BuildRigConstants.flavors.ship.toUpperCase() : BuildRigConstants.flavors.debug.toUpperCase()));
|
|
67
|
+
this.setupSharedConfig();
|
|
68
|
+
}
|
|
69
|
+
coreBuild.initialize(gulp);
|
|
70
|
+
// Try to ensure the casing of the rootPath is correct
|
|
71
|
+
try {
|
|
72
|
+
const originalRootPath = coreBuild.getConfig().rootPath;
|
|
73
|
+
const normalizedRootPath = fs.realpathSync.native(originalRootPath);
|
|
74
|
+
if (normalizedRootPath !== originalRootPath) {
|
|
75
|
+
coreBuild.mergeConfig({
|
|
76
|
+
rootPath: normalizedRootPath
|
|
77
|
+
});
|
|
78
|
+
// eslint-disable-next-line no-console
|
|
79
|
+
console.log(`Normalized project rootPath from "${originalRootPath}" to ${normalizedRootPath}`);
|
|
80
|
+
}
|
|
81
|
+
} catch (e) {
|
|
82
|
+
// eslint-disable-next-line no-console
|
|
83
|
+
console.error(`An error occurred when normalizing the project root path: ${e}`);
|
|
84
|
+
}
|
|
85
|
+
// If they are just looking for the task list, save time by not reading config files
|
|
86
|
+
if (!this.args.tasks) {
|
|
87
|
+
this.finalizeSharedConfig();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Register additional telemetry sub-tasks to run at the end of the sequence
|
|
92
|
+
*/ addPostTelemetryTask(tasks) {
|
|
93
|
+
this.addTaskOrListOfTasks(tasks, this._postTelemetryTask);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Register additional telemetry sub-tasks to run at the beginning of the sequence
|
|
97
|
+
*/ addPreTelemetryTask(tasks) {
|
|
98
|
+
this.addTaskOrListOfTasks(tasks, this._preTelemetryTask);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Register additional sub-tasks to run before the typescript subtask.
|
|
102
|
+
* Note, this is meant to be used in a gulpfile.js to inject one-off subtasks
|
|
103
|
+
*/ addPreBuildTask(tasks) {
|
|
104
|
+
this.addTaskOrListOfTasks(tasks, this._preBuildTasks);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Register additional sub-tasks to run after the typescript subtask.
|
|
108
|
+
* Note, this is meant to be used in a gulpfile.js to inject one-off subtasks
|
|
109
|
+
*/ addPostTypescriptTask(tasks) {
|
|
110
|
+
this.addTaskOrListOfTasks(tasks, this._postTypescriptTasks);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Register additional sub-tasks to run after the typescript subtask.
|
|
114
|
+
* @deprecated - Use {@link addPostTypescriptTask} instead
|
|
115
|
+
*/ addBuildTasks(tasks) {
|
|
116
|
+
this.addTaskOrListOfTasks(tasks, this._postTypescriptTasks);
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Register additional sub-tasks to run after the entire build.
|
|
120
|
+
* Note, this is meant to be used in a gulpfile.js to inject one-off subtasks
|
|
121
|
+
*/ addPostBuildTask(tasks) {
|
|
122
|
+
this.addTaskOrListOfTasks(tasks, this._postBuildTasks);
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Override this function to register more top-level command line arguments (i.e. not task-specific).
|
|
126
|
+
* Ideally, extend the ICoreBuildArgs when hooking into this function
|
|
127
|
+
*
|
|
128
|
+
* Registers the command line arguments which are available for this rig
|
|
129
|
+
*/ getYargs() {
|
|
130
|
+
return yargs.usage().option('production', {
|
|
131
|
+
alias: 'p',
|
|
132
|
+
describe: 'build in ship mode with full localization and minimization',
|
|
133
|
+
boolean: true
|
|
134
|
+
}).option('ship', {
|
|
135
|
+
alias: 'p',
|
|
136
|
+
describe: 'build in ship mode with full localization and minimization',
|
|
137
|
+
boolean: true
|
|
138
|
+
}).option('verbose', {
|
|
139
|
+
describe: 'run the build with verbose logging'
|
|
140
|
+
}).option('tasks', {
|
|
141
|
+
alias: [
|
|
142
|
+
'T',
|
|
143
|
+
'tasks-simple'
|
|
144
|
+
],
|
|
145
|
+
describe: 'shows the list of tasks which can be run'
|
|
146
|
+
}).help('h').global([
|
|
147
|
+
'production',
|
|
148
|
+
'verbose',
|
|
149
|
+
'h'
|
|
150
|
+
]).option('locale', {
|
|
151
|
+
describe: 'override the default culture (e.g. "fr-fr")',
|
|
152
|
+
type: 'string'
|
|
153
|
+
}).option('lite', {
|
|
154
|
+
alias: 'l',
|
|
155
|
+
describe: 'Speeds up the build by running the minimal set of tasks required to produce an executable output',
|
|
156
|
+
type: 'boolean'
|
|
157
|
+
}).command(BuildRigConstants.tasks.build, 'build the project').command(BuildRigConstants.tasks.default, 'equivalent to bundle');
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Override this function to create new top-level tasks which can be executed via the command line
|
|
161
|
+
*
|
|
162
|
+
* Register 2 tasks, build and default, which simply copy files, then run typescript and tslint
|
|
163
|
+
*/ getTasks() {
|
|
164
|
+
const result = new Map();
|
|
165
|
+
result.set(BuildRigConstants.tasks.build, {
|
|
166
|
+
executable: this.getBuildTask()
|
|
167
|
+
});
|
|
168
|
+
result.set(BuildRigConstants.tasks.default, {
|
|
169
|
+
executable: this.getBuildTask()
|
|
170
|
+
});
|
|
171
|
+
return result;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Override this function to overwrite the "build" task
|
|
175
|
+
*/ getBuildTask() {
|
|
176
|
+
return coreBuild.serial(preCopy, coreBuild.serial(this._preBuildTasks), this.getCoreBuildTask(), coreBuild.serial(this._postBuildTasks), postCopy);
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Override this function to redefine the core build loop
|
|
180
|
+
*/ getCoreBuildTask() {
|
|
181
|
+
return coreBuild.parallel(lintCmd, coreBuild.serial(coreBuild.serial(tscCmd, apiExtractor), coreBuild.serial(...this._postTypescriptTasks)));
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Override this function to do configuration before the configuration .json files have been loaded
|
|
185
|
+
*/ setupSharedConfig() {
|
|
186
|
+
preCopy.name = 'pre-copy';
|
|
187
|
+
postCopy.name = 'post-copy';
|
|
188
|
+
// adding release folder to the list of folders to be removed during the clean task run
|
|
189
|
+
coreBuild.clean.getCleanMatch = ()=>[
|
|
190
|
+
'release'
|
|
191
|
+
];
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Override this function to do configuration after the configuration .json files have been loaded
|
|
195
|
+
*
|
|
196
|
+
* This function cleans up the shared config by populating task config properties that depend on other tasks'
|
|
197
|
+
* user-defined properties.
|
|
198
|
+
*/ finalizeSharedConfig() {
|
|
199
|
+
if (this.args.lite) {
|
|
200
|
+
this._disableTasks(lintCmd);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
addTaskOrListOfTasks(tasks, array) {
|
|
204
|
+
if (tasks.length) {
|
|
205
|
+
array.push(...tasks);
|
|
206
|
+
} else {
|
|
207
|
+
array.push(tasks);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
_disableTasks(...tasks) {
|
|
211
|
+
tasks.forEach((task)=>{
|
|
212
|
+
task.isEnabled = ()=>false;
|
|
213
|
+
coreBuild.verbose(`Disabling task: ${task.name}`);
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
constructor(){
|
|
217
|
+
_define_property(this, "_preBuildTasks", []);
|
|
218
|
+
_define_property(this, "_postTypescriptTasks", []);
|
|
219
|
+
_define_property(this, "_postBuildTasks", []);
|
|
220
|
+
_define_property(this, "_postTelemetryTask", []);
|
|
221
|
+
_define_property(this, "_preTelemetryTask", []);
|
|
222
|
+
_define_property(this, "args", void 0);
|
|
223
|
+
_define_property(this, "nodeSupportedVersionRange", '>=18.17.1 <19.0.0 || >=20.11.0 <21.0.0 || >=22.14.0 <23.0.0');
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
//#sourceMappingUrl=./SPBuildRig.js.map
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
function _define_property(obj, key, value) {
|
|
2
|
+
if (key in obj) {
|
|
3
|
+
Object.defineProperty(obj, key, {
|
|
4
|
+
value: value,
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true
|
|
8
|
+
});
|
|
9
|
+
} else {
|
|
10
|
+
obj[key] = value;
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
import sass from '@microsoft/gulp-core-build-sass';
|
|
15
|
+
import { reload, trustDevCert, untrustDevCert } from '@microsoft/gulp-core-build-serve';
|
|
16
|
+
import { copyStaticAssets, jest, parallel, serial, watch } from '@microsoft/gulp-core-build';
|
|
17
|
+
import { webpack as webpackTask } from '@microsoft/gulp-core-build-webpack';
|
|
18
|
+
import * as spBuildCoreTasks from '@microsoft/sp-build-core-tasks';
|
|
19
|
+
import { FILE_LOADER_EXTENSIONS } from '@microsoft/sp-build-core-tasks/lib/webpack/ConfigureWebpackTask';
|
|
20
|
+
import { tscCmd, lintCmd, apiExtractor } from '@microsoft/gulp-core-build-typescript';
|
|
21
|
+
import { WebBuildRigConstants } from './WebBuildRigConstants';
|
|
22
|
+
import { SPBuildRig } from './SPBuildRig';
|
|
23
|
+
import { BuildRigConstants } from './BuildRigConstants';
|
|
24
|
+
export const serveWatchFilter = [
|
|
25
|
+
'src/**/*.{ts,tsx,scss,resx,js,json,html}',
|
|
26
|
+
'!src/**/*.{scss.ts,resx.ts}',
|
|
27
|
+
'node_modules/*/*/dist/*.manifest.json'
|
|
28
|
+
];
|
|
29
|
+
export class SPWebBuildRig extends SPBuildRig {
|
|
30
|
+
addPostBundleTask(tasks) {
|
|
31
|
+
this.addTaskOrListOfTasks(tasks, this._postBundleTasks);
|
|
32
|
+
}
|
|
33
|
+
getYargs() {
|
|
34
|
+
return super.getYargs().option('debug', {
|
|
35
|
+
describe: 'runs tests in unit mode'
|
|
36
|
+
}).option('upgrade', {
|
|
37
|
+
describe: 'upgrades outdated files in the project'
|
|
38
|
+
}).command(WebBuildRigConstants.tasks.bundle, 'build, localize, and bundle the project').command(WebBuildRigConstants.tasks.deployAzureStorage, 'upload the assets to a development CDN').command(WebBuildRigConstants.tasks.packageSolution, 'package the project into a SPPKG').command(WebBuildRigConstants.tasks.test, 'build, localize, and bundle the project and run tests, and verify the coverage').command(WebBuildRigConstants.tasks.testOnly, 'run the tests without running the build').command(WebBuildRigConstants.tasks.serve, 'build and bundle the project and run the development server').command(WebBuildRigConstants.tasks.trustDevCert, "generates and trusts a development certificate if one isn't already present").command(WebBuildRigConstants.tasks.untrustDevCert, 'untrusts and deletes the development certificate if it exists').command('default', 'equivalent to bundle and test').option('entry', {
|
|
39
|
+
describe: 'Select which entries should be bundled. This can match the GUID or the alias of the entry.',
|
|
40
|
+
string: true
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
setupSharedConfig() {
|
|
44
|
+
super.setupSharedConfig();
|
|
45
|
+
webpackTask.taskConfig.webpack = require('webpack');
|
|
46
|
+
sass.mergeConfig({
|
|
47
|
+
preamble: '',
|
|
48
|
+
postamble: '',
|
|
49
|
+
sassMatch: [
|
|
50
|
+
'src/**/*.scss',
|
|
51
|
+
'src/**/*.sass'
|
|
52
|
+
],
|
|
53
|
+
useCSSModules: false,
|
|
54
|
+
warnOnCssInvalidPropertyName: true,
|
|
55
|
+
dropCssFiles: true,
|
|
56
|
+
warnOnNonCSSModules: true,
|
|
57
|
+
// Cast is needed due to autoprefixer types mismatch due to workspace install in odsp-web
|
|
58
|
+
autoprefixerOptions: {
|
|
59
|
+
overrideBrowserslist: [
|
|
60
|
+
'> 1%',
|
|
61
|
+
'ie >= 11'
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
spBuildCoreTasks.configureWebpack.mergeConfig({
|
|
66
|
+
webpack: webpackTask,
|
|
67
|
+
singleLocale: this.args.locale,
|
|
68
|
+
useLegacyExternals: true
|
|
69
|
+
});
|
|
70
|
+
copyStaticAssets.setConfig({
|
|
71
|
+
includeExtensions: [
|
|
72
|
+
...FILE_LOADER_EXTENSIONS,
|
|
73
|
+
'resx'
|
|
74
|
+
]
|
|
75
|
+
});
|
|
76
|
+
tscCmd.mergeConfig({
|
|
77
|
+
allowBuiltinCompiler: true
|
|
78
|
+
});
|
|
79
|
+
lintCmd.mergeConfig({
|
|
80
|
+
allowBuiltinCompiler: true
|
|
81
|
+
});
|
|
82
|
+
apiExtractor.mergeConfig({
|
|
83
|
+
allowBuiltinCompiler: true
|
|
84
|
+
});
|
|
85
|
+
jest.mergeConfig({
|
|
86
|
+
writeNUnitResults: this.args.writeNUnitResults
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
finalizeSharedConfig() {
|
|
90
|
+
super.finalizeSharedConfig();
|
|
91
|
+
if (this.args.lite || this.args.notest) {
|
|
92
|
+
this._disableTasks(jest);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
getTasks() {
|
|
96
|
+
const result = super.getTasks();
|
|
97
|
+
result.set(BuildRigConstants.tasks.build, {
|
|
98
|
+
executable: this.getBuildTask()
|
|
99
|
+
});
|
|
100
|
+
result.set(WebBuildRigConstants.tasks.bundle, {
|
|
101
|
+
executable: this.getBundleTask()
|
|
102
|
+
});
|
|
103
|
+
result.set(WebBuildRigConstants.tasks.deployAzureStorage, {
|
|
104
|
+
executable: spBuildCoreTasks.deployAzureStorage
|
|
105
|
+
});
|
|
106
|
+
result.set(WebBuildRigConstants.tasks.packageSolution, {
|
|
107
|
+
executable: spBuildCoreTasks.packageSolution
|
|
108
|
+
});
|
|
109
|
+
// @todo VSO #167343
|
|
110
|
+
result.set(WebBuildRigConstants.tasks.test, {
|
|
111
|
+
executable: this.getTestTask(),
|
|
112
|
+
arguments: (yargs)=>{
|
|
113
|
+
return yargs.option('debug', {
|
|
114
|
+
describe: 'run tests in debug mode'
|
|
115
|
+
}).option('match', {
|
|
116
|
+
describe: 'regular expression. Only run tests that match',
|
|
117
|
+
string: true
|
|
118
|
+
}).option('notest', {
|
|
119
|
+
describe: 'run the build without running the test'
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
result.set(WebBuildRigConstants.tasks.serve, {
|
|
124
|
+
executable: serial(spBuildCoreTasks.serve, watch(serveWatchFilter, serial(this._preTelemetryTask, // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
125
|
+
result.get(WebBuildRigConstants.tasks.bundle).executable, reload, this._postTelemetryTask))),
|
|
126
|
+
arguments: (yargs)=>{
|
|
127
|
+
return yargs.option('port', {
|
|
128
|
+
description: 'the port to serve on should be the next argument (e.g. "--port 80")'
|
|
129
|
+
}).option('nobrowser', {
|
|
130
|
+
description: "don't open a browser after initial bundle"
|
|
131
|
+
}).option('config', {
|
|
132
|
+
description: 'use this option to specify which configuration to use in the serve.json file'
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
result.set(WebBuildRigConstants.tasks.trustDevCert, {
|
|
137
|
+
executable: trustDevCert
|
|
138
|
+
});
|
|
139
|
+
result.set(WebBuildRigConstants.tasks.untrustDevCert, {
|
|
140
|
+
executable: untrustDevCert
|
|
141
|
+
});
|
|
142
|
+
result.set(WebBuildRigConstants.tasks.testOnly, {
|
|
143
|
+
executable: this.getTestOnlyTask(),
|
|
144
|
+
arguments: (yargs)=>{
|
|
145
|
+
return yargs.option('writeNUnitResults', {
|
|
146
|
+
description: 'write the jest results to an nunit test results file',
|
|
147
|
+
boolean: true
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
result.forEach((taskDefinition, name)=>{
|
|
152
|
+
result.set(name, {
|
|
153
|
+
executable: serial(serial(this._preTelemetryTask), taskDefinition.executable, serial(this._postTelemetryTask)),
|
|
154
|
+
arguments: taskDefinition.arguments
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
158
|
+
result.set(BuildRigConstants.tasks.default, result.get(WebBuildRigConstants.tasks.bundle));
|
|
159
|
+
return result;
|
|
160
|
+
}
|
|
161
|
+
getTestTask() {
|
|
162
|
+
return serial(this.getBundleTask(), jest);
|
|
163
|
+
}
|
|
164
|
+
getTestOnlyTask() {
|
|
165
|
+
return serial(jest);
|
|
166
|
+
}
|
|
167
|
+
getCoreBuildTask() {
|
|
168
|
+
return parallel(serial(sass, super.getCoreBuildTask()), copyStaticAssets);
|
|
169
|
+
}
|
|
170
|
+
getBundleTask() {
|
|
171
|
+
return serial(this.getBuildTask(), this.getPreWebpackTasks(), spBuildCoreTasks.configureWebpack, webpackTask, this.getPreCopyAssetsTasks(), parallel(this._postBundleTasks));
|
|
172
|
+
}
|
|
173
|
+
getPreWebpackTasks() {
|
|
174
|
+
return serial();
|
|
175
|
+
}
|
|
176
|
+
getPreCopyAssetsTasks() {
|
|
177
|
+
return serial();
|
|
178
|
+
}
|
|
179
|
+
constructor(...args){
|
|
180
|
+
super(...args);
|
|
181
|
+
_define_property(this, "args", void 0);
|
|
182
|
+
_define_property(this, "_postBundleTasks", []);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
//#sourceMappingUrl=./SPWebBuildRig.js.map
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WebBuildRigConstants = void 0;
|
|
4
1
|
// eslint-disable-next-line @typescript-eslint/typedef
|
|
5
|
-
|
|
2
|
+
export const WebBuildRigConstants = {
|
|
6
3
|
tasks: {
|
|
7
4
|
test: 'test',
|
|
8
5
|
testOnly: 'test-only',
|
|
@@ -14,4 +11,5 @@ exports.WebBuildRigConstants = {
|
|
|
14
11
|
untrustDevCert: 'untrust-dev-cert'
|
|
15
12
|
}
|
|
16
13
|
};
|
|
17
|
-
|
|
14
|
+
|
|
15
|
+
//#sourceMappingUrl=./WebBuildRigConstants.js.map
|
package/lib-esm/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export * from '@microsoft/gulp-core-build-sass';
|
|
2
|
+
export * from '@microsoft/gulp-core-build-typescript';
|
|
3
|
+
// Don't export "serve" from GCB-serve. Export it from sp-build-core-tasks
|
|
4
|
+
export { reload, trustDevCert, untrustDevCert } from '@microsoft/gulp-core-build-serve';
|
|
5
|
+
export * from '@microsoft/gulp-core-build-webpack';
|
|
6
|
+
export * from '@microsoft/sp-build-core-tasks/lib/index';
|
|
7
|
+
export * from '@microsoft/gulp-core-build';
|
|
8
|
+
export * from './SPWebBuildRig';
|
|
9
|
+
export * from './WebBuildRigConstants';
|
|
10
|
+
export * from './SPBuildRig';
|
|
11
|
+
import { SPWebBuildRig } from './SPWebBuildRig';
|
|
12
|
+
export const rig = new SPWebBuildRig();
|
|
13
|
+
// Replace gcb.initialize to call our init stuff first.
|
|
14
|
+
export const initialize = (gulp)=>{
|
|
15
|
+
rig.initialize(gulp);
|
|
16
|
+
return rig;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
//#sourceMappingUrl=./index.js.map
|
package/package.json
CHANGED
|
@@ -1,14 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/sp-build-web",
|
|
3
|
-
"version": "1.21.0-beta.
|
|
3
|
+
"version": "1.21.0-beta.2",
|
|
4
4
|
"description": "SharePoint Framework build rig for web projects",
|
|
5
5
|
"license": "https://aka.ms/spfx/license",
|
|
6
6
|
"homepage": "http://aka.ms/spfx",
|
|
7
7
|
"engines": {
|
|
8
|
-
"node": ">=18.17.1 <19.0.0"
|
|
8
|
+
"node": ">=18.17.1 <19.0.0 || >=22.14.0 < 23.0.0"
|
|
9
|
+
},
|
|
10
|
+
"main": "lib-commonjs/index.js",
|
|
11
|
+
"module": "lib-esm/index.js",
|
|
12
|
+
"typings": "lib-dts/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"import": "./lib-esm/index.js",
|
|
16
|
+
"require": "./lib-commonjs/index.js",
|
|
17
|
+
"types": "./lib-dts/index.d.ts"
|
|
18
|
+
},
|
|
19
|
+
"./lib/*": {
|
|
20
|
+
"import": "./lib-esm/*.js",
|
|
21
|
+
"require": "./lib-commonjs/*.js",
|
|
22
|
+
"types": "./lib-dts/*.d.ts"
|
|
23
|
+
},
|
|
24
|
+
"./package.json": "./package.json"
|
|
25
|
+
},
|
|
26
|
+
"typesVersions": {
|
|
27
|
+
"*": {
|
|
28
|
+
"lib/*": [
|
|
29
|
+
"lib-dts/*"
|
|
30
|
+
]
|
|
31
|
+
}
|
|
9
32
|
},
|
|
10
|
-
"main": "lib/index.js",
|
|
11
|
-
"typings": "lib/index.d.ts",
|
|
12
33
|
"dependencies": {
|
|
13
34
|
"@microsoft/gulp-core-build": "3.19.0",
|
|
14
35
|
"@microsoft/gulp-core-build-sass": "4.17.3",
|
|
@@ -19,13 +40,13 @@
|
|
|
19
40
|
"semver": "~7.3.2",
|
|
20
41
|
"webpack": "~5.95.0",
|
|
21
42
|
"yargs": "~4.6.0",
|
|
22
|
-
"@microsoft/sp-build-core-tasks": "1.21.0-beta.
|
|
43
|
+
"@microsoft/sp-build-core-tasks": "1.21.0-beta.2"
|
|
23
44
|
},
|
|
24
45
|
"devDependencies": {
|
|
25
|
-
"@rushstack/heft": "0.
|
|
46
|
+
"@rushstack/heft": "0.71.0",
|
|
26
47
|
"@types/semver": "7.3.8",
|
|
27
48
|
"eslint": "8.57.1",
|
|
28
|
-
"@
|
|
49
|
+
"@msinternal/internal-node-rig": "0.1.0"
|
|
29
50
|
},
|
|
30
51
|
"scripts": {
|
|
31
52
|
"build": "heft test --clean",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BuildRigConstants.d.ts","sourceRoot":"","sources":["../src/BuildRigConstants.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,iBAAiB;;;;;;;;;CAS7B,CAAC"}
|
package/lib/SPBuildRig.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SPBuildRig.d.ts","sourceRoot":"","sources":["../src/SPBuildRig.ts"],"names":[],"mappings":"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"}
|