feat: Add Be and tbd skill, also added Roadmap file

This commit is contained in:
2026-05-10 16:32:12 -04:00
parent 3500ade13f
commit 0bb8885802
29587 changed files with 10611695 additions and 0 deletions

View File

View File

@@ -0,0 +1,59 @@
export interface SemVer {
semver: string;
version: string;
major: number;
minor: number;
patch: number;
release?: string;
}
export declare class Version {
name: string;
semver: SemVer;
major: number;
minor: number;
patch: number;
constructor(name: string, semverString: string);
static semverParse(input: string): SemVer;
/**
* Checks to see if we fully match another version
* @param {Version} other
* @returns {boolean}
*/
majorMinorPatchMatch(other: Version): boolean;
/**
* Checks to see if we match another version on major and minor
* @param {Version} other
* @returns {boolean}
*/
majorMinorMatch(other: Version): boolean;
/**
* Checks to see if we match another version on major, minor, and patch
* @param {Version} other
* @returns {boolean}
*/
exactMatch(other: Version): boolean;
toString(): string;
}
export default class Singleton {
/**
* Returns the root directory of the current module
* @param {NodeModule} module
* @returns {string}
*/
static getProjectRoot(module: NodeModule): string;
/**
* Reads version information from a package.json
* @param {NodeModule} module The node module object for the project we
* want to make into a singleton
* @returns {Version}
*/
static readVersion(module: NodeModule): Version;
/**
* Get's or creates the singleton class we want
* @param {NodeModule} module The module of the project we want to make
* into a singleton
* @param {Function} creator A function that returns a new instance of
* the class we want to make into a singleton
*/
static getOrCreateSingleton(module: NodeModule, creator: () => any): any;
}

View File

@@ -0,0 +1,3 @@
module.exports = require("./main");
//# sourceMappingURL=map/index.js.map

View File

@@ -0,0 +1,138 @@
/**
* @fileOverview
*
* Created on 3/7/16.
* @author Siggi Orn <siggi@jibo.com>
*/
"use strict";
var path = require('path');
var findRoot = require('find-root');
var semverUtils = require('semver-utils');
var Version = (function () {
function Version(name, semverString) {
this.name = name;
this.semver = Version.semverParse(semverString);
this.major = this.semver.major;
this.minor = this.semver.minor;
this.patch = this.semver.patch;
}
Version.semverParse = function (input) {
var parse = semverUtils.parse(input);
return {
semver: parse.semver,
version: parse.version,
major: parseInt(parse.major),
minor: parseInt(parse.minor),
patch: parseInt(parse.patch),
release: parse.release
};
};
/**
* Checks to see if we fully match another version
* @param {Version} other
* @returns {boolean}
*/
Version.prototype.majorMinorPatchMatch = function (other) {
return other.major === this.major &&
other.minor === this.minor &&
other.patch === this.patch;
};
/**
* Checks to see if we match another version on major and minor
* @param {Version} other
* @returns {boolean}
*/
Version.prototype.majorMinorMatch = function (other) {
return other.major === this.major &&
other.minor === this.minor;
};
/**
* Checks to see if we match another version on major, minor, and patch
* @param {Version} other
* @returns {boolean}
*/
Version.prototype.exactMatch = function (other) {
if (other.semver) {
return other.semver.semver === this.semver.semver;
}
else {
return this.majorMinorPatchMatch(other);
}
};
Version.prototype.toString = function () {
return this.name + '@' + this.semver.semver;
};
return Version;
}());
exports.Version = Version;
var Container = (function () {
function Container(object, version) {
this.object = object;
this.version = version;
}
return Container;
}());
var Singleton = (function () {
function Singleton() {
}
/**
* Returns the root directory of the current module
* @param {NodeModule} module
* @returns {string}
*/
Singleton.getProjectRoot = function (module) {
return findRoot(module.filename);
};
/**
* Reads version information from a package.json
* @param {NodeModule} module The node module object for the project we
* want to make into a singleton
* @returns {Version}
*/
Singleton.readVersion = function (module) {
var root = Singleton.getProjectRoot(module);
var packagePath = path.join(root, 'package.json');
var versionString = require(packagePath).version;
var nameString = require(packagePath).name;
return new Version(nameString, versionString);
};
/**
* Get's or creates the singleton class we want
* @param {NodeModule} module The module of the project we want to make
* into a singleton
* @param {Function} creator A function that returns a new instance of
* the class we want to make into a singleton
*/
Singleton.getOrCreateSingleton = function (module, creator) {
var incomingVersion = Singleton.readVersion(module);
var container = singletons.get(incomingVersion.name);
if (!container) {
container = new Container(creator(), incomingVersion);
container.object.__singletonVersion = incomingVersion;
singletons.set(incomingVersion.name, container);
}
else if (!incomingVersion.majorMinorMatch(container.version)) {
throw new Error("Incompatible versions: " +
("Incoming = '" + incomingVersion + "', existing= ") +
("" + container.version));
}
else if (!incomingVersion.exactMatch(container.version)) {
console.warn("Patch difference in requested and loaded " +
("singletons. Loaded: '" + container.version + "', requested: ") +
("'" + incomingVersion + "'"));
}
return container.object;
};
return Singleton;
}());
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = Singleton;
/**
* This is where we store all the singletons
*/
if (!global['singletons4543']) {
global['singletons4543'] = new Map();
}
var singletons = global['singletons4543'];
//# sourceMappingURL=../map/main/index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC","file":"index.js","sourcesContent":["module.exports = require(\"./main\");"],"sourceRoot":"/source/"}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
{"version":3,"sources":["test/index.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,qBAAuB,MAAM,CAAC,CAAA;AAC9B,IAAY,IAAI,WAAM,MAAM,CAAC,CAAA;AAC7B,IAAI,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAEpC,qBAAsB,SAAS,CAAC,CAAA;AAEhC,QAAQ,CAAC,KAAK,EAAE;IAEZ,EAAE,CAAC,SAAS,EAAE;QACV,IAAI,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACrC,IAAI,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;QACjD,IAAI,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;QAC5B,IAAI,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;QACvC,IAAI,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC5B,aAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,aAAa,EAAE;QACd,IAAI,OAAO,GAAG,cAAS,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAC5C,aAAM,CAAC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC/C,aAAM,CAAC,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACvD,aAAM,CAAC,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACvD,aAAM,CAAC,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sBAAsB,EAAE;QACvB,IAAI,UAAU,GAAG,cAAS,CAAC,oBAAoB,CAAC,MAAM,EAAE;YACpD,MAAM,CAAC,EAAC,CAAC,EAAE,MAAM,EAAC,CAAC;QACvB,CAAC,CAAC,CAAC;QACH,IAAI,UAAU,GAAG,cAAS,CAAC,oBAAoB,CAAC,MAAM,EAAE;YACpD,MAAM,CAAC,EAAC,CAAC,EAAE,MAAM,EAAC,CAAC;QACvB,CAAC,CAAC,CAAC;QACH,aAAM,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC;QAC/C,aAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACtC,aAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACtC,aAAM,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","file":"test/index.js","sourcesContent":["/**\n * Created by siggi on 2/29/16.\n */\n\nimport { expect } from 'chai';\nimport * as path from 'path';\nlet findRoot = require('find-root');\n\nimport Singleton from '../main';\n\ndescribe('All', () => {\n\n it('loadLib', () => {\n let root = findRoot(module.filename);\n let packageStr = path.join(root, 'package.json');\n let p = require(packageStr);\n let appEntry = path.join(root, p.main);\n let lib = require(appEntry);\n expect(lib.Version).to.exist;\n });\n\n it('readVersion', () => {\n let version = Singleton.readVersion(module);\n expect(typeof version.name).to.equal('string');\n expect(typeof version.semver.major).to.equal('number');\n expect(typeof version.semver.minor).to.equal('number');\n expect(typeof version.semver.patch).to.equal('number');\n });\n\n it('getOrCreateSingleton', () => {\n let singleton1 = Singleton.getOrCreateSingleton(module, () => {\n return {a: 'bla1'};\n });\n let singleton2 = Singleton.getOrCreateSingleton(module, () => {\n return {a: 'bla2'};\n });\n expect(singleton2.__singletonVersion).to.exist;\n expect(singleton1.a).to.equal('bla1');\n expect(singleton2.a).to.equal('bla1');\n expect(singleton1).to.equal(singleton2);\n });\n});\n"],"sourceRoot":"/source/"}