internaldocs-fb-helpers
Advanced tools
Comparing version 1.7.0 to 1.7.1
@@ -22,3 +22,5 @@ /** | ||
export declare function validateFbContentArgs<X, Y>(args: FbContent<X, Y>): void; | ||
export declare function isInternal(): Boolean; | ||
export declare function isInternal(): boolean; | ||
export declare function hasEphemeralDiffNumber(): boolean; | ||
export declare function getEphemeralDiffNumber(): string | null; | ||
export declare function FbInternalOnly<T>(props: { | ||
@@ -25,0 +27,0 @@ children: ReactElement<T>; |
@@ -27,3 +27,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.OssOnly = exports.FbInternalOnly = exports.isInternal = exports.validateFbContentArgs = exports.fbInternalOnly = exports.fbContent = exports.inpageeditor = exports.feedback = exports.uidocs = exports.bloks = void 0; | ||
exports.OssOnly = exports.FbInternalOnly = exports.getEphemeralDiffNumber = exports.hasEphemeralDiffNumber = exports.isInternal = exports.validateFbContentArgs = exports.fbInternalOnly = exports.fbContent = exports.inpageeditor = exports.feedback = exports.uidocs = exports.bloks = void 0; | ||
exports.bloks = __importStar(require("./bloks")); | ||
@@ -95,2 +95,22 @@ exports.uidocs = __importStar(require("./uidocs")); | ||
exports.isInternal = isInternal; | ||
function hasEphemeralDiffNumber() { | ||
return Boolean(getEphemeralDiffNumber()); | ||
} | ||
exports.hasEphemeralDiffNumber = hasEphemeralDiffNumber; | ||
function getEphemeralDiffNumber() { | ||
// To use this in front-end code, we're relying on docusaurus-plugin-internaldocs-fb to add this value to the webpack env plugins. | ||
try { | ||
if (process.env.PHABRICATOR_DIFF_NUMBER) { | ||
return process.env.PHABRICATOR_DIFF_NUMBER; | ||
} | ||
else { | ||
return null; | ||
} | ||
} | ||
catch (e) { | ||
console.log("process.env.PHABRICATOR_DIFF_NUMBER couldn't be read, maybe you forgot to add the required webpack EnvironmentPlugin config?", e); | ||
return null; | ||
} | ||
} | ||
exports.getEphemeralDiffNumber = getEphemeralDiffNumber; | ||
/* | ||
@@ -97,0 +117,0 @@ * React component for wrapping content that should only be rendered on the internal (facebook empoyee-facing) website. |
@@ -18,3 +18,4 @@ /** | ||
project_name: string | null; | ||
diff_number: number | null; | ||
}): Promise<createPhabricatorDiffApiResponse>; | ||
export {}; |
@@ -21,3 +21,3 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const { file_path, new_content, project_name } = args; | ||
const { file_path, new_content, project_name, diff_number } = args; | ||
try { | ||
@@ -31,2 +31,3 @@ return (yield bridge_1.call({ | ||
project_name, | ||
diff_number, | ||
}, | ||
@@ -33,0 +34,0 @@ })); |
{ | ||
"name": "internaldocs-fb-helpers", | ||
"version": "1.7.0", | ||
"version": "1.7.1", | ||
"description": "Helper library for including / excluding content from docusaurus websites", | ||
@@ -14,2 +14,7 @@ "main": "dist/index.js", | ||
"@types/react": "^17.0.1", | ||
"@typescript-eslint/eslint-plugin": "^4.28.1", | ||
"@typescript-eslint/parser": "^4.28.1", | ||
"eslint": "^7.29.0", | ||
"eslint-plugin-react": "^7.24.0", | ||
"eslint-plugin-react-hooks": "^4.2.0", | ||
"jest": "^26.6.3", | ||
@@ -23,4 +28,7 @@ "ts-jest": "^26.4.4", | ||
"prepare": "yarn clean && yarn test && yarn build", | ||
"test": "jest" | ||
} | ||
"prepublishOnly": "../../check-clean-hg.sh", | ||
"test": "jest", | ||
"lint": "eslint . --ext .ts,.tsx" | ||
}, | ||
"dependencies": {} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19368
523
10
4
1