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

@area17/a17-generator

Package Overview
Dependencies
Maintainers
4
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@area17/a17-generator - npm Package Compare versions

Comparing version 0.1.16 to 1.0.0

.editorconfig

129

bin/a17_generator.js
#!/usr/bin/env node
'use strict';
const path = require('path');
const fs = require('fs-extra');
const chalk = require('chalk');
const spawn = require('cross-spawn');
const _ = require('lodash');
const readlineSync = require('readline-sync');
import child_process from 'child_process';
import chalk from 'chalk';
import path from 'path';
import readlineSync from 'readline-sync';
const processArgv = _.toArray(process.argv);
const args = processArgv.slice(2);
const appName = args[0];
import libs from '../src/libs.js';
import writePkgJson from '../src/writePkgJson.js';
import applicationOptions from '../src/applicationOptions.js';
import installPackages from '../src/installPackages.js';
import copySetupFiles from '../src/copySetupFiles.js';
import postInstall from '../src/postInstall.js';
import initialiseGit from '../src/initialiseGit.js';
// Main install process
console.log(chalk.green('Start to install'));
const processArgv = [...process.argv];
const args = processArgv.slice(2);
const maxSteps = 5;
const printStep = (str) => {
console.log(chalk.magenta(`\n[${ currentStep++ }/${ maxSteps }] ${ str }`));
};
let currentStep = 1;
let appName = args[0] === undefined ? path.basename(process.cwd()) : args[0];
console.log(`Creating '${appName}' at ${process.cwd()} \n`);
console.clear();
console.log(`
17771 /7A
/77777/ /A7/
/A777777/ A7/
A77A/A777/ 171
A777/ /A77A/ 171
1777/ /777A 17A
17777777777777A /7A
/777A1111111A7771 /7A/
/777A 17771 /77/
A777/ 7777/ A71
`);
console.log(chalk.blue(`[1/3] Create package.json file`));
writePkgJson();
console.log(chalk.blue(`[2/3] Install packages(This might take some time)`));
installPackage();
console.log(chalk.blue(`[3/3] Generate boilerplate files`));
init();
console.log(chalk.green('Finished, enjoy!'));
// End of install process
// Generate package.json file for the project
function writePkgJson() {
if(fs.existsSync(path.join(process.cwd(),'package.json'))) {
let answer = readlineSync.question('Existing package.json is found, continue will overwrite, are you sure?(y/n)');
if(answer !== 'y') {
process.exit();
}
}
const packageJson = {
name: appName,
version: '0.1.0',
private: true,
dependencies: {
'@area17/a17-helpers': '^2.0.2',
},
devDependencies: {
'@area17/a17-boilerplate': '^7.1.3'
},
scripts: {
'init': 'a17-bp init'
},
engines: {
'node': '>= 10.15.0',
'npm': '>= 6.4.1'
}
};
fs.writeFileSync(
path.join(process.cwd(),'package.json'),
JSON.stringify(packageJson, null, 2)
);
console.log(chalk.green('package.json is created'));
printStep('Choose application name');
console.log(chalk.cyan(`\nIs "${ chalk.white(appName) }" your application name?`));
if (readlineSync.keyInSelect(['Yes'], null, { cancel: 'No'}) !== 0) {
appName = readlineSync.question('What is your application name? ', {
defaultInput: appName,
});
}
// Install necessary packages (a17-helpers / a17-scripts)
function installPackage() {
let result = spawn.sync('npm', ['install'], {stdio: 'inherit'});
printStep('First, lets choose application options');
const installOptions = applicationOptions();
if(result.status === 1) {
console.log(chalk.red('Exit with an error'));
process.exit();
} else {
console.log(chalk.green('Packages are successfully installed'));
}
}
console.log(chalk.green(`\nCreating '${ chalk.white(appName) }' at ${process.cwd()}`));
// Initialize files (using a17-script init function)
function init() {
console.log(`Start to initialize project`);
let result = spawn.sync('npm', ['run','init'], {stdio: 'inherit'});
printStep('Create package.json file');
writePkgJson(appName, installOptions);
if(result.status === 1) {
console.log(chalk.red('Exit with an error'));
process.exit();
} else {
console.log(chalk.green('Files are generated'));
}
if (installOptions.git.init) {
printStep('Initialise Git');
initialiseGit(installOptions);
}
printStep('Install packages (This might take some time)');
installPackages(installOptions);
printStep('Copy setup files and folders');
copySetupFiles(installOptions, processArgv, appName);
postInstall(installOptions, appName);
{
"name": "@area17/a17-generator",
"version": "0.1.16",
"description": "The generator of A17 Bolierplate",
"version": "1.0.0",
"description": "A17 Generator is used to quickly install A17 FE libraries",
"author": "A17 <dev@area17.com> (https://area17.com/)",
"license": "MIT",
"type": "module",
"bin": {
"a17-generator": "bin/a17_generator.js"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://code.area17.com/a17/a17-generator"
"url": "https://github.com/area17/a17-generator"
},
"author": "A17 <dev@area17.com> (https://area17.com/)",
"license": "MIT",
"dependencies": {
"chalk": "^2.1.0",
"cross-spawn": "^5.1.0",
"fs-extra": "^4.0.2",
"lodash": "^4.17.4",
"readline-sync": "^1.4.7"
"chalk": "^5.0.1",
"figlet": "^1.5.2",
"fs-extra": "^10.1.0",
"readline-sync": "^1.4.10"
}
}

@@ -1,104 +0,31 @@

#A17 Generator
# A17 Generator
A17 Generator is used to quickly generate an [A17 Boilerplate](https://code.area17.com/a17/fe-boilerplate/tree/master).
A17 Generator is used to quickly install A17 FE libraries. It can:
## Usage
* generate a `package.json` for you,
* initialise Git,
* set up a Webpack build process,
* add helpful dot files,
* set up linting,
* set up a pre-commit hook,
* generate a `frontend` folder structure,
* generate a `README.md`,
* install a pattern library,
**Install A17 Generator globally**
Plus, it has ASCII art.
```shell
$ npm install -g @area17/a17-generator
```
## Usage
**Go to the root of your project**
Firstly, you'll want to `cd` into a project folder if it already exists, or if not:
```shell
$ cd project-root
```
```shell
$ mkdir project-name && cd project-name
```
**Initialize the A17 Boilerplate**
And then run `a17-generator`;
```shell
# @ ~/project-root
$ a17-generator [project-name]
```
```shell
$ npx @area17/a17-generator
```
Now you will have a `frontend` folder, a `package.json` file and all the node modules.
A17 Boilerplate is installed too which can help you to run all your dev tasks through npm script, e.g.:
```shell
npm run build
```
For more details, please refer to [A17 Boilerplate](https://code.area17.com/a17/fe-boilerplate/tree/master).
## Change Log
**0.1.16**
Update to latest version of boilerplate and helpers
**0.1.15**
Update to latest version of boilerplate
**0.1.14**
Update to latest version of boilerplate
**0.1.13**
Update to latest version of boilerplate
**0.1.12**
Update to latest version of boilerplate
**0.1.11**
Update to latest version of boilerplate
**0.1.10**
Update to latest version of node, npm, boilerplate and helpers
**0.1.9**
Readme updates
**0.1.8**
Update to latest version of boilerplate and helpers
**0.1.7**
Update to latest version of boilerplate
**0.1.6**
Update to latest version of boilerplate
**0.1.5**
Update to latest version of boilerplate
**0.1.4**
Publish to npm
**0.1.3**
Make install information more clear
**0.1.2**
Add engines property to package.json
**0.1.1**
Updated default git packages link
**0.1.0**
The birth of A17 Generator
You may be asked to install `a17-generator`. And then `a17-generator` will then ask you a series of questions and then begin installing and setting up as needed.
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