@specbook/codegen 0.1.0 → 0.2.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.
- package/package.json +2 -2
- package/src/index.ts +1 -1
- package/src/write.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@specbook/codegen",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Turns an OpenAPI or Swagger document into types, examples, schemas and metadata, in Node or in a browser.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"specbook",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"swagger2openapi": "7.0.8"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@specbook/core": "0.
|
|
43
|
+
"@specbook/core": "0.2.0",
|
|
44
44
|
"@types/node": "24.19.2",
|
|
45
45
|
"@types/swagger2openapi": "7.0.4",
|
|
46
46
|
"typescript": "7.0.2"
|
package/src/index.ts
CHANGED
package/src/write.ts
CHANGED
|
@@ -17,7 +17,7 @@ let counter = 0
|
|
|
17
17
|
* over the target (atomic on one file system). A file that already holds this content is left alone,
|
|
18
18
|
* which keeps its timestamp and spares a watching dev server a reload for nothing.
|
|
19
19
|
*/
|
|
20
|
-
async function writeAtomically(full: string, content: string): Promise<void> {
|
|
20
|
+
export async function writeAtomically(full: string, content: string): Promise<void> {
|
|
21
21
|
const current = await readFile(full, 'utf8').catch(() => undefined)
|
|
22
22
|
if (current === content) return
|
|
23
23
|
const tmp = `${full}.${process.pid}.${counter++}.tmp`
|