@salesforce/storefront-next-dev 0.1.1 → 0.2.0-alpha.1
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/README.md +45 -36
- package/bin/run.js +12 -0
- package/dist/bundle.js +83 -0
- package/dist/cartridge-services/index.d.ts +2 -26
- package/dist/cartridge-services/index.d.ts.map +1 -1
- package/dist/cartridge-services/index.js +3 -336
- package/dist/cartridge-services/index.js.map +1 -1
- package/dist/commands/create-bundle.js +107 -0
- package/dist/commands/create-instructions.js +174 -0
- package/dist/commands/create-storefront.js +210 -0
- package/dist/commands/deploy-cartridge.js +52 -0
- package/dist/commands/dev.js +122 -0
- package/dist/commands/extensions/create.js +38 -0
- package/dist/commands/extensions/install.js +44 -0
- package/dist/commands/extensions/list.js +21 -0
- package/dist/commands/extensions/remove.js +38 -0
- package/dist/commands/generate-cartridge.js +35 -0
- package/dist/commands/prepare-local.js +30 -0
- package/dist/commands/preview.js +101 -0
- package/dist/commands/push.js +139 -0
- package/dist/config.js +87 -0
- package/dist/configs/react-router.config.js +3 -1
- package/dist/configs/react-router.config.js.map +1 -1
- package/dist/dependency-utils.js +314 -0
- package/dist/entry/client.d.ts +1 -0
- package/dist/entry/client.js +28 -0
- package/dist/entry/client.js.map +1 -0
- package/dist/entry/server.d.ts +15 -0
- package/dist/entry/server.d.ts.map +1 -0
- package/dist/entry/server.js +35 -0
- package/dist/entry/server.js.map +1 -0
- package/dist/flags.js +11 -0
- package/dist/generate-cartridge.js +620 -0
- package/dist/hooks/init.js +47 -0
- package/dist/index.d.ts +9 -29
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +413 -621
- package/dist/index.js.map +1 -1
- package/dist/local-dev-setup.js +176 -0
- package/dist/logger.js +105 -0
- package/dist/manage-extensions.js +329 -0
- package/dist/mrt/ssr.mjs +21 -21
- package/dist/mrt/ssr.mjs.map +1 -1
- package/dist/mrt/streamingHandler.mjs +28 -28
- package/dist/mrt/streamingHandler.mjs.map +1 -1
- package/dist/server.js +425 -0
- package/dist/utils.js +126 -0
- package/package.json +44 -9
- package/dist/cli.js +0 -3393
- /package/{LICENSE.txt → LICENSE} +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//#region src/entry/client.ts
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2026 Salesforce, Inc.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Platform client-side setup module.
|
|
19
|
+
*
|
|
20
|
+
* This is imported as a side-effect before the customer's (or SDK default)
|
|
21
|
+
* client entry runs. Future additions:
|
|
22
|
+
* - Client-side error tracking
|
|
23
|
+
* - Performance monitoring (Web Vitals)
|
|
24
|
+
* - Analytics bootstrapping
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","names":[],"sources":["../../src/entry/client.ts"],"sourcesContent":["/**\n * Copyright 2026 Salesforce, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Platform client-side setup module.\n *\n * This is imported as a side-effect before the customer's (or SDK default)\n * client entry runs. Future additions:\n * - Client-side error tracking\n * - Performance monitoring (Web Vitals)\n * - Analytics bootstrapping\n */\n"],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ServerEntryModule } from "react-router";
|
|
2
|
+
|
|
3
|
+
//#region src/entry/server.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Composes a server entry module with platform-level features.
|
|
7
|
+
*
|
|
8
|
+
* - Spreads all app module properties to forward unknown/future exports
|
|
9
|
+
* - Wraps the default handler for platform-level processing
|
|
10
|
+
* - Prepends a platform instrumentation to unstable_instrumentations
|
|
11
|
+
*/
|
|
12
|
+
declare function composeServerEntry(appModule: ServerEntryModule): ServerEntryModule;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { composeServerEntry };
|
|
15
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","names":[],"sources":["../../src/entry/server.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;iBA8DgB,kBAAA,YAA8B,oBAAoB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//#region src/entry/server.ts
|
|
2
|
+
/**
|
|
3
|
+
* Platform-level handler instrumentation.
|
|
4
|
+
*
|
|
5
|
+
* Uses React Router's unstable_ServerInstrumentation API to observe the
|
|
6
|
+
* request lifecycle at the handler level. This runs around ALL requests
|
|
7
|
+
* (document + data) and provides a hook for platform-level tracing.
|
|
8
|
+
*
|
|
9
|
+
* @see https://reactrouter.com/how-to/instrumentation
|
|
10
|
+
*/
|
|
11
|
+
const platformInstrumentation = { handler(handler) {
|
|
12
|
+
handler.instrument({ async request(handleRequest) {
|
|
13
|
+
await handleRequest();
|
|
14
|
+
} });
|
|
15
|
+
} };
|
|
16
|
+
/**
|
|
17
|
+
* Composes a server entry module with platform-level features.
|
|
18
|
+
*
|
|
19
|
+
* - Spreads all app module properties to forward unknown/future exports
|
|
20
|
+
* - Wraps the default handler for platform-level processing
|
|
21
|
+
* - Prepends a platform instrumentation to unstable_instrumentations
|
|
22
|
+
*/
|
|
23
|
+
function composeServerEntry(appModule) {
|
|
24
|
+
return {
|
|
25
|
+
...appModule,
|
|
26
|
+
default(request, statusCode, headers, context, loadContext) {
|
|
27
|
+
return appModule.default(request, statusCode, headers, context, loadContext);
|
|
28
|
+
},
|
|
29
|
+
unstable_instrumentations: [platformInstrumentation, ...appModule.unstable_instrumentations ?? []]
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
export { composeServerEntry };
|
|
35
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","names":["platformInstrumentation: unstable_ServerInstrumentation"],"sources":["../../src/entry/server.ts"],"sourcesContent":["/**\n * Copyright 2026 Salesforce, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Server entry composition function.\n *\n * Wraps the full ServerEntryModule (the customer's or SDK default entry.server)\n * with platform-level features. The Vite plugin (platformEntryPlugin) generates\n * a virtual module that imports this function and calls it with the app's entry\n * module. New platform features ship via `npm update` without changes to the\n * plugin or customer code.\n *\n * Current platform behaviors:\n * - Adds a handler-level instrumentation for request lifecycle tracing\n *\n * Future additions:\n * - loadContext enrichment (correlation IDs, platform metadata)\n * - Response header injection (tracing, cache directives)\n * - Default error handling with platform error reporting\n */\n\nimport type { ServerEntryModule, unstable_ServerInstrumentation } from 'react-router';\n\n/**\n * Platform-level handler instrumentation.\n *\n * Uses React Router's unstable_ServerInstrumentation API to observe the\n * request lifecycle at the handler level. This runs around ALL requests\n * (document + data) and provides a hook for platform-level tracing.\n *\n * @see https://reactrouter.com/how-to/instrumentation\n */\nconst platformInstrumentation: unstable_ServerInstrumentation = {\n handler(handler) {\n handler.instrument({\n async request(handleRequest) {\n await handleRequest();\n },\n });\n },\n};\n\n/**\n * Composes a server entry module with platform-level features.\n *\n * - Spreads all app module properties to forward unknown/future exports\n * - Wraps the default handler for platform-level processing\n * - Prepends a platform instrumentation to unstable_instrumentations\n */\nexport function composeServerEntry(appModule: ServerEntryModule): ServerEntryModule {\n return {\n // Spread all properties first so unknown/future exports pass through\n ...appModule,\n // Override the exports the platform layer enhances\n default(request, statusCode, headers, context, loadContext) {\n return appModule.default(request, statusCode, headers, context, loadContext);\n },\n unstable_instrumentations: [platformInstrumentation, ...(appModule.unstable_instrumentations ?? [])],\n };\n}\n"],"mappings":";;;;;;;;;;AA6CA,MAAMA,0BAA0D,EAC5D,QAAQ,SAAS;AACb,SAAQ,WAAW,EACf,MAAM,QAAQ,eAAe;AACzB,QAAM,eAAe;IAE5B,CAAC;GAET;;;;;;;;AASD,SAAgB,mBAAmB,WAAiD;AAChF,QAAO;EAEH,GAAG;EAEH,QAAQ,SAAS,YAAY,SAAS,SAAS,aAAa;AACxD,UAAO,UAAU,QAAQ,SAAS,YAAY,SAAS,SAAS,YAAY;;EAEhF,2BAA2B,CAAC,yBAAyB,GAAI,UAAU,6BAA6B,EAAE,CAAE;EACvG"}
|
package/dist/flags.js
ADDED