@mokr/core
Advanced tools
Comparing version 0.0.1-alpha.1 to 0.0.1-alpha.2
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; | ||
result["default"] = mod; | ||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.plugins = void 0; | ||
const plugins = __importStar(require("./plugins")); | ||
exports.plugins = plugins; | ||
__export(require("./parts")); | ||
__export(require("./utils")); | ||
__exportStar(require("./parts"), exports); | ||
__exportStar(require("./utils"), exports); | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.GitIgnore = void 0; | ||
const IgnoreFile_1 = require("./IgnoreFile"); | ||
@@ -4,0 +5,0 @@ class GitIgnore extends IgnoreFile_1.IgnoreFile { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.IgnoreFile = void 0; | ||
const TextFile_1 = require("./TextFile"); | ||
@@ -4,0 +5,0 @@ class IgnoreFile extends TextFile_1.TextFile { |
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// Generic functions | ||
__export(require("../utils")); | ||
__exportStar(require("../utils"), exports); | ||
// Core classes | ||
__export(require("./Package")); | ||
__export(require("./Project")); | ||
__export(require("./Workspace")); | ||
__export(require("./TextFile")); | ||
__export(require("./IgnoreFile")); | ||
__export(require("./GitIgnore")); | ||
__export(require("./JsonFile")); | ||
__export(require("./PackageJson")); | ||
__export(require("./TsconfigJson")); | ||
__export(require("./LernaJson")); | ||
__exportStar(require("./Package"), exports); | ||
__exportStar(require("./Project"), exports); | ||
__exportStar(require("./Workspace"), exports); | ||
__exportStar(require("./TextFile"), exports); | ||
__exportStar(require("./IgnoreFile"), exports); | ||
__exportStar(require("./GitIgnore"), exports); | ||
__exportStar(require("./JsonFile"), exports); | ||
__exportStar(require("./PackageJson"), exports); | ||
__exportStar(require("./TsconfigJson"), exports); | ||
__exportStar(require("./LernaJson"), exports); | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.JestConfig = void 0; | ||
const TextFile_1 = require("./TextFile"); | ||
@@ -4,0 +5,0 @@ class JestConfig extends TextFile_1.TextFile { |
@@ -13,2 +13,3 @@ import { TextFile } from './TextFile'; | ||
set contents(object: Schema); | ||
assign(object: Partial<Schema>): void; | ||
} |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.JsonFile = void 0; | ||
const deepmerge_1 = __importDefault(require("deepmerge")); | ||
const TextFile_1 = require("./TextFile"); | ||
@@ -12,3 +17,3 @@ function schemaProxy(object, onChange) { | ||
return result; | ||
} | ||
}, | ||
}); | ||
@@ -25,3 +30,3 @@ } | ||
const object = new this.SchemaClass(JSON.parse(this.text || '{}')); | ||
return schemaProxy(object, object => (this.contents = object)); | ||
return schemaProxy(object, (object) => (this.contents = object)); | ||
} | ||
@@ -31,4 +36,8 @@ set contents(object) { | ||
} | ||
assign(object) { | ||
const base = this.contents; | ||
this.contents = deepmerge_1.default(base, object); | ||
} | ||
} | ||
exports.JsonFile = JsonFile; | ||
//# sourceMappingURL=JsonFile.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.LernaJson = void 0; | ||
const JsonFile_1 = require("./JsonFile"); | ||
@@ -4,0 +5,0 @@ class LernaJsonSchema { |
@@ -12,2 +12,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Package = void 0; | ||
const path = require("path"); | ||
@@ -14,0 +15,0 @@ const utils_1 = require("../utils"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.PackageJson = exports.PackageJsonSchema = void 0; | ||
const JsonFile_1 = require("./JsonFile"); | ||
@@ -4,0 +5,0 @@ class PackageJsonSchema { |
@@ -15,2 +15,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Project = exports.DEFAULT_WORKSPACES_DIRECTORY = exports.DEFAULT_INITIAL_VERSION = exports.DEFAULT_LICENSE = void 0; | ||
const fs_1 = __importDefault(require("fs")); | ||
@@ -17,0 +18,0 @@ const path_1 = __importDefault(require("path")); |
@@ -9,2 +9,3 @@ export declare class TextFile { | ||
set text(contents: string | null); | ||
private createIfNeeded; | ||
} |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const path_1 = __importDefault(require("path")); | ||
const fs_1 = __importDefault(require("fs")); | ||
exports.TextFile = void 0; | ||
const path_1 = require("path"); | ||
const fs_1 = require("fs"); | ||
const mkdirp_1 = require("mkdirp"); | ||
class TextFile { | ||
@@ -12,17 +11,23 @@ constructor(directory, filename) { | ||
this.filename = filename; | ||
this.createIfNeeded(); | ||
} | ||
get path() { | ||
return path_1.default.join(this.directory, this.filename); | ||
return path_1.join(this.directory, this.filename); | ||
} | ||
get exists() { | ||
return fs_1.default.existsSync(this.path); | ||
return fs_1.existsSync(this.path); | ||
} | ||
get text() { | ||
return this.exists ? fs_1.default.readFileSync(this.path, 'utf8').trim() : null; | ||
return this.exists ? fs_1.readFileSync(this.path, 'utf8').trim() : null; | ||
} | ||
set text(contents) { | ||
fs_1.default.writeFileSync(this.path, (contents !== null && contents !== void 0 ? contents : '').trim() + '\n'); | ||
fs_1.writeFileSync(this.path, (contents !== null && contents !== void 0 ? contents : '').trim() + '\n'); | ||
} | ||
createIfNeeded() { | ||
if (!this.exists) { | ||
mkdirp_1.sync(path_1.dirname(this.path)); | ||
} | ||
} | ||
} | ||
exports.TextFile = TextFile; | ||
//# sourceMappingURL=TextFile.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.TsconfigJson = void 0; | ||
const JsonFile_1 = require("./JsonFile"); | ||
@@ -4,0 +5,0 @@ class TsconfigJsonSchema { |
@@ -15,2 +15,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Workspace = void 0; | ||
const fs_1 = __importDefault(require("fs")); | ||
@@ -17,0 +18,0 @@ const path_1 = __importDefault(require("path")); |
@@ -12,2 +12,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.githubActions = void 0; | ||
function githubActions(pkg) { | ||
@@ -14,0 +15,0 @@ return __awaiter(this, void 0, void 0, function* () { }); |
@@ -12,2 +12,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.gitignore = exports.DEFAULT_GITIGNORE = void 0; | ||
exports.DEFAULT_GITIGNORE = ['node_modules/']; | ||
@@ -14,0 +15,0 @@ function gitignore(project, extra = []) { |
@@ -0,1 +1,2 @@ | ||
export * from './file'; | ||
export * from './githubActions'; | ||
@@ -2,0 +3,0 @@ export * from './jest'; |
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(require("./githubActions")); | ||
__export(require("./jest")); | ||
__export(require("./npmPackage")); | ||
__export(require("./readme")); | ||
__export(require("./typescript")); | ||
__export(require("./lerna")); | ||
__export(require("./gitignore")); | ||
__exportStar(require("./file"), exports); | ||
__exportStar(require("./githubActions"), exports); | ||
__exportStar(require("./jest"), exports); | ||
__exportStar(require("./npmPackage"), exports); | ||
__exportStar(require("./readme"), exports); | ||
__exportStar(require("./typescript"), exports); | ||
__exportStar(require("./lerna"), exports); | ||
__exportStar(require("./gitignore"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -12,2 +12,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.jest = void 0; | ||
function jest(pkg) { | ||
@@ -14,0 +15,0 @@ return __awaiter(this, void 0, void 0, function* () { |
@@ -12,2 +12,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.lerna = void 0; | ||
function lerna(project, options = {}) { | ||
@@ -14,0 +15,0 @@ return __awaiter(this, void 0, void 0, function* () { |
@@ -12,16 +12,17 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.npmPackage = void 0; | ||
function npmPackage(pkg, contents) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
if (pkg.isProject()) { | ||
pkg.packageJson.contents = Object.assign({ private: true, scripts: { | ||
pkg.packageJson.assign(Object.assign({ private: true, scripts: { | ||
publish: 'lerna publish', | ||
start: 'lerna run --parallel start', | ||
dev: 'stmux -w always -e ERROR -m beep,system -- [ [ "yarn watch:build" .. "yarn watch:test" ] : -s 1/3 -f "yarn start" ]' | ||
} }, contents); | ||
dev: 'stmux -w always -e ERROR -m beep,system -- [ [ "yarn watch:build" .. "yarn watch:test" ] : -s 1/3 -f "yarn start" ]', | ||
} }, contents)); | ||
} | ||
else if (pkg.isWorkspace()) { | ||
pkg.packageJson.contents = Object.assign({}, contents); | ||
pkg.packageJson.assign(Object.assign({}, contents)); | ||
if (pkg.project.scoped) { | ||
pkg.packageJson.contents.publishConfig = { | ||
access: 'public' | ||
access: 'public', | ||
}; | ||
@@ -28,0 +29,0 @@ } |
@@ -12,2 +12,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.readme = void 0; | ||
const __1 = require(".."); | ||
@@ -14,0 +15,0 @@ function readme(pkg) { |
@@ -12,2 +12,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.typescript = void 0; | ||
function typescript(pkg) { | ||
@@ -14,0 +15,0 @@ return __awaiter(this, void 0, void 0, function* () { |
@@ -12,2 +12,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.assertYarnIsAvailable = void 0; | ||
const exec_1 = require("./exec"); | ||
@@ -14,0 +15,0 @@ const NEEDS_VERSION = 1; |
@@ -12,2 +12,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.asyncForEach = void 0; | ||
function asyncForEach(array, callback) { | ||
@@ -14,0 +15,0 @@ return __awaiter(this, void 0, void 0, function* () { |
@@ -15,2 +15,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.exec = void 0; | ||
const child_process_1 = __importDefault(require("child_process")); | ||
@@ -17,0 +18,0 @@ function childAwaiter(child) { |
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(require("./assertions")); | ||
__export(require("./exec")); | ||
__export(require("./asyncForeach")); | ||
__exportStar(require("./assertions"), exports); | ||
__exportStar(require("./exec"), exports); | ||
__exportStar(require("./asyncForeach"), exports); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@mokr/core", | ||
"version": "0.0.1-alpha.1", | ||
"version": "0.0.1-alpha.2", | ||
"description": "Core Mokr functions", | ||
@@ -20,9 +20,10 @@ "repository": "https://github.com/hongaar/mokr", | ||
"dependencies": { | ||
"deepmerge": "^4.2.2", | ||
"mkdirp": "^1.0.4", | ||
"pkg-up": "3.1.0" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "13.9.0", | ||
"jest": "25.1.0", | ||
"ts-jest": "25.2.0", | ||
"typescript": "3.8.3" | ||
"@types/mkdirp": "^1.0.0", | ||
"@types/node": "13.13.9", | ||
"typescript": "3.9.3" | ||
}, | ||
@@ -32,3 +33,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "ea2f4a28bba5fa9fa3f3288c7f80f05e117b0b47" | ||
"gitHead": "1e7d2a8c9a40bf18b11324155d1369d142ad23b1" | ||
} |
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
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
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
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
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
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
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
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
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
3
4
59031
3
81
1009
2
+ Addeddeepmerge@^4.2.2
+ Addedmkdirp@^1.0.4
+ Addeddeepmerge@4.3.1(transitive)
+ Addedmkdirp@1.0.4(transitive)