@starko-one/sdk 0.0.0-stage → 0.1.0-beta.0

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 (108) hide show
  1. package/CHANGELOG.md +124 -0
  2. package/LICENSE +17 -0
  3. package/NOTICE +58 -0
  4. package/README.md +81 -2
  5. package/dist/api-B5IHeINe.d.ts +558 -0
  6. package/dist/api-DR4HazCu.d.cts +558 -0
  7. package/dist/browser/index.cjs +168 -0
  8. package/dist/browser/index.d.cts +131 -0
  9. package/dist/browser/index.d.ts +131 -0
  10. package/dist/browser/index.js +7 -0
  11. package/dist/build/rollup.cjs +22 -0
  12. package/dist/build/rollup.d.cts +34 -0
  13. package/dist/build/rollup.d.ts +34 -0
  14. package/dist/build/rollup.js +3 -0
  15. package/dist/build/vite.cjs +51 -0
  16. package/dist/build/vite.d.cts +23 -0
  17. package/dist/build/vite.d.ts +23 -0
  18. package/dist/build/vite.js +46 -0
  19. package/dist/build/webpack.cjs +18 -0
  20. package/dist/build/webpack.d.cts +39 -0
  21. package/dist/build/webpack.d.ts +39 -0
  22. package/dist/build/webpack.js +3 -0
  23. package/dist/chunk-7HYGODU6.cjs +583 -0
  24. package/dist/chunk-A5M4NOVT.js +413 -0
  25. package/dist/chunk-A7MYYWMP.cjs +15 -0
  26. package/dist/chunk-BAQA47FM.js +1113 -0
  27. package/dist/chunk-CM7HM6CC.js +563 -0
  28. package/dist/chunk-DFYNIWUN.js +608 -0
  29. package/dist/chunk-DMVVCGKO.cjs +96 -0
  30. package/dist/chunk-FARGXYJ4.cjs +56 -0
  31. package/dist/chunk-G3MYIAX2.js +1226 -0
  32. package/dist/chunk-G4NAVZQ4.js +249 -0
  33. package/dist/chunk-GH7RYPKS.js +96 -0
  34. package/dist/chunk-HADYYQNL.cjs +134 -0
  35. package/dist/chunk-HOQPAB4X.js +178 -0
  36. package/dist/chunk-J5RU73SW.js +214 -0
  37. package/dist/chunk-JNAJ3YZB.cjs +223 -0
  38. package/dist/chunk-KN7H22EQ.cjs +659 -0
  39. package/dist/chunk-LDQ4I7FZ.cjs +1151 -0
  40. package/dist/chunk-NPGESRVQ.js +1212 -0
  41. package/dist/chunk-OPWM5V7A.cjs +258 -0
  42. package/dist/chunk-PYYWPIFL.cjs +1230 -0
  43. package/dist/chunk-R7JLZ4WO.cjs +115 -0
  44. package/dist/chunk-SC6VQSES.js +213 -0
  45. package/dist/chunk-TPSJGLR3.cjs +220 -0
  46. package/dist/chunk-UKBY6HPC.js +131 -0
  47. package/dist/chunk-VRSEHRBX.cjs +185 -0
  48. package/dist/chunk-X74AONZA.js +90 -0
  49. package/dist/chunk-XW3I5CJN.js +12 -0
  50. package/dist/chunk-XW56FKKJ.js +53 -0
  51. package/dist/chunk-Z3G5SW7R.cjs +1251 -0
  52. package/dist/chunk-ZVMAN7OO.cjs +431 -0
  53. package/dist/cli/index.cjs +1487 -0
  54. package/dist/common-ARWXbeS3.d.ts +36 -0
  55. package/dist/common-CwIFh2hK.d.cts +36 -0
  56. package/dist/dedupe-eHBIfUUD.d.cts +13 -0
  57. package/dist/dedupe-fw8aNtt4.d.ts +13 -0
  58. package/dist/handler-DTZ4Rzcf.d.ts +82 -0
  59. package/dist/handler-_00lctTI.d.cts +82 -0
  60. package/dist/index.cjs +277 -0
  61. package/dist/index.d.cts +187 -0
  62. package/dist/index.d.ts +187 -0
  63. package/dist/index.js +4 -0
  64. package/dist/next/client.cjs +113 -0
  65. package/dist/next/client.d.cts +26 -0
  66. package/dist/next/client.d.ts +26 -0
  67. package/dist/next/client.js +41 -0
  68. package/dist/next/config.cjs +275 -0
  69. package/dist/next/config.d.cts +193 -0
  70. package/dist/next/config.d.ts +193 -0
  71. package/dist/next/config.js +261 -0
  72. package/dist/next/index.cjs +148 -0
  73. package/dist/next/index.d.cts +32 -0
  74. package/dist/next/index.d.ts +32 -0
  75. package/dist/next/index.js +59 -0
  76. package/dist/node/index.cjs +257 -0
  77. package/dist/node/index.d.cts +145 -0
  78. package/dist/node/index.d.ts +145 -0
  79. package/dist/node/index.js +83 -0
  80. package/dist/options-0BhybO54.d.cts +47 -0
  81. package/dist/options-0BhybO54.d.ts +47 -0
  82. package/dist/react/index.cjs +107 -0
  83. package/dist/react/index.d.cts +84 -0
  84. package/dist/react/index.d.ts +84 -0
  85. package/dist/react/index.js +103 -0
  86. package/dist/scope-Bvh45bOf.d.cts +404 -0
  87. package/dist/scope-Bvh45bOf.d.ts +404 -0
  88. package/dist/server-edge-BPOGA3GH.cjs +51 -0
  89. package/dist/server-edge-GYKAJREU.js +48 -0
  90. package/dist/server-node-HYK2OB2J.js +24 -0
  91. package/dist/server-node-J2DBAHDV.cjs +27 -0
  92. package/dist/session-C_WzbEN2.d.cts +4 -0
  93. package/dist/session-C_WzbEN2.d.ts +4 -0
  94. package/dist/session-propagation-B7REA7uy.d.cts +30 -0
  95. package/dist/session-propagation-BnJjKJbR.d.ts +30 -0
  96. package/dist/starko.min.js +6 -0
  97. package/docs/browser.md +381 -0
  98. package/docs/configuration.md +269 -0
  99. package/docs/nextjs.md +312 -0
  100. package/docs/node.md +376 -0
  101. package/docs/other-backends.md +232 -0
  102. package/docs/privacy.md +112 -0
  103. package/docs/react.md +187 -0
  104. package/docs/source-maps.md +332 -0
  105. package/docs/troubleshooting.md +171 -0
  106. package/docs/widget.md +84 -0
  107. package/docs/wire-format.md +367 -0
  108. package/package.json +98 -4
@@ -0,0 +1,46 @@
1
+ import { createStarkoRollupPlugin } from '../chunk-J5RU73SW.js';
2
+ import { resolveConnection, createLogger, NO_API_KEY_MESSAGE } from '../chunk-G3MYIAX2.js';
3
+ import '../chunk-GH7RYPKS.js';
4
+
5
+ // src/build/vite.ts
6
+ function starkoVitePlugin(options = {}) {
7
+ const connection = resolveConnection(options);
8
+ const logger = createLogger({ silent: options.silent, secrets: [connection.apiKey] });
9
+ let enabled = false;
10
+ let owner = "user";
11
+ let warnedNoKey = false;
12
+ const wanted = (command, mode, watch) => options.enabled ?? (command === "build" && mode === "production" && !watch);
13
+ const base = createStarkoRollupPlugin(options, {
14
+ name: "starko-vite-plugin",
15
+ isEnabled: () => enabled,
16
+ sourcemapOwner: () => owner
17
+ });
18
+ return {
19
+ ...base,
20
+ apply: "build",
21
+ enforce: "post",
22
+ config(userConfig, env) {
23
+ owner = "user";
24
+ if (!wanted(env.command, env.mode, userConfig.build?.watch) || !connection.apiKey) return;
25
+ if (!userConfig.build?.sourcemap) {
26
+ owner = "starko";
27
+ return { build: { sourcemap: "hidden" } };
28
+ }
29
+ return;
30
+ },
31
+ configResolved(config) {
32
+ enabled = wanted(config.command, config.mode, config.build.watch);
33
+ if (enabled && !connection.apiKey) {
34
+ if (!warnedNoKey) logger.warn(NO_API_KEY_MESSAGE);
35
+ warnedNoKey = true;
36
+ enabled = false;
37
+ }
38
+ if (enabled && config.build.sourcemap === "inline") {
39
+ logger.warn("build.sourcemap is 'inline': inline source maps are not uploaded; use true or 'hidden'");
40
+ }
41
+ }
42
+ };
43
+ }
44
+ var vite_default = starkoVitePlugin;
45
+
46
+ export { vite_default as default, starkoVitePlugin };
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var chunkVRSEHRBX_cjs = require('../chunk-VRSEHRBX.cjs');
6
+ require('../chunk-Z3G5SW7R.cjs');
7
+ require('../chunk-R7JLZ4WO.cjs');
8
+
9
+
10
+
11
+ Object.defineProperty(exports, "StarkoWebpackPlugin", {
12
+ enumerable: true,
13
+ get: function () { return chunkVRSEHRBX_cjs.StarkoWebpackPlugin; }
14
+ });
15
+ Object.defineProperty(exports, "default", {
16
+ enumerable: true,
17
+ get: function () { return chunkVRSEHRBX_cjs.webpack_default; }
18
+ });
@@ -0,0 +1,39 @@
1
+ import { Compiler } from 'webpack';
2
+ import { a as StarkoBuildOptions, S as SourcemapOwner } from '../options-0BhybO54.cjs';
3
+
4
+ interface StarkoWebpackPluginOptions extends StarkoBuildOptions {
5
+ /**
6
+ * Upload before the output is written. Default true. Set false to only
7
+ * inject, when something else uploads the output (as `withStarko` does
8
+ * when Next runs its post-compile hook); nothing is deleted then either.
9
+ */
10
+ upload?: boolean;
11
+ }
12
+ /** @internal Set by `withStarko`, which knows who asked Next for the maps. */
13
+ interface StarkoWebpackPluginInternals {
14
+ sourcemapOwner?: SourcemapOwner;
15
+ }
16
+ /**
17
+ * webpack 5 plugin. Injects each emitted JS chunk with its debug id (snippet,
18
+ * trailing comment, `debugId` in its map) during asset processing, right after
19
+ * the source maps are made and before real content hashes, integrity
20
+ * manifests and emit; then uploads the maps from memory just before the
21
+ * output is written. `enabled` defaults to `mode: "production"`. Without an
22
+ * API key it changes nothing. Eval and inline devtools are not supported.
23
+ *
24
+ * Source maps: with no `devtool` and no source-map plugin of your own, the
25
+ * plugin adds hidden maps for the upload and deletes them (only those) from
26
+ * the compilation afterwards, whatever the upload's outcome, so they are
27
+ * never written. Maps your `devtool` or your own `SourceMapDevToolPlugin`
28
+ * produces are kept unless `deleteSourcemapsAfterUpload: true`; with an
29
+ * `EvalSourceMapDevToolPlugin` nothing is injected or uploaded.
30
+ */
31
+ declare class StarkoWebpackPlugin {
32
+ private readonly options;
33
+ private readonly internals;
34
+ private readonly logger;
35
+ constructor(options?: StarkoWebpackPluginOptions, internals?: StarkoWebpackPluginInternals);
36
+ apply(compiler: Compiler): void;
37
+ }
38
+
39
+ export { StarkoBuildOptions, StarkoWebpackPlugin, type StarkoWebpackPluginInternals, type StarkoWebpackPluginOptions, StarkoWebpackPlugin as default };
@@ -0,0 +1,39 @@
1
+ import { Compiler } from 'webpack';
2
+ import { a as StarkoBuildOptions, S as SourcemapOwner } from '../options-0BhybO54.js';
3
+
4
+ interface StarkoWebpackPluginOptions extends StarkoBuildOptions {
5
+ /**
6
+ * Upload before the output is written. Default true. Set false to only
7
+ * inject, when something else uploads the output (as `withStarko` does
8
+ * when Next runs its post-compile hook); nothing is deleted then either.
9
+ */
10
+ upload?: boolean;
11
+ }
12
+ /** @internal Set by `withStarko`, which knows who asked Next for the maps. */
13
+ interface StarkoWebpackPluginInternals {
14
+ sourcemapOwner?: SourcemapOwner;
15
+ }
16
+ /**
17
+ * webpack 5 plugin. Injects each emitted JS chunk with its debug id (snippet,
18
+ * trailing comment, `debugId` in its map) during asset processing, right after
19
+ * the source maps are made and before real content hashes, integrity
20
+ * manifests and emit; then uploads the maps from memory just before the
21
+ * output is written. `enabled` defaults to `mode: "production"`. Without an
22
+ * API key it changes nothing. Eval and inline devtools are not supported.
23
+ *
24
+ * Source maps: with no `devtool` and no source-map plugin of your own, the
25
+ * plugin adds hidden maps for the upload and deletes them (only those) from
26
+ * the compilation afterwards, whatever the upload's outcome, so they are
27
+ * never written. Maps your `devtool` or your own `SourceMapDevToolPlugin`
28
+ * produces are kept unless `deleteSourcemapsAfterUpload: true`; with an
29
+ * `EvalSourceMapDevToolPlugin` nothing is injected or uploaded.
30
+ */
31
+ declare class StarkoWebpackPlugin {
32
+ private readonly options;
33
+ private readonly internals;
34
+ private readonly logger;
35
+ constructor(options?: StarkoWebpackPluginOptions, internals?: StarkoWebpackPluginInternals);
36
+ apply(compiler: Compiler): void;
37
+ }
38
+
39
+ export { StarkoBuildOptions, StarkoWebpackPlugin, type StarkoWebpackPluginInternals, type StarkoWebpackPluginOptions, StarkoWebpackPlugin as default };
@@ -0,0 +1,3 @@
1
+ export { StarkoWebpackPlugin, webpack_default as default } from '../chunk-HOQPAB4X.js';
2
+ import '../chunk-G3MYIAX2.js';
3
+ import '../chunk-GH7RYPKS.js';