Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@magicspace/core

Package Overview
Dependencies
Maintainers
5
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@magicspace/core - npm Package Compare versions

Comparing version 0.1.5 to 0.2.0

bld/library/@constants.d.ts

17

bld/library/@utils.d.ts

@@ -1,1 +0,16 @@

export declare function requireDefault<T>(path: string): T;
export declare function unique<T>(values: T[]): T[];
export declare function uniqueBy<T, TKey>(values: T[], keyCallback: (value: T) => TKey): T[];
export declare class SpawnSyncFailure {
readonly stdout: string;
readonly stderr: string;
readonly code: number | null;
constructor(stdout: string, stderr: string, code: number | null);
}
export declare function spawnSync(cwd: string, command: string, args: string[]): string;
/**
* Move directory content without conflict.
*
* @returns `true` if content completely moved, otherwise `false`.
*/
export declare function conservativelyMove(from: string, to: string): boolean;
export declare function getClosetExistingUpperDirectory(path: string): string | undefined;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getClosetExistingUpperDirectory = exports.conservativelyMove = exports.spawnSync = exports.SpawnSyncFailure = exports.uniqueBy = exports.unique = void 0;
const tslib_1 = require("tslib");
function requireDefault(path) {
return tslib_1.__importDefault(require(path)).default;
const ChildProcess = tslib_1.__importStar(require("child_process"));
const Path = tslib_1.__importStar(require("path"));
const FSExtra = tslib_1.__importStar(require("fs-extra"));
function unique(values) {
return Array.from(new Set(values));
}
exports.requireDefault = requireDefault;
exports.unique = unique;
function uniqueBy(values, keyCallback) {
let map = new Map();
for (let value of values) {
let key = keyCallback(value);
if (!map.has(key)) {
map.set(key, value);
}
}
return Array.from(map.values());
}
exports.uniqueBy = uniqueBy;
class SpawnSyncFailure {
constructor(stdout, stderr, code) {
this.stdout = stdout;
this.stderr = stderr;
this.code = code;
}
}
exports.SpawnSyncFailure = SpawnSyncFailure;
function spawnSync(cwd, command, args) {
let { error, status, stdout, stderr } = ChildProcess.spawnSync(command, args, {
cwd,
encoding: 'utf8',
});
if (error) {
throw error;
}
if (status !== 0) {
throw new SpawnSyncFailure(stdout, stderr, status);
}
return stdout;
}
exports.spawnSync = spawnSync;
/**
* Move directory content without conflict.
*
* @returns `true` if content completely moved, otherwise `false`.
*/
function conservativelyMove(from, to) {
if (FSExtra.existsSync(to)) {
if (FSExtra.statSync(to).isDirectory()) {
let names = FSExtra.readdirSync(from);
let completelyMoved = names
.map(name => conservativelyMove(Path.join(from, name), Path.join(to, name)))
.every(result => result);
if (completelyMoved) {
FSExtra.rmdirSync(from);
}
return true;
}
else {
return false;
}
}
else {
FSExtra.moveSync(from, to);
return true;
}
}
exports.conservativelyMove = conservativelyMove;
function getClosetExistingUpperDirectory(path) {
while (!FSExtra.existsSync(path)) {
let upperPath = Path.dirname(path);
if (upperPath === path) {
return undefined;
}
path = upperPath;
}
return path;
}
exports.getClosetExistingUpperDirectory = getClosetExistingUpperDirectory;
//# sourceMappingURL=@utils.js.map

3

bld/library/config/index.d.ts

@@ -1,2 +0,1 @@

export * from './template-bundle-config';
export * from './project-config';
export * as Config from './namespace';
"use strict";
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 (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./template-bundle-config"), exports);
exports.Config = __importStar(require("./namespace"));
//# sourceMappingURL=index.js.map

@@ -0,7 +1,5 @@

export * from './file';
export * from './composables';
export * from './config';
export * from './magicspace-builder';
export * from './template';
export * from './formatter';
export * from './helpers';
export * from './ts-node';
export * from './default-magicspace-builder';
export * from './global';
export * from './project';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./file"), exports);
tslib_1.__exportStar(require("./composables"), exports);
tslib_1.__exportStar(require("./config"), exports);
tslib_1.__exportStar(require("./magicspace-builder"), exports);
tslib_1.__exportStar(require("./template"), exports);
tslib_1.__exportStar(require("./formatter"), exports);
tslib_1.__exportStar(require("./helpers"), exports);
tslib_1.__exportStar(require("./ts-node"), exports);
tslib_1.__exportStar(require("./default-magicspace-builder"), exports);
tslib_1.__exportStar(require("./global"), exports);
tslib_1.__exportStar(require("./project"), exports);
//# sourceMappingURL=index.js.map
{
"name": "@magicspace/core",
"version": "0.1.5",
"version": "0.2.0",
"description": "",

@@ -22,21 +22,17 @@ "author": "Chengdu Mufan Technology Co., Ltd.",

"dependencies": {
"fs-extra": "^8.1.0",
"glob": "^7.1.4",
"handlebars": "^4.1.2",
"lodash": "^4.17.14",
"prettier": "^1.18.2",
"resolve": "^1.11.1",
"sort-keys": "^3.0.0",
"strip-json-comments": "^3.0.1",
"ts-node": "^8.3.0",
"tslang": "^0.1.15",
"tslib": "^1.10.0",
"typescript": "^3.5.3"
"fast-glob": "^3.2.4",
"fs-extra": "^9.0.1",
"handlebars": "^4.7.6",
"module-lens": "^0.1.3",
"prettier": "^2.0.5",
"sort-keys": "^4.0.0",
"tslang": "^0.1.22",
"tslib": "^2.0.1",
"typescript": "^3.9.7"
},
"devDependencies": {
"@magicspace/tslint-rules": "^0.1.46",
"tslint": "^5.20.1",
"tslint-config-prettier": "^1.18.0"
"@types/fs-extra": "^9.0.1",
"@types/prettier": "^2.0.2"
},
"gitHead": "3618066b8e42c6fab0c5babedcd96ef1af0bcca3"
"gitHead": "d13f3b74107a3edfa1491970e6a64f1b531532c3"
}

@@ -1,5 +0,100 @@

import {__importDefault} from 'tslib';
import * as ChildProcess from 'child_process';
import * as Path from 'path';
export function requireDefault<T>(path: string): T {
return __importDefault(require(path)).default;
import * as FSExtra from 'fs-extra';
export function unique<T>(values: T[]): T[] {
return Array.from(new Set(values));
}
export function uniqueBy<T, TKey>(
values: T[],
keyCallback: (value: T) => TKey,
): T[] {
let map = new Map<TKey, T>();
for (let value of values) {
let key = keyCallback(value);
if (!map.has(key)) {
map.set(key, value);
}
}
return Array.from(map.values());
}
export class SpawnSyncFailure {
constructor(
readonly stdout: string,
readonly stderr: string,
readonly code: number | null,
) {}
}
export function spawnSync(
cwd: string,
command: string,
args: string[],
): string {
let {error, status, stdout, stderr} = ChildProcess.spawnSync(command, args, {
cwd,
encoding: 'utf8',
});
if (error) {
throw error;
}
if (status !== 0) {
throw new SpawnSyncFailure(stdout, stderr, status);
}
return stdout;
}
/**
* Move directory content without conflict.
*
* @returns `true` if content completely moved, otherwise `false`.
*/
export function conservativelyMove(from: string, to: string): boolean {
if (FSExtra.existsSync(to)) {
if (FSExtra.statSync(to).isDirectory()) {
let names = FSExtra.readdirSync(from);
let completelyMoved = names
.map(name =>
conservativelyMove(Path.join(from, name), Path.join(to, name)),
)
.every(result => result);
if (completelyMoved) {
FSExtra.rmdirSync(from);
}
return true;
} else {
return false;
}
} else {
FSExtra.moveSync(from, to);
return true;
}
}
export function getClosetExistingUpperDirectory(
path: string,
): string | undefined {
while (!FSExtra.existsSync(path)) {
let upperPath = Path.dirname(path);
if (upperPath === path) {
return undefined;
}
path = upperPath;
}
return path;
}

@@ -1,2 +0,1 @@

export * from './template-bundle-config';
export * from './project-config';
export * as Config from './namespace';

@@ -0,7 +1,5 @@

export * from './file';
export * from './composables';
export * from './config';
export * from './magicspace-builder';
export * from './template';
export * from './formatter';
export * from './helpers';
export * from './ts-node';
export * from './default-magicspace-builder';
export * from './global';
export * from './project';

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc