Skip to content

Commit

Permalink
Watermelon (#12)
Browse files Browse the repository at this point in the history
* v2.4 | Initial

* Tweaked Templates
Changed folder structure to align with the new template-copying method

* Minor tweaks
  • Loading branch information
iTzSharkSV authored Feb 14, 2022
1 parent f136ed9 commit f2ede87
Show file tree
Hide file tree
Showing 36 changed files with 149 additions and 974 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
```diff
- Bug fix
- New feature
- Breaking change (fix or feature that would cause existing functionality to change)
- Updated docs
- Breaking change (fix or feature that would cause existing functionality to change)
```

## Qualification checks
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ Dist
# VSCode related files #
##########
.vscode

# Tests Target Files #
##########
Tests/Target
2 changes: 1 addition & 1 deletion .husky/pre-publish
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run prepublish
npm run precommit
2 changes: 1 addition & 1 deletion Bin/Hyper
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
* @author SharkSV <https://github.com/iTzSharkSV>
*/

require('../Cli');
require('../Cli/Lib');
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM node:latest

COPY . .

RUN npm install
RUN npm run build

CMD node ./Bin/Hyper
2 changes: 1 addition & 1 deletion Lib/Tasks/Copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ async function copyTemplateFiles(
// prettier-ignore
const templateDir: string = join(
__dirname,
'../../Templates',
'../../../Templates',
Template
);

Expand Down
31 changes: 27 additions & 4 deletions Lib/Tasks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,22 @@ async function Init(options: Answers): Promise<void> {
[
{
title: 'Copy project files',
task: () => copyTemplateFiles(projTemplate, overWriteFiles)
task: () => {
const Jumpstart = () => {
copyTemplateFiles('Jumpstart', overWriteFiles);
};

switch (projTemplate) {
case 'Node':
case 'Rust':
case 'Static':
Jumpstart();
copyTemplateFiles(projTemplate, overWriteFiles);
break;
default:
Jumpstart();
}
}
},
{
title: 'Setting up License',
Expand All @@ -44,7 +59,11 @@ async function Init(options: Answers): Promise<void> {
},
{
title: 'Install dependencies',
task: () => iDependencies(pkgManager),
task: () => {
projTemplate == 'Node'
? iDependencies(pkgManager)
: 'Installing dependencies only available for $Node projects';
},
skip: () =>
!flags.install && projTemplate == 'Node'
? 'Pass -i to automatically install dependencies'
Expand All @@ -56,13 +75,17 @@ async function Init(options: Answers): Promise<void> {
}
);

const Run = async () => {
await Tasks.run();
};

switch (confirm) {
case 'yes':
await Tasks.run();
Run();
break;
case 'overwrite':
overWriteFiles = true;
await Tasks.run();
Run();
break;
case 'change':
Print('Warning', "Couldn't change project dir (Coming soon!)");
Expand Down
11 changes: 5 additions & 6 deletions Lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,21 @@ import Inquire from './Inquire';
import Info from './Modules/Info';
import Print from './Modules/Print';
import listTemplates from './Tasks/List';
import * as pkg from '../package.json';
import * as updateNotifier from 'update-notifier';

(async (): Promise<void> => {
const { version } = pkg;
const ver = version.substring(0, version.length - 2);

Info({
title: 'Hyper',
tagLine: 'by @Shorky',
description: 'A Cli to bootstrap new projects',
version: '2.3',
version: ver,
clear: true
});

const pkg = {
name: '@sharksv/hyper',
version: '2.3.0'
};

updateNotifier({
pkg,
updateCheckInterval: 0
Expand Down
100 changes: 50 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,57 +4,9 @@ A CLI to bootstrap new projects!

Generate an Advanced Project Template in seconds.

## Prerequisites

[Node.js](https://nodejs.org/en/) and npm are required as a peer dependency.

## Installing

### From [`npmjs.com`](https://npmjs.com/package/@sharksv/hyper)

```bash
npm install -g @sharksv/hyper
# or
yarn global add @sharksv/hyper
```

### Compile from source

```bash
$ git clone https://github.com/iTzSharkSV/Hyper.git
$ cd Hyper
$ npm install # to install project dependencies
$ npm run build # to compile the project
$ npm i -g . # to add it as a global variable
```

## Usage/Examples

```bash
$ hyper help

Hyper v2.3 by Shorky
A CLI to bootstrap new projects!

USAGE:
$ hyper <commands> [options]

COMMANDS:
help Prints usage-help info
init Initialize a new project
ls List available templates

OPTIONS:
-c, --clear Clear Terminal (on by Default)
-v, --version Prints CLI version
-y, --default Roll with default selection
-y, --install Install project dependencies
-r, --rainbow I wonder?!
```

## Available Templates

```bash
```Txt
$ hyper ls
---------------------------------------------------------
LANGUAGE Size(kb) NAME
Expand Down Expand Up @@ -99,9 +51,57 @@ Java - Java-Proj (Coming soon)
└─ LICENSE
```

## Prerequisites

[Node.js](https://nodejs.org/en/) and npm are required as a peer dependency.

## Installing

### From [`npmjs.com`](https://npmjs.com/package/@sharksv/hyper)

```bash
npm install -g @sharksv/hyper
# or
yarn global add @sharksv/hyper
```

### Compile from source

```Txt
$ git clone https://github.com/iTzSharkSV/Hyper.git
$ cd Hyper
$ npm install # to install project dependencies
$ npm run build # to compile the project
$ npm i -g . # to add it as a global variable
```

## Usage/Examples

```Txt
$ hyper help
Hyper v2.3 by Shorky
A CLI to bootstrap new projects!
USAGE:
$ hyper <commands> [options]
COMMANDS:
help Prints usage-help info
init Initialize a new project
ls List available templates
OPTIONS:
-c, --clear Clear Terminal (on by Default)
-v, --version Prints CLI version
-y, --default Roll with default selection
-y, --install Install project dependencies
-r, --rainbow I wonder?!
```

## License

```text
```Txt
#
# Copyright 2021 - SharkSV
# License Identifier: MIT
Expand Down
12 changes: 0 additions & 12 deletions Templates/Node/.github/Funding.yml

This file was deleted.

30 changes: 0 additions & 30 deletions Templates/Node/.github/ISSUE_TEMPLATE/BUG_REPORT.md

This file was deleted.

16 changes: 0 additions & 16 deletions Templates/Node/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md

This file was deleted.

34 changes: 0 additions & 34 deletions Templates/Node/.github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

38 changes: 0 additions & 38 deletions Templates/Node/.github/workflows/CodeQL.yml

This file was deleted.

Loading

0 comments on commit f2ede87

Please sign in to comment.