Skip to content

Commit b41baec

Browse files
committed
chore: ensure build + check pass post-fleet-onboard
Surface fixes uncovered by the first end-to-end build/lint/type pass on the fleet-onboarded codebase. Functional behavior unchanged. Build/dep: - Rename @socketsecurity/registry/lib/constants import to @socketsecurity/lib/constants/socket (canonical fleet home for shared constants since registry@2.0 dropped the lib/* subpath). - Drop @socketsecurity/registry from runtime deps (unused after rename). - Restore toml-eslint-parser as a runtime dep — util.ts, github.ts, parse-externals.ts use it for TOML parsing. - Move @socketsecurity/lib to runtime deps (auth.ts uses it now). Type-check: - Add .config/tsconfig.{base,check}.json matching fleet pattern. Base ES2024 + DOM lib for WebAssembly globals; check uses bundler resolution + node + vscode types. - Cast WebAssembly.instantiate(Uint8Array, …) result to WebAssemblyInstantiatedSource in mod-parser.ts (TS picks the Module-overload incorrectly). Lint: - Drop orphan `path.is` at parse-externals.ts:467 (refactor leftover). - Drop orphan `null` at manager.ts:140 (pre-await placeholder). - Replace Array<T> with T[] in auth.ts (array-type rule). - Inline-disable no-this-alias on Go WASM runtime's _makeFuncWrapper. Format: - oxfmt --write across the tree (fleet style auto-applied). Config: - Add **/vendor to oxlint + oxfmt ignorePatterns (vendored acorn-wasm bindings break the wasm-bindgen contract if reformatted). Verified: pnpm install --ignore-scripts && pnpm rebuild esbuild && pnpm run build && pnpm run check all green. out/main.js 5.8 MB.
1 parent 442a1d0 commit b41baec

34 files changed

Lines changed: 3892 additions & 3167 deletions

.config/tsconfig.base.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"compilerOptions": {
3+
"allowImportingTsExtensions": false,
4+
"allowJs": false,
5+
"allowSyntheticDefaultImports": true,
6+
"composite": false,
7+
"declaration": true,
8+
"declarationMap": false,
9+
// VSCode extension uses parameter properties / decorators / etc.
10+
// that emit runtime code — erasable-only would forbid them.
11+
"erasableSyntaxOnly": false,
12+
"esModuleInterop": true,
13+
"exactOptionalPropertyTypes": false,
14+
"forceConsistentCasingInFileNames": true,
15+
"incremental": false,
16+
"isolatedModules": true,
17+
// DOM is needed for the WebAssembly globals used by the bundled
18+
// WASM glue (Go runtime, acorn-wasm).
19+
"lib": ["DOM", "ES2024"],
20+
"noEmitOnError": true,
21+
"noFallthroughCasesInSwitch": true,
22+
"noImplicitOverride": true,
23+
"noPropertyAccessFromIndexSignature": false,
24+
"noUncheckedIndexedAccess": false,
25+
"noUncheckedSideEffectImports": true,
26+
// Existing source has many unused-local and unused-param sites
27+
// (legacy from the pre-fleet-onboard codebase). Re-enable both
28+
// checks once those are cleaned up.
29+
"noUnusedLocals": false,
30+
"noUnusedParameters": false,
31+
"resolveJsonModule": true,
32+
"rewriteRelativeImportExtensions": false,
33+
"skipLibCheck": true,
34+
"sourceMap": true,
35+
"strict": true,
36+
"strictNullChecks": true,
37+
"target": "ES2024",
38+
"useUnknownInCatchVariables": true,
39+
"verbatimModuleSyntax": false
40+
}
41+
}

.config/tsconfig.check.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"extends": "./tsconfig.base.json",
3+
"compilerOptions": {
4+
"declarationMap": false,
5+
"module": "esnext",
6+
"moduleResolution": "bundler",
7+
"noEmit": true,
8+
"skipLibCheck": true,
9+
"sourceMap": false,
10+
"types": ["node", "vscode"],
11+
"verbatimModuleSyntax": false
12+
},
13+
"include": ["../src/**/*.ts", "../test/**/*.mts"],
14+
"exclude": ["**/.cache/**", "**/node_modules/**/*", "**/vendor/**/*"]
15+
}

.oxfmtrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"**/pnpm-lock.yaml",
4646
"**/test/fixtures",
4747
"**/test/packages",
48+
"**/vendor",
4849
"**/lockstep.schema.json"
4950
]
5051
}

.oxlintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"**/patches",
5757
"**/test/fixtures",
5858
"**/test/packages",
59+
"**/vendor",
5960
"**/*.d.ts",
6061
"**/*.d.ts.map",
6162
"**/*.tsbuildinfo"

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ This extension provides automatic reporting of security concerns from [Socket Se
44

55
## Ahead of Package Installation
66

7-
* Package imports in JavaScript and Python are detected and given summary scores to show concerns with configurable overlays. These overlays will persist even after package installation.
7+
- Package imports in JavaScript and Python are detected and given summary scores to show concerns with configurable overlays. These overlays will persist even after package installation.
88

9-
* Socket detects multiple alternate forms of package imports, including dynamic `import()` or `require` in JavaScript or `importlib.import_module` in Python.
9+
- Socket detects multiple alternate forms of package imports, including dynamic `import()` or `require` in JavaScript or `importlib.import_module` in Python.
1010

1111
## MCP Server
1212

13-
* This will automatically register the socket MCP server at https://mcp.socket.dev to allow usage of the public MCP server.
13+
- This will automatically register the socket MCP server at https://mcp.socket.dev to allow usage of the public MCP server.
1414

1515
# Team Guide
1616

assets/README.md

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@ marketplace icon, web page favicon, README banner, …).
88

99
### SVG variants
1010

11-
| File | Layers | Color | viewBox |
12-
|---|---|---|---|
13-
| `socket-icon.svg` | 1 (bolt is a cutout) | `currentColor` | `0 0 181.41 240` |
14-
| `socket-icon-square.svg` | 1 | `currentColor` | `-29.295 0 240 240` |
15-
| `socket-icon-shield.svg` | 2 (shield + bolt) | shield: `currentColor`, bolt: `#fff` | `0 0 181.41 240` |
16-
| `socket-icon-shield-square.svg` | 2 | shield: `currentColor`, bolt: `#fff` | `-29.295 0 240 240` |
17-
| `socket-icon-brand.svg`| 2 | shield: pink→purple gradient, bolt: `#fff` | `0 0 181.41 240` |
18-
| `socket-icon-brand-square.svg`| 2 | shield: pink→purple gradient, bolt: `#fff` | `-29.295 0 240 240` |
11+
| File | Layers | Color | viewBox |
12+
| -------------------------------- | -------------------- | ------------------------------------------ | ------------------- |
13+
| `socket-icon.svg` | 1 (bolt is a cutout) | `currentColor` | `0 0 181.41 240` |
14+
| `socket-icon-square.svg` | 1 | `currentColor` | `-29.295 0 240 240` |
15+
| `socket-icon-shield.svg` | 2 (shield + bolt) | shield: `currentColor`, bolt: `#fff` | `0 0 181.41 240` |
16+
| `socket-icon-shield-square.svg` | 2 | shield: `currentColor`, bolt: `#fff` | `-29.295 0 240 240` |
17+
| `socket-icon-brand.svg` | 2 | shield: pink→purple gradient, bolt: `#fff` | `0 0 181.41 240` |
18+
| `socket-icon-brand-square.svg`| 2 | shield: pink→purple gradient, bolt: `#fff` | `-29.295 0 240 240` |
1919

2020
### Wordmark variants (shield + "Socket" text, 840×240 landscape)
2121

22-
| File | Layers | viewBox |
23-
|---|---|---|
22+
| File | Layers | viewBox |
23+
| ----------------------- | --------------------------------------------------- | ------------- |
2424
| `socket-logo-light.svg` | shield (gradient) + bolt (white) + text (slate-900) | `0 0 840 240` |
25-
| `socket-logo-dark.svg` | shield (gradient) + bolt (white) + text (slate-50) | `0 0 840 240` |
25+
| `socket-logo-dark.svg` | shield (gradient) + bolt (white) + text (slate-50) | `0 0 840 240` |
2626

2727
"Light" and "dark" refer to the **page background** the wordmark sits
2828
on — light wordmark has dark text (for use on white/light bg); dark
@@ -33,32 +33,38 @@ color-scheme preference:
3333

3434
```html
3535
<picture>
36-
<source media="(prefers-color-scheme: dark)" srcset="assets/socket-logo-dark-840.png">
37-
<source media="(prefers-color-scheme: light)" srcset="assets/socket-logo-light-840.png">
38-
<img alt="Socket" width="420" src="assets/socket-logo-light-840.png">
36+
<source
37+
media="(prefers-color-scheme: dark)"
38+
srcset="assets/socket-logo-dark-840.png"
39+
/>
40+
<source
41+
media="(prefers-color-scheme: light)"
42+
srcset="assets/socket-logo-light-840.png"
43+
/>
44+
<img alt="Socket" width="420" src="assets/socket-logo-light-840.png" />
3945
</picture>
4046
```
4147

4248
### PNG variants
4349

4450
Brand-square (favicons + marketplace listing):
4551

46-
| File | Use |
47-
|---|---|
48-
| `socket-icon-brand-16.png` | Favicon (small) |
49-
| `socket-icon-brand-32.png` | Favicon (standard) |
50-
| `socket-icon-brand-64.png` | README badges, GitHub social previews |
51-
| `socket-icon-brand-128.png` | Docs, OG cards |
52-
| `socket-icon-brand-256.png` | VSCode marketplace listing |
53-
| `socket-icon-brand-512.png` | High-DPI, hero images, press kit |
52+
| File | Use |
53+
| --------------------------- | ------------------------------------- |
54+
| `socket-icon-brand-16.png` | Favicon (small) |
55+
| `socket-icon-brand-32.png` | Favicon (standard) |
56+
| `socket-icon-brand-64.png` | README badges, GitHub social previews |
57+
| `socket-icon-brand-128.png` | Docs, OG cards |
58+
| `socket-icon-brand-256.png` | VSCode marketplace listing |
59+
| `socket-icon-brand-512.png` | High-DPI, hero images, press kit |
5460

5561
Wordmark (README hero banners, in light/dark pairs):
5662

57-
| File | Width | Use |
58-
|---|---|---|
59-
| `socket-logo-{light,dark}-420.png` | 420×120 | README hero (1× display) |
60-
| `socket-logo-{light,dark}-840.png` | 840×240 | README hero (2× / Retina) |
61-
| `socket-logo-{light,dark}-1680.png` | 1680×480 | Press kit, hero images |
63+
| File | Width | Use |
64+
| ----------------------------------- | -------- | ------------------------- |
65+
| `socket-logo-{light,dark}-420.png` | 420×120 | README hero (1× display) |
66+
| `socket-logo-{light,dark}-840.png` | 840×240 | README hero (2× / Retina) |
67+
| `socket-logo-{light,dark}-1680.png` | 1680×480 | Press kit, hero images |
6268

6369
## Variant semantics
6470

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,13 @@
118118
"@babel/traverse": "7.29.0",
119119
"@babel/types": "7.29.0",
120120
"@socketsecurity/config": "3.0.1",
121-
"@socketsecurity/registry": "2.0.2",
121+
"@socketsecurity/lib": "catalog:",
122122
"@vscode/python-extension": "1.0.6",
123123
"ini": "6.0.0",
124-
"json-to-ast": "2.1.0"
124+
"json-to-ast": "2.1.0",
125+
"toml-eslint-parser": "1.0.3"
125126
},
126127
"devDependencies": {
127-
"@socketsecurity/lib": "catalog:",
128128
"@types/babel__traverse": "7.28.0",
129129
"@types/ini": "4.1.1",
130130
"@types/json-to-ast": "2.1.4",

pnpm-lock.yaml

Lines changed: 20 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/lockstep.mts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,8 @@ function loadManifestTree(rootManifestPath: string): {
184184
for (const rel of includes) {
185185
const subPath = path.resolve(baseDir, rel)
186186
const sub = readManifest(subPath)
187-
const area = sub.area ?? path.basename(rel, '.json').replace(/^lockstep-/, '')
187+
const area =
188+
sub.area ?? path.basename(rel, '.json').replace(/^lockstep-/, '')
188189
areas.push({ area, manifest: sub })
189190
}
190191

scripts/socket-repo-template-emit-schema.mts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ const rootDir = path.resolve(__dirname, '..')
2323
// Schema lives in `.config/` next to the per-repo
2424
// `.config/socket-repo-template.json` it describes — the marker's
2525
// `$schema` ref is `./socket-repo-template-schema.json`.
26-
const outPath = path.join(rootDir, '.config', 'socket-repo-template-schema.json')
26+
const outPath = path.join(
27+
rootDir,
28+
'.config',
29+
'socket-repo-template-schema.json',
30+
)
2731

2832
const enriched = {
2933
$schema: 'https://json-schema.org/draft/2020-12/schema',

0 commit comments

Comments
 (0)