@microsoft/generator-sharepoint 1.20.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/common/BaseGenerator.js +161 -121
- package/lib/common/ConfigJsonManager.js +45 -29
- package/lib/common/JsonManager.js +70 -29
- package/lib/common/PackageJsonManager.js +28 -8
- package/lib/common/PackageSolutionJsonManager.js +41 -23
- package/lib/common/ServeJsonManager.js +69 -31
- package/lib/common/TeamsManifestJsonManager.js +33 -21
- package/lib/common/YeomanConfiguration.js +25 -8
- package/lib/common/bundles-versions.json +1 -4
- package/lib/common/dependencies.json +62 -100
- package/lib/common/spsay.js +32 -19
- package/lib/common/utilities.js +97 -63
- package/lib/generators/adaptiveCardExtension/BaseAdaptiveCardExtensionGenerator.js +86 -41
- package/lib/generators/adaptiveCardExtension/index.js +103 -62
- package/lib/generators/app/index.js +138 -117
- package/lib/generators/applicationCustomizer/index.js +89 -45
- package/lib/generators/commandSet/index.js +89 -45
- package/lib/generators/component/BaseComponentGenerator.js +130 -77
- package/lib/generators/component/index.js +108 -69
- package/lib/generators/dataVisualizationAdaptiveCardExtension/index.js +72 -43
- package/lib/generators/extension/BaseExtensionGenerator.js +95 -49
- package/lib/generators/extension/index.js +104 -64
- package/lib/generators/fieldCustomizer/index.js +97 -50
- package/lib/generators/formCustomizer/index.js +99 -52
- package/lib/generators/formCustomizer/templates/none/{componentClassName}.ts +6 -2
- package/lib/generators/genericAdaptiveCardExtension/index.js +80 -46
- package/lib/generators/library/index.js +89 -43
- package/lib/generators/searchAdaptiveCardExtension/index.js +72 -43
- package/lib/generators/searchQueryModifier/index.js +89 -45
- package/lib/generators/solution/heft.package.json +1 -1
- package/lib/generators/solution/index.js +110 -80
- package/lib/generators/solution/non-heft.package.json +1 -1
- package/lib/generators/webpart/index.js +99 -50
- package/lib/generators/webpart/initial.teamsManifest.json +2 -4
- package/package.json +38 -12
- package/lib/common/BaseGenerator.d.ts +0 -59
- package/lib/common/BaseGenerator.d.ts.map +0 -1
- package/lib/common/ConfigJsonManager.d.ts +0 -16
- package/lib/common/ConfigJsonManager.d.ts.map +0 -1
- package/lib/common/JsonManager.d.ts +0 -12
- package/lib/common/JsonManager.d.ts.map +0 -1
- package/lib/common/PackageJsonManager.d.ts +0 -18
- package/lib/common/PackageJsonManager.d.ts.map +0 -1
- package/lib/common/PackageSolutionJsonManager.d.ts +0 -20
- package/lib/common/PackageSolutionJsonManager.d.ts.map +0 -1
- package/lib/common/ServeJsonManager.d.ts +0 -12
- package/lib/common/ServeJsonManager.d.ts.map +0 -1
- package/lib/common/TeamsManifestJsonManager.d.ts +0 -51
- package/lib/common/TeamsManifestJsonManager.d.ts.map +0 -1
- package/lib/common/YeomanConfiguration.d.ts +0 -25
- package/lib/common/YeomanConfiguration.d.ts.map +0 -1
- package/lib/common/spsay.d.ts +0 -2
- package/lib/common/spsay.d.ts.map +0 -1
- package/lib/common/utilities.d.ts +0 -9
- package/lib/common/utilities.d.ts.map +0 -1
- package/lib/generators/adaptiveCardExtension/BaseAdaptiveCardExtensionGenerator.d.ts +0 -18
- package/lib/generators/adaptiveCardExtension/BaseAdaptiveCardExtensionGenerator.d.ts.map +0 -1
- package/lib/generators/adaptiveCardExtension/index.d.ts +0 -23
- package/lib/generators/adaptiveCardExtension/index.d.ts.map +0 -1
- package/lib/generators/app/index.d.ts +0 -10
- package/lib/generators/app/index.d.ts.map +0 -1
- package/lib/generators/applicationCustomizer/index.d.ts +0 -24
- package/lib/generators/applicationCustomizer/index.d.ts.map +0 -1
- package/lib/generators/commandSet/index.d.ts +0 -23
- package/lib/generators/commandSet/index.d.ts.map +0 -1
- package/lib/generators/component/BaseComponentGenerator.d.ts +0 -56
- package/lib/generators/component/BaseComponentGenerator.d.ts.map +0 -1
- package/lib/generators/component/index.d.ts +0 -23
- package/lib/generators/component/index.d.ts.map +0 -1
- package/lib/generators/dataVisualizationAdaptiveCardExtension/index.d.ts +0 -19
- package/lib/generators/dataVisualizationAdaptiveCardExtension/index.d.ts.map +0 -1
- package/lib/generators/extension/BaseExtensionGenerator.d.ts +0 -19
- package/lib/generators/extension/BaseExtensionGenerator.d.ts.map +0 -1
- package/lib/generators/extension/index.d.ts +0 -26
- package/lib/generators/extension/index.d.ts.map +0 -1
- package/lib/generators/fieldCustomizer/index.d.ts +0 -24
- package/lib/generators/fieldCustomizer/index.d.ts.map +0 -1
- package/lib/generators/formCustomizer/index.d.ts +0 -24
- package/lib/generators/formCustomizer/index.d.ts.map +0 -1
- package/lib/generators/genericAdaptiveCardExtension/index.d.ts +0 -21
- package/lib/generators/genericAdaptiveCardExtension/index.d.ts.map +0 -1
- package/lib/generators/library/index.d.ts +0 -23
- package/lib/generators/library/index.d.ts.map +0 -1
- package/lib/generators/searchAdaptiveCardExtension/index.d.ts +0 -19
- package/lib/generators/searchAdaptiveCardExtension/index.d.ts.map +0 -1
- package/lib/generators/searchQueryModifier/index.d.ts +0 -23
- package/lib/generators/searchQueryModifier/index.d.ts.map +0 -1
- package/lib/generators/solution/index.d.ts +0 -19
- package/lib/generators/solution/index.d.ts.map +0 -1
- package/lib/generators/webpart/index.d.ts +0 -23
- package/lib/generators/webpart/index.d.ts.map +0 -1
|
@@ -1,38 +1,83 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
composeWith: function() {
|
|
13
|
+
return composeWith;
|
|
14
|
+
},
|
|
15
|
+
defineOptions: function() {
|
|
16
|
+
return defineOptions;
|
|
7
17
|
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
18
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
Object.defineProperty(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
const _lodash = /*#__PURE__*/ _interop_require_wildcard(require("lodash"));
|
|
20
|
+
const _path = /*#__PURE__*/ _interop_require_wildcard(require("path"));
|
|
21
|
+
const _utilities = /*#__PURE__*/ _interop_require_wildcard(require("../../common/utilities"));
|
|
22
|
+
const _BaseGenerator = require("../../common/BaseGenerator");
|
|
23
|
+
const _YeomanConfiguration = require("../../common/YeomanConfiguration");
|
|
24
|
+
function _define_property(obj, key, value) {
|
|
25
|
+
if (key in obj) {
|
|
26
|
+
Object.defineProperty(obj, key, {
|
|
27
|
+
value: value,
|
|
28
|
+
enumerable: true,
|
|
29
|
+
configurable: true,
|
|
30
|
+
writable: true
|
|
31
|
+
});
|
|
32
|
+
} else {
|
|
33
|
+
obj[key] = value;
|
|
34
|
+
}
|
|
35
|
+
return obj;
|
|
36
|
+
}
|
|
37
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
38
|
+
if (typeof WeakMap !== "function") return null;
|
|
39
|
+
var cacheBabelInterop = new WeakMap();
|
|
40
|
+
var cacheNodeInterop = new WeakMap();
|
|
41
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
42
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
43
|
+
})(nodeInterop);
|
|
44
|
+
}
|
|
45
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
46
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
47
|
+
return obj;
|
|
48
|
+
}
|
|
49
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
50
|
+
return {
|
|
51
|
+
default: obj
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
55
|
+
if (cache && cache.has(obj)) {
|
|
56
|
+
return cache.get(obj);
|
|
57
|
+
}
|
|
58
|
+
var newObj = {
|
|
59
|
+
__proto__: null
|
|
60
|
+
};
|
|
61
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
62
|
+
for(var key in obj){
|
|
63
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
64
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
65
|
+
if (desc && (desc.get || desc.set)) {
|
|
66
|
+
Object.defineProperty(newObj, key, desc);
|
|
67
|
+
} else {
|
|
68
|
+
newObj[key] = obj[key];
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
newObj.default = obj;
|
|
73
|
+
if (cache) {
|
|
74
|
+
cache.set(obj, newObj);
|
|
75
|
+
}
|
|
76
|
+
return newObj;
|
|
77
|
+
}
|
|
32
78
|
function composeWith(base, options) {
|
|
33
|
-
|
|
79
|
+
_utilities.compose(_path.basename(__dirname), base, options);
|
|
34
80
|
}
|
|
35
|
-
exports.composeWith = composeWith;
|
|
36
81
|
function defineOptions(generator) {
|
|
37
82
|
generator.option('solution-name', {
|
|
38
83
|
description: 'Solution name, as well as folder name',
|
|
@@ -51,14 +96,11 @@ function defineOptions(generator) {
|
|
|
51
96
|
type: String
|
|
52
97
|
});
|
|
53
98
|
generator.option('skip-feature-deployment', {
|
|
54
|
-
description: 'If specified, allow the tenant admin the choice of being able to ' +
|
|
55
|
-
'deploy the components to all sites immediately without running any ' +
|
|
56
|
-
'feature deployment or adding apps in sites',
|
|
99
|
+
description: 'If specified, allow the tenant admin the choice of being able to ' + 'deploy the components to all sites immediately without running any ' + 'feature deployment or adding apps in sites',
|
|
57
100
|
type: Boolean
|
|
58
101
|
});
|
|
59
102
|
generator.option('is-domain-isolated', {
|
|
60
|
-
description: 'If specified, the solution will have permissions to access web APIs ' +
|
|
61
|
-
'that are unique not shared with other components in the tenant',
|
|
103
|
+
description: 'If specified, the solution will have permissions to access web APIs ' + 'that are unique not shared with other components in the tenant',
|
|
62
104
|
type: Boolean
|
|
63
105
|
});
|
|
64
106
|
generator.option('use-heft', {
|
|
@@ -66,11 +108,9 @@ function defineOptions(generator) {
|
|
|
66
108
|
type: Boolean
|
|
67
109
|
});
|
|
68
110
|
}
|
|
69
|
-
|
|
70
|
-
class SolutionGenerator extends BaseGenerator_1.BaseGenerator {
|
|
111
|
+
class SolutionGenerator extends _BaseGenerator.BaseGenerator {
|
|
71
112
|
initializing() {
|
|
72
|
-
|
|
73
|
-
}
|
|
113
|
+
/* no-op */ }
|
|
74
114
|
async prompting() {
|
|
75
115
|
if (!this._shouldExecute()) {
|
|
76
116
|
return;
|
|
@@ -79,8 +119,8 @@ class SolutionGenerator extends BaseGenerator_1.BaseGenerator {
|
|
|
79
119
|
{
|
|
80
120
|
type: 'input',
|
|
81
121
|
name: 'solutionName',
|
|
82
|
-
default:
|
|
83
|
-
when: ()
|
|
122
|
+
default: _lodash.kebabCase(this.appname),
|
|
123
|
+
when: ()=>!this.config.get('solutionName'),
|
|
84
124
|
message: 'What is your solution name?'
|
|
85
125
|
}
|
|
86
126
|
]);
|
|
@@ -93,12 +133,10 @@ class SolutionGenerator extends BaseGenerator_1.BaseGenerator {
|
|
|
93
133
|
if (skipFeatureDeploymentConfig !== undefined) {
|
|
94
134
|
if (typeof skipFeatureDeploymentConfig === 'string') {
|
|
95
135
|
skipFeatureDeployment = skipFeatureDeploymentConfig.toLowerCase() === 'true';
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
136
|
+
} else {
|
|
98
137
|
skipFeatureDeployment = skipFeatureDeploymentConfig;
|
|
99
138
|
}
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
139
|
+
} else {
|
|
102
140
|
skipFeatureDeployment = true;
|
|
103
141
|
}
|
|
104
142
|
const componentType = this.config.get('componentType');
|
|
@@ -113,12 +151,10 @@ class SolutionGenerator extends BaseGenerator_1.BaseGenerator {
|
|
|
113
151
|
if (isDomainIsolatedConfig !== undefined) {
|
|
114
152
|
if (typeof isDomainIsolatedConfig === 'string') {
|
|
115
153
|
isDomainIsolated = isDomainIsolatedConfig.toLowerCase() === 'true';
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
154
|
+
} else {
|
|
118
155
|
isDomainIsolated = isDomainIsolatedConfig;
|
|
119
156
|
}
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
157
|
+
} else {
|
|
122
158
|
isDomainIsolated = false;
|
|
123
159
|
}
|
|
124
160
|
// allows to set --use-heft false
|
|
@@ -127,29 +163,27 @@ class SolutionGenerator extends BaseGenerator_1.BaseGenerator {
|
|
|
127
163
|
if (useHeftConfig !== undefined) {
|
|
128
164
|
if (typeof useHeftConfig === 'string') {
|
|
129
165
|
useHeft = useHeftConfig.toLowerCase() === 'true';
|
|
130
|
-
}
|
|
131
|
-
else {
|
|
166
|
+
} else {
|
|
132
167
|
useHeft = useHeftConfig;
|
|
133
168
|
}
|
|
134
169
|
}
|
|
135
170
|
const isPlusBeta = this.config.get('plusBeta');
|
|
136
171
|
this.context.solutionName = solutionName;
|
|
137
172
|
this.context.useHeft = !!useHeft;
|
|
138
|
-
this.context.libraryName =
|
|
139
|
-
this.context.libraryId =
|
|
173
|
+
this.context.libraryName = _lodash.kebabCase(this.context.solutionName);
|
|
174
|
+
this.context.libraryId = _utilities.generateGuid();
|
|
140
175
|
this.context.solutionShortDescription = solutionShortDescription;
|
|
141
176
|
this.context.skipFeatureDeployment = skipFeatureDeployment;
|
|
142
177
|
this.context.isDomainIsolated = isDomainIsolated;
|
|
143
|
-
this.context.version =
|
|
178
|
+
this.context.version = _BaseGenerator.BaseGenerator.generatorPackageJson.version;
|
|
144
179
|
this.context.versionBadge = `https://img.shields.io/badge/version-${this.context.version.replace('-', '--')}-${this.context.version.indexOf('-') !== -1 ? 'yellow' : 'green'}.svg`;
|
|
145
180
|
// store some variables
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
YeomanConfiguration_1.YeomanConfiguration.useHeft = !!useHeft;
|
|
181
|
+
_YeomanConfiguration.YeomanConfiguration.version = _BaseGenerator.BaseGenerator.generatorPackageJson.version;
|
|
182
|
+
_YeomanConfiguration.YeomanConfiguration.libraryName = this.context.libraryName;
|
|
183
|
+
_YeomanConfiguration.YeomanConfiguration.libraryId = this.context.libraryId;
|
|
184
|
+
_YeomanConfiguration.YeomanConfiguration.environment = environment;
|
|
185
|
+
_YeomanConfiguration.YeomanConfiguration.packageManager = this.config.get('packageManager') || _YeomanConfiguration.YeomanConfiguration.packageManager || 'npm';
|
|
186
|
+
_YeomanConfiguration.YeomanConfiguration.useHeft = !!useHeft;
|
|
153
187
|
this.config.set('solutionName', solutionName);
|
|
154
188
|
this.config.set('useHeft', useHeft);
|
|
155
189
|
this.config.set('environment', environment);
|
|
@@ -167,9 +201,7 @@ class SolutionGenerator extends BaseGenerator_1.BaseGenerator {
|
|
|
167
201
|
}
|
|
168
202
|
configuring() {
|
|
169
203
|
if (this._shouldExecute()) {
|
|
170
|
-
const packageJsonTemplate = this.context.useHeft
|
|
171
|
-
? require('./heft.package.json')
|
|
172
|
-
: require('./non-heft.package.json');
|
|
204
|
+
const packageJsonTemplate = this.context.useHeft ? require('./heft.package.json') : require('./non-heft.package.json');
|
|
173
205
|
if (this.packageJsonManager.data) {
|
|
174
206
|
this.log(`Overwriting an existing "package.json"`);
|
|
175
207
|
}
|
|
@@ -177,8 +209,7 @@ class SolutionGenerator extends BaseGenerator_1.BaseGenerator {
|
|
|
177
209
|
this.packageJsonManager.set(packageJsonTemplate);
|
|
178
210
|
if (this.context.useHeft) {
|
|
179
211
|
this.ensureDependencyGroup('useHeft');
|
|
180
|
-
}
|
|
181
|
-
else {
|
|
212
|
+
} else {
|
|
182
213
|
this.ensureDependencyGroup('useGulp');
|
|
183
214
|
}
|
|
184
215
|
if (this.configJson.data) {
|
|
@@ -199,13 +230,12 @@ class SolutionGenerator extends BaseGenerator_1.BaseGenerator {
|
|
|
199
230
|
console.log();
|
|
200
231
|
super.writing(false);
|
|
201
232
|
const dest = this.destinationRoot();
|
|
202
|
-
this.copyTemplate(
|
|
233
|
+
this.copyTemplate(_path.join(this.sourceRoot(), 'base'), dest);
|
|
203
234
|
if (this.context.useHeft) {
|
|
204
|
-
this.copyTemplate(
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
this.copyTemplate(
|
|
208
|
-
this.copyTemplate(path.join(this.sourceRoot(), YeomanConfiguration_1.YeomanConfiguration.environment), dest);
|
|
235
|
+
this.copyTemplate(_path.join(this.sourceRoot(), 'heft'), dest);
|
|
236
|
+
} else {
|
|
237
|
+
this.copyTemplate(_path.join(this.sourceRoot(), 'gulp'), dest);
|
|
238
|
+
this.copyTemplate(_path.join(this.sourceRoot(), _YeomanConfiguration.YeomanConfiguration.environment), dest);
|
|
209
239
|
}
|
|
210
240
|
this.packageJsonManager.save();
|
|
211
241
|
this.configJson.save();
|
|
@@ -220,22 +250,22 @@ class SolutionGenerator extends BaseGenerator_1.BaseGenerator {
|
|
|
220
250
|
}
|
|
221
251
|
}
|
|
222
252
|
end() {
|
|
223
|
-
|
|
253
|
+
/* no-op */ }
|
|
254
|
+
_shouldExecute() {
|
|
255
|
+
return this.config.get('isCreatingSolution');
|
|
224
256
|
}
|
|
225
257
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
226
|
-
constructor(args, options)
|
|
258
|
+
constructor(args, options){
|
|
227
259
|
super(args, options);
|
|
228
|
-
this
|
|
229
|
-
this
|
|
260
|
+
_define_property(this, "allowEmptyPackageJson", true);
|
|
261
|
+
_define_property(this, "friendlyName", 'Solution');
|
|
230
262
|
defineOptions(this);
|
|
231
263
|
}
|
|
232
|
-
_shouldExecute() {
|
|
233
|
-
return this.config.get('isCreatingSolution');
|
|
234
|
-
}
|
|
235
264
|
}
|
|
236
265
|
// Yeoman expects exports of this type, which overrides the TS exports above
|
|
237
266
|
// Ensure that anything marked as export above is also listed here
|
|
238
267
|
module.exports = SolutionGenerator;
|
|
239
268
|
module.exports.composeWith = composeWith;
|
|
240
269
|
module.exports.defineOptions = defineOptions;
|
|
241
|
-
|
|
270
|
+
|
|
271
|
+
//#sourceMappingUrl=./index.js.map
|
|
@@ -1,45 +1,91 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
WebpartGenerator: function() {
|
|
13
|
+
return WebpartGenerator;
|
|
14
|
+
},
|
|
15
|
+
composeWith: function() {
|
|
16
|
+
return composeWith;
|
|
17
|
+
},
|
|
18
|
+
defineOptions: function() {
|
|
19
|
+
return defineOptions;
|
|
7
20
|
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
21
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
const _path = /*#__PURE__*/ _interop_require_wildcard(require("path"));
|
|
23
|
+
const _utilities = /*#__PURE__*/ _interop_require_wildcard(require("../../common/utilities"));
|
|
24
|
+
const _YeomanConfiguration = require("../../common/YeomanConfiguration");
|
|
25
|
+
const _BaseComponentGenerator = /*#__PURE__*/ _interop_require_wildcard(require("../component/BaseComponentGenerator"));
|
|
26
|
+
function _define_property(obj, key, value) {
|
|
27
|
+
if (key in obj) {
|
|
28
|
+
Object.defineProperty(obj, key, {
|
|
29
|
+
value: value,
|
|
30
|
+
enumerable: true,
|
|
31
|
+
configurable: true,
|
|
32
|
+
writable: true
|
|
33
|
+
});
|
|
34
|
+
} else {
|
|
35
|
+
obj[key] = value;
|
|
36
|
+
}
|
|
37
|
+
return obj;
|
|
38
|
+
}
|
|
39
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
40
|
+
if (typeof WeakMap !== "function") return null;
|
|
41
|
+
var cacheBabelInterop = new WeakMap();
|
|
42
|
+
var cacheNodeInterop = new WeakMap();
|
|
43
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
44
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
45
|
+
})(nodeInterop);
|
|
46
|
+
}
|
|
47
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
48
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
49
|
+
return obj;
|
|
50
|
+
}
|
|
51
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
52
|
+
return {
|
|
53
|
+
default: obj
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
57
|
+
if (cache && cache.has(obj)) {
|
|
58
|
+
return cache.get(obj);
|
|
59
|
+
}
|
|
60
|
+
var newObj = {
|
|
61
|
+
__proto__: null
|
|
62
|
+
};
|
|
63
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
64
|
+
for(var key in obj){
|
|
65
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
66
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
67
|
+
if (desc && (desc.get || desc.set)) {
|
|
68
|
+
Object.defineProperty(newObj, key, desc);
|
|
69
|
+
} else {
|
|
70
|
+
newObj[key] = obj[key];
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
newObj.default = obj;
|
|
75
|
+
if (cache) {
|
|
76
|
+
cache.set(obj, newObj);
|
|
77
|
+
}
|
|
78
|
+
return newObj;
|
|
79
|
+
}
|
|
31
80
|
function composeWith(base, options) {
|
|
32
|
-
|
|
81
|
+
_utilities.compose(_path.basename(__dirname), base, options);
|
|
33
82
|
}
|
|
34
|
-
exports.composeWith = composeWith;
|
|
35
83
|
function defineOptions(generator) {
|
|
36
|
-
|
|
84
|
+
_BaseComponentGenerator.defineOptions(generator, 'Web part');
|
|
37
85
|
}
|
|
38
|
-
|
|
39
|
-
class WebpartGenerator extends BaseComponent.BaseComponentGenerator {
|
|
86
|
+
class WebpartGenerator extends _BaseComponentGenerator.BaseComponentGenerator {
|
|
40
87
|
initializing() {
|
|
41
|
-
|
|
42
|
-
}
|
|
88
|
+
/* no-op */ }
|
|
43
89
|
async prompting() {
|
|
44
90
|
this.ensureCorrectFolder();
|
|
45
91
|
if (this._shouldExecute()) {
|
|
@@ -51,8 +97,8 @@ class WebpartGenerator extends BaseComponent.BaseComponentGenerator {
|
|
|
51
97
|
super.configuring();
|
|
52
98
|
this.ensureDependencyGroup('webpart');
|
|
53
99
|
this.serveJson.setUpForWebParts();
|
|
54
|
-
const solutionName =
|
|
55
|
-
this.packageSolutionJson.addFeature(
|
|
100
|
+
const solutionName = _YeomanConfiguration.YeomanConfiguration.libraryName;
|
|
101
|
+
this.packageSolutionJson.addFeature(_utilities.generateGuid(), `${solutionName} Feature`, `The feature that activates elements of the ${solutionName} solution.`, false);
|
|
56
102
|
}
|
|
57
103
|
}
|
|
58
104
|
writing() {
|
|
@@ -60,12 +106,12 @@ class WebpartGenerator extends BaseComponent.BaseComponentGenerator {
|
|
|
60
106
|
super.writing(false);
|
|
61
107
|
const dest = this._getOutputFolder(this.context.componentNameCamelCase);
|
|
62
108
|
const template = this.context.template;
|
|
63
|
-
this.copyTemplate(
|
|
109
|
+
this.copyTemplate(_path.join(this.sourceRoot(), template), dest);
|
|
64
110
|
if (template !== 'minimal') {
|
|
65
|
-
this.copyTemplate(
|
|
66
|
-
this.copyTemplate(
|
|
111
|
+
this.copyTemplate(_path.join(this.sourceRoot(), 'loc'), _path.join(dest, 'loc'));
|
|
112
|
+
this.copyTemplate(_path.join(this.sourceRoot(), 'assets'), _path.join(dest, 'assets'));
|
|
67
113
|
}
|
|
68
|
-
this.copyTemplate(
|
|
114
|
+
this.copyTemplate(_path.join(this.sourceRoot(), 'base'), dest);
|
|
69
115
|
this.fs.copy(this.templatePath('./images/outline.png'), this.destinationPath(`teams/${this.context.componentId}_outline.png`));
|
|
70
116
|
this.fs.copy(this.templatePath('./images/color.png'), this.destinationPath(`teams/${this.context.componentId}_color.png`));
|
|
71
117
|
}
|
|
@@ -78,22 +124,25 @@ class WebpartGenerator extends BaseComponent.BaseComponentGenerator {
|
|
|
78
124
|
end() {
|
|
79
125
|
super.end();
|
|
80
126
|
}
|
|
81
|
-
constructor(args, options) {
|
|
82
|
-
super(args, options);
|
|
83
|
-
this.friendlyName = 'Web part';
|
|
84
|
-
this.codeName = 'WebPart';
|
|
85
|
-
this.allowedTemplates = ['react', 'minimal'];
|
|
86
|
-
this.folderName = 'webparts';
|
|
87
|
-
defineOptions(this);
|
|
88
|
-
}
|
|
89
127
|
_shouldExecute() {
|
|
90
128
|
return this.config.get('environment') === 'spo' && this.config.get('componentType') === 'webpart';
|
|
91
129
|
}
|
|
130
|
+
constructor(args, options){
|
|
131
|
+
super(args, options);
|
|
132
|
+
_define_property(this, "friendlyName", 'Web part');
|
|
133
|
+
_define_property(this, "codeName", 'WebPart');
|
|
134
|
+
_define_property(this, "allowedTemplates", [
|
|
135
|
+
'react',
|
|
136
|
+
'minimal'
|
|
137
|
+
]);
|
|
138
|
+
_define_property(this, "folderName", 'webparts');
|
|
139
|
+
defineOptions(this);
|
|
140
|
+
}
|
|
92
141
|
}
|
|
93
|
-
exports.WebpartGenerator = WebpartGenerator;
|
|
94
142
|
// Yeoman expects exports of this type, which overrides the TS exports above
|
|
95
143
|
// Ensure that anything marked as export above is also listed here
|
|
96
144
|
module.exports = WebpartGenerator;
|
|
97
145
|
module.exports.defineOptions = defineOptions;
|
|
98
146
|
module.exports.composeWith = composeWith;
|
|
99
|
-
|
|
147
|
+
|
|
148
|
+
//#sourceMappingUrl=./index.js.map
|
|
@@ -41,10 +41,8 @@
|
|
|
41
41
|
"res-2-sdf.cdn.office.net",
|
|
42
42
|
"res-1.cdn.office.net",
|
|
43
43
|
"res-2.cdn.office.net",
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"odspwebcidev.blob.core.windows.net",
|
|
47
|
-
"odspweblocaldev.blob.core.windows.net",
|
|
44
|
+
"odspwebcidev.z13.web.core.windows.net",
|
|
45
|
+
"odspwebuserdev.z1.web.core.windows.net",
|
|
48
46
|
"msft.spoppe.com"
|
|
49
47
|
],
|
|
50
48
|
"webApplicationInfo": {
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/generator-sharepoint",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.21.0-beta.2",
|
|
4
4
|
"description": "Yeoman generator for the SharePoint Framework",
|
|
5
5
|
"engines": {
|
|
6
|
-
"node": ">=
|
|
6
|
+
"node": ">=22.14.0 < 23.0.0"
|
|
7
7
|
},
|
|
8
8
|
"keywords": [
|
|
9
9
|
"yeoman-generator"
|
|
@@ -11,20 +11,45 @@
|
|
|
11
11
|
"license": "https://aka.ms/spfx/license",
|
|
12
12
|
"homepage": "http://aka.ms/spfx",
|
|
13
13
|
"main": "lib/generators/app/index.js",
|
|
14
|
+
"module": "lib-esm/generators/app/index.js",
|
|
15
|
+
"typings": "lib-dts/generators/app/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"import": "./lib-esm/generators/app/index.js",
|
|
19
|
+
"require": "./lib/generators/app/index.js",
|
|
20
|
+
"types": "./lib-dts/generators/app/index.d.ts"
|
|
21
|
+
},
|
|
22
|
+
"./lib/*": {
|
|
23
|
+
"import": "./lib-esm/*.js",
|
|
24
|
+
"require": "./lib/*.js",
|
|
25
|
+
"types": "./lib-dts/*.d.ts"
|
|
26
|
+
},
|
|
27
|
+
"./package.json": "./package.json"
|
|
28
|
+
},
|
|
29
|
+
"typesVersions": {
|
|
30
|
+
"*": {
|
|
31
|
+
"lib/*": [
|
|
32
|
+
"lib-dts/*"
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
},
|
|
14
36
|
"dependencies": {
|
|
15
|
-
"@rushstack/node-core-library": "5.
|
|
16
|
-
"@rushstack/terminal": "0.
|
|
37
|
+
"@rushstack/node-core-library": "5.12.0",
|
|
38
|
+
"@rushstack/terminal": "0.15.1",
|
|
17
39
|
"colors": "~1.2.1",
|
|
18
40
|
"lodash": "4.17.21",
|
|
41
|
+
"mem-fs": "2.2.1",
|
|
19
42
|
"update-notifier": "5.1.0",
|
|
20
43
|
"uuid": "^9.0.0",
|
|
21
44
|
"yeoman-generator": "5.10.0",
|
|
22
45
|
"yosay": "2.0.2",
|
|
23
|
-
"@microsoft/spfx-heft-plugins": "1.
|
|
46
|
+
"@microsoft/spfx-heft-plugins": "1.21.0-beta.2"
|
|
24
47
|
},
|
|
25
48
|
"devDependencies": {
|
|
26
|
-
"@microsoft/rush-lib": "5.
|
|
27
|
-
"@rushstack/heft": "0.
|
|
49
|
+
"@microsoft/rush-lib": "5.150.0",
|
|
50
|
+
"@rushstack/heft": "0.71.0",
|
|
51
|
+
"@rushstack/heft-isolated-typescript-transpile-plugin": "0.1.1",
|
|
52
|
+
"@rushstack/heft-typescript-plugin": "0.8.0",
|
|
28
53
|
"@types/inquirer": "7.3.1",
|
|
29
54
|
"@types/lodash": "4.14.117",
|
|
30
55
|
"@types/mem-fs-editor": "7.0.1",
|
|
@@ -32,8 +57,8 @@
|
|
|
32
57
|
"@types/uuid": "9.0.1",
|
|
33
58
|
"@types/yeoman-generator": "5.2.14",
|
|
34
59
|
"@types/yosay": "2.0.0",
|
|
35
|
-
"eslint": "8.57.
|
|
36
|
-
"@
|
|
60
|
+
"eslint": "8.57.1",
|
|
61
|
+
"@msinternal/internal-node-rig": "0.1.0"
|
|
37
62
|
},
|
|
38
63
|
"scripts": {
|
|
39
64
|
"build": "heft test --clean",
|
|
@@ -41,9 +66,10 @@
|
|
|
41
66
|
"test": "heft run --only test",
|
|
42
67
|
"start": "heft build-watch",
|
|
43
68
|
"test-watch": "heft test-watch",
|
|
44
|
-
"_phase:
|
|
69
|
+
"_phase:depscan": "heft depscan",
|
|
45
70
|
"_phase:test": "heft run --only test -- --clean",
|
|
46
|
-
"_phase:
|
|
47
|
-
"_phase:
|
|
71
|
+
"_phase:test:incremental": "heft run --only test --",
|
|
72
|
+
"_phase:tool-build": "heft run --only build -- --clean",
|
|
73
|
+
"_phase:tool-build:incremental": "heft run --only build --"
|
|
48
74
|
}
|
|
49
75
|
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import yeoman from 'yeoman-generator';
|
|
2
|
-
import type { Editor } from 'mem-fs-editor';
|
|
3
|
-
import { type IPackageJson } from '@rushstack/node-core-library';
|
|
4
|
-
import { PackageJsonManager } from './PackageJsonManager';
|
|
5
|
-
import { ConfigJsonManager } from './ConfigJsonManager';
|
|
6
|
-
import { ServeJsonManager } from './ServeJsonManager';
|
|
7
|
-
import { PackageSolutionJsonManager } from './PackageSolutionJsonManager';
|
|
8
|
-
export type AvailableTemplates = 'react' | 'none' | 'minimal';
|
|
9
|
-
export type DependencyGroups = keyof typeof import('./dependencies.json');
|
|
10
|
-
export interface IBaseOptions {
|
|
11
|
-
'skip-install': boolean;
|
|
12
|
-
plusbeta: boolean;
|
|
13
|
-
force?: boolean;
|
|
14
|
-
}
|
|
15
|
-
export declare abstract class BaseGenerator<IOptions extends IBaseOptions, IContext extends object> extends yeoman<IOptions> {
|
|
16
|
-
protected static generatorPackageJson: IPackageJson;
|
|
17
|
-
private static _hasCheckedForUpdates;
|
|
18
|
-
/**
|
|
19
|
-
* The context property bag used by templates
|
|
20
|
-
*/
|
|
21
|
-
context: IContext;
|
|
22
|
-
protected abstract friendlyName: string;
|
|
23
|
-
protected allowEmptyPackageJson: boolean;
|
|
24
|
-
private _dependenciesByDependencyGroup;
|
|
25
|
-
protected get packageJsonManager(): PackageJsonManager;
|
|
26
|
-
protected get configJson(): ConfigJsonManager;
|
|
27
|
-
protected get serveJson(): ServeJsonManager;
|
|
28
|
-
protected get packageSolutionJson(): PackageSolutionJsonManager;
|
|
29
|
-
private static _checkForUpdates;
|
|
30
|
-
/**
|
|
31
|
-
* Lifecycle events, these are called in a specific order by the Yeoman
|
|
32
|
-
* generator, which is why they are listed here in order.
|
|
33
|
-
* http://yeoman.io/authoring/running-context.html
|
|
34
|
-
*/
|
|
35
|
-
/** Your initialization methods (checking current project state, getting configs, etc) */
|
|
36
|
-
abstract initializing(): Promise<void> | void;
|
|
37
|
-
/** Where you prompt users for options (where you'd call this.prompt()) */
|
|
38
|
-
abstract prompting(): Promise<void> | void;
|
|
39
|
-
/** Saving configurations and configure the project (creating metadata files) */
|
|
40
|
-
abstract configuring(): Promise<void> | void;
|
|
41
|
-
copyTemplate: Editor['copy'];
|
|
42
|
-
/** Where you write the generator specific files (routes, controllers, etc) */
|
|
43
|
-
writing(shouldCopy?: boolean): void;
|
|
44
|
-
/** Where installation are run (npm, bower) */
|
|
45
|
-
abstract install(): Promise<void> | void;
|
|
46
|
-
/** Called last, cleanup, say good bye, etc */
|
|
47
|
-
abstract end(): Promise<void> | void;
|
|
48
|
-
protected constructor(args: string | string[], options: IOptions);
|
|
49
|
-
protected tryInstall(): boolean;
|
|
50
|
-
protected ensureCorrectFolder(): void;
|
|
51
|
-
protected ensureDependencyGroup(group: DependencyGroups): void;
|
|
52
|
-
protected nameIsDependencyGroup(name: string): name is DependencyGroups;
|
|
53
|
-
private _ensureDependenciesByDependencyGroup;
|
|
54
|
-
private _dedupeDependencies;
|
|
55
|
-
private _addResolutionsIfApplicable;
|
|
56
|
-
private _doPnpmInstall;
|
|
57
|
-
private _untokenizedCopier;
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=BaseGenerator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BaseGenerator.d.ts","sourceRoot":"","sources":["../../src/common/BaseGenerator.ts"],"names":[],"mappings":"AAGA,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,KAAK,YAAY,EAAY,MAAM,8BAA8B,CAAC;AAG3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAG1E,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAE9D,MAAM,MAAM,gBAAgB,GAAG,MAAM,cAAc,qBAAqB,CAAC,CAAC;AAC1E,MAAM,WAAW,YAAY;IAC3B,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAOD,8BAAsB,aAAa,CACjC,QAAQ,SAAS,YAAY,EAC7B,QAAQ,SAAS,MAAM,CACvB,SAAQ,MAAM,CAAC,QAAQ,CAAC;IACxB,SAAS,CAAC,MAAM,CAAC,oBAAoB,EAAE,YAAY,CAAoD;IACvG,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAAkB;IAEtD;;OAEG;IACI,OAAO,EAAE,QAAQ,CAAC;IAEzB,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IACxC,SAAS,CAAC,qBAAqB,EAAE,OAAO,CAAS;IAEjD,OAAO,CAAC,8BAA8B,CAAqD;IAE3F,SAAS,KAAK,kBAAkB,IAAI,kBAAkB,CAQrD;IAED,SAAS,KAAK,UAAU,IAAI,iBAAiB,CAK5C;IAED,SAAS,KAAK,SAAS,IAAI,gBAAgB,CAK1C;IAED,SAAS,KAAK,mBAAmB,IAAI,0BAA0B,CAK9D;IAED,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAa/B;;;;OAIG;IAEH,yFAAyF;aACzE,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAEpD,0EAA0E;aAC1D,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAEjD,gFAAgF;aAChE,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAE5C,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,CAEjC;IAEF,8EAA8E;IACvE,OAAO,CAAC,UAAU,GAAE,OAAc,GAAG,IAAI;IAkBhD,8CAA8C;aAC9B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAE/C,8CAA8C;aAC9B,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAE3C,SAAS,aAAa,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ;IAmChE,SAAS,CAAC,UAAU,IAAI,OAAO;IAQ/B,SAAS,CAAC,mBAAmB,IAAI,IAAI;IAMrC,SAAS,CAAC,qBAAqB,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI;IAqB9D,SAAS,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,gBAAgB;IAMvE,OAAO,CAAC,oCAAoC;IAsB5C,OAAO,CAAC,mBAAmB;IAe3B,OAAO,CAAC,2BAA2B;IAWnC,OAAO,CAAC,cAAc;IAiCtB,OAAO,CAAC,kBAAkB;CAS3B"}
|