@ewizardjs/system-settings
Advanced tools
Comparing version 3.12.3 to 3.13.0
@@ -43,5 +43,6 @@ "use strict"; | ||
exports.ensureDefaultsForReferences = exports.getDefaultSettings = void 0; | ||
var content_types_1 = require("@ewizardjs/content-types"); | ||
var dot_prop_1 = __importDefault(require("dot-prop")); | ||
var lodash_merge_1 = __importDefault(require("lodash.merge")); | ||
var defaults_1 = require("../defaults"); | ||
var dot_prop_1 = __importDefault(require("dot-prop")); | ||
function getDefaultSettings(entry, contextStorage) { | ||
@@ -67,3 +68,3 @@ return __awaiter(this, void 0, void 0, function () { | ||
var content = { | ||
type: 'survey', | ||
type: content_types_1.ContentTypes.SURVEY, | ||
subtype: '', | ||
@@ -83,3 +84,3 @@ }; | ||
content = { | ||
type: 'email', | ||
type: content_types_1.ContentTypes.EMAIL, | ||
subtype: '', | ||
@@ -162,3 +163,3 @@ }; | ||
content: { | ||
type: 'email', | ||
type: content_types_1.ContentTypes.EMAIL, | ||
subtype: contentType, | ||
@@ -165,0 +166,0 @@ }, |
@@ -6,2 +6,2 @@ /// <reference types="node" /> | ||
export declare function assignDefaultSettings(entry: string | Buffer, settings: any, storageStrategy: Strategy): Promise<SystemSettings>; | ||
export declare function getJson(path: string, entry: string | Buffer, storageStrategy: Strategy): Promise<SystemSettings | {}>; | ||
export declare function getJson(path: string, entry: string | Buffer, storageStrategy: Strategy): Promise<SystemSettings | Record<string, never>>; |
@@ -43,6 +43,6 @@ "use strict"; | ||
exports.getJson = exports.assignDefaultSettings = exports.getSettings = void 0; | ||
var node_path_1 = require("node:path"); | ||
var alias_resolver_1 = require("@ewizardjs/alias-resolver"); | ||
var content_types_1 = require("@ewizardjs/content-types"); | ||
var lodash_merge_1 = __importDefault(require("lodash.merge")); | ||
var path_1 = require("path"); | ||
var defaults_1 = require("./defaults"); | ||
@@ -83,6 +83,6 @@ function getSettings(settingsPath, entry, storageStrategy) { | ||
if (!settings.path.blocksManifest) { | ||
settings.path.blocksManifest = (0, path_1.resolve)(settings.path.blocks, settings.path.blocksFilename); | ||
settings.path.blocksManifest = (0, node_path_1.resolve)(settings.path.blocks, settings.path.blocksFilename); | ||
} | ||
if (!settings.path.modulesManifest) { | ||
settings.path.modulesManifest = (0, path_1.resolve)(settings.path.blocks, settings.path.modulesFilename); | ||
settings.path.modulesManifest = (0, node_path_1.resolve)(settings.path.blocks, settings.path.modulesFilename); | ||
} | ||
@@ -89,0 +89,0 @@ return settings; |
@@ -67,10 +67,4 @@ "use strict"; | ||
if (storageStrategy === void 0) { storageStrategy = settings_strategies_1.fsStrategy; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
var settingsPath, settingsPromise; | ||
return __generator(this, function (_a) { | ||
settingsPath = storageStrategy.resolve(entry, defaults_1.EWIZARD_SETTINGS_FILE); | ||
settingsPromise = (0, get_settings_1.getSettings)(settingsPath, entry, storageStrategy); | ||
return [2, settingsPromise]; | ||
}); | ||
}); | ||
var settingsPath = storageStrategy.resolve(entry, defaults_1.EWIZARD_SETTINGS_FILE); | ||
return (0, get_settings_1.getSettings)(settingsPath, entry, storageStrategy); | ||
} | ||
@@ -77,0 +71,0 @@ exports.get = get; |
@@ -5,2 +5,3 @@ "use strict"; | ||
exports.EWIZARD_SETTINGS_FILE = '.ewizard/settings.json'; | ||
var DEFAULT_THUMBNAIL_PATH = 'media/images/thumb.jpg'; | ||
function getDefaultScreenshoter() { | ||
@@ -34,2 +35,3 @@ return { | ||
slides: 'slides', | ||
banners: 'banners', | ||
themes: 'themes', | ||
@@ -55,3 +57,3 @@ themePaths: { | ||
component: 'index.vue', | ||
thumbnail: 'media/images/thumb.jpg', | ||
thumbnail: DEFAULT_THUMBNAIL_PATH, | ||
screenshot: 'media/images/screenshot.jpg', | ||
@@ -81,4 +83,7 @@ }, | ||
page: { | ||
thumbnail: 'media/images/thumb.jpg', | ||
thumbnail: DEFAULT_THUMBNAIL_PATH, | ||
}, | ||
banner: { | ||
thumbnail: DEFAULT_THUMBNAIL_PATH, | ||
}, | ||
favicon: 'favicon.ico', | ||
@@ -85,0 +90,0 @@ }; |
@@ -0,1 +1,2 @@ | ||
import { ContentTypes, SiteSubtypes } from '@ewizardjs/content-types'; | ||
export interface SystemSettings { | ||
@@ -14,6 +15,7 @@ [key: string]: ContentType | Paths | Screenshoter | Archive | VCS | CLI; | ||
} | undefined; | ||
type ContentSubtypes = Exclude<ContentTypes, ContentTypes.BRIEF | ContentTypes.COMPONENT | ContentTypes.BLOCK | ContentTypes.MODULE> | SiteSubtypes | string; | ||
export interface ContentType { | ||
[key: string]: string | boolean | undefined; | ||
type: 'email' | 'survey' | 'edetailer' | 'brief' | 'messenger_ad' | string; | ||
subtype: string; | ||
type: ContentTypes | string; | ||
subtype: ContentSubtypes; | ||
brief?: boolean; | ||
@@ -37,2 +39,3 @@ } | ||
slides: string; | ||
banners: string; | ||
themes: string; | ||
@@ -42,3 +45,5 @@ themesManifest: string; | ||
settings: string; | ||
structure: string; | ||
slide: SlidePaths; | ||
banner: ContentEntityPaths; | ||
common: CommonPaths; | ||
@@ -59,10 +64,10 @@ assets: string; | ||
} | ||
export interface SlidePaths { | ||
export type ContentEntityPaths = { | ||
[key: string]: string; | ||
thumbnail: string; | ||
}; | ||
export interface SlidePaths extends ContentEntityPaths { | ||
screenshot: string; | ||
} | ||
export interface PagePaths { | ||
[key: string]: string; | ||
thumbnail: string; | ||
export interface PagePaths extends ContentEntityPaths { | ||
} | ||
@@ -69,0 +74,0 @@ export interface CommonPaths { |
@@ -8,2 +8,2 @@ "use strict"; | ||
NpmVersion["Latest"] = "latest"; | ||
})(NpmVersion = exports.NpmVersion || (exports.NpmVersion = {})); | ||
})(NpmVersion || (exports.NpmVersion = NpmVersion = {})); |
{ | ||
"name": "@ewizardjs/system-settings", | ||
"version": "3.12.3", | ||
"version": "3.13.0", | ||
"description": "", | ||
@@ -8,3 +8,3 @@ "main": "dist/backend/index.js", | ||
"scripts": { | ||
"build": "tsc", | ||
"build": "npm run lint && tsc", | ||
"dev": "tsc -w", | ||
@@ -14,3 +14,4 @@ "test": "jest --ci --coverage", | ||
"test:unit": "jest --ci test/unit --coverage", | ||
"snapshot:update": "jest --updateSnapshot" | ||
"snapshot:update": "jest --updateSnapshot", | ||
"lint": "eslint ." | ||
}, | ||
@@ -25,3 +26,3 @@ "repository": { | ||
"@ewizardjs/alias-resolver": "^1.1.3", | ||
"@ewizardjs/content-types": "^2.0.2", | ||
"@ewizardjs/content-types": "^2.2.0", | ||
"@ewizardjs/settings-strategies": "^1.2.2", | ||
@@ -32,13 +33,12 @@ "dot-prop": "^6.0.1", | ||
"devDependencies": { | ||
"@ewizardjs/eslint-config": "^0.0.1", | ||
"@ewizardjs/upath": "^3.0.0", | ||
"@types/jest": "^29.5.0", | ||
"@types/jest": "^29.5.10", | ||
"@types/lodash.merge": "^4.6.6", | ||
"@types/mock-fs": "^4.13.1", | ||
"jest": "^29.5.0", | ||
"jest": "^29.7.0", | ||
"jest-extended": "^1.1.0", | ||
"mock-fs": "^5.1.2", | ||
"ts-jest": "^29.1.0", | ||
"tslint-config-airbnb": "^5.11.2", | ||
"typescript": "^5.0.4" | ||
"memfs": "^3.5.3", | ||
"ts-jest": "^29.1.1", | ||
"typescript": "^5.2.2" | ||
} | ||
} |
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
31147
9
15
662