@khanacademy/perseus-core
Advanced tools
Comparing version 0.0.0-PR745-20230928001000 to 0.0.0-PR745-20231003214236
# @khanacademy/perseus-core | ||
## 0.0.0-PR745-20230928001000 | ||
## 0.0.0-PR745-20231003214236 | ||
@@ -5,0 +5,0 @@ ### Patch Changes |
@@ -1,19 +0,33 @@ | ||
// This file is processed by a Rollup plugin (replace) to inject the production | ||
// version number during the release build. | ||
// In dev, you'll never see the version number. | ||
import { addLibraryVersionToPerseusDebug as addLibraryVersionToPerseusDebug$1 } from '@khanacademy/perseus-core'; | ||
const libName = "@khanacademy/perseus-core"; | ||
const libVersion = "1.1.0"; // Injected by the build in rollup.config.js; | ||
/** | ||
* Log library version to the console. | ||
* Adds the given perseus library version information to the __perseus_debug__ | ||
* object and ensures that the object is attached to `globalThis` (`window` in | ||
* browser environments). | ||
* | ||
* This allows each library to provide runtime version information to assist in | ||
* debugging in production environments. | ||
*/ | ||
if (globalThis && !globalThis.PERSEUS_SILENCE_LOGGING) { | ||
const addLibraryVersionToPerseusDebug = (libraryName, libraryVersion) => { | ||
let prefix = "v"; | ||
const printString = ` * ${libName} ${prefix}${libVersion} * `; | ||
// eslint-disable-next-line no-console | ||
console.log(`%c${printString}`, "background: #000; color: #fff"); | ||
} | ||
if (libraryVersion === "__lib_version__") { | ||
prefix = ""; | ||
} | ||
const s = `${prefix}${libraryVersion}`; | ||
if (globalThis) { | ||
var _globalThis$__perseus; | ||
globalThis.__perseus_debug__ = (_globalThis$__perseus = globalThis.__perseus_debug__) != null ? _globalThis$__perseus : {}; | ||
globalThis.__perseus_debug__[libraryName] = s; | ||
} else { | ||
// eslint-disable-next-line no-console | ||
console.warn(`globalThis not found found (${s})`); | ||
} | ||
}; | ||
export { libVersion }; | ||
// This file is processed by a Rollup plugin (replace) to inject the production | ||
const libName = "@khanacademy/perseus-core"; | ||
const libVersion = "1.1.0"; | ||
addLibraryVersionToPerseusDebug$1(libName, libVersion); | ||
export { addLibraryVersionToPerseusDebug, libVersion }; | ||
//# sourceMappingURL=index.js.map |
@@ -1,3 +0,4 @@ | ||
export { default as libVersion } from "./version"; | ||
export type { PerseusAnalyticsEvent, AnalyticsEventHandlerFn } from "./analytics"; | ||
export type { KEScore, KeypadContextRendererInterface, RendererInterface, } from "./types"; | ||
export { addLibraryVersionToPerseusDebug } from "./utils/add-library-version-To-perseus-debug"; | ||
export { libVersion } from "./version"; |
@@ -5,20 +5,35 @@ 'use strict'; | ||
// This file is processed by a Rollup plugin (replace) to inject the production | ||
// version number during the release build. | ||
// In dev, you'll never see the version number. | ||
var perseusCore = require('@khanacademy/perseus-core'); | ||
const libName = "@khanacademy/perseus-core"; | ||
const libVersion = "1.1.0"; // Injected by the build in rollup.config.js; | ||
/** | ||
* Log library version to the console. | ||
* Adds the given perseus library version information to the __perseus_debug__ | ||
* object and ensures that the object is attached to `globalThis` (`window` in | ||
* browser environments). | ||
* | ||
* This allows each library to provide runtime version information to assist in | ||
* debugging in production environments. | ||
*/ | ||
if (globalThis && !globalThis.PERSEUS_SILENCE_LOGGING) { | ||
const addLibraryVersionToPerseusDebug = (libraryName, libraryVersion) => { | ||
let prefix = "v"; | ||
const printString = " * ".concat(libName, " ").concat(prefix).concat(libVersion, " * "); | ||
// eslint-disable-next-line no-console | ||
console.log("%c".concat(printString), "background: #000; color: #fff"); | ||
} | ||
if (libraryVersion === "__lib_version__") { | ||
prefix = ""; | ||
} | ||
const s = "".concat(prefix).concat(libraryVersion); | ||
if (globalThis) { | ||
var _globalThis$__perseus; | ||
globalThis.__perseus_debug__ = (_globalThis$__perseus = globalThis.__perseus_debug__) !== null && _globalThis$__perseus !== void 0 ? _globalThis$__perseus : {}; | ||
globalThis.__perseus_debug__[libraryName] = s; | ||
} else { | ||
// eslint-disable-next-line no-console | ||
console.warn("globalThis not found found (".concat(s, ")")); | ||
} | ||
}; | ||
// This file is processed by a Rollup plugin (replace) to inject the production | ||
const libName = "@khanacademy/perseus-core"; | ||
const libVersion = "1.1.0"; | ||
perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion); | ||
exports.addLibraryVersionToPerseusDebug = addLibraryVersionToPerseusDebug; | ||
exports.libVersion = libVersion; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,1 @@ | ||
declare const libVersion = "dev"; | ||
export default libVersion; | ||
export declare const libVersion = "__lib_version__"; |
@@ -6,3 +6,3 @@ { | ||
"license": "MIT", | ||
"version": "0.0.0-PR745-20230928001000", | ||
"version": "0.0.0-PR745-20231003214236", | ||
"publishConfig": { | ||
@@ -9,0 +9,0 @@ "access": "public" |
@@ -1,3 +0,1 @@ | ||
export {default as libVersion} from "./version"; | ||
export type {PerseusAnalyticsEvent, AnalyticsEventHandlerFn} from "./analytics"; | ||
@@ -9,1 +7,6 @@ export type { | ||
} from "./types"; | ||
// Careful, `version.ts` uses this function so it _must_ be imported above it | ||
export {addLibraryVersionToPerseusDebug} from "./utils/add-library-version-To-perseus-debug"; | ||
export {libVersion} from "./version"; |
@@ -5,18 +5,7 @@ // This file is processed by a Rollup plugin (replace) to inject the production | ||
import {addLibraryVersionToPerseusDebug} from "@khanacademy/perseus-core"; | ||
const libName = "@khanacademy/perseus-core"; | ||
const libVersion = "dev"; | ||
export const libVersion = "__lib_version__"; | ||
/** | ||
* Log library version to the console. | ||
*/ | ||
if (globalThis && !globalThis.PERSEUS_SILENCE_LOGGING) { | ||
let prefix = "v"; | ||
if (libVersion === "dev") { | ||
prefix = ""; | ||
} | ||
const printString = ` * ${libName} ${prefix}${libVersion} * `; | ||
// eslint-disable-next-line no-console | ||
console.log(`%c${printString}`, "background: #000; color: #fff"); | ||
} | ||
export default libVersion; | ||
addLibraryVersionToPerseusDebug(libName, libVersion); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
62488
21
274