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

create-evergreen-app

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-evergreen-app - npm Package Compare versions

Comparing version 0.4.0 to 0.4.1

.gitignore

24

package.json
{
"name": "create-evergreen-app",
"version": "0.4.0",
"version": "0.4.1",
"description": "Create an evergreen web application with no build configuration",

@@ -20,2 +20,22 @@ "license": "MIT",

},
"files": [
".browserslistrc",
".editorconfig",
".eslintrc",
".gitignore",
".gitattributes",
"yarn.lock",
"package-lock.json",
"babel.config.js",
"karma-test-shim.js",
"karma.conf.js",
"lws.config.js",
"postcss.config.js",
"README.md",
"webpack.config.common.js",
"webpack.config.develop.js",
"webpack.config.prod.js",
"src/",
"tasks/"
],
"scripts": {

@@ -39,3 +59,2 @@ "build": "rimraf ./public && webpack --config ./webpack.config.prod.js --progress",

"babel-plugin-transform-builtin-classes": "^0.6.1",
"cross-spawn": "^6.0.5",
"css-loader": "^1.0.0",

@@ -48,3 +67,2 @@ "css-to-string-loader": "^0.1.3",

"file-loader": "^2.0.0",
"fs-extra": "^7.0.1",
"html-webpack-plugin": "^3.2.0",

@@ -51,0 +69,0 @@ "istanbul-instrumenter-loader": "^3.0.1",

2

README.md

@@ -41,3 +41,3 @@ # create-evergreen-app

# 1) Create new evergreen app
$ npx -D create-evergreen-app my-app
$ npx create-evergreen-app my-app

@@ -44,0 +44,0 @@ # 2) Change Directory

#!/usr/bin/env node
/* eslint no-console: 0 */
const spawn = require('cross-spawn');
// THIS SCRIPT SHOULD ONLY USE NATIVE NODE.JS APIs, NO PACKAGES FROM NPM ALLOWED
const copyFolder = require('./copy-folder');
const fs = require('fs');
const os = require('os');
const path = require('path');
const fs = require('fs-extra');
const os = require('os');
const { spawn } = require('child_process');

@@ -16,3 +18,3 @@ let TARGET_DIR;

// Check target application directory/name is included in args
// remove directory if present, create new target directory
// warn if directory is present, else create new target directory
const checkTargetDir = async appDir => {

@@ -26,9 +28,13 @@ if (!appDir) {

const targetExists = await fs.pathExists(appDir);
const targetExists = await fs.existsSync(appDir);
if (targetExists) {
// should we warn about this first?
await fs.remove(appDir);
console.error(
`${appDir} already exists, existing project detected? Delete ${appDir} to try again or run from a different directory.`
);
process.exit(1); // eslint-disable-line no-process-exit
}
await fs.ensureDir(appDir);
await fs.mkdirSync(appDir);
return appDir;

@@ -40,3 +46,3 @@ };

return new Promise((resolve, reject) => {
const command = 'npm';
const command = os.platform() === 'win32' ? 'npm.cmd' : 'npm';
const args = ['install', '--save', '--save-exact', '--loglevel', 'error'];

@@ -76,10 +82,9 @@ const child = spawn(command, args, { stdio: 'inherit' });

// Copy template files to target
// Copy root and src files to target directory
const srcInit = async () => {
const copyDirs = [
'src',
const rootFiles = [
'.browserslistrc',
'.editorconfig',
'.eslintrc',
'.gitignore',
// '.gitignore',
'.gitattributes',

@@ -99,15 +104,24 @@ 'yarn.lock',

const sourceFiles = [
'src'
];
return await Promise.all(
copyDirs.map(async directory => {
const initDir = path.join(__dirname, '..', directory);
rootFiles.map(async fileName => {
const resolvedFilePath = path.join(__dirname, '..', fileName);
if (await fs.existsSync(initDir)) {
return await fs.copySync(
initDir,
path.join(TARGET_DIR, directory)
if (await fs.existsSync(resolvedFilePath)) {
return await fs.copyFileSync(
resolvedFilePath,
path.join(TARGET_DIR, fileName)
);
} else {
console.error("Directory doesn't exist! :" + initDir);
console.error(`File doesn't exist! : ${resolvedFilePath}`);
process.exit(1); // eslint-disable-line no-process-exit
}
}),
sourceFiles.map(async directory => {
const resolvedDirectoryPath = path.join(__dirname, '..', directory);
await copyFolder(resolvedDirectoryPath, TARGET_DIR);
})

@@ -114,0 +128,0 @@ );

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