@fern-api/generator-cli 0.5.0 → 0.5.2
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/bin/cli +2 -0
- package/dist/{api.cjs → api.js} +6 -2
- package/dist/cli.d.ts +2 -0
- package/dist/{cli.cjs → cli.js} +8 -5
- package/package.json +10 -10
- /package/dist/{api.d.cts → api.d.ts} +0 -0
package/bin/cli
ADDED
package/dist/{api.cjs → api.js}
RENAMED
|
@@ -6863,7 +6863,7 @@ var Language = {
|
|
|
6863
6863
|
};
|
|
6864
6864
|
|
|
6865
6865
|
// src/utils/Writer.ts
|
|
6866
|
-
var import_fs = __toESM(require("fs")
|
|
6866
|
+
var import_fs = __toESM(require("fs"));
|
|
6867
6867
|
var Writer = class {
|
|
6868
6868
|
async writeCodeBlock(language, content) {
|
|
6869
6869
|
await this.writeLine(`\`\`\`${language}`);
|
|
@@ -8086,7 +8086,11 @@ ${content}
|
|
|
8086
8086
|
return content.map(({ text, location }) => this.wrapInLink(text, location)).join("");
|
|
8087
8087
|
}
|
|
8088
8088
|
wrapInLink(content, link) {
|
|
8089
|
-
|
|
8089
|
+
const encodedContent = this.htmlEncode(content);
|
|
8090
|
+
return link != null ? `<a href="${link.path}">${encodedContent}</a>` : encodedContent;
|
|
8091
|
+
}
|
|
8092
|
+
htmlEncode(content) {
|
|
8093
|
+
return content.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
8090
8094
|
}
|
|
8091
8095
|
};
|
|
8092
8096
|
|
package/dist/cli.d.ts
ADDED
package/dist/{cli.cjs → cli.js}
RENAMED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
"use strict";
|
|
3
2
|
var __create = Object.create;
|
|
4
3
|
var __defProp = Object.defineProperty;
|
|
@@ -6066,9 +6065,9 @@ function resolve(...paths) {
|
|
|
6066
6065
|
}
|
|
6067
6066
|
|
|
6068
6067
|
// src/cli.ts
|
|
6069
|
-
var import_fs6 = __toESM(require("fs")
|
|
6068
|
+
var import_fs6 = __toESM(require("fs"));
|
|
6070
6069
|
var import_promises6 = require("fs/promises");
|
|
6071
|
-
var import_path7 = __toESM(require("path")
|
|
6070
|
+
var import_path7 = __toESM(require("path"));
|
|
6072
6071
|
|
|
6073
6072
|
// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/yerror.js
|
|
6074
6073
|
var YError = class _YError extends Error {
|
|
@@ -13002,7 +13001,7 @@ var Language = {
|
|
|
13002
13001
|
};
|
|
13003
13002
|
|
|
13004
13003
|
// src/utils/Writer.ts
|
|
13005
|
-
var import_fs5 = __toESM(require("fs")
|
|
13004
|
+
var import_fs5 = __toESM(require("fs"));
|
|
13006
13005
|
var Writer = class {
|
|
13007
13006
|
async writeCodeBlock(language, content) {
|
|
13008
13007
|
await this.writeLine(`\`\`\`${language}`);
|
|
@@ -14205,7 +14204,11 @@ ${content}
|
|
|
14205
14204
|
return content.map(({ text, location }) => this.wrapInLink(text, location)).join("");
|
|
14206
14205
|
}
|
|
14207
14206
|
wrapInLink(content, link) {
|
|
14208
|
-
|
|
14207
|
+
const encodedContent = this.htmlEncode(content);
|
|
14208
|
+
return link != null ? `<a href="${link.path}">${encodedContent}</a>` : encodedContent;
|
|
14209
|
+
}
|
|
14210
|
+
htmlEncode(content) {
|
|
14211
|
+
return content.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
14209
14212
|
}
|
|
14210
14213
|
};
|
|
14211
14214
|
|
package/package.json
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fern-api/generator-cli",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
|
-
"url": "https://github.com/fern-api/fern"
|
|
6
|
+
"url": "git+https://github.com/fern-api/fern.git",
|
|
7
|
+
"directory": "packages/generator-cli"
|
|
7
8
|
},
|
|
8
|
-
"type": "
|
|
9
|
-
"main": "dist/api.
|
|
9
|
+
"type": "commonjs",
|
|
10
|
+
"main": "dist/api.js",
|
|
10
11
|
"source": "src/index.ts",
|
|
11
|
-
"types": "dist/api.d.
|
|
12
|
+
"types": "dist/api.d.ts",
|
|
12
13
|
"bin": {
|
|
13
|
-
"generator-cli": "
|
|
14
|
+
"generator-cli": "bin/cli"
|
|
14
15
|
},
|
|
15
|
-
"files": ["dist"],
|
|
16
|
+
"files": ["bin", "dist"],
|
|
16
17
|
"scripts": {
|
|
17
|
-
"clean": "rm -rf ./dist && tsc --build --clean",
|
|
18
|
-
"compile": "tsup && pnpm compile:api:dts && echo '#!/usr/bin/env node' | cat - dist/cli.cjs > dist/tmp && mv dist/tmp dist/cli.cjs",
|
|
19
|
-
"compile:api:dts": "tsup ./src/api.ts --format cjs --dts --dts-only",
|
|
18
|
+
"clean": "rm -rf ./lib && rm -rf ./dist && tsc --build --clean",
|
|
20
19
|
"depcheck": "depcheck",
|
|
20
|
+
"dist:cli": "node build.mjs",
|
|
21
21
|
"test": "vitest --run --passWithNoTests --globals --disable-console-intercept",
|
|
22
22
|
"test:update": "vitest -u --run --passWithNoTests --globals --disable-console-intercept"
|
|
23
23
|
},
|
|
File without changes
|