@amplitude/element-selector 0.0.1 → 0.1.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 (115) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +162 -0
  3. package/lib/cjs/config/resolve-config.d.ts +56 -0
  4. package/lib/cjs/config/resolve-config.d.ts.map +1 -0
  5. package/lib/cjs/config/resolve-config.js +114 -0
  6. package/lib/cjs/config/resolve-config.js.map +1 -0
  7. package/lib/cjs/engine.d.ts +54 -0
  8. package/lib/cjs/engine.d.ts.map +1 -0
  9. package/lib/cjs/engine.js +104 -0
  10. package/lib/cjs/engine.js.map +1 -0
  11. package/lib/cjs/fallback-css-path.d.ts +53 -0
  12. package/lib/cjs/fallback-css-path.d.ts.map +1 -0
  13. package/lib/cjs/fallback-css-path.js +124 -0
  14. package/lib/cjs/fallback-css-path.js.map +1 -0
  15. package/lib/cjs/helpers/describe-relative.d.ts +28 -0
  16. package/lib/cjs/helpers/describe-relative.d.ts.map +1 -0
  17. package/lib/cjs/helpers/describe-relative.js +60 -0
  18. package/lib/cjs/helpers/describe-relative.js.map +1 -0
  19. package/lib/cjs/helpers/escape-css-identifier.d.ts +8 -0
  20. package/lib/cjs/helpers/escape-css-identifier.d.ts.map +1 -0
  21. package/lib/cjs/helpers/escape-css-identifier.js +50 -0
  22. package/lib/cjs/helpers/escape-css-identifier.js.map +1 -0
  23. package/lib/cjs/helpers/escape-id.d.ts +3 -0
  24. package/lib/cjs/helpers/escape-id.d.ts.map +1 -0
  25. package/lib/cjs/helpers/escape-id.js +10 -0
  26. package/lib/cjs/helpers/escape-id.js.map +1 -0
  27. package/lib/cjs/helpers/get-stable-id.d.ts +23 -0
  28. package/lib/cjs/helpers/get-stable-id.d.ts.map +1 -0
  29. package/lib/cjs/helpers/get-stable-id.js +44 -0
  30. package/lib/cjs/helpers/get-stable-id.js.map +1 -0
  31. package/lib/cjs/index.d.ts +29 -0
  32. package/lib/cjs/index.d.ts.map +1 -0
  33. package/lib/cjs/index.js +53 -0
  34. package/lib/cjs/index.js.map +1 -0
  35. package/lib/cjs/orchestrator.d.ts +61 -0
  36. package/lib/cjs/orchestrator.d.ts.map +1 -0
  37. package/lib/cjs/orchestrator.js +140 -0
  38. package/lib/cjs/orchestrator.js.map +1 -0
  39. package/lib/cjs/patterns/autogenerated-ids.d.ts +37 -0
  40. package/lib/cjs/patterns/autogenerated-ids.d.ts.map +1 -0
  41. package/lib/cjs/patterns/autogenerated-ids.js +102 -0
  42. package/lib/cjs/patterns/autogenerated-ids.js.map +1 -0
  43. package/lib/cjs/patterns/unstable-classes.d.ts +48 -0
  44. package/lib/cjs/patterns/unstable-classes.d.ts.map +1 -0
  45. package/lib/cjs/patterns/unstable-classes.js +155 -0
  46. package/lib/cjs/patterns/unstable-classes.js.map +1 -0
  47. package/lib/cjs/strategies/explicit-tracking-attribute.d.ts +22 -0
  48. package/lib/cjs/strategies/explicit-tracking-attribute.d.ts.map +1 -0
  49. package/lib/cjs/strategies/explicit-tracking-attribute.js +36 -0
  50. package/lib/cjs/strategies/explicit-tracking-attribute.js.map +1 -0
  51. package/lib/cjs/strategies/stable-id.d.ts +14 -0
  52. package/lib/cjs/strategies/stable-id.d.ts.map +1 -0
  53. package/lib/cjs/strategies/stable-id.js +27 -0
  54. package/lib/cjs/strategies/stable-id.js.map +1 -0
  55. package/lib/cjs/types.d.ts +100 -0
  56. package/lib/cjs/types.d.ts.map +1 -0
  57. package/lib/cjs/types.js +13 -0
  58. package/lib/cjs/types.js.map +1 -0
  59. package/lib/esm/config/resolve-config.d.ts +56 -0
  60. package/lib/esm/config/resolve-config.d.ts.map +1 -0
  61. package/lib/esm/config/resolve-config.js +110 -0
  62. package/lib/esm/config/resolve-config.js.map +1 -0
  63. package/lib/esm/engine.d.ts +54 -0
  64. package/lib/esm/engine.d.ts.map +1 -0
  65. package/lib/esm/engine.js +100 -0
  66. package/lib/esm/engine.js.map +1 -0
  67. package/lib/esm/fallback-css-path.d.ts +53 -0
  68. package/lib/esm/fallback-css-path.d.ts.map +1 -0
  69. package/lib/esm/fallback-css-path.js +120 -0
  70. package/lib/esm/fallback-css-path.js.map +1 -0
  71. package/lib/esm/helpers/describe-relative.d.ts +28 -0
  72. package/lib/esm/helpers/describe-relative.d.ts.map +1 -0
  73. package/lib/esm/helpers/describe-relative.js +56 -0
  74. package/lib/esm/helpers/describe-relative.js.map +1 -0
  75. package/lib/esm/helpers/escape-css-identifier.d.ts +8 -0
  76. package/lib/esm/helpers/escape-css-identifier.d.ts.map +1 -0
  77. package/lib/esm/helpers/escape-css-identifier.js +46 -0
  78. package/lib/esm/helpers/escape-css-identifier.js.map +1 -0
  79. package/lib/esm/helpers/escape-id.d.ts +3 -0
  80. package/lib/esm/helpers/escape-id.d.ts.map +1 -0
  81. package/lib/esm/helpers/escape-id.js +6 -0
  82. package/lib/esm/helpers/escape-id.js.map +1 -0
  83. package/lib/esm/helpers/get-stable-id.d.ts +23 -0
  84. package/lib/esm/helpers/get-stable-id.d.ts.map +1 -0
  85. package/lib/esm/helpers/get-stable-id.js +40 -0
  86. package/lib/esm/helpers/get-stable-id.js.map +1 -0
  87. package/lib/esm/index.d.ts +29 -0
  88. package/lib/esm/index.d.ts.map +1 -0
  89. package/lib/esm/index.js +34 -0
  90. package/lib/esm/index.js.map +1 -0
  91. package/lib/esm/orchestrator.d.ts +61 -0
  92. package/lib/esm/orchestrator.d.ts.map +1 -0
  93. package/lib/esm/orchestrator.js +136 -0
  94. package/lib/esm/orchestrator.js.map +1 -0
  95. package/lib/esm/patterns/autogenerated-ids.d.ts +37 -0
  96. package/lib/esm/patterns/autogenerated-ids.d.ts.map +1 -0
  97. package/lib/esm/patterns/autogenerated-ids.js +97 -0
  98. package/lib/esm/patterns/autogenerated-ids.js.map +1 -0
  99. package/lib/esm/patterns/unstable-classes.d.ts +48 -0
  100. package/lib/esm/patterns/unstable-classes.d.ts.map +1 -0
  101. package/lib/esm/patterns/unstable-classes.js +150 -0
  102. package/lib/esm/patterns/unstable-classes.js.map +1 -0
  103. package/lib/esm/strategies/explicit-tracking-attribute.d.ts +22 -0
  104. package/lib/esm/strategies/explicit-tracking-attribute.d.ts.map +1 -0
  105. package/lib/esm/strategies/explicit-tracking-attribute.js +33 -0
  106. package/lib/esm/strategies/explicit-tracking-attribute.js.map +1 -0
  107. package/lib/esm/strategies/stable-id.d.ts +14 -0
  108. package/lib/esm/strategies/stable-id.d.ts.map +1 -0
  109. package/lib/esm/strategies/stable-id.js +24 -0
  110. package/lib/esm/strategies/stable-id.js.map +1 -0
  111. package/lib/esm/types.d.ts +100 -0
  112. package/lib/esm/types.d.ts.map +1 -0
  113. package/lib/esm/types.js +12 -0
  114. package/lib/esm/types.js.map +1 -0
  115. package/package.json +40 -5
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stable-id.js","sourceRoot":"","sources":["../../../src/strategies/stable-id.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,IAAM,QAAQ,GAAa;IAChC,IAAI,EAAE,UAAU;IAEhB,GAAG,YAAC,EAAE,EAAE,GAAG;QACT,IAAM,EAAE,GAAG,WAAW,CAAC,EAAE,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;QACvC,IAAI,EAAE,KAAK,IAAI,EAAE;YACf,OAAO,IAAI,CAAC;SACb;QACD,OAAO,UAAG,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,cAAI,cAAc,CAAC,EAAE,CAAC,CAAE,CAAC;IAC7D,CAAC;CACF,CAAC","sourcesContent":["import { Strategy } from '../types';\nimport { getStableId } from '../helpers/get-stable-id';\nimport { escapeIdForCss } from '../helpers/escape-id';\n\n/**\n * Second strategy in the chain. Anchors on the element's `id` when the id is\n * \"stable\" — i.e., present, not suppressed via the explicit-tracking-attribute\n * empty-value mechanism, and not matching any autogenerated-id pattern.\n *\n * Returns `tag#id` (CSS-escaped) when the id is usable; null otherwise.\n *\n * Filtering is delegated to `getStableId` so this strategy and the\n * `fallback-css-path` walker (in the orchestration PR) share a single source\n * of truth for \"is this id usable?\"\n */\nexport const stableId: Strategy = {\n name: 'stableId',\n\n try(el, ctx) {\n const id = getStableId(el, ctx.config);\n if (id === null) {\n return null;\n }\n return `${el.tagName.toLowerCase()}#${escapeIdForCss(id)}`;\n },\n};\n"]}
@@ -0,0 +1,100 @@
1
+ /**
2
+ * Core type definitions for the v1 element-selector algorithm.
3
+ *
4
+ * These are the public-API contract that consumers (autocapture SDK, dashboard
5
+ * tagging UI, Chrome extension visual tagger) design against. They land before
6
+ * any implementation so the contract is stable for cross-team review.
7
+ *
8
+ * See the design doc:
9
+ * packages/plugin-autocapture-browser/element-selector-strategy-v1-no-classes.md
10
+ */
11
+ /**
12
+ * A pluggable selector strategy. Given an element + context, returns a CSS
13
+ * selector string candidate (which the orchestrator will then uniqueness-check)
14
+ * or `null` when the strategy doesn't apply to this element.
15
+ */
16
+ export interface Strategy {
17
+ /** Stable identifier for the strategy. Used for diagnostics and remote-config references. */
18
+ readonly name: string;
19
+ /**
20
+ * Produce a candidate selector for `el`, or `null` if this strategy has
21
+ * nothing to contribute for this element. Strategies are pure transforms —
22
+ * they never call `querySelectorAll` themselves; uniqueness is checked by
23
+ * the orchestrator in the next layer up.
24
+ */
25
+ try(el: Element, ctx: StrategyContext): string | null;
26
+ }
27
+ /**
28
+ * Context passed to every strategy invocation. `scope` is the document or
29
+ * shadow root the orchestrator will use for uniqueness checks; `config` is the
30
+ * resolved configuration (defaults + remote + local options merged).
31
+ */
32
+ export interface StrategyContext {
33
+ scope: ParentNode;
34
+ config: ResolvedSelectorConfig;
35
+ }
36
+ /**
37
+ * Logger shape accepted by element-selector diagnostics.
38
+ *
39
+ * This is intentionally structural so callers can pass the SDK's
40
+ * `@amplitude/analytics-core` ILogger without this package needing to import
41
+ * analytics-core types during standalone tests/builds.
42
+ */
43
+ export interface ElementSelectorLogger {
44
+ warn(...args: unknown[]): void;
45
+ debug(...args: unknown[]): void;
46
+ }
47
+ /**
48
+ * Fully-resolved configuration consumed at runtime. Produced by
49
+ * `resolveSelectorConfig` (lands in the orchestration PR) from the
50
+ * `ElementSelectorRemoteConfig` payload plus built-in defaults.
51
+ */
52
+ export interface ResolvedSelectorConfig {
53
+ /** Master kill switch. When false, autocapture reverts to legacy cssPath. */
54
+ enabled: boolean;
55
+ /** Attribute name customers can use to set or suppress anchors. Default: 'data-amp-track-id'. */
56
+ explicitTrackingAttribute: string;
57
+ /** Compiled regex patterns matching ids the algorithm should treat as autogenerated. */
58
+ autogeneratedIdPatterns: RegExp[];
59
+ /** Compiled regex patterns matching classes the fallback should filter from sibling disambiguation. */
60
+ unstableClassPatterns: RegExp[];
61
+ /** Optional throttle on the ancestor walk. When undefined, the walk runs to <html>. */
62
+ maxAncestorWalkDepth?: number;
63
+ }
64
+ /**
65
+ * Remote-config payload shape. Each field is optional; absent fields fall back
66
+ * to built-in defaults. Customers see the defaults in the remote-config UI and
67
+ * may add or remove patterns as needed.
68
+ */
69
+ export interface ElementSelectorRemoteConfig {
70
+ /** Kill switch. When set, overrides the default at resolve time. */
71
+ enabled?: boolean;
72
+ /** Override the attribute name used for explicit tracking. */
73
+ explicitTrackingAttribute?: string;
74
+ /** Full replacement for the autogenerated-id pattern list. When omitted, defaults apply. */
75
+ autogeneratedIdPatterns?: string[];
76
+ /** Full replacement for the unstable-class pattern list. When omitted, defaults apply. */
77
+ unstableClassPatterns?: string[];
78
+ /** Defensive throttle on the ancestor walk. Omit for unbounded walking to <html>. */
79
+ maxAncestorWalkDepth?: number;
80
+ }
81
+ /**
82
+ * Public interface of the runtime engine. Implementation lands in the
83
+ * orchestration PR; the interface is declared here so consumers can write
84
+ * against the contract before the class exists.
85
+ */
86
+ export interface SelectorEngine {
87
+ /** Produce a CSS selector string identifying `el` using the engine's current config. */
88
+ generate(el: Element): string;
89
+ /** Read-only access to the current resolved config — for diagnostics and consumer hydration. */
90
+ getConfig(): Readonly<ResolvedSelectorConfig>;
91
+ /** Replace the current config. Notifies any onConfigChange subscribers. */
92
+ updateConfig(next: ResolvedSelectorConfig): void;
93
+ /**
94
+ * Subscribe to config-change notifications. Returns an unsubscribe function.
95
+ * Used by the Chrome extension to keep its locally-hydrated engine in sync
96
+ * with the customer's SDK as remote config updates flow in.
97
+ */
98
+ onConfigChange(cb: (config: ResolvedSelectorConfig) => void): () => void;
99
+ }
100
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACvB,6FAA6F;IAC7F,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;;OAKG;IACH,GAAG,CAAC,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,eAAe,GAAG,MAAM,GAAG,IAAI,CAAC;CACvD;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,EAAE,sBAAsB,CAAC;CAChC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAC/B,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;CACjC;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,6EAA6E;IAC7E,OAAO,EAAE,OAAO,CAAC;IACjB,iGAAiG;IACjG,yBAAyB,EAAE,MAAM,CAAC;IAClC,wFAAwF;IACxF,uBAAuB,EAAE,MAAM,EAAE,CAAC;IAClC,uGAAuG;IACvG,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,uFAAuF;IACvF,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C,oEAAoE;IACpE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,8DAA8D;IAC9D,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,4FAA4F;IAC5F,uBAAuB,CAAC,EAAE,MAAM,EAAE,CAAC;IACnC,0FAA0F;IAC1F,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC,qFAAqF;IACrF,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,wFAAwF;IACxF,QAAQ,CAAC,EAAE,EAAE,OAAO,GAAG,MAAM,CAAC;IAE9B,gGAAgG;IAChG,SAAS,IAAI,QAAQ,CAAC,sBAAsB,CAAC,CAAC;IAE9C,2EAA2E;IAC3E,YAAY,CAAC,IAAI,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAEjD;;;;OAIG;IACH,cAAc,CAAC,EAAE,EAAE,CAAC,MAAM,EAAE,sBAAsB,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;CAC1E"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Core type definitions for the v1 element-selector algorithm.
3
+ *
4
+ * These are the public-API contract that consumers (autocapture SDK, dashboard
5
+ * tagging UI, Chrome extension visual tagger) design against. They land before
6
+ * any implementation so the contract is stable for cross-team review.
7
+ *
8
+ * See the design doc:
9
+ * packages/plugin-autocapture-browser/element-selector-strategy-v1-no-classes.md
10
+ */
11
+ export {};
12
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG","sourcesContent":["/**\n * Core type definitions for the v1 element-selector algorithm.\n *\n * These are the public-API contract that consumers (autocapture SDK, dashboard\n * tagging UI, Chrome extension visual tagger) design against. They land before\n * any implementation so the contract is stable for cross-team review.\n *\n * See the design doc:\n * packages/plugin-autocapture-browser/element-selector-strategy-v1-no-classes.md\n */\n\n/**\n * A pluggable selector strategy. Given an element + context, returns a CSS\n * selector string candidate (which the orchestrator will then uniqueness-check)\n * or `null` when the strategy doesn't apply to this element.\n */\nexport interface Strategy {\n /** Stable identifier for the strategy. Used for diagnostics and remote-config references. */\n readonly name: string;\n\n /**\n * Produce a candidate selector for `el`, or `null` if this strategy has\n * nothing to contribute for this element. Strategies are pure transforms —\n * they never call `querySelectorAll` themselves; uniqueness is checked by\n * the orchestrator in the next layer up.\n */\n try(el: Element, ctx: StrategyContext): string | null;\n}\n\n/**\n * Context passed to every strategy invocation. `scope` is the document or\n * shadow root the orchestrator will use for uniqueness checks; `config` is the\n * resolved configuration (defaults + remote + local options merged).\n */\nexport interface StrategyContext {\n scope: ParentNode;\n config: ResolvedSelectorConfig;\n}\n\n/**\n * Logger shape accepted by element-selector diagnostics.\n *\n * This is intentionally structural so callers can pass the SDK's\n * `@amplitude/analytics-core` ILogger without this package needing to import\n * analytics-core types during standalone tests/builds.\n */\nexport interface ElementSelectorLogger {\n warn(...args: unknown[]): void;\n debug(...args: unknown[]): void;\n}\n\n/**\n * Fully-resolved configuration consumed at runtime. Produced by\n * `resolveSelectorConfig` (lands in the orchestration PR) from the\n * `ElementSelectorRemoteConfig` payload plus built-in defaults.\n */\nexport interface ResolvedSelectorConfig {\n /** Master kill switch. When false, autocapture reverts to legacy cssPath. */\n enabled: boolean;\n /** Attribute name customers can use to set or suppress anchors. Default: 'data-amp-track-id'. */\n explicitTrackingAttribute: string;\n /** Compiled regex patterns matching ids the algorithm should treat as autogenerated. */\n autogeneratedIdPatterns: RegExp[];\n /** Compiled regex patterns matching classes the fallback should filter from sibling disambiguation. */\n unstableClassPatterns: RegExp[];\n /** Optional throttle on the ancestor walk. When undefined, the walk runs to <html>. */\n maxAncestorWalkDepth?: number;\n}\n\n/**\n * Remote-config payload shape. Each field is optional; absent fields fall back\n * to built-in defaults. Customers see the defaults in the remote-config UI and\n * may add or remove patterns as needed.\n */\nexport interface ElementSelectorRemoteConfig {\n /** Kill switch. When set, overrides the default at resolve time. */\n enabled?: boolean;\n /** Override the attribute name used for explicit tracking. */\n explicitTrackingAttribute?: string;\n /** Full replacement for the autogenerated-id pattern list. When omitted, defaults apply. */\n autogeneratedIdPatterns?: string[];\n /** Full replacement for the unstable-class pattern list. When omitted, defaults apply. */\n unstableClassPatterns?: string[];\n /** Defensive throttle on the ancestor walk. Omit for unbounded walking to <html>. */\n maxAncestorWalkDepth?: number;\n}\n\n/**\n * Public interface of the runtime engine. Implementation lands in the\n * orchestration PR; the interface is declared here so consumers can write\n * against the contract before the class exists.\n */\nexport interface SelectorEngine {\n /** Produce a CSS selector string identifying `el` using the engine's current config. */\n generate(el: Element): string;\n\n /** Read-only access to the current resolved config — for diagnostics and consumer hydration. */\n getConfig(): Readonly<ResolvedSelectorConfig>;\n\n /** Replace the current config. Notifies any onConfigChange subscribers. */\n updateConfig(next: ResolvedSelectorConfig): void;\n\n /**\n * Subscribe to config-change notifications. Returns an unsubscribe function.\n * Used by the Chrome extension to keep its locally-hydrated engine in sync\n * with the customer's SDK as remote config updates flow in.\n */\n onConfigChange(cb: (config: ResolvedSelectorConfig) => void): () => void;\n}\n"]}
package/package.json CHANGED
@@ -1,9 +1,44 @@
1
1
  {
2
2
  "name": "@amplitude/element-selector",
3
- "version": "0.0.1",
4
- "description": "Bootstrap placeholder for Trusted Publishing setup. Do not use.",
5
- "private": false,
3
+ "version": "0.1.0",
4
+ "description": "Shared element-selector algorithm consumed by autocapture, the Amplitude dashboard, and the Chrome extension visual tagger.",
5
+ "author": "Amplitude Inc",
6
+ "homepage": "https://github.com/amplitude/Amplitude-TypeScript",
7
+ "license": "MIT",
8
+ "main": "lib/cjs/index.js",
9
+ "module": "lib/esm/index.js",
10
+ "types": "lib/esm/index.d.ts",
11
+ "sideEffects": false,
6
12
  "publishConfig": {
7
- "access": "public"
13
+ "access": "public",
14
+ "tag": "latest"
15
+ },
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/amplitude/Amplitude-TypeScript.git"
19
+ },
20
+ "bugs": {
21
+ "url": "https://github.com/amplitude/Amplitude-TypeScript/issues"
22
+ },
23
+ "dependencies": {
24
+ "tslib": "^2.4.1"
25
+ },
26
+ "files": [
27
+ "lib"
28
+ ],
29
+ "scripts": {
30
+ "build": "pnpm build:es5 & pnpm build:esm",
31
+ "build:es5": "tsc -p ./tsconfig.es5.json",
32
+ "build:esm": "tsc -p ./tsconfig.esm.json",
33
+ "watch": "tsc -p ./tsconfig.esm.json --watch",
34
+ "clean": "rimraf node_modules lib coverage",
35
+ "fix": "pnpm fix:eslint & pnpm fix:prettier",
36
+ "fix:eslint": "eslint '{src,test}/**/*.ts' --fix",
37
+ "fix:prettier": "prettier --write \"{src,test}/**/*.ts\"",
38
+ "lint": "pnpm lint:eslint & pnpm lint:prettier",
39
+ "lint:eslint": "eslint '{src,test}/**/*.ts'",
40
+ "lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
41
+ "test": "jest",
42
+ "typecheck": "tsc -p ./tsconfig.json"
8
43
  }
9
- }
44
+ }