Skip to content

Commit 572c6b4

Browse files
committed
wip
1 parent 2ac7e9e commit 572c6b4

File tree

6 files changed

+21
-73
lines changed

6 files changed

+21
-73
lines changed

packages/signals/signals-runtime/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ Encapsults Signals runtime functionality, in order to share logic between the si
66
| Generated File(s) | Description |
77
|--------|-------------|
88
| `/dist/global/index.[platform].js`, `/[platform]/get-runtime-code.generated.js` | Exposes `globalThis.Signals` and constants (e.g. `SignalType`), either through the script tag or in the mobile JS engine |
9-
| `/editor/[platform]-editor.d.ts` | Type definitions for monaco editor on app.segment.com
9+
| `/dist/editor/[platform]-editor.d.ts` | Type definitions for monaco editor on app.segment.com
1010
| `/dist/esm/index.js` | Entry point for `@segment/analytics-signals` and the segment app, that want to consume the types / runtime code. |

packages/signals/signals-runtime/api-extractor.mobile.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"mainEntryPointFilePath": "./dist/types/mobile/index.mobile-editor.d.ts",
44
"dtsRollup": {
55
"enabled": true,
6-
"untrimmedFilePath": "./editor/mobile-editor.d.ts"
6+
"untrimmedFilePath": "./dist/editor/mobile-editor.d.ts.txt"
77
}
88
}

packages/signals/signals-runtime/api-extractor.web.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"mainEntryPointFilePath": "./dist/types/web/index.web-editor.d.ts",
44
"dtsRollup": {
55
"enabled": true,
6-
"untrimmedFilePath": "./editor/web-editor.d.ts"
6+
"untrimmedFilePath": "./dist/editor/web-editor.d.ts.txt"
77
}
88
}

packages/signals/signals-runtime/build-editor-types.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ async function prependGenerated(filePath) {
77
'/* eslint-disable */',
88
'// These types will be used in the segment app UI for autocomplete',
99
`// Generated from: ${pkgJSON.name}@${pkgJSON.version}`,
10+
'// Built as text so they do not cause global scope pollution for packages importing unrelated modules',
1011
'\n',
1112
].join('\n')
1213
try {
@@ -38,7 +39,10 @@ const main = async () => {
3839
// eslint-disable-next-line no-undef
3940
execSync('npx api-extractor run --config ./api-extractor.mobile.json --local')
4041
execSync('npx api-extractor run --config ./api-extractor.web.json --local')
41-
const outputs = ['./editor/web-editor.d.ts', './editor/mobile-editor.d.ts']
42+
const outputs = [
43+
'./dist/editor/web-editor.d.ts.txt',
44+
'./dist/editor/mobile-editor.d.ts.txt',
45+
]
4246
await Promise.all(outputs.map(removeExports))
4347
await Promise.all(outputs.map(prependGenerated))
4448
console.log('wrote:', outputs.join(', '))

packages/signals/signals-runtime/package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"files": [
1111
"LICENSE",
1212
"dist/",
13-
"editor/",
1413
"src/",
1514
"!**/__tests__/**",
1615
"!**/test-helpers/**",
@@ -21,7 +20,7 @@
2120
"test": "yarn jest",
2221
"lint": "yarn concurrently 'yarn:eslint .' 'yarn:tsc --noEmit'",
2322
"build": "rm -rf dist && yarn concurrently 'yarn:build:*'",
24-
"build:editor-types": "node build-editor-types.js",
23+
"build:editor": "node build-editor-types.js",
2524
"build:esm": "yarn tsc -p tsconfig.build.json",
2625
"build:cjs": "yarn tsc -p tsconfig.build.json --outDir ./dist/cjs --module commonjs",
2726
"build:global": "node build-signals-runtime-global.js",
@@ -45,7 +44,6 @@
4544
},
4645
"devDependencies": {
4746
"@internal/test-helpers": "workspace:^",
48-
"@microsoft/api-extractor": "^7.47.9",
49-
"esbuild-plugin-d.ts": "^1.3.1"
47+
"@microsoft/api-extractor": "^7.47.9"
5048
}
5149
}

yarn.lock

Lines changed: 11 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -4329,7 +4329,6 @@ __metadata:
43294329
dependencies:
43304330
"@internal/test-helpers": "workspace:^"
43314331
"@microsoft/api-extractor": ^7.47.9
4332-
esbuild-plugin-d.ts: ^1.3.1
43334332
tslib: ^2.4.1
43344333
languageName: unknown
43354334
linkType: soft
@@ -9294,16 +9293,6 @@ __metadata:
92949293
languageName: node
92959294
linkType: hard
92969295

9297-
"chalk@npm:4.1.2, chalk@npm:^4.0.2, chalk@npm:^4.1.0, chalk@npm:^4.1.2":
9298-
version: 4.1.2
9299-
resolution: "chalk@npm:4.1.2"
9300-
dependencies:
9301-
ansi-styles: ^4.1.0
9302-
supports-color: ^7.1.0
9303-
checksum: fe75c9d5c76a7a98d45495b91b2172fa3b7a09e0cc9370e5c8feb1c567b85c4288e2b3fded7cfdd7359ac28d6b3844feb8b82b8686842e93d23c827c417e83fc
9304-
languageName: node
9305-
linkType: hard
9306-
93079296
"chalk@npm:^1.1.3":
93089297
version: 1.1.3
93099298
resolution: "chalk@npm:1.1.3"
@@ -9348,6 +9337,16 @@ __metadata:
93489337
languageName: node
93499338
linkType: hard
93509339

9340+
"chalk@npm:^4.0.2, chalk@npm:^4.1.0, chalk@npm:^4.1.2":
9341+
version: 4.1.2
9342+
resolution: "chalk@npm:4.1.2"
9343+
dependencies:
9344+
ansi-styles: ^4.1.0
9345+
supports-color: ^7.1.0
9346+
checksum: fe75c9d5c76a7a98d45495b91b2172fa3b7a09e0cc9370e5c8feb1c567b85c4288e2b3fded7cfdd7359ac28d6b3844feb8b82b8686842e93d23c827c417e83fc
9347+
languageName: node
9348+
linkType: hard
9349+
93519350
"chalk@npm:^5.1.2, chalk@npm:^5.2.0":
93529351
version: 5.2.0
93539352
resolution: "chalk@npm:5.2.0"
@@ -11029,18 +11028,6 @@ __metadata:
1102911028
languageName: node
1103011029
linkType: hard
1103111030

11032-
"dts-bundle-generator@npm:^9.5.1":
11033-
version: 9.5.1
11034-
resolution: "dts-bundle-generator@npm:9.5.1"
11035-
dependencies:
11036-
typescript: ">=5.0.2"
11037-
yargs: ^17.6.0
11038-
bin:
11039-
dts-bundle-generator: dist/bin/dts-bundle-generator.js
11040-
checksum: e67b0a3d7e2e53035aa3940d15ae9d6e5a9894dc885c74c9b3118ca588076f24d4c817bfb267aa6b72ad86fc903adad5cfb5c1c79a55b2660ed7edceb4a6494f
11041-
languageName: node
11042-
linkType: hard
11043-
1104411031
"duplexer2@npm:~0.1.4":
1104511032
version: 0.1.4
1104611033
resolution: "duplexer2@npm:0.1.4"
@@ -11600,20 +11587,6 @@ __metadata:
1160011587
languageName: node
1160111588
linkType: hard
1160211589

11603-
"esbuild-plugin-d.ts@npm:^1.3.1":
11604-
version: 1.3.1
11605-
resolution: "esbuild-plugin-d.ts@npm:1.3.1"
11606-
dependencies:
11607-
chalk: 4.1.2
11608-
dts-bundle-generator: ^9.5.1
11609-
lodash.merge: ^4.6.2
11610-
type-fest: ^4.26.1
11611-
peerDependencies:
11612-
typescript: "*"
11613-
checksum: a45d256f511aa7b6ba0882333a8fbb3ab290a95be071f655f7fe8ba351bf4582a8dd2052b1dfd57bd032561256520e79bb846ff7473840212947e7ffac0f39e0
11614-
languageName: node
11615-
linkType: hard
11616-
1161711590
"esbuild-sunos-64@npm:0.14.54":
1161811591
version: 0.14.54
1161911592
resolution: "esbuild-sunos-64@npm:0.14.54"
@@ -22284,13 +22257,6 @@ __metadata:
2228422257
languageName: node
2228522258
linkType: hard
2228622259

22287-
"type-fest@npm:^4.26.1":
22288-
version: 4.26.1
22289-
resolution: "type-fest@npm:4.26.1"
22290-
checksum: 7188db3bca82afa62c69a8043fb7c5eb74e63c45e7e28efb986da1629d844286f7181bc5a8185f38989fffff0d6c96be66fd13529b01932d1b6ebe725181d31a
22291-
languageName: node
22292-
linkType: hard
22293-
2229422260
"type-is@npm:~1.6.18":
2229522261
version: 1.6.18
2229622262
resolution: "type-is@npm:1.6.18"
@@ -22367,16 +22333,6 @@ __metadata:
2236722333
languageName: node
2236822334
linkType: hard
2236922335

22370-
"typescript@npm:>=5.0.2":
22371-
version: 5.6.3
22372-
resolution: "typescript@npm:5.6.3"
22373-
bin:
22374-
tsc: bin/tsc
22375-
tsserver: bin/tsserver
22376-
checksum: ba302f8822777ebefb28b554105f3e074466b671e7444ec6b75dadc008a62f46f373d9e57ceced1c433756d06c8b7dc569a7eefdf3a9573122a49205ff99021a
22377-
languageName: node
22378-
linkType: hard
22379-
2238022336
"typescript@npm:^4.7.0":
2238122337
version: 4.9.5
2238222338
resolution: "typescript@npm:4.9.5"
@@ -22397,16 +22353,6 @@ __metadata:
2239722353
languageName: node
2239822354
linkType: hard
2239922355

22400-
"typescript@patch:typescript@>=5.0.2#~builtin<compat/typescript>":
22401-
version: 5.6.3
22402-
resolution: "typescript@patch:typescript@npm%3A5.6.3#~builtin<compat/typescript>::version=5.6.3&hash=1f5320"
22403-
bin:
22404-
tsc: bin/tsc
22405-
tsserver: bin/tsserver
22406-
checksum: ade87bce2363ee963eed0e4ca8a312ea02c81873ebd53609bc3f6dc0a57f6e61ad7e3fb8cbb7f7ab8b5081cbee801b023f7c4823ee70b1c447eae050e6c7622b
22407-
languageName: node
22408-
linkType: hard
22409-
2241022356
"typescript@patch:typescript@^4.7.0#~builtin<compat/typescript>":
2241122357
version: 4.9.5
2241222358
resolution: "typescript@patch:typescript@npm%3A4.9.5#~builtin<compat/typescript>::version=4.9.5&hash=23ec76"
@@ -23913,7 +23859,7 @@ __metadata:
2391323859
languageName: node
2391423860
linkType: hard
2391523861

23916-
"yargs@npm:^17.6.0, yargs@npm:^17.7.2":
23862+
"yargs@npm:^17.7.2":
2391723863
version: 17.7.2
2391823864
resolution: "yargs@npm:17.7.2"
2391923865
dependencies:

0 commit comments

Comments
 (0)