@microsoft/generator-sharepoint 1.13.1 → 1.14.0-beta.4

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.
Files changed (82) hide show
  1. package/lib/common/BaseGenerator.d.ts +2 -2
  2. package/lib/common/BaseGenerator.d.ts.map +1 -1
  3. package/lib/common/PackageSolutionJsonManager.d.ts +6 -0
  4. package/lib/common/PackageSolutionJsonManager.d.ts.map +1 -1
  5. package/lib/common/PackageSolutionJsonManager.js +57 -16
  6. package/lib/common/dependency/adaptiveCardExtension/firstParty.json +6 -6
  7. package/lib/common/dependency/adaptiveCardExtension/firstPartyPlusBeta.json +6 -6
  8. package/lib/common/dependency/applicationCustomizer.json +2 -2
  9. package/lib/common/dependency/applicationCustomizerPlusBeta.json +2 -2
  10. package/lib/common/dependency/commandSet.json +2 -2
  11. package/lib/common/dependency/commandSetPlusBeta.json +2 -2
  12. package/lib/common/dependency/extension/firstParty.json +5 -5
  13. package/lib/common/dependency/extension/firstPartyPlusBeta.json +5 -5
  14. package/lib/common/dependency/fieldCustomizer.json +1 -1
  15. package/lib/common/dependency/fieldCustomizerPlusBeta.json +1 -1
  16. package/lib/common/dependency/library/firstParty.json +3 -3
  17. package/lib/common/dependency/library/firstPartyPlusBeta.json +3 -3
  18. package/lib/common/dependency/searchQueryModifier.json +1 -1
  19. package/lib/common/dependency/searchQueryModifierPlusBeta.json +1 -1
  20. package/lib/common/dependency/webpart/firstParty.json +8 -8
  21. package/lib/common/dependency/webpart/firstPartyPlusBeta.json +8 -8
  22. package/lib/generators/adaptiveCardExtension/index.d.ts +2 -2
  23. package/lib/generators/adaptiveCardExtension/index.d.ts.map +1 -1
  24. package/lib/generators/adaptiveCardExtension/index.js +4 -1
  25. package/lib/generators/app/index.js +17 -4
  26. package/lib/generators/applicationCustomizer/index.d.ts +2 -2
  27. package/lib/generators/applicationCustomizer/index.d.ts.map +1 -1
  28. package/lib/generators/applicationCustomizer/index.js +1 -1
  29. package/lib/generators/applicationCustomizer/templates/none/{componentClassName}.ts +0 -2
  30. package/lib/generators/commandSet/index.d.ts +2 -2
  31. package/lib/generators/commandSet/index.d.ts.map +1 -1
  32. package/lib/generators/commandSet/index.js +1 -1
  33. package/lib/generators/commandSet/templates/none/{componentClassName}.ts +0 -4
  34. package/lib/generators/component/BaseComponentGenerator.d.ts +8 -4
  35. package/lib/generators/component/BaseComponentGenerator.d.ts.map +1 -1
  36. package/lib/generators/component/BaseComponentGenerator.js +18 -11
  37. package/lib/generators/component/index.d.ts.map +1 -1
  38. package/lib/generators/extension/BaseExtensionGenerator.d.ts +2 -1
  39. package/lib/generators/extension/BaseExtensionGenerator.d.ts.map +1 -1
  40. package/lib/generators/extension/BaseExtensionGenerator.js +25 -0
  41. package/lib/generators/fieldCustomizer/index.d.ts +2 -2
  42. package/lib/generators/fieldCustomizer/index.d.ts.map +1 -1
  43. package/lib/generators/fieldCustomizer/index.js +12 -2
  44. package/lib/generators/fieldCustomizer/templates/{base/loc → loc}/en-us.js +0 -0
  45. package/lib/generators/fieldCustomizer/templates/{base/loc → loc}/myStrings.d.ts +0 -0
  46. package/lib/generators/fieldCustomizer/templates/minimal/loc/en-us.js +4 -0
  47. package/lib/generators/fieldCustomizer/templates/minimal/loc/myStrings.d.ts +7 -0
  48. package/lib/generators/fieldCustomizer/templates/minimal/{componentClassName}.module.scss +3 -0
  49. package/lib/generators/fieldCustomizer/templates/minimal/{componentClassName}.ts +29 -0
  50. package/lib/generators/fieldCustomizer/templates/none/{componentClassName}.ts +0 -4
  51. package/lib/generators/fieldCustomizer/templates/react/components/{componentName}.tsx +0 -4
  52. package/lib/generators/fieldCustomizer/templates/react/{componentClassName}.ts +0 -4
  53. package/lib/generators/library/index.d.ts +2 -2
  54. package/lib/generators/library/index.d.ts.map +1 -1
  55. package/lib/generators/library/index.js +1 -1
  56. package/lib/generators/searchQueryModifier/index.d.ts +2 -2
  57. package/lib/generators/searchQueryModifier/index.d.ts.map +1 -1
  58. package/lib/generators/searchQueryModifier/index.js +1 -1
  59. package/lib/generators/searchQueryModifier/templates/none/{componentClassName}.ts +0 -3
  60. package/lib/generators/solution/index.d.ts +1 -0
  61. package/lib/generators/solution/index.d.ts.map +1 -1
  62. package/lib/generators/solution/index.js +25 -19
  63. package/lib/generators/webpart/index.d.ts +2 -2
  64. package/lib/generators/webpart/index.d.ts.map +1 -1
  65. package/lib/generators/webpart/index.js +13 -5
  66. package/lib/generators/webpart/templates/assets/welcome-dark.png +0 -0
  67. package/lib/generators/webpart/templates/assets/welcome-light.png +0 -0
  68. package/lib/generators/webpart/templates/loc/en-us.js +11 -0
  69. package/lib/generators/webpart/templates/{base/loc → loc}/mystrings.d.ts +4 -0
  70. package/lib/generators/webpart/templates/minimal/loc/en-us.js +4 -0
  71. package/lib/generators/webpart/templates/minimal/loc/mystrings.d.ts +7 -0
  72. package/lib/generators/webpart/templates/minimal/{componentClassName}.module.scss +3 -0
  73. package/lib/generators/webpart/templates/minimal/{componentClassName}.ts +22 -0
  74. package/lib/generators/webpart/templates/none/{componentClassName}.module.scss +22 -62
  75. package/lib/generators/webpart/templates/none/{componentClassName}.ts +57 -14
  76. package/lib/generators/webpart/templates/react/components/I{componentName}Props.ts +4 -0
  77. package/lib/generators/webpart/templates/react/components/{componentName}.module.scss +23 -63
  78. package/lib/generators/webpart/templates/react/components/{componentName}.tsx +31 -13
  79. package/lib/generators/webpart/templates/react/{componentClassName}.ts +38 -1
  80. package/package.json +3 -3
  81. package/lib/generators/webpart/templates/base/loc/en-us.js +0 -7
  82. package/lib/generators/webpart/templates/officeAddin/initial.outlookManifest.xml +0 -91
@@ -40,7 +40,8 @@ function defineOptions(generator, type) {
40
40
  type: String
41
41
  });
42
42
  generator.option('framework', {
43
- description: 'Framework to use. Available: "none", "react"',
43
+ // NOTE: 'framemowrk' name is kept for backward compatibility
44
+ description: 'Template to use. Available: "none", "react", "minimal"',
44
45
  type: String
45
46
  });
46
47
  generator.option('plusbeta', {
@@ -52,11 +53,14 @@ exports.defineOptions = defineOptions;
52
53
  class BaseComponentGenerator extends BaseGenerator_1.BaseGenerator {
53
54
  prompting() {
54
55
  return this.checkSolution().then(() => {
55
- const availableFrameworks = [
56
+ const availableTemplates = [
56
57
  { name: 'No JavaScript framework', value: 'none' }
57
58
  ];
58
- if (this.allowedFrameworks.indexOf('react') !== -1) {
59
- availableFrameworks.push({ name: 'React', value: 'react' });
59
+ if (this.allowedTemplates.indexOf('react') !== -1) {
60
+ availableTemplates.push({ name: 'React', value: 'react' });
61
+ }
62
+ if (this.allowedTemplates.indexOf('minimal') !== -1) {
63
+ availableTemplates.unshift({ name: 'Minimal', value: 'minimal' });
60
64
  }
61
65
  return this.prompt([
62
66
  {
@@ -92,13 +96,16 @@ class BaseComponentGenerator extends BaseGenerator_1.BaseGenerator {
92
96
  },
93
97
  {
94
98
  type: 'list',
95
- name: 'framework',
96
- when: () => !this.config.get('framework') && availableFrameworks.length !== 1,
97
- message: 'Which framework would you like to use?',
98
- choices: availableFrameworks
99
+ name: 'template',
100
+ when: () => !this.config.get('framework') &&
101
+ !this.config.get('template') &&
102
+ availableTemplates.length !== 1,
103
+ message: 'Which template would you like to use?',
104
+ choices: availableTemplates
99
105
  }
100
106
  ]).then((answers) => {
101
- this.context.framework = this.config.get('framework') || answers.framework || 'none';
107
+ this.context.template =
108
+ this.config.get('framework') || this.config.get('template') || answers.template || 'none';
102
109
  this.context.componentDescription =
103
110
  this.config.get('componentDescription') || answers.componentDescription || '';
104
111
  this.context.componentId = Utils.generateGuid();
@@ -123,7 +130,7 @@ class BaseComponentGenerator extends BaseGenerator_1.BaseGenerator {
123
130
  });
124
131
  }
125
132
  configuring(bundleEntry) {
126
- this.ensureDependencyGroup(this.context.framework);
133
+ this.ensureDependencyGroup(this.context.template);
127
134
  if (!this.configJson.data) {
128
135
  throw new Error(`Missing required file: "config/config.json"`);
129
136
  }
@@ -154,7 +161,7 @@ class BaseComponentGenerator extends BaseGenerator_1.BaseGenerator {
154
161
  super.writing(false);
155
162
  if (shouldWrite) {
156
163
  const dest = this._getOutputFolder(this.context.componentNameCamelCase);
157
- this.copyTemplate(path.join(this.sourceRoot(), this.context.framework), dest);
164
+ this.copyTemplate(path.join(this.sourceRoot(), this.context.template), dest);
158
165
  this.copyTemplate(path.join(this.sourceRoot(), 'base'), dest);
159
166
  }
160
167
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generators/component/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAGzE,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,SAAS,MAAM,cAAc,CAAC;AAE1C,OAAO,KAAK,qBAAqB,MAAM,0BAA0B,CAAC;AAGlE,MAAM,WAAW,yBACf,SAAQ,OAAO,CAAC,eAAe,EAC7B,SAAS,CAAC,iBAAiB,EAC3B,qBAAqB,CAAC,WAAW;IACnC,aAAa,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,uBAAuB,CAAC;CAC9E;AAED,wBAAgB,WAAW,CAAC,QAAQ,SAAS,YAAY,EAAE,QAAQ,EACjE,IAAI,EAAE,aAAa,CAAC,QAAQ,EAAE,QAAQ,CAAC,EACvC,OAAO,EAAE,YAAY,GACpB,IAAI,CAEN;AAED,wBAAgB,aAAa,CAAC,QAAQ,SAAS,YAAY,EAAE,QAAQ,EACnE,SAAS,EAAE,aAAa,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAC3C,IAAI,CAUN;AAED;;GAEG;AACH,qBAAa,0BAA2B,SAAQ,aAAa,CAAC,yBAAyB,EAAE,EAAE,CAAC;IAC1F,SAAgB,YAAY,EAAE,MAAM,CAAyB;IAEtD,YAAY,IAAI,IAAI;IAIpB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAgE1B,WAAW,IAAI,IAAI;IAGnB,OAAO,IAAI,IAAI;IAGf,OAAO,IAAI,IAAI;IAGf,GAAG,IAAI,IAAI;IAIlB,OAAO,CAAC,aAAa;CAGtB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generators/component/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAGzE,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,SAAS,MAAM,cAAc,CAAC;AAE1C,OAAO,KAAK,qBAAqB,MAAM,0BAA0B,CAAC;AAGlE,MAAM,WAAW,yBACf,SAAQ,OAAO,CAAC,eAAe,EAC7B,SAAS,CAAC,iBAAiB,EAC3B,qBAAqB,CAAC,WAAW;IACnC,aAAa,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,uBAAuB,CAAC;CAC9E;AAED,wBAAgB,WAAW,CAAC,QAAQ,SAAS,YAAY,EAAE,QAAQ,EACjE,IAAI,EAAE,aAAa,CAAC,QAAQ,EAAE,QAAQ,CAAC,EACvC,OAAO,EAAE,YAAY,GACpB,IAAI,CAEN;AAED,wBAAgB,aAAa,CAAC,QAAQ,SAAS,YAAY,EAAE,QAAQ,EACnE,SAAS,EAAE,aAAa,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAC3C,IAAI,CAUN;AAED;;GAEG;AACH,qBAAa,0BAA2B,SAAQ,aAAa,CAAC,yBAAyB,EAAE,EAAE,CAAC;IAC1F,SAAgB,YAAY,EAAE,MAAM,CAAyB;IAEtD,YAAY,IAAI,IAAI;IAIpB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAkE1B,WAAW,IAAI,IAAI;IAGnB,OAAO,IAAI,IAAI;IAGf,OAAO,IAAI,IAAI;IAGf,GAAG,IAAI,IAAI;IAIlB,OAAO,CAAC,aAAa;CAGtB"}
@@ -13,6 +13,7 @@ export declare abstract class BaseExtensionGenerator<IOptions extends IBaseExten
13
13
  writing(shouldCopy?: boolean): void;
14
14
  install(): void;
15
15
  protected abstract includeClientSideInstances(): boolean;
16
- private hasElementsXml;
16
+ protected hasElementsXml(): boolean;
17
+ private _getFeatureFrameworkDocsUrl;
17
18
  }
18
19
  //# sourceMappingURL=BaseExtensionGenerator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseExtensionGenerator.d.ts","sourceRoot":"","sources":["../../../src/generators/extension/BaseExtensionGenerator.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,KAAK,aAAa,MAAM,qCAAqC,CAAC;AAErE,oBAAY,mBAAmB,GAC3B,uBAAuB,GACvB,YAAY,GACZ,iBAAiB,GACjB,qBAAqB,CAAC;AAE1B,MAAM,WAAW,qBAAsB,SAAQ,aAAa,CAAC,qBAAqB;CAAG;AACrF,MAAM,WAAW,qBAAsB,SAAQ,aAAa,CAAC,qBAAqB;CAAG;AAErF,wBAAgB,aAAa,CAAC,QAAQ,SAAS,YAAY,EAAE,QAAQ,EACnE,SAAS,EAAE,aAAa,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAC5C,IAAI,GAAE,MAAoB,GACzB,IAAI,CAEN;AAED,8BAAsB,sBAAsB,CAC1C,QAAQ,SAAS,qBAAqB,EACtC,QAAQ,SAAS,qBAAqB,CACtC,SAAQ,aAAa,CAAC,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAChE,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAgB;IAE9C,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAI1B,WAAW,IAAI,IAAI;IAQnB,OAAO,CAAC,UAAU,GAAE,OAAc,GAAG,IAAI;IAUzC,OAAO,IAAI,IAAI;IAItB,SAAS,CAAC,QAAQ,CAAC,0BAA0B,IAAI,OAAO;IAExD,OAAO,CAAC,cAAc;CAIvB"}
1
+ {"version":3,"file":"BaseExtensionGenerator.d.ts","sourceRoot":"","sources":["../../../src/generators/extension/BaseExtensionGenerator.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,KAAK,aAAa,MAAM,qCAAqC,CAAC;AAErE,oBAAY,mBAAmB,GAC3B,uBAAuB,GACvB,YAAY,GACZ,iBAAiB,GACjB,qBAAqB,CAAC;AAE1B,MAAM,WAAW,qBAAsB,SAAQ,aAAa,CAAC,qBAAqB;CAAG;AACrF,MAAM,WAAW,qBAAsB,SAAQ,aAAa,CAAC,qBAAqB;CAAG;AAErF,wBAAgB,aAAa,CAAC,QAAQ,SAAS,YAAY,EAAE,QAAQ,EACnE,SAAS,EAAE,aAAa,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAC5C,IAAI,GAAE,MAAoB,GACzB,IAAI,CAEN;AAED,8BAAsB,sBAAsB,CAC1C,QAAQ,SAAS,qBAAqB,EACtC,QAAQ,SAAS,qBAAqB,CACtC,SAAQ,aAAa,CAAC,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAChE,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAgB;IAE9C,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAI1B,WAAW,IAAI,IAAI;IAQnB,OAAO,CAAC,UAAU,GAAE,OAAc,GAAG,IAAI;IAoBzC,OAAO,IAAI,IAAI;IAItB,SAAS,CAAC,QAAQ,CAAC,0BAA0B,IAAI,OAAO;IAExD,SAAS,CAAC,cAAc,IAAI,OAAO;IAKnC,OAAO,CAAC,2BAA2B;CAgBpC"}
@@ -18,9 +18,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
18
18
  __setModuleDefault(result, mod);
19
19
  return result;
20
20
  };
21
+ var __importDefault = (this && this.__importDefault) || function (mod) {
22
+ return (mod && mod.__esModule) ? mod : { "default": mod };
23
+ };
21
24
  Object.defineProperty(exports, "__esModule", { value: true });
22
25
  exports.BaseExtensionGenerator = exports.defineOptions = void 0;
23
26
  const path = __importStar(require("path"));
27
+ const safe_1 = __importDefault(require("colors/safe"));
24
28
  const node_core_library_1 = require("@rushstack/node-core-library");
25
29
  const Utils = __importStar(require("../../common/utilities"));
26
30
  const BaseComponent = __importStar(require("../component/BaseComponentGenerator"));
@@ -50,6 +54,12 @@ class BaseExtensionGenerator extends BaseComponent.BaseComponentGenerator {
50
54
  const dest = path.join(this.destinationRoot(), 'sharepoint');
51
55
  this.copyTemplate(path.join(this.sourceRoot(), 'sharepoint'), dest);
52
56
  }
57
+ else {
58
+ const docsUrl = this._getFeatureFrameworkDocsUrl();
59
+ if (docsUrl) {
60
+ this.log(safe_1.default.yellow(`Elements.xml already exists. Please, reference ${docsUrl} to add additional elements to it.`));
61
+ }
62
+ }
53
63
  }
54
64
  }
55
65
  install() {
@@ -59,6 +69,21 @@ class BaseExtensionGenerator extends BaseComponent.BaseComponentGenerator {
59
69
  const elementsXmlPath = path.join(this.destinationRoot(), 'sharepoint', 'assets', 'elements.xml');
60
70
  return node_core_library_1.FileSystem.exists(elementsXmlPath);
61
71
  }
72
+ _getFeatureFrameworkDocsUrl() {
73
+ const extensionType = this.config.get('extensionType');
74
+ switch (extensionType) {
75
+ case 'FieldCustomizer':
76
+ return 'https://aka.ms/spfx/extensions/field';
77
+ case 'ListViewCommandSet':
78
+ return 'https://aka.ms/spfx/extensions/cmdset';
79
+ case 'ApplicationCustomizer':
80
+ return 'https://aka.ms/spfx/extensions/tutorial/helloworld3';
81
+ case 'SearchQueryModifier':
82
+ return 'https://aka.ms/spfx/extensions/search';
83
+ default:
84
+ return '';
85
+ }
86
+ }
62
87
  }
63
88
  exports.BaseExtensionGenerator = BaseExtensionGenerator;
64
89
  //# sourceMappingURL=BaseExtensionGenerator.js.map
@@ -1,4 +1,4 @@
1
- import { IBaseOptions, BaseGenerator, AvailableFrameworks } from '../../common/BaseGenerator';
1
+ import { IBaseOptions, BaseGenerator, AvailableTemplates } from '../../common/BaseGenerator';
2
2
  import * as BaseExtension from '../extension/BaseExtensionGenerator';
3
3
  export interface IFieldCustomizerOptions extends BaseExtension.IBaseExtensionOptions {
4
4
  }
@@ -10,7 +10,7 @@ export declare function defineOptions<TOptions extends IBaseOptions, TContext>(g
10
10
  export declare class FieldCustomizerGenerator extends BaseExtension.BaseExtensionGenerator<IFieldCustomizerOptions, IFieldCustomizerContext> {
11
11
  protected readonly friendlyName: string;
12
12
  protected readonly codeName: string;
13
- protected readonly allowedFrameworks: AvailableFrameworks[];
13
+ protected readonly allowedTemplates: AvailableTemplates[];
14
14
  initializing(): void;
15
15
  prompting(): Promise<void>;
16
16
  configuring(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generators/fieldCustomizer/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAG9F,OAAO,KAAK,aAAa,MAAM,qCAAqC,CAAC;AAErE,MAAM,WAAW,uBAAwB,SAAQ,aAAa,CAAC,qBAAqB;CAAG;AACvF,MAAM,WAAW,uBAAwB,SAAQ,aAAa,CAAC,qBAAqB;IAClF,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,WAAW,CAAC,QAAQ,SAAS,YAAY,EAAE,QAAQ,EACjE,IAAI,EAAE,aAAa,CAAC,QAAQ,EAAE,QAAQ,CAAC,EACvC,OAAO,EAAE,YAAY,GACpB,IAAI,CAEN;AAED,wBAAgB,aAAa,CAAC,QAAQ,SAAS,YAAY,EAAE,QAAQ,EACnE,SAAS,EAAE,aAAa,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAC3C,IAAI,CAEN;AAED,qBAAa,wBAAyB,SAAQ,aAAa,CAAC,sBAAsB,CAChF,uBAAuB,EACvB,uBAAuB,CACxB;IACC,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAsB;IAC7D,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAqB;IACxD,SAAS,CAAC,QAA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AAQ,CAAC,gBAAgB,EAAE,kBAAkB,EAAE,CAAwB;IAE1E,YAAY,IAAI,IAAI;IAIpB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ1B,WAAW,IAAI,IAAI;IAoBnB,OAAO,IAAI,IAAI;IAuBf,OAAO,IAAI,IAAI;IAMf,GAAG,IAAI,IAAI;IAIlB,SAAS,aAAa,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,OAAO,EAAE,uBAAuB;IAK/E,SAAS,CAAC,0BAA0B,IAAI,OAAO;IAI/C,OAAO,CAAC,aAAa;CAOtB"}
@@ -36,7 +36,7 @@ class FieldCustomizerGenerator extends BaseExtension.BaseExtensionGenerator {
36
36
  super(args, options);
37
37
  this.friendlyName = 'Field Customizer';
38
38
  this.codeName = 'FieldCustomizer';
39
- this.allowedFrameworks = ['react'];
39
+ this.allowedTemplates = ['react', 'minimal'];
40
40
  defineOptions(this);
41
41
  }
42
42
  initializing() {
@@ -69,7 +69,17 @@ class FieldCustomizerGenerator extends BaseExtension.BaseExtensionGenerator {
69
69
  }
70
70
  writing() {
71
71
  if (this.shouldExecute()) {
72
- super.writing();
72
+ super.writing(false);
73
+ const dest = this._getOutputFolder(this.context.componentNameCamelCase);
74
+ const template = this.context.template;
75
+ this.copyTemplate(path.join(this.sourceRoot(), template), dest);
76
+ if (template !== 'minimal') {
77
+ this.copyTemplate(path.join(this.sourceRoot(), 'loc'), path.join(dest, 'loc'));
78
+ }
79
+ if (!this.hasElementsXml()) {
80
+ this.copyTemplate(path.join(this.sourceRoot(), 'sharepoint'), path.join(this.destinationRoot(), 'sharepoint'));
81
+ }
82
+ this.copyTemplate(path.join(this.sourceRoot(), 'base'), dest);
73
83
  }
74
84
  }
75
85
  install() {
@@ -0,0 +1,4 @@
1
+ define([], function() {
2
+ return {
3
+ }
4
+ });
@@ -0,0 +1,7 @@
1
+ declare interface I<%= componentStrings %> {
2
+ }
3
+
4
+ declare module '<%= componentStrings %>' {
5
+ const strings: I<%= componentStrings %>;
6
+ export = strings;
7
+ }
@@ -0,0 +1,3 @@
1
+ .<%= componentName %> {
2
+ color: inherit;
3
+ }
@@ -0,0 +1,29 @@
1
+ import {
2
+ BaseFieldCustomizer,
3
+ IFieldCustomizerCellEventParameters
4
+ } from '@microsoft/sp-listview-extensibility';
5
+
6
+ import styles from './<%= componentClassName %>.module.scss';
7
+
8
+ /**
9
+ * If your field customizer uses the ClientSideComponentProperties JSON input,
10
+ * it will be deserialized into the BaseExtension.properties object.
11
+ * You can define an interface to describe it.
12
+ */
13
+ export interface I<%= componentClassName %>Properties {}
14
+
15
+ export default class <%= componentClassName %>
16
+ extends BaseFieldCustomizer<I<%= componentClassName %>Properties> {
17
+
18
+ public onInit(): Promise<void> {
19
+ return Promise.resolve();
20
+ }
21
+
22
+ public onRenderCell(event: IFieldCustomizerCellEventParameters): void {
23
+ event.domElement.classList.add(styles.<%= componentName %>);
24
+ }
25
+
26
+ public onDisposeCell(event: IFieldCustomizerCellEventParameters): void {
27
+ super.onDisposeCell(event);
28
+ }
29
+ }
@@ -1,5 +1,4 @@
1
1
  import { Log } from '@microsoft/sp-core-library';
2
- import { override } from '@microsoft/decorators';
3
2
  import {
4
3
  BaseFieldCustomizer,
5
4
  IFieldCustomizerCellEventParameters
@@ -23,7 +22,6 @@ const LOG_SOURCE: string = '<%= componentClassName %>';
23
22
  export default class <%= componentClassName %>
24
23
  extends BaseFieldCustomizer<I<%= componentClassName %>Properties> {
25
24
 
26
- @override
27
25
  public onInit(): Promise<void> {
28
26
  // Add your custom initialization to this method. The framework will wait
29
27
  // for the returned promise to resolve before firing any BaseFieldCustomizer events.
@@ -33,7 +31,6 @@ export default class <%= componentClassName %>
33
31
  return Promise.resolve();
34
32
  }
35
33
 
36
- @override
37
34
  public onRenderCell(event: IFieldCustomizerCellEventParameters): void {
38
35
  // Use this method to perform your custom cell rendering.
39
36
  const text: string = `${this.properties.sampleText}: ${event.fieldValue}`;
@@ -43,7 +40,6 @@ export default class <%= componentClassName %>
43
40
  event.domElement.classList.add(styles.<%= componentName %>);
44
41
  }
45
42
 
46
- @override
47
43
  public onDisposeCell(event: IFieldCustomizerCellEventParameters): void {
48
44
  // This method should be used to free any resources that were allocated during rendering.
49
45
  // For example, if your onRenderCell() called ReactDOM.render(), then you should
@@ -1,5 +1,4 @@
1
1
  import { Log } from '@microsoft/sp-core-library';
2
- import { override } from '@microsoft/decorators';
3
2
  import * as React from 'react';
4
3
 
5
4
  import styles from './<%= componentName %>.module.scss';
@@ -11,17 +10,14 @@ export interface I<%= componentName %>Props {
11
10
  const LOG_SOURCE: string = '<%= componentName %>';
12
11
 
13
12
  export default class <%= componentName %> extends React.Component<I<%= componentName %>Props, {}> {
14
- @override
15
13
  public componentDidMount(): void {
16
14
  Log.info(LOG_SOURCE, 'React Element: <%= componentName %> mounted');
17
15
  }
18
16
 
19
- @override
20
17
  public componentWillUnmount(): void {
21
18
  Log.info(LOG_SOURCE, 'React Element: <%= componentName %> unmounted');
22
19
  }
23
20
 
24
- @override
25
21
  public render(): React.ReactElement<{}> {
26
22
  return (
27
23
  <div className={styles.<%= componentName %>}>
@@ -2,7 +2,6 @@ import * as React from 'react';
2
2
  import * as ReactDOM from 'react-dom';
3
3
 
4
4
  import { Log } from '@microsoft/sp-core-library';
5
- import { override } from '@microsoft/decorators';
6
5
  import {
7
6
  BaseFieldCustomizer,
8
7
  IFieldCustomizerCellEventParameters
@@ -26,7 +25,6 @@ const LOG_SOURCE: string = '<%= componentClassName %>';
26
25
  export default class <%= componentClassName %>
27
26
  extends BaseFieldCustomizer<I<%= componentClassName %>Properties> {
28
27
 
29
- @override
30
28
  public onInit(): Promise<void> {
31
29
  // Add your custom initialization to this method. The framework will wait
32
30
  // for the returned promise to resolve before firing any BaseFieldCustomizer events.
@@ -36,7 +34,6 @@ export default class <%= componentClassName %>
36
34
  return Promise.resolve();
37
35
  }
38
36
 
39
- @override
40
37
  public onRenderCell(event: IFieldCustomizerCellEventParameters): void {
41
38
  // Use this method to perform your custom cell rendering.
42
39
  const text: string = `${this.properties.sampleText}: ${event.fieldValue}`;
@@ -47,7 +44,6 @@ export default class <%= componentClassName %>
47
44
  ReactDOM.render(<%= componentNameCamelCase %>, event.domElement);
48
45
  }
49
46
 
50
- @override
51
47
  public onDisposeCell(event: IFieldCustomizerCellEventParameters): void {
52
48
  // This method should be used to free any resources that were allocated during rendering.
53
49
  // For example, if your onRenderCell() called ReactDOM.render(), then you should
@@ -1,4 +1,4 @@
1
- import { IBaseOptions, BaseGenerator, AvailableFrameworks } from '../../common/BaseGenerator';
1
+ import { IBaseOptions, BaseGenerator, AvailableTemplates } from '../../common/BaseGenerator';
2
2
  import * as BaseComponent from '../component/BaseComponentGenerator';
3
3
  export interface ILibraryOptions extends BaseComponent.IBaseComponentOptions {
4
4
  }
@@ -9,7 +9,7 @@ export declare function defineOptions<TOptions extends IBaseOptions, TContext>(g
9
9
  export declare class LibraryGenerator extends BaseComponent.BaseComponentGenerator<ILibraryOptions, ILibraryContext> {
10
10
  protected readonly friendlyName: string;
11
11
  protected readonly codeName: string;
12
- protected readonly allowedFrameworks: AvailableFrameworks[];
12
+ protected readonly allowedTemplates: AvailableTemplates[];
13
13
  protected readonly folderName: string;
14
14
  initializing(): void;
15
15
  prompting(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generators/library/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAE9F,OAAO,KAAK,aAAa,MAAM,qCAAqC,CAAC;AAErE,MAAM,WAAW,eAAgB,SAAQ,aAAa,CAAC,qBAAqB;CAAG;AAE/E,MAAM,WAAW,eAAgB,SAAQ,aAAa,CAAC,qBAAqB;CAAG;AAE/E,wBAAgB,WAAW,CAAC,QAAQ,SAAS,YAAY,EAAE,QAAQ,EACjE,IAAI,EAAE,aAAa,CAAC,QAAQ,EAAE,QAAQ,CA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GACpB,IAAI,CAEN;AAED,wBAAgB,aAAa,CAAC,QAAQ,SAAS,YAAY,EAAE,QAAQ,EACnE,SAAS,EAAE,aAAa,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAC3C,IAAI,CAEN;AAED,qBAAa,gBAAiB,SAAQ,aAAa,CAAC,sBAAsB,CAAC,eAAe,EAAE,eAAe,CAAC;IAC1G,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAa;IACpD,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAa;IAChD,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,kBAAkB,EAAE,CAAM;IAC/D,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAe;IAE7C,YAAY,IAAI,IAAI;IAIpB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ1B,WAAW,IAAI,IAAI;IAiBnB,OAAO,IAAI,IAAI;IAOf,OAAO,IAAI,IAAI;IAMf,GAAG,IAAI,IAAI;IAIlB,SAAS,aAAa,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,OAAO,EAAE,eAAe;IAKvE,OAAO,CAAC,aAAa;CAGtB"}
@@ -36,7 +36,7 @@ class LibraryGenerator extends BaseComponent.BaseComponentGenerator {
36
36
  super(args, options);
37
37
  this.friendlyName = 'Library';
38
38
  this.codeName = 'Library';
39
- this.allowedFrameworks = [];
39
+ this.allowedTemplates = [];
40
40
  this.folderName = 'libraries';
41
41
  defineOptions(this);
42
42
  }
@@ -1,4 +1,4 @@
1
- import { IBaseOptions, BaseGenerator, AvailableFrameworks } from '../../common/BaseGenerator';
1
+ import { IBaseOptions, BaseGenerator, AvailableTemplates } from '../../common/BaseGenerator';
2
2
  import * as BaseExtension from '../extension/BaseExtensionGenerator';
3
3
  export interface ISearchQueryModifierOptions extends BaseExtension.IBaseExtensionOptions {
4
4
  }
@@ -9,7 +9,7 @@ export declare function defineOptions<TOptions extends IBaseOptions, TContext>(g
9
9
  export declare class SearchQueryModifierGenerator extends BaseExtension.BaseExtensionGenerator<ISearchQueryModifierOptions, ISearchQueryModifierContext> {
10
10
  protected readonly friendlyName: string;
11
11
  protected readonly codeName: string;
12
- protected readonly allowedFrameworks: AvailableFrameworks[];
12
+ protected readonly allowedTemplates: AvailableTemplates[];
13
13
  initializing(): void;
14
14
  prompting(): Promise<void>;
15
15
  configuring(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generators/searchQueryModifier/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAG9F,OAAO,KAAK,aAAa,MAAM,qCAAqC,CAAC;AAErE,MAAM,WAAW,2BAA4B,SAAQ,aAAa,CAAC,qBAAqB;CAAG;AAC3F,MAAM,WAAW,2BAA4B,SAAQ,aAAa,CAAC,qBAAqB;CAAG;AAE3F,wBAAgB,WAAW,CAAC,QAAQ,SAAS,YAAY,EAAE,QAAQ,EACjE,IAAI,EAAE,aAAa,CAAC,QAAQ,EAAE,QAAQ,CAAC,EACvC,OAAO,EAAE,YAAY,GACpB,IAAI,CAEN;AAED,wBAAgB,aAAa,CAAC,QAAQ,SAAS,YAAY,EAAE,QAAQ,EACnE,SAAS,EAAE,aAAa,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAC3C,IAAI,CAEN;AAED,qBAAa,4BAA6B,SAAQ,aAAa,CAAC,sBAAsB,CACpF,2BAA2B,EAC3B,2BAA2B,CAC5B;IACC,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAA2B;IAClE,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAyB;IAC5D,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,mBAAmB,EAAE,CAAM;IAE1D,YAAY,IAAI,IAAI;IAIpB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ1B,W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B,OAAO,IAAI,IAAI;IAMf,OAAO,IAAI,IAAI;IAMf,GAAG,IAAI,IAAI;IAIlB,SAAS,aAAa,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,OAAO,EAAE,2BAA2B;IAKnF,SAAS,CAAC,0BAA0B,IAAI,OAAO;IAI/C,OAAO,CAAC,aAAa;CAOtB"}
@@ -36,7 +36,7 @@ class SearchQueryModifierGenerator extends BaseExtension.BaseExtensionGenerator
36
36
  super(args, options);
37
37
  this.friendlyName = 'Search Query Modifier';
38
38
  this.codeName = 'SearchQueryModifier';
39
- this.allowedFrameworks = [];
39
+ this.allowedTemplates = [];
40
40
  defineOptions(this);
41
41
  }
42
42
  initializing() {
@@ -1,4 +1,3 @@
1
- import { override } from '@microsoft/decorators';
2
1
  import { Log } from '@microsoft/sp-core-library';
3
2
  import { BaseSearchQueryModifier, IQuery, SearchQueryScenario } from '@microsoft/sp-search-extensibility';
4
3
 
@@ -18,13 +17,11 @@ const LOG_SOURCE: string = '<%= componentClassName %>';
18
17
 
19
18
  export default class <%= componentClassName %> extends BaseSearchQueryModifier<I<%= componentClassName %>Properties> {
20
19
 
21
- @override
22
20
  public onInit(): Promise<void> {
23
21
  Log.info(LOG_SOURCE, 'Initialized <%= componentClassName %>');
24
22
  return Promise.resolve();
25
23
  }
26
24
 
27
- @override
28
25
  public modifySearchQuery(query: IQuery, scenario: SearchQueryScenario): Promise<IQuery> {
29
26
  Log.info(LOG_SOURCE, `Modifying query ${query.queryText} with ${strings.Title}`);
30
27
  return Promise.resolve(query);
@@ -1,6 +1,7 @@
1
1
  import { BaseGenerator, IBaseOptions } from '../../common/BaseGenerator';
2
2
  export interface ISolutionOptions extends IBaseOptions {
3
3
  solutionName: string;
4
+ solutionShortDescription: string;
4
5
  skipFeatureDeployment: boolean;
5
6
  environment: 'spo';
6
7
  packageManager: 'npm' | 'pnpm' | 'yarn';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generators/solution/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAIzE,MAAM,WAAW,gBAAiB,SAAQ,YAAY;IACpD,YAAY,EAAE,MAAM,CAAC;IACrB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,WAAW,EAAE,KAAK,CAAC;IACnB,cAAc,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;IACxC,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,gBAAiB,SAAQ,gBAAgB;IACxD,WAAW,EAAE,MAAM,CAAiD;IACpE,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,WAAW,CAAC,QAAQ,SAAS,YAAY,EAAE,QAAQ,EACjE,IAAI,EAAE,aAAa,CAAC,QAAQ,EAAE,QAAQ,CAAC,EACvC,OAAO,EAAE,YAAY,GACpB,IAAI,CAEN;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,aAAa,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,GAAG,IAAI,CA8BhG"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generators/solution/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAIzE,MAAM,WAAW,gBAAiB,SAAQ,YAAY;IACpD,YAAY,EAAE,MAAM,CAAC;IACrB,wBAAwB,EAAE,MAAM,CAAC;IACjC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,WAAW,EAAE,KAAK,CAAC;IACnB,cAAc,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;IACxC,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,gBAAiB,SAAQ,gBAAgB;IACxD,WAAW,EAAE,MAAM,CAAiD;IACpE,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,WAAW,CAAC,QAAQ,SAAS,YAAY,EAAE,QAAQ,EACjE,IAAI,EAAE,aAAa,CAAC,QAAQ,EAAE,QAAQ,CAAC,EACvC,OAAO,EAAE,YAAY,GACpB,IAAI,CAEN;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,aAAa,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,GAAG,IAAI,CA8BhG"}
@@ -18,10 +18,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
18
18
  __setModuleDefault(result, mod);
19
19
  return result;
20
20
  };
21
+ var __importDefault = (this && this.__importDefault) || function (mod) {
22
+ return (mod && mod.__esModule) ? mod : { "default": mod };
23
+ };
21
24
  Object.defineProperty(exports, "__esModule", { value: true });
22
25
  exports.defineOptions = exports.composeWith = void 0;
23
26
  const lodash = __importStar(require("lodash"));
24
27
  const path = __importStar(require("path"));
28
+ const colors_1 = __importDefault(require("colors"));
25
29
  const Utils = __importStar(require("../../common/utilities"));
26
30
  const BaseGenerator_1 = require("../../common/BaseGenerator");
27
31
  const YeomanConfiguration_1 = require("../../common/YeomanConfiguration");
@@ -82,6 +86,13 @@ class SolutionGenerator extends BaseGenerator_1.BaseGenerator {
82
86
  when: () => !this.config.get('solutionName'),
83
87
  message: 'What is your solution name?'
84
88
  },
89
+ {
90
+ type: 'input',
91
+ name: 'solutionShortDescription',
92
+ when: () => !this.config.get('solutionShortDescription'),
93
+ message: 'Enter a short description for your solution?',
94
+ default: (answers) => `${this.config.get('solutionName') || answers.solutionName} description`
95
+ },
85
96
  {
86
97
  type: 'list',
87
98
  name: 'environment',
@@ -97,6 +108,7 @@ class SolutionGenerator extends BaseGenerator_1.BaseGenerator {
97
108
  }
98
109
  const environment = this.config.get('environment');
99
110
  const solutionName = this.config.get('solutionName');
111
+ const solutionShortDescription = this.config.get('solutionShortDescription') || answers.solutionShortDescription;
100
112
  // allows to set --skip-feature-deployment false
101
113
  let skipFeatureDeployment = undefined;
102
114
  const skipFeatureDeploymentConfig = this.config.get('skipFeatureDeployment');
@@ -110,7 +122,7 @@ class SolutionGenerator extends BaseGenerator_1.BaseGenerator {
110
122
  }
111
123
  const componentType = this.config.get('componentType');
112
124
  const extensionType = this.config.get('extensionType');
113
- const framework = this.config.get('framework');
125
+ const template = this.config.get('framework') || this.config.get('template');
114
126
  const componentName = this.config.get('componentName');
115
127
  const componentDescription = this.config.get('componentDescription');
116
128
  const isCreatingSolution = this.config.get('isCreatingSolution');
@@ -129,6 +141,7 @@ class SolutionGenerator extends BaseGenerator_1.BaseGenerator {
129
141
  this.context.solutionName = this.config.get('solutionName') || answers.solutionName;
130
142
  this.context.libraryName = lodash.kebabCase(this.context.solutionName);
131
143
  this.context.libraryId = Utils.generateGuid();
144
+ this.context.solutionShortDescription = solutionShortDescription;
132
145
  // store some variables
133
146
  YeomanConfiguration_1.YeomanConfiguration.version = BaseGenerator_1.BaseGenerator.generatorPackageJson.version;
134
147
  YeomanConfiguration_1.YeomanConfiguration.libraryName = this.context.libraryName;
@@ -137,10 +150,11 @@ class SolutionGenerator extends BaseGenerator_1.BaseGenerator {
137
150
  YeomanConfiguration_1.YeomanConfiguration.packageManager =
138
151
  this.config.get('packageManager') || YeomanConfiguration_1.YeomanConfiguration.packageManager || 'npm';
139
152
  this.config.set('solutionName', solutionName);
153
+ this.config.set('solutionShortDescription', solutionShortDescription);
140
154
  this.config.set('skipFeatureDeployment', skipFeatureDeployment);
141
155
  this.config.set('componentType', componentType);
142
156
  this.config.set('extensionType', extensionType);
143
- this.config.set('framework', framework);
157
+ this.config.set('template', template);
144
158
  this.config.set('componentName', componentName);
145
159
  this.config.set('componentDescription', componentDescription);
146
160
  this.config.set('isCreatingSolution', isCreatingSolution);
@@ -148,23 +162,15 @@ class SolutionGenerator extends BaseGenerator_1.BaseGenerator {
148
162
  this.config.set('plusBeta', isPlusBeta);
149
163
  })
150
164
  .then(() => {
151
- return this.prompt([
152
- {
153
- type: 'confirm',
154
- name: 'skipFeatureDeployment',
155
- default: false,
156
- when: () => this.config.get('skipFeatureDeployment') === undefined,
157
- message: 'Do you want to allow the tenant admin the choice of being able ' +
158
- 'to deploy the solution to all sites immediately without running ' +
159
- 'any feature deployment or adding apps in sites?'
160
- }
161
- ]);
162
- })
163
- .then((answers) => {
164
- this.context.skipFeatureDeployment =
165
- this.config.get('skipFeatureDeployment') !== undefined
166
- ? this.config.get('skipFeatureDeployment')
167
- : answers.skipFeatureDeployment;
165
+ if (this.config.get('skipFeatureDeployment') === undefined) {
166
+ this.log(colors_1.default.green('The ability for the tenant admin to immediately deploy the solution to all sites' +
167
+ ' without running any feature deployment (tenant-wide deployment) is enabled by default.' +
168
+ ' You can change this by setting the skipFeatureDeployment property to false in ./config/package-solution.json.'));
169
+ this.context.skipFeatureDeployment = true;
170
+ }
171
+ else {
172
+ this.context.skipFeatureDeployment = this.config.get('skipFeatureDeployment');
173
+ }
168
174
  })
169
175
  .then(() => {
170
176
  return this.prompt([
@@ -1,4 +1,4 @@
1
- import { IBaseOptions, BaseGenerator, AvailableFrameworks } from '../../common/BaseGenerator';
1
+ import { IBaseOptions, BaseGenerator, AvailableTemplates } from '../../common/BaseGenerator';
2
2
  import * as BaseComponent from '../component/BaseComponentGenerator';
3
3
  export interface IWebpartOptions extends BaseComponent.IBaseComponentOptions {
4
4
  }
@@ -9,7 +9,7 @@ export declare function defineOptions<TOptions extends IBaseOptions, TContext>(g
9
9
  export declare class WebpartGenerator extends BaseComponent.BaseComponentGenerator<IWebpartOptions, IWebpartContext> {
10
10
  protected readonly friendlyName: string;
11
11
  protected readonly codeName: string;
12
- protected readonly allowedFrameworks: AvailableFrameworks[];
12
+ protected readonly allowedTemplates: AvailableTemplates[];
13
13
  protected readonly folderName: string;
14
14
  initializing(): void;
15
15
  prompting(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generators/webpart/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAG9F,OAAO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C,CAAC;AAErE,MAAM,WAAW,eAAgB,SAAQ,aAAa,CAAC,qBAAqB;CAAG;AAE/E,MAAM,WAAW,eAAgB,SAAQ,aAAa,CAAC,qBAAqB;CAAG;AAE/E,wBAAgB,WAAW,CAAC,QAAQ,SAAS,YAAY,EAAE,QAAQ,EACjE,IAAI,EAAE,aAAa,CAAC,QAAQ,EAAE,QAAQ,CAAC,EACvC,OAAO,EAAE,YAAY,GACpB,IAAI,CAEN;AAED,wBAAgB,aAAa,CAAC,QAAQ,SAAS,YAAY,EAAE,QAAQ,EACnE,SAAS,EAAE,aAAa,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAC3C,IAAI,CAEN;AAED,qBAAa,gBAAiB,SAAQ,aAAa,CAAC,sBAAsB,CAAC,eAAe,EAAE,eAAe,CAAC;IAC1G,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAc;IACrD,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAa;IAChD,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,kBAAkB,EAAE,CAAwB;IACjF,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAc;IAE5C,YAAY,IAAI,IAAI;IAIpB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ1B,WAAW,IAAI,IAAI;IAenB,OAAO,IAAI,IAAI;IA0Bf,OAAO,IAAI,IAAI;IAMf,GAAG,IAAI,IAAI;IAIlB,SAAS,aAAa,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,OAAO,EAAE,eAAe;IAKvE,OAAO,CAAC,aAAa;CAGtB"}
@@ -22,6 +22,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
22
22
  exports.WebpartGenerator = exports.defineOptions = exports.composeWith = void 0;
23
23
  const path = __importStar(require("path"));
24
24
  const Utils = __importStar(require("../../common/utilities"));
25
+ const YeomanConfiguration_1 = require("../../common/YeomanConfiguration");
25
26
  const BaseComponent = __importStar(require("../component/BaseComponentGenerator"));
26
27
  function composeWith(base, options) {
27
28
  Utils.compose(path.basename(__dirname), base, options);
@@ -36,7 +37,7 @@ class WebpartGenerator extends BaseComponent.BaseComponentGenerator {
36
37
  super(args, options);
37
38
  this.friendlyName = 'Web part';
38
39
  this.codeName = 'WebPart';
39
- this.allowedFrameworks = ['react'];
40
+ this.allowedTemplates = ['react', 'minimal'];
40
41
  this.folderName = 'webparts';
41
42
  defineOptions(this);
42
43
  }
@@ -55,16 +56,23 @@ class WebpartGenerator extends BaseComponent.BaseComponentGenerator {
55
56
  super.configuring();
56
57
  this.ensureDependencyGroup('webpart');
57
58
  this.serveJson.setUpForWebParts();
59
+ const solutionName = YeomanConfiguration_1.YeomanConfiguration.libraryName;
60
+ this.packageSolutionJson.addFeature(Utils.generateGuid(), `${solutionName} Feature`, `The feature that activates elements of the ${solutionName} solution.`, false);
58
61
  }
59
62
  }
60
63
  writing() {
61
64
  if (this.shouldExecute()) {
62
- super.writing(true);
65
+ super.writing(false);
66
+ const dest = this._getOutputFolder(this.context.componentNameCamelCase);
67
+ const template = this.context.template;
68
+ this.copyTemplate(path.join(this.sourceRoot(), template), dest);
69
+ if (template !== 'minimal') {
70
+ this.copyTemplate(path.join(this.sourceRoot(), 'loc'), path.join(dest, 'loc'));
71
+ this.copyTemplate(path.join(this.sourceRoot(), 'assets'), path.join(dest, 'assets'));
72
+ }
73
+ this.copyTemplate(path.join(this.sourceRoot(), 'base'), dest);
63
74
  this.fs.copy(this.templatePath('./images/outline.png'), this.destinationPath(`teams/${this.context.componentId}_outline.png`));
64
75
  this.fs.copy(this.templatePath('./images/color.png'), this.destinationPath(`teams/${this.context.componentId}_color.png`));
65
- if (this.options.plusbeta) {
66
- this.fs.copyTpl(this.templatePath('./officeAddin/initial.outlookManifest.xml'), this.destinationPath(`officeAddin/${this.context.componentId}_outlookManifest.xml`), { componentId: this.context.componentId });
67
- }
68
76
  }
69
77
  }
70
78
  install() {
@@ -0,0 +1,11 @@
1
+ define([], function() {
2
+ return {
3
+ "PropertyPaneDescription": "Description",
4
+ "BasicGroupName": "Group Name",
5
+ "DescriptionFieldLabel": "Description Field",
6
+ "AppLocalEnvironmentSharePoint": "The app is running on your local environment as SharePoint web part",
7
+ "AppLocalEnvironmentTeams": "The app is running on your local environment as Microsoft Teams app",
8
+ "AppSharePointEnvironment": "The app is running on SharePoint page",
9
+ "AppTeamsTabEnvironment": "The app is running in Microsoft Teams"
10
+ }
11
+ });