-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli): Remove crypto module from @fern-api/ir-generator (#5358)
- Loading branch information
Showing
47 changed files
with
202 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,7 +79,6 @@ | |
} | ||
} | ||
} | ||
}, | ||
"components": {} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,7 +79,6 @@ | |
} | ||
} | ||
} | ||
}, | ||
"components": {} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -137,7 +137,6 @@ | |
} | ||
} | ||
} | ||
}, | ||
"components": {} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,7 +105,6 @@ | |
} | ||
} | ||
} | ||
}, | ||
"components": {} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,6 @@ | |
} | ||
], | ||
"x-fern-base-path": "/v1", | ||
"paths": {}, | ||
"components": {} | ||
"paths": {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,7 +53,6 @@ | |
} | ||
} | ||
} | ||
}, | ||
"components": {} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,7 +75,6 @@ | |
"#/paths/~1users/get/responses/200/content/application~1json/schema/items" | ||
] | ||
} | ||
], | ||
"components": {} | ||
] | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
packages/cli/ete-tests/src/tests/dependencies/__snapshots__/dependencies.test.ts.snap
Large diffs are not rendered by default.
Oops, something went wrong.
16 changes: 8 additions & 8 deletions
16
packages/cli/ete-tests/src/tests/ir/__snapshots__/ir.test.ts.snap
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
const packageJson = require("./package.json"); | ||
const tsup = require('tsup'); | ||
const { writeFile, rename } = require("fs/promises"); | ||
const path = require("path"); | ||
|
||
main(); | ||
|
||
async function main() { | ||
await tsup.build({ | ||
entry: ['src/**/*.ts', '!src/__test__'], | ||
format: ['cjs'], | ||
clean: true, | ||
// minify: true, | ||
dts: true, | ||
outDir: 'dist', | ||
target: "es2017", | ||
external: [ | ||
// Exclude the optional dependencies that aren't supported in the browser. | ||
'prettier', | ||
], | ||
tsconfig: "./build.tsconfig.json" | ||
}); | ||
|
||
process.chdir(path.join(__dirname, "dist")); | ||
|
||
// The module expects the imports defined in the index.d.ts file. | ||
await rename("index.d.cts", "index.d.ts"); | ||
|
||
await writeFile( | ||
"package.json", | ||
JSON.stringify( | ||
{ | ||
name: packageJson.name, | ||
version: process.argv[2] || packageJson.version, | ||
repository: packageJson.repository, | ||
main: "index.cjs", | ||
types: "index.d.ts", | ||
files: ["index.cjs", "index.d.ts"] | ||
}, | ||
undefined, | ||
2 | ||
) | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"extends": "../../../../shared/tsconfig.shared.json", | ||
"include": ["src/**/*.ts"], | ||
"exclude": ["src/**/__test__"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
packages/cli/generation/ir-generator/src/utils/hashJSON.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export function hashJSON(obj: unknown): string { | ||
const jsonString = JSON.stringify(obj); | ||
let hash = 0x811c9dc5; // Random prime number. | ||
for (let i = 0; i < jsonString.length; i++) { | ||
const char = jsonString.charCodeAt(i); | ||
hash ^= char; | ||
hash += (hash << 1) + (hash << 4) + (hash << 7) + (hash << 8) + (hash << 24); | ||
} | ||
const positiveHash = hash >>> 0; | ||
return positiveHash.toString(16); | ||
} |
Oops, something went wrong.