@spfx-extensions/package 1.6.1 → 1.6.3

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 (81) hide show
  1. package/.npmignore +16 -16
  2. package/.nvmrc +1 -1
  3. package/LICENSE +674 -674
  4. package/README.md +166 -166
  5. package/config/config-scripts/rename-solution.mjs +22 -0
  6. package/config/config-scripts/update-version.mjs +23 -0
  7. package/config/config-scripts/webpack-patch.mjs +134 -0
  8. package/config/config.json +27 -27
  9. package/config/deploy-azure-storage.json +6 -6
  10. package/config/heft.json +58 -0
  11. package/config/package-solution.json +3 -3
  12. package/config/rig.json +7 -0
  13. package/config/sass.json +3 -2
  14. package/config/serve.json +18 -18
  15. package/config/typescript.json +7 -0
  16. package/config/webpack-patch.json +6 -0
  17. package/config/write-manifests.json +3 -3
  18. package/dist/8d1029da-85e6-48cc-aaaf-37a5bbc0b9be.manifest.json +3 -3
  19. package/dist/d6ca1fc2-0591-4c6d-8a25-cae3262c017b.manifest.json +6 -6
  20. package/dist/debug/83e13c11-682e-4eaa-9ae0-74617ca28f96/ClientSideInstance.xml +8 -8
  21. package/dist/debug/83e13c11-682e-4eaa-9ae0-74617ca28f96/Extension_8d1029da-85e6-48cc-aaaf-37a5bbc0b9be.xml +1 -1
  22. package/dist/debug/83e13c11-682e-4eaa-9ae0-74617ca28f96/WebPart_d6ca1fc2-0591-4c6d-8a25-cae3262c017b.xml +1 -1
  23. package/dist/debug/83e13c11-682e-4eaa-9ae0-74617ca28f96/elements.xml +8 -8
  24. package/dist/debug/AppManifest.xml +1 -1
  25. package/dist/debug/ClientSideAssets/spfx-extension-application-customizer_a3a347c8bd029396ec50.js +2 -0
  26. package/dist/debug/ClientSideAssets/spfx-extensionloader-web-part_3b393b3ec530c336b801.js +2 -0
  27. package/dist/debug/ClientSideAssets/spfx-extensions-classiccustomaction.js +1 -0
  28. package/dist/debug/ClientSideAssets/spfx-extensions-classicwrapper.js +1 -0
  29. package/dist/debug/ClientSideAssets/spfx-extensions-core.js +1 -0
  30. package/dist/debug/ClientSideAssets/spfx-extensions-coreconfigurator.js +175 -0
  31. package/dist/debug/ClientSideAssets/spfx-extensions-loader_6e8eb68a4b27d7c6f742.js +2 -0
  32. package/dist/debug/ClientSideAssets.xml +1 -1
  33. package/dist/debug/ClientSideAssets.xml.config.xml +1 -1
  34. package/dist/debug/_rels/AppManifest.xml.rels +1 -1
  35. package/dist/debug/_rels/ClientSideAssets.xml.rels +1 -1
  36. package/dist/debug/feature_83e13c11-682e-4eaa-9ae0-74617ca28f96.xml +1 -1
  37. package/dist/debug/feature_83e13c11-682e-4eaa-9ae0-74617ca28f96.xml.config.xml +1 -1
  38. package/dist/deploy/sp-fx-extensions.sppkg +0 -0
  39. package/dist/spfx-extension-application-customizer_a3a347c8bd029396ec50.js +2 -0
  40. package/dist/spfx-extensionloader-web-part_3b393b3ec530c336b801.js +2 -0
  41. package/dist/spfx-extensions-classiccustomaction.js +1 -0
  42. package/dist/spfx-extensions-classicwrapper.js +1 -0
  43. package/dist/spfx-extensions-core.js +1 -0
  44. package/dist/spfx-extensions-coreconfigurator.js +175 -0
  45. package/dist/spfx-extensions-loader_6e8eb68a4b27d7c6f742.js +2 -0
  46. package/gulpfile.js +80 -196
  47. package/package.json +68 -63
  48. package/sharepoint/assets/ClientSideInstance.xml +8 -8
  49. package/sharepoint/assets/elements.xml +8 -8
  50. package/src/@types/globals.d.ts +17 -14
  51. package/src/extensions/spfxExtension/SpfxExtensionApplicationCustomizer.manifest.json +17 -17
  52. package/src/extensions/spfxExtension/SpfxExtensionApplicationCustomizer.ts +70 -70
  53. package/src/extensions/spfxExtension/loc/en-us.js +4 -4
  54. package/src/extensions/spfxExtension/loc/myStrings.d.ts +8 -8
  55. package/src/index.ts +1 -1
  56. package/src/services/initCoreService.ts +68 -60
  57. package/src/utilities/constants.ts +3 -3
  58. package/src/webparts/spfxExtensionloader/SpfxExtensionloaderWebPart.manifest.json +34 -34
  59. package/src/webparts/spfxExtensionloader/SpfxExtensionloaderWebPart.module.scss +185 -185
  60. package/src/webparts/spfxExtensionloader/SpfxExtensionloaderWebPart.ts +767 -767
  61. package/src/webparts/spfxExtensionloader/ai.json +38 -0
  62. package/src/webparts/spfxExtensionloader/loc/en-us.js +15 -15
  63. package/src/webparts/spfxExtensionloader/loc/mystrings.d.ts +19 -19
  64. package/tsconfig.json +25 -25
  65. package/dist/debug/ClientSideAssets/spfx-extension-application-customizer_4ec7a7e885824c810f4a.js +0 -2
  66. package/dist/debug/ClientSideAssets/spfx-extension-core.js +0 -1
  67. package/dist/debug/ClientSideAssets/spfx-extension-coreconfigurator.js +0 -175
  68. package/dist/debug/ClientSideAssets/spfx-extension-loader_a8e9e98c65f5ffdfbd2f.js +0 -2
  69. package/dist/debug/ClientSideAssets/spfx-extension-wrapper.js +0 -1
  70. package/dist/debug/ClientSideAssets/spfx-extensionloader-web-part_02ffe17119fb99560692.js +0 -3
  71. package/dist/spfx-extension-application-customizer_4ec7a7e885824c810f4a.js +0 -2
  72. package/dist/spfx-extension-core.js +0 -1
  73. package/dist/spfx-extension-coreconfigurator.js +0 -175
  74. package/dist/spfx-extension-loader_a8e9e98c65f5ffdfbd2f.js +0 -2
  75. package/dist/spfx-extension-wrapper.js +0 -1
  76. package/dist/spfx-extensionloader-web-part_02ffe17119fb99560692.js +0 -3
  77. package/src/webparts/spfxExtensionloader/SpfxExtensionloaderWebPart.module.scss.ts +0 -24
  78. /package/dist/debug/ClientSideAssets/{3be36e80-4431-4b52-99c5-0a339b4e696e_color.png → d6ca1fc2-0591-4c6d-8a25-cae3262c017b_color.png} +0 -0
  79. /package/dist/debug/ClientSideAssets/{3be36e80-4431-4b52-99c5-0a339b4e696e_outline.png → d6ca1fc2-0591-4c6d-8a25-cae3262c017b_outline.png} +0 -0
  80. /package/teams/{3be36e80-4431-4b52-99c5-0a339b4e696e_color.png → d6ca1fc2-0591-4c6d-8a25-cae3262c017b_color.png} +0 -0
  81. /package/teams/{3be36e80-4431-4b52-99c5-0a339b4e696e_outline.png → d6ca1fc2-0591-4c6d-8a25-cae3262c017b_outline.png} +0 -0
package/README.md CHANGED
@@ -1,166 +1,166 @@
1
- # SPFx Extensions Framework
2
-
3
- ## Summary
4
-
5
- A SharePoint Framework (SPFx) extension solution that provides a framework-agnostic wrapper for building modern SharePoint applications. This solution contains both a web part and an application customizer that can be installed tenant-wide, enabling developers to break free from the traditional SPFx ecosystem limitations.
6
-
7
- The solution acts as a wrapper around the `@spfx-extensions/core` package, allowing you to use any modern bundler (Bun, esbuild, Vite, etc.) and the latest Node.js versions for your SharePoint solutions.
8
-
9
- ## Used SharePoint Framework Version
10
-
11
- ![version](https://img.shields.io/badge/version-1.22.0-green.svg)
12
-
13
- ## Applies to
14
- - SharePoint Online
15
-
16
- > Get your own free development tenant by subscribing to [Microsoft 365 developer program](http://aka.ms/o365devprogram)
17
-
18
- ## Prerequisites
19
-
20
- - SharePoint Online tenant
21
- - App Catalog site collection
22
- - Global administrator or SharePoint administrator permissions for tenant-wide deployment
23
- - Node.js 22.14.0 or higher (but less than 23.0.0)
24
-
25
- ## Disclaimer
26
-
27
- **THIS CODE IS PROVIDED _AS IS_ WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**
28
-
29
- ---
30
-
31
- ## Minimal Path to Awesome
32
-
33
- ### Installation
34
-
35
- 1. **Clone this repository**
36
- ```bash
37
- git clone https://github.com/SPWizard01/spfx-extensions
38
- cd spfx-extensions
39
- ```
40
-
41
- 2. **Install dependencies**
42
- ```bash
43
- npm install
44
- ```
45
-
46
- 3. **Build the solution**
47
- ```bash
48
- npm run build
49
- ```
50
-
51
- 4. **Package for deployment**
52
- ```bash
53
- npm run release
54
- ```
55
- If you would like to change the name of the webpart to use your own then use `--change-name` argument
56
- ```bash
57
- npm run release --change-name My Awesome Webpart
58
- ```
59
-
60
- 5. **Deploy to App Catalog**
61
- - Upload the generated `.sppkg` file from `./dist/deploy/` to your tenant's App Catalog
62
- - Deploy the solution tenant-wide when prompted
63
- - The solution will automatically create the required subsite and configuration infrastructure
64
-
65
- ### Post-Installation
66
-
67
- After successful deployment, you can:
68
-
69
- - Navigate to `/sites/appcatalog/SPFxExtensionsData/SitePages/SPFxExtensionsConfigurator.aspx` for global configuration
70
- ![Global configuration](docs/images/configurator.png)
71
- - Add the SPFx Extensions Loader web part to any SharePoint page
72
- ![Full-width section](docs/images/fullwidthsupport.png)
73
- - Then configure which app the webpart should load
74
- ![Select an app](docs/images/propertypane.png)
75
- - Configure applications at different scopes (Global, Hub, Site, Web) as needed
76
- ![Add webs](docs/images/sitelist.png)
77
- - Add webs where you want to add the apps
78
- ![Configure app](docs/images/appconfig.png)
79
- - Configure the app/upload necessary files
80
- ![Enable app at scope](docs/images/enableapp.png)
81
- - Enable or disable the app at specific scope
82
- ## Development Commands
83
-
84
- | Command | Description |
85
- | ------- | ----------- |
86
- | `npm run build` | Build the solution in development mode |
87
- | `npm run serve` | Start the local development server |
88
- | `npm run release` | Build and package for production deployment |
89
- | `npm run clean` | Clean build artifacts |
90
- | `npm test` | Run tests |
91
-
92
- ## What This Solution Does
93
-
94
- When deployed to your SharePoint tenant, this solution:
95
-
96
- 1. **Creates Infrastructure**: Automatically provisions a special subsite at `/sites/appcatalog/SPFxExtensionsData`
97
- 2. **Configuration Management**: Sets up application-specific configuration lists in the subsite
98
- 3. **Global Configuration Page**: Creates a configuration page at `SitePages/SPFxExtensionsConfigurator.aspx`
99
- 4. **Multi-Scope Support**: Enables configuration for Global, Hub, Site, and Web scoped solutions
100
- 5. **Framework Freedom**: Acts as a wrapper around `@spfx-extensions/core`, freeing you from SPFx ecosystem constraints
101
-
102
- ## Key Benefits
103
-
104
- ### 🚀 **Modern Development Stack**
105
- - Use any bundler you prefer: **Bun**, **esbuild**, **Vite**, **Webpack**, or others
106
- - Support for the latest Node.js versions (not limited to SPFx-supported versions)
107
- - Modern JavaScript/TypeScript features without SPFx limitations
108
-
109
- ### 🔧 **Flexible Architecture**
110
- - Framework-agnostic development approach
111
- - Break free from Microsoft's SPFx app ecosystem constraints
112
- - Maintain full control over your build pipeline and dependencies
113
-
114
- ### 🎯 **Enterprise-Ready**
115
- - Tenant-wide deployment capability
116
- - Centralized configuration management
117
- - Support for multiple scoping levels (Global/Hub/Site/Web)
118
-
119
- ## Architecture Overview
120
-
121
- This solution consists of two main components:
122
-
123
- ### 1. Application Customizer (`SpfxExtensionApplicationCustomizer`)
124
- - Deployed tenant-wide for global functionality
125
- - Initializes the core framework on every SharePoint page
126
- - Manages application lifecycle and placeholder handling
127
-
128
- ### 2. Web Part (`SpfxExtensionloaderWebPart`)
129
- - Provides a configurable interface for loading custom applications
130
- - Integrates with the centralized configuration system
131
- - Supports dynamic app loading and configuration
132
-
133
- Both components leverage the `@spfx-extensions/core` package to provide the underlying framework functionality.
134
- ## Technical Details
135
-
136
- ### Core Dependencies
137
- - **@spfx-extensions/core**: The foundational package that provides framework-agnostic capabilities
138
- - **SharePoint Framework 1.21.0**: Base SPFx framework for SharePoint integration
139
- - **TypeScript**: Full TypeScript support with modern language features
140
-
141
- ### Infrastructure Created
142
- - **Subsite**: `/sites/appcatalog/SPFxExtensionsData`
143
- - **Configuration Lists**: `SPFxExtensionsWhiteList`, `SPFxExtensionsConfiguration`
144
- - **Configuration Page**: `SitePages/SPFxExtensionsConfigurator.aspx`
145
-
146
- ### Supported Scopes
147
- - **Global**: Tenant-wide configurations
148
- - **Hub**: Hub site specific configurations
149
- - **Site**: Site collection specific configurations
150
- - **Web**: Individual web specific configurations
151
-
152
- ## Contributing
153
-
154
- This project welcomes contributions and suggestions. Please feel free to submit issues and enhancement requests.
155
-
156
- ## License
157
-
158
- This project is licensed under the GPL-3.0 License - see the [LICENSE](LICENSE) file for details.
159
-
160
- ## References
161
-
162
- - [Getting started with SharePoint Framework](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-developer-tenant)
163
- - [Building for Microsoft teams](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/build-for-teams-overview)
164
- - [Use Microsoft Graph in your solution](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/using-microsoft-graph-apis)
165
- - [Publish SharePoint Framework applications to the Marketplace](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/publish-to-marketplace-overview)
166
- - [Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp) - Guidance, tooling, samples and open-source controls for your Microsoft 365 development
1
+ # SPFx Extensions Framework
2
+
3
+ ## Summary
4
+
5
+ A SharePoint Framework (SPFx) extension solution that provides a framework-agnostic wrapper for building modern SharePoint applications. This solution contains both a web part and an application customizer that can be installed tenant-wide, enabling developers to break free from the traditional SPFx ecosystem limitations.
6
+
7
+ The solution acts as a wrapper around the `@spfx-extensions/core` package, allowing you to use any modern bundler (Bun, esbuild, Vite, etc.) and the latest Node.js versions for your SharePoint solutions.
8
+
9
+ ## Used SharePoint Framework Version
10
+
11
+ ![version](https://img.shields.io/badge/version-1.22.0-green.svg)
12
+
13
+ ## Applies to
14
+ - SharePoint Online
15
+
16
+ > Get your own free development tenant by subscribing to [Microsoft 365 developer program](http://aka.ms/o365devprogram)
17
+
18
+ ## Prerequisites
19
+
20
+ - SharePoint Online tenant
21
+ - App Catalog site collection
22
+ - Global administrator or SharePoint administrator permissions for tenant-wide deployment
23
+ - Node.js 22.14.0 or higher (but less than 23.0.0)
24
+
25
+ ## Disclaimer
26
+
27
+ **THIS CODE IS PROVIDED _AS IS_ WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**
28
+
29
+ ---
30
+
31
+ ## Minimal Path to Awesome
32
+
33
+ ### Installation
34
+
35
+ 1. **Clone this repository**
36
+ ```bash
37
+ git clone https://github.com/SPWizard01/spfx-extensions
38
+ cd spfx-extensions
39
+ ```
40
+
41
+ 2. **Install dependencies**
42
+ ```bash
43
+ npm install
44
+ ```
45
+
46
+ 3. **Build the solution**
47
+ ```bash
48
+ npm run build
49
+ ```
50
+
51
+ 4. **Package for deployment**
52
+ ```bash
53
+ npm run release
54
+ ```
55
+ If you would like to change the name of the webpart to use your own then use `--change-name` argument
56
+ ```bash
57
+ npm run release --change-name My Awesome Webpart
58
+ ```
59
+
60
+ 5. **Deploy to App Catalog**
61
+ - Upload the generated `.sppkg` file from `./dist/deploy/` to your tenant's App Catalog
62
+ - Deploy the solution tenant-wide when prompted
63
+ - The solution will automatically create the required subsite and configuration infrastructure
64
+
65
+ ### Post-Installation
66
+
67
+ After successful deployment, you can:
68
+
69
+ - Navigate to `/sites/appcatalog/SPFxExtensionsData/SitePages/SPFxExtensionsConfigurator.aspx` for global configuration
70
+ ![Global configuration](docs/images/configurator.png)
71
+ - Add the SPFx Extensions Loader web part to any SharePoint page
72
+ ![Full-width section](docs/images/fullwidthsupport.png)
73
+ - Then configure which app the webpart should load
74
+ ![Select an app](docs/images/propertypane.png)
75
+ - Configure applications at different scopes (Global, Hub, Site, Web) as needed
76
+ ![Add webs](docs/images/sitelist.png)
77
+ - Add webs where you want to add the apps
78
+ ![Configure app](docs/images/appconfig.png)
79
+ - Configure the app/upload necessary files
80
+ ![Enable app at scope](docs/images/enableapp.png)
81
+ - Enable or disable the app at specific scope
82
+ ## Development Commands
83
+
84
+ | Command | Description |
85
+ | ------- | ----------- |
86
+ | `npm run build` | Build the solution in development mode |
87
+ | `npm run serve` | Start the local development server |
88
+ | `npm run release` | Build and package for production deployment |
89
+ | `npm run clean` | Clean build artifacts |
90
+ | `npm test` | Run tests |
91
+
92
+ ## What This Solution Does
93
+
94
+ When deployed to your SharePoint tenant, this solution:
95
+
96
+ 1. **Creates Infrastructure**: Automatically provisions a special subsite at `/sites/appcatalog/SPFxExtensionsData`
97
+ 2. **Configuration Management**: Sets up application-specific configuration lists in the subsite
98
+ 3. **Global Configuration Page**: Creates a configuration page at `SitePages/SPFxExtensionsConfigurator.aspx`
99
+ 4. **Multi-Scope Support**: Enables configuration for Global, Hub, Site, and Web scoped solutions
100
+ 5. **Framework Freedom**: Acts as a wrapper around `@spfx-extensions/core`, freeing you from SPFx ecosystem constraints
101
+
102
+ ## Key Benefits
103
+
104
+ ### 🚀 **Modern Development Stack**
105
+ - Use any bundler you prefer: **Bun**, **esbuild**, **Vite**, **Webpack**, or others
106
+ - Support for the latest Node.js versions (not limited to SPFx-supported versions)
107
+ - Modern JavaScript/TypeScript features without SPFx limitations
108
+
109
+ ### 🔧 **Flexible Architecture**
110
+ - Framework-agnostic development approach
111
+ - Break free from Microsoft's SPFx app ecosystem constraints
112
+ - Maintain full control over your build pipeline and dependencies
113
+
114
+ ### 🎯 **Enterprise-Ready**
115
+ - Tenant-wide deployment capability
116
+ - Centralized configuration management
117
+ - Support for multiple scoping levels (Global/Hub/Site/Web)
118
+
119
+ ## Architecture Overview
120
+
121
+ This solution consists of two main components:
122
+
123
+ ### 1. Application Customizer (`SpfxExtensionApplicationCustomizer`)
124
+ - Deployed tenant-wide for global functionality
125
+ - Initializes the core framework on every SharePoint page
126
+ - Manages application lifecycle and placeholder handling
127
+
128
+ ### 2. Web Part (`SpfxExtensionloaderWebPart`)
129
+ - Provides a configurable interface for loading custom applications
130
+ - Integrates with the centralized configuration system
131
+ - Supports dynamic app loading and configuration
132
+
133
+ Both components leverage the `@spfx-extensions/core` package to provide the underlying framework functionality.
134
+ ## Technical Details
135
+
136
+ ### Core Dependencies
137
+ - **@spfx-extensions/core**: The foundational package that provides framework-agnostic capabilities
138
+ - **SharePoint Framework 1.21.0**: Base SPFx framework for SharePoint integration
139
+ - **TypeScript**: Full TypeScript support with modern language features
140
+
141
+ ### Infrastructure Created
142
+ - **Subsite**: `/sites/appcatalog/SPFxExtensionsData`
143
+ - **Configuration Lists**: `SPFxExtensionsWhiteList`, `SPFxExtensionsConfiguration`
144
+ - **Configuration Page**: `SitePages/SPFxExtensionsConfigurator.aspx`
145
+
146
+ ### Supported Scopes
147
+ - **Global**: Tenant-wide configurations
148
+ - **Hub**: Hub site specific configurations
149
+ - **Site**: Site collection specific configurations
150
+ - **Web**: Individual web specific configurations
151
+
152
+ ## Contributing
153
+
154
+ This project welcomes contributions and suggestions. Please feel free to submit issues and enhancement requests.
155
+
156
+ ## License
157
+
158
+ This project is licensed under the GPL-3.0 License - see the [LICENSE](LICENSE) file for details.
159
+
160
+ ## References
161
+
162
+ - [Getting started with SharePoint Framework](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-developer-tenant)
163
+ - [Building for Microsoft teams](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/build-for-teams-overview)
164
+ - [Use Microsoft Graph in your solution](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/using-microsoft-graph-apis)
165
+ - [Publish SharePoint Framework applications to the Marketplace](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/publish-to-marketplace-overview)
166
+ - [Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp) - Guidance, tooling, samples and open-source controls for your Microsoft 365 development
@@ -0,0 +1,22 @@
1
+ import { readFile, writeFile } from "node:fs/promises";
2
+ /**
3
+ *
4
+ * @param {import("@rushstack/heft").IRunScriptOptions} params
5
+ */
6
+ export async function runAsync(params) {
7
+ const newName = process.env["SPFX_EXTENSIONS_SOLUTION_NAME"]?.trim() ?? "";
8
+ if (newName) {
9
+ console.log("New webpart name from environment variable:", newName);
10
+ const jsonPath =
11
+ "./src/webparts/spfxExtensionloader/SpfxExtensionloaderWebPart.manifest.json";
12
+ const webpartData = await readFile(jsonPath, { encoding: "utf8" });
13
+ const webpartDataJson = JSON.parse(webpartData);
14
+ const oldName = webpartDataJson.preconfiguredEntries[0].title.default;
15
+ console.log("Old Webpart Name:", oldName);
16
+ console.log("New Webpart Name:", newName);
17
+ webpartDataJson.preconfiguredEntries[0].title.default = newName;
18
+ console.log("Updated webpart manifest with new name.");
19
+ console.log(webpartDataJson);
20
+ // await writeFile(jsonPath, JSON.stringify(webpartDataJson, null, 2));
21
+ }
22
+ }
@@ -0,0 +1,23 @@
1
+ import { readFile, writeFile } from "node:fs/promises";
2
+ /**
3
+ *
4
+ * @param {import("@rushstack/heft").IRunScriptOptions} params
5
+ */
6
+ export async function runAsync(params) {
7
+ const projectSolutionPackage = await readFile(
8
+ "./config/package-solution.json",
9
+ { encoding: "utf8" },
10
+ );
11
+ const projectPackage = await readFile("./package.json", { encoding: "utf8" });
12
+ const projectPackageJson = JSON.parse(projectPackage);
13
+ const projectSolutionPackageJson = JSON.parse(projectSolutionPackage);
14
+ const projectVersion = `${projectPackageJson.version}.0`;
15
+ console.log("Project Version:", projectVersion);
16
+ projectSolutionPackageJson.solution.version = projectVersion;
17
+ projectSolutionPackageJson.solution.features[0].version = projectVersion;
18
+
19
+ await writeFile(
20
+ "./config/package-solution.json",
21
+ JSON.stringify(projectSolutionPackageJson, null, 2),
22
+ );
23
+ }
@@ -0,0 +1,134 @@
1
+ const isProd =
2
+ process.argv.indexOf("--ship") > -1 ||
3
+ process.argv.indexOf("--production") > -1;
4
+ /**
5
+ *
6
+ * @param {import("webpack").Configuration} webpackConfig
7
+ * @returns
8
+ */
9
+ //module.exports = function (webpackConfig) {
10
+ export default function updatedWebpackConfig(webpackConfig) {
11
+ webpackConfig.output.chunkFilename = "[name]_[contenthash].js";
12
+ webpackConfig.output.environment = {
13
+ arrowFunction: true,
14
+ const: true,
15
+ optionalChaining: true,
16
+ module: true,
17
+ templateLiteral: true,
18
+ destructuring: true,
19
+ dynamicImport: true,
20
+ globalThis: true,
21
+ forOf: true,
22
+ asyncFunction: true,
23
+ };
24
+ // webpackConfig.devtool = "source-map";
25
+ webpackConfig.optimization.splitChunks = {
26
+ cacheGroups: {
27
+ defaultVendors: false,
28
+ },
29
+ };
30
+ // webpackConfig.optimization.minimizer = [];
31
+ //find the source-map-loader and disable
32
+ // const srcMapLoaderIdx = webpackConfig.module.rules.findIndex(
33
+ // (rule) =>
34
+ // rule.use?.loader && rule.use.loader.indexOf("source-map-loader") !== -1,
35
+ // );
36
+ // if (srcMapLoaderIdx > -1) {
37
+ // webpackConfig.module.rules.splice(srcMapLoaderIdx, 1);
38
+ // }
39
+ // console.log(webpackConfig.optimization.minimizer)
40
+ // webpackConfig.optimization.minimizer = [
41
+ // // new TerserPlugin({
42
+ // // exclude:
43
+ // // /(spfx-extension-core|spfx-extension-wrapper|spfx-extension-coreconfigurator)/,
44
+ // // }),
45
+ // ];
46
+ // webpackConfig.module.rules.push({
47
+ // test: /(spfx-extension-core|spfx-extension-wrapper|spfx-extension-coreconfigurator)/,
48
+ // // test: /\.js$/,
49
+ // enforce: "post",
50
+ // use: { "loader": "source-map-loader" },
51
+ // // extractSourceMap: true,
52
+ // });
53
+ // webpackConfig.plugins.push(new webpack.SourceMapDevToolPlugin({
54
+ // test: /spfx-extensions-core\.js/,
55
+ // // test(asset) {
56
+ // // const isMatch = /spfx-extensions-core\.js(\?v=\w+)?$/.test(asset);
57
+ // // console.log("Processing asset for source map:", asset, isMatch);
58
+ // // return isMatch;
59
+ // // },
60
+ // append: `\n//# sourceMappingURL=spfx-extensions-core.js.map`,
61
+ // }))
62
+ // console.log("Updated webpack configuration:", webpackConfig.module.rules);
63
+ webpackConfig.module.rules.push({
64
+ test: /spfx-extensions-core\.js$/,
65
+ generator: {
66
+ filename: "spfx-extensions-core[ext]?v=[hash]",
67
+ },
68
+ type: "asset/resource",
69
+ });
70
+ // webpackConfig.module.rules.push({
71
+ // test: /\.map$/,
72
+ // generator: {
73
+ // filename: "[name][ext]?v=[hash]",
74
+ // },
75
+ // type: "asset/resource",
76
+ // });
77
+
78
+ webpackConfig.module.rules.push({
79
+ test: /spfx-extensions-coreconfigurator\.js$/,
80
+ generator: {
81
+ filename: "spfx-extensions-coreconfigurator[ext]?v=[hash]",
82
+ },
83
+ type: "asset/resource",
84
+ });
85
+ webpackConfig.module.rules.push({
86
+ test: /spfx-extensions-classiccustomaction\.js$/,
87
+ generator: {
88
+ filename: "spfx-extensions-classiccustomaction[ext]?v=[hash]",
89
+ },
90
+ type: "asset/resource",
91
+ });
92
+ webpackConfig.module.rules.push({
93
+ test: /spfx-extensions-classicwrapper\.js$/,
94
+ generator: {
95
+ filename: "spfx-extensions-classicwrapper[ext]?v=[hash]",
96
+ },
97
+ type: "asset/resource",
98
+ });
99
+
100
+ // webpackConfig.resolve.alias["spfx-extensions-core.js"] =
101
+ // "@spfx-extensions/core/spfx-extensions-core";
102
+ // webpackConfig.resolve.alias["spfx-extensions-core.js.map"] =
103
+ // "@spfx-extensions/core/dist/core/spfx-extensions-core.js.map";
104
+
105
+ // webpackConfig.resolve.alias["spfx-extensions-coreconfigurator.js"] =
106
+ // "@spfx-extensions/core/spfx-extensions-coreconfigurator";
107
+ // webpackConfig.resolve.alias["spfx-extensions-coreconfigurator.js.map"] =
108
+ // "@spfx-extensions/core/spfx-extensions-coreconfigurator";
109
+
110
+ // webpackConfig.resolve.alias["spfx-extensions-classicwrapper.js"] =
111
+ // "@spfx-extensions/core/spfx-extensions-classicwrapper";
112
+ // webpackConfig.resolve.alias.push({
113
+
114
+ // })
115
+ // webpackConfig.experiments = {
116
+ // outputModule: true,
117
+ // };
118
+ // webpackConfig.output.libraryTarget = "commonjs-module";
119
+ // webpackConfig.output.library = {
120
+ // type: "commonjs-module",
121
+ // };
122
+ const definePlugin = webpackConfig.plugins.find((p) => p.definitions);
123
+ if (definePlugin) {
124
+ const date = new Date().toISOString();
125
+ console.log("Adding BUILD_DATE to define plugin:", date);
126
+ definePlugin.definitions["BUILD_DATE"] = JSON.stringify(date);
127
+ console.log("Adding ISDEBUG to define plugin:", isProd ? false : true);
128
+ definePlugin.definitions["ISDEBUG"] = JSON.stringify(isProd ? false : true);
129
+ } else {
130
+ console.error("No define plugin found in webpack configuration.");
131
+ }
132
+
133
+ return webpackConfig;
134
+ }
@@ -1,27 +1,27 @@
1
- {
2
- "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json",
3
- "version": "2.0",
4
- "bundles": {
5
- "spfx-extension-application-customizer": {
6
- "components": [
7
- {
8
- "entrypoint": "./lib/extensions/spfxExtension/SpfxExtensionApplicationCustomizer.js",
9
- "manifest": "./src/extensions/spfxExtension/SpfxExtensionApplicationCustomizer.manifest.json"
10
- }
11
- ]
12
- },
13
- "spfx-extensionloader-web-part": {
14
- "components": [
15
- {
16
- "entrypoint": "./lib/webparts/spfxExtensionloader/SpfxExtensionloaderWebPart.js",
17
- "manifest": "./src/webparts/spfxExtensionloader/SpfxExtensionloaderWebPart.manifest.json"
18
- }
19
- ]
20
- }
21
- },
22
- "externals": {},
23
- "localizedResources": {
24
- "SpfxExtensionApplicationCustomizerStrings": "lib/extensions/spfxExtension/loc/{locale}.js",
25
- "SpfxExtensionloaderWebPartStrings": "lib/webparts/spfxExtensionloader/loc/{locale}.js"
26
- }
27
- }
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json",
3
+ "version": "2.0",
4
+ "bundles": {
5
+ "spfx-extension-application-customizer": {
6
+ "components": [
7
+ {
8
+ "entrypoint": "./lib/extensions/spfxExtension/SpfxExtensionApplicationCustomizer.js",
9
+ "manifest": "./src/extensions/spfxExtension/SpfxExtensionApplicationCustomizer.manifest.json"
10
+ }
11
+ ]
12
+ },
13
+ "spfx-extensionloader-web-part": {
14
+ "components": [
15
+ {
16
+ "entrypoint": "./lib/webparts/spfxExtensionloader/SpfxExtensionloaderWebPart.js",
17
+ "manifest": "./src/webparts/spfxExtensionloader/SpfxExtensionloaderWebPart.manifest.json"
18
+ }
19
+ ]
20
+ }
21
+ },
22
+ "externals": {},
23
+ "localizedResources": {
24
+ "SpfxExtensionApplicationCustomizerStrings": "lib/extensions/spfxExtension/loc/{locale}.js",
25
+ "SpfxExtensionloaderWebPartStrings": "lib/webparts/spfxExtensionloader/loc/{locale}.js"
26
+ }
27
+ }
@@ -1,7 +1,7 @@
1
- {
2
- "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json",
3
- "workingDir": "./release/assets/",
4
- "account": "<!-- STORAGE ACCOUNT NAME -->",
5
- "container": "sp-fx-extensions",
6
- "accessKey": "<!-- ACCESS KEY -->"
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json",
3
+ "workingDir": "./release/assets/",
4
+ "account": "<!-- STORAGE ACCOUNT NAME -->",
5
+ "container": "sp-fx-extensions",
6
+ "accessKey": "<!-- ACCESS KEY -->"
7
7
  }
@@ -0,0 +1,58 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/heft/v0/heft.schema.json",
3
+ "extends": "@microsoft/spfx-web-build-rig/profiles/default/config/heft.json",
4
+ "phasesByName": {
5
+ "build": {
6
+ "tasksByName": {
7
+ "update-version": {
8
+ "taskDependencies": [],
9
+ "taskPlugin": {
10
+ "pluginPackage": "@rushstack/heft",
11
+ "pluginName": "run-script-plugin",
12
+ "options": {
13
+ "scriptPath": "./config/config-scripts/update-version.mjs"
14
+ }
15
+ }
16
+ },
17
+ "rename-solution": {
18
+ "taskDependencies": [],
19
+ "taskPlugin": {
20
+ "pluginPackage": "@rushstack/heft",
21
+ "pluginName": "run-script-plugin",
22
+ "options": {
23
+ "scriptPath": "./config/config-scripts/rename-solution.mjs"
24
+ }
25
+ }
26
+ }
27
+ }
28
+ },
29
+ "update-version": {
30
+ "tasksByName": {
31
+ "update-version": {
32
+ "taskDependencies": [],
33
+ "taskPlugin": {
34
+ "pluginPackage": "@rushstack/heft",
35
+ "pluginName": "run-script-plugin",
36
+ "options": {
37
+ "scriptPath": "./config/config-scripts/update-version.mjs"
38
+ }
39
+ }
40
+ }
41
+ }
42
+ },
43
+ "rename-solution": {
44
+ "tasksByName": {
45
+ "rename-solution": {
46
+ "taskDependencies": [],
47
+ "taskPlugin": {
48
+ "pluginPackage": "@rushstack/heft",
49
+ "pluginName": "run-script-plugin",
50
+ "options": {
51
+ "scriptPath": "./config/config-scripts/rename-solution.mjs"
52
+ }
53
+ }
54
+ }
55
+ }
56
+ }
57
+ }
58
+ }