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

code-engine-destination-filesystem

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

code-engine-destination-filesystem - npm Package Compare versions

Comparing version 0.0.10 to 0.0.11

lib/plugin.d.ts

5

lib/clean.d.ts

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

import { Context } from "@code-engine/types";
import { NormalizedConfig } from "./normalize-config";
import { FSPromises } from "./normalize-config";
/**
* Cleans the destination directory by deleting all of its contents.
*/
export declare function clean(config: NormalizedConfig): (context: Context) => Promise<void>;
export declare function clean(dir: string, fs: FSPromises): Promise<void>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const ono_1 = require("ono");
const path_1 = require("path");
const trash = require("trash");

@@ -9,14 +8,10 @@ /**

*/
function clean(config) {
return async (context) => {
// Resolve the output path, relative to the config path and/or the CWD
let dir = path_1.resolve(context.cwd, config.path);
let exists = await directoryExists(dir, config);
if (exists) {
// Move the output directory to the OS trash.
// This is safer than permanently deleting it,
// and allows users to roll-back to previous output if they want.
await trash(dir, { glob: false });
}
};
async function clean(dir, fs) {
let exists = await directoryExists(dir, fs);
if (exists) {
// Move the output directory to the OS trash.
// This is safer than permanently deleting it,
// and allows users to roll-back to previous output if they want.
await trash(dir, { glob: false });
}
}

@@ -28,5 +23,5 @@ exports.clean = clean;

*/
async function directoryExists(dir, config) {
async function directoryExists(dir, fs) {
try {
let stats = await config.fs.promises.stat(dir);
let stats = await fs.promises.stat(dir);
if (stats.isDirectory()) {

@@ -33,0 +28,0 @@ // The directory exists

7

lib/index.d.ts

@@ -1,9 +0,4 @@

import { Plugin } from "@code-engine/types";
import { FileSystemConfig } from "./config";
/**
* A CodeEngine plugin that writes files to the filesystem.
*/
declare function filesystem(conf?: FileSystemConfig): Plugin;
import { filesystem } from "./plugin";
export * from "./config";
export { filesystem };
export default filesystem;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const clean_1 = require("./clean");
const normalize_config_1 = require("./normalize-config");
const process_file_1 = require("./process-file");
/**
* A CodeEngine plugin that writes files to the filesystem.
*/
function filesystem(conf) {
let config = normalize_config_1.normalizeConfig(conf);
return {
name: "Filesystem Destination",
filter: config.filter,
processFile: process_file_1.processFile(config),
clean: clean_1.clean(config),
};
}
exports.filesystem = filesystem;
const plugin_1 = require("./plugin");
exports.filesystem = plugin_1.filesystem;
// Export `filesystem` as the default export
// tslint:disable: no-default-export
exports.default = filesystem;
exports.default = plugin_1.filesystem;
// CommonJS default export hack

@@ -23,0 +9,0 @@ if (typeof module === "object" && typeof module.exports === "object") {

{
"name": "code-engine-destination-filesystem",
"version": "0.0.10",
"version": "0.0.11",
"description": "A CodeEngine plugin that reads files from the filesystem",

@@ -45,7 +45,7 @@ "keywords": [

"devDependencies": {
"@code-engine/lib": "0.0.16",
"@code-engine/types": "0.0.12",
"@code-engine/lib": "0.0.17",
"@code-engine/types": "0.0.13",
"@types/chai": "^4.2.7",
"@types/mocha": "^5.2.7",
"@types/node": "^13.1.6",
"@types/node": "^13.1.7",
"chai": "^4.2.0",

@@ -60,3 +60,3 @@ "chai-fs": "^2.0.0",

"shx": "^0.3.2",
"sinon": "^8.0.4",
"sinon": "^8.1.0",
"source-map-support": "^0.5.16",

@@ -66,3 +66,3 @@ "tmp": "^0.1.0",

"tslint-modular": "^1.4.1",
"typescript": "^3.7.4",
"typescript": "^3.7.5",
"typescript-tslint-plugin": "^0.5.5",

@@ -69,0 +69,0 @@ "version-bump-prompt": "^5.0.7"

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