@resoc/create-img
Advanced tools
Comparing version 0.2.13 to 0.3.0
@@ -1,4 +0,4 @@ | ||
import { ImageTemplate, ParamValues } from '@resoc/core'; | ||
export declare const compileLocalTemplate: (templateManifestPath: string, paramValues: ParamValues, imagePath: string) => Promise<void>; | ||
export declare const compileTemplate: (template: ImageTemplate, paramValues: ParamValues, imagePath: string, resourcePath?: string | undefined) => Promise<void>; | ||
import { ImageTemplate, ImageResolution, ParamValues } from '@resoc/core'; | ||
export declare const compileLocalTemplate: (templateManifestPath: string, paramValues: ParamValues, resolution: ImageResolution, imagePath: string) => Promise<void>; | ||
export declare const compileTemplate: (template: ImageTemplate, paramValues: ParamValues, resolution: ImageResolution, imagePath: string, resourcePath?: string | undefined) => Promise<void>; | ||
export declare const urlToImage: (url: string, outputPath: string) => Promise<void>; |
@@ -140,3 +140,3 @@ import { renderTemplateToHtml } from '@resoc/core'; | ||
var compileLocalTemplate = function (templateManifestPath, paramValues, imagePath) { return __awaiter(void 0, void 0, void 0, function () { | ||
var compileLocalTemplate = function (templateManifestPath, paramValues, resolution, imagePath) { return __awaiter(void 0, void 0, void 0, function () { | ||
var template; | ||
@@ -148,7 +148,7 @@ return __generator(this, function (_a) { | ||
template = _a.sent(); | ||
return [2 /*return*/, compileTemplate(template, paramValues, imagePath, path.resolve(path.dirname(templateManifestPath)))]; | ||
return [2 /*return*/, compileTemplate(template, paramValues, resolution, imagePath, path.resolve(path.dirname(templateManifestPath)))]; | ||
} | ||
}); | ||
}); }; | ||
var compileTemplate = function (template, paramValues, imagePath, resourcePath) { return __awaiter(void 0, void 0, void 0, function () { | ||
var compileTemplate = function (template, paramValues, resolution, imagePath, resourcePath) { return __awaiter(void 0, void 0, void 0, function () { | ||
var html, tmpDir, htmlPath; | ||
@@ -158,3 +158,3 @@ return __generator(this, function (_a) { | ||
case 0: | ||
html = renderTemplateToHtml(template, paramValues); | ||
html = renderTemplateToHtml(template, paramValues, resolution); | ||
return [4 /*yield*/, fs.mkdtemp(path.join(os.tmpdir(), 'resoc-compile-'))]; | ||
@@ -161,0 +161,0 @@ case 1: |
@@ -152,3 +152,3 @@ 'use strict'; | ||
var compileLocalTemplate = function (templateManifestPath, paramValues, imagePath) { return __awaiter(void 0, void 0, void 0, function () { | ||
var compileLocalTemplate = function (templateManifestPath, paramValues, resolution, imagePath) { return __awaiter(void 0, void 0, void 0, function () { | ||
var template; | ||
@@ -160,7 +160,7 @@ return __generator(this, function (_a) { | ||
template = _a.sent(); | ||
return [2 /*return*/, compileTemplate(template, paramValues, imagePath, path__default['default'].resolve(path__default['default'].dirname(templateManifestPath)))]; | ||
return [2 /*return*/, compileTemplate(template, paramValues, resolution, imagePath, path__default['default'].resolve(path__default['default'].dirname(templateManifestPath)))]; | ||
} | ||
}); | ||
}); }; | ||
var compileTemplate = function (template, paramValues, imagePath, resourcePath) { return __awaiter(void 0, void 0, void 0, function () { | ||
var compileTemplate = function (template, paramValues, resolution, imagePath, resourcePath) { return __awaiter(void 0, void 0, void 0, function () { | ||
var html, tmpDir, htmlPath; | ||
@@ -170,3 +170,3 @@ return __generator(this, function (_a) { | ||
case 0: | ||
html = core.renderTemplateToHtml(template, paramValues); | ||
html = core.renderTemplateToHtml(template, paramValues, resolution); | ||
return [4 /*yield*/, fs__default['default'].mkdtemp(path__default['default'].join(os__default['default'].tmpdir(), 'resoc-compile-'))]; | ||
@@ -173,0 +173,0 @@ case 1: |
{ | ||
"name": "@resoc/create-img", | ||
"version": "0.2.13", | ||
"version": "0.3.0", | ||
"description": "Create an image based on a Resoc image template", | ||
@@ -29,3 +29,3 @@ "main": "build/index.js", | ||
"dependencies": { | ||
"@resoc/core": "^0.2.12", | ||
"@resoc/core": "^0.3.0", | ||
"commander": "^8.1.0", | ||
@@ -53,3 +53,3 @@ "puppeteer": "^10.2.0", | ||
}, | ||
"gitHead": "8c8ede9fcf27983f3c61cc371164ec03f97de9e9" | ||
"gitHead": "e7a11a17f5baa8e9b99c40aa2d1bdb42ab9455d2" | ||
} |
@@ -1,2 +0,2 @@ | ||
import { ImageTemplate, loadRemoteTemplate, ParamValues, renderTemplateToHtml } from '@resoc/core' | ||
import { ImageTemplate, ImageResolution, loadRemoteTemplate, ParamValues, renderTemplateToHtml } from '@resoc/core' | ||
import puppeteer from 'puppeteer' | ||
@@ -9,3 +9,3 @@ import fs from 'fs/promises' | ||
export const compileLocalTemplate = async (templateManifestPath: string, paramValues: ParamValues, imagePath: string): Promise<void> => { | ||
export const compileLocalTemplate = async (templateManifestPath: string, paramValues: ParamValues, resolution: ImageResolution, imagePath: string): Promise<void> => { | ||
const template = await loadLocalTemplate(templateManifestPath); | ||
@@ -16,2 +16,3 @@ | ||
paramValues, | ||
resolution, | ||
imagePath, | ||
@@ -22,4 +23,4 @@ path.resolve(path.dirname(templateManifestPath)) | ||
export const compileTemplate = async (template: ImageTemplate, paramValues: ParamValues, imagePath: string, resourcePath?: string): Promise<void> => { | ||
const html = renderTemplateToHtml(template, paramValues); | ||
export const compileTemplate = async (template: ImageTemplate, paramValues: ParamValues, resolution: ImageResolution, imagePath: string, resourcePath?: string): Promise<void> => { | ||
const html = renderTemplateToHtml(template, paramValues, resolution); | ||
@@ -26,0 +27,0 @@ const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), 'resoc-compile-')); |
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
41520
590
+ Added@resoc/core@0.3.0(transitive)
- Removed@resoc/core@0.2.12(transitive)
Updated@resoc/core@^0.3.0