New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

chai-latte

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chai-latte - npm Package Compare versions

Comparing version 0.1.2 to 0.2.0

build/codegen/actions/compileUsingTsNode.d.ts

35

build/cli.js

@@ -5,6 +5,7 @@ #! /usr/bin/env node

const tslib_1 = require("tslib");
const tsnode_1 = require("./codegen/tsnode");
const commander_1 = require("commander");
const chokidar_1 = tslib_1.__importDefault(require("chokidar"));
const fs_1 = tslib_1.__importDefault(require("fs"));
const path_1 = tslib_1.__importDefault(require("path"));
const compileUsingTsNode_1 = require("./codegen/actions/compileUsingTsNode");
const getPkgInfo = () => {

@@ -19,17 +20,23 @@ const pkgjsonPath = path_1.default.resolve(__dirname, '..', 'package.json');

.version(pkgInfo.version)
.option('-i --input <path>', 'input file path')
.option('-i --output <filename>', 'desired generated file name');
.option('-i --input <path>', 'Input file path that should be typed')
.option('-o --output <filename>', 'Desired generated file name')
.option('-w --watch', 'Watch for changes and re-generate typed file');
commander_1.program.parse();
const options = commander_1.program.opts();
const entryFile = options.input || './index';
const outputFileName = options.output ? `${options.output}.ts` : 'generated.ts';
// We need to run the script with ts-node
// to be able to import entry ts file
(0, tsnode_1.tsnode) `
import { generateTypedApiFromPath } from 'chai-latte';
generateTypedApiFromPath({
input: '${entryFile}',
output: '${outputFileName}'
});
`;
const input = options.input || './index';
const output = options.output ? `${options.output}.ts` : 'generated.ts';
const runCompilation = () => {
console.log('Start compiling...');
(0, compileUsingTsNode_1.compileUsingTsNode)({
input,
output,
});
console.log('Done!');
};
runCompilation();
if (options.watch) {
const watchPath = path_1.default.resolve(process.cwd(), input + '.ts');
chokidar_1.default.watch(watchPath)
.on('change', runCompilation);
}
//# sourceMappingURL=cli.js.map

10

examples/fixtures.ts

@@ -17,3 +17,3 @@ import { compile, expression } from 'chai-latte';

return withNarration(() => {
// return new State(stateName, { initial: true });
// return new State(stateName, { initial: true }); aaaaa
});

@@ -30,2 +30,10 @@ }

),
expression(
({ it }) => it.can.be(String),
(stateName: string) => {
return withNarration(() => {
// return new State(stateName);
});
}
),
);
{
"version": "0.1.2",
"version": "0.2.0",
"name": "chai-latte",

@@ -38,2 +38,3 @@ "description": "Build expressive & readable fluent interface libraries.",

"dependencies": {
"chokidar": "^3.5.3",
"commander": "^9.4.0",

@@ -40,0 +41,0 @@ "tslib": "^2.4.0"

#! /usr/bin/env node
import { tsnode } from './codegen/tsnode';
import { program } from 'commander';
import chokidar from 'chokidar';
import fs from 'fs';
import path from 'path';
import { compileUsingTsNode } from './codegen/actions/compileUsingTsNode';

@@ -19,4 +20,5 @@ const getPkgInfo = () => {

.version(pkgInfo.version)
.option('-i --input <path>', 'input file path')
.option('-i --output <filename>', 'desired generated file name');
.option('-i --input <path>', 'Input file path that should be typed')
.option('-o --output <filename>', 'Desired generated file name')
.option('-w --watch', 'Watch for changes and re-generate typed file');

@@ -26,13 +28,23 @@ program.parse();

const options = program.opts();
const entryFile = options.input || './index';
const outputFileName = options.output ? `${options.output}.ts` : 'generated.ts';
// We need to run the script with ts-node
// to be able to import entry ts file
tsnode`
import { generateTypedApiFromPath } from 'chai-latte';
generateTypedApiFromPath({
input: '${entryFile}',
output: '${outputFileName}'
const input = options.input || './index';
const output = options.output ? `${options.output}.ts` : 'generated.ts';
const runCompilation = () => {
console.log('Start compiling...');
compileUsingTsNode({
input,
output,
});
`;
console.log('Done!');
}
runCompilation();
if (options.watch) {
const watchPath = path.resolve(process.cwd(), input + '.ts');
chokidar.watch(watchPath)
.on('change', runCompilation);
}

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