Socket
Socket
Sign inDemoInstall

ssg-api

Package Overview
Dependencies
Maintainers
1
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ssg-api - npm Package Compare versions

Comparing version 1.5.0 to 1.5.1

.nvmrc

6

CHANGELOG.md

@@ -8,2 +8,8 @@ # Change Log

## [1.5.1] - 2023-10-21
### Fixed
Replaced jest by testscript
## [1.5.0] - 2023-09-16

@@ -10,0 +16,0 @@

8

dist/src/step/CopyStep.d.ts

@@ -1,6 +0,6 @@

import { SsgStep } from "./SsgStep";
import { SsgConfig } from "../Ssg";
import { SsgContext } from "../SsgContext";
import { SsgStep } from './SsgStep';
import { SsgConfig } from '../Ssg';
import { SsgContext } from '../SsgContext';
export type CopyStepResult = {
filesCount: number;
files: string[];
};

@@ -7,0 +7,0 @@ /**

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

import { FileUtil } from "../util";
import { FileUtil } from '../util';
import * as process from 'process';
/**

@@ -9,3 +10,3 @@ * Perform copies to out directory.

this.config = config;
this.name = "copy";
this.name = 'copy';
}

@@ -16,12 +17,12 @@ async execute(context) {

try {
context.log("Copying to", dest, copies);
const files = await FileUtil.ssgCopy(dest, ...copies);
return {
filesCount: files.length
};
context.log('Copying to', dest, copies);
const copiedFiles = await FileUtil.ssgCopy(dest, copies);
const cwd = process.cwd();
const files = copiedFiles.map(file => file.startsWith(cwd) ? file.substring(cwd.length + 1) : file);
return { files };
}
catch (e) {
throw Error(`Could not copy${copies} because of ${e}`);
throw Error(`Could not copy ${copies} because of ${e}`);
}
}
}
/// <reference types="node" />
import { Options } from 'cpy';
export declare class FileUtil {

@@ -9,4 +10,4 @@ static toBufferEncoding(encoding: string | undefined): BufferEncoding | undefined;

static dirNames(dir: string): Promise<string[]>;
static ssgCopy(to: string, ...from: string[]): Promise<string[]>;
static ssgCopy(to: string, from: string[], options?: Options): Promise<string[]>;
static getContentType(html: HTMLElement): BufferEncoding | undefined;
}

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

import * as fs from "fs";
import { promises as fsAsync } from "fs";
import detectCharacterEncoding from "detect-character-encoding";
import path from "path";
import { readdir } from "fs/promises";
import cpy from "cpy";
import * as fs from 'fs';
import { promises as fsAsync } from 'fs';
import detectCharacterEncoding from 'detect-character-encoding';
import path from 'path';
import { readdir } from 'fs/promises';
import cpy from 'cpy';
export class FileUtil {

@@ -63,4 +63,4 @@ static toBufferEncoding(encoding) {

}
static async ssgCopy(to, ...from) {
return cpy(from, to);
static async ssgCopy(to, from, options) {
return cpy(from, to, options);
}

@@ -67,0 +67,0 @@ static getContentType(html) {

@@ -5,3 +5,3 @@ {

"author": "Jérôme Beau <javarome@gmail.com> (https://javarome.com)",
"version": "1.5.0",
"version": "1.5.1",
"description": "Static Site Generation TypeScript API",

@@ -23,3 +23,4 @@ "exports": "./dist/src/index.js",

"prepublishOnly": "npm run build && npm test",
"test": "rm -Rf out && NODE_OPTIONS=--experimental-vm-modules jest --runInBand",
"test": "rm -Rf out && tsx src/test.ts",
"test-one": "rm -Rf out && tsx src/step/DirectoryStepTest.ts",
"test-ci": "rm -Rf out && NODE_OPTIONS=--experimental-vm-modules jest --coverage --runInBand"

@@ -36,8 +37,6 @@ },

"@types/jsdom": "^21.1.3",
"@types/jest": "^29.5.5",
"jest": "^29.7.0",
"ts-jest": "^29.1.1",
"typescript": "^5.2.2",
"uuid": "^9.0.1",
"@babel/plugin-transform-modules-commonjs": "^7.22.15"
"tsx": "3.14.0",
"@javarome/testscript": "^0.4.1"
},

@@ -44,0 +43,0 @@ "keywords": [

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