-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: import packages as default import * fix: import packages as default import * fix: change main execution file * feat: add basics for create components * chore(app): upgrade nodemon from ^3.1.0 to ^3.1.4 * style: remove unecess ts config files * chore(ci): update docker ignore file * refactor(app): put auth functions together * feat: ignore `.DS_Store` from dynamic component import * chore: make framework to use AMD and cli to use commonjs * refactor: show welcome message on root * refactor: show welcome message on root * feat: add create package manager * feat: add create package manager
- Loading branch information
Showing
151 changed files
with
107,167 additions
and
3,215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,3 @@ build/ | |
/build | ||
.dockerignore | ||
Dockerfile | ||
Dockerfile.prod | ||
Dockerfile.dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
#PRODUCTION | ||
RDBMS_DATABASE_URI="mysql://DATBASE_USER:DATABASE_PASSWORD@DATABASE_HOST:DATABASE_PORT/DATABASE_DB" | ||
NOSQL_DATABASE_URI="mongodb://DATABASE_HOST:DATABASE_PORT/DATABASE_DB" | ||
NOSQL_DATABASE_ADAPTER="mongodb" | ||
API_BASE='/v1/' | ||
JWT_SECRET='fractal-dev' | ||
DEVELOPMENT_JWT_SECRET='fractal-dev' | ||
ENVIRONMENT='development' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
node_modules | ||
packages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* eslint no-console: 0 */ | ||
import fs from "fs"; | ||
import path from "path"; | ||
|
||
export class App { | ||
private name: string; | ||
|
||
constructor(name: string) { | ||
this.name = name; | ||
} | ||
|
||
public create = () => { | ||
console.log("Creating fractal-js application..."); | ||
|
||
const basComponentPath = path.resolve(`${this.name}`); | ||
// create component directories | ||
if (!fs.existsSync(basComponentPath)) { | ||
this.createDirs(basComponentPath); | ||
// create component source files | ||
|
||
} else { | ||
console.log("The folder already exists"); | ||
} | ||
}; | ||
|
||
private createDirs = async (basComponentPath: string) => { | ||
await fs.mkdirSync(`${basComponentPath}`); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* eslint no-console: 0 */ | ||
import fs from "fs"; | ||
import path from "path"; | ||
|
||
export class Component { | ||
private name: string; | ||
|
||
constructor(name: string) { | ||
this.name = name; | ||
} | ||
|
||
public create = () => { | ||
console.log("Creating component..."); | ||
|
||
const basComponentPath = path.resolve(`components/${this.name}`); | ||
// create component directories | ||
if (!fs.existsSync(basComponentPath)) { | ||
this.createDirs(basComponentPath); | ||
// create component source files | ||
|
||
} else { | ||
console.log("The component already exists"); | ||
} | ||
}; | ||
|
||
private createDirs = async (basComponentPath: string) => { | ||
await fs.mkdirSync(`${basComponentPath}`); | ||
await fs.mkdirSync(`${basComponentPath}/controllers`); | ||
await fs.mkdirSync(`${basComponentPath}/adapters`); | ||
await fs.mkdirSync(`${basComponentPath}/jobs`); | ||
await fs.mkdirSync(`${basComponentPath}/logic`); | ||
await fs.mkdirSync(`${basComponentPath}/middleware`); | ||
await fs.mkdirSync(`${basComponentPath}/models`); | ||
await fs.mkdirSync(`${basComponentPath}/notifications`); | ||
await fs.mkdirSync(`${basComponentPath}/policies`); | ||
await fs.mkdirSync(`${basComponentPath}/public`); | ||
await fs.mkdirSync(`${basComponentPath}/public/dtos`); | ||
await fs.mkdirSync(`${basComponentPath}/public/entities`); | ||
await fs.mkdirSync(`${basComponentPath}/public/mappers`); | ||
await fs.mkdirSync(`${basComponentPath}/public/repositories`); | ||
await fs.mkdirSync(`${basComponentPath}/routes`); | ||
await fs.mkdirSync(`${basComponentPath}/tests`); | ||
await fs.mkdirSync(`${basComponentPath}/views`); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* eslint no-console: 0 */ | ||
import { Command } from "commander"; | ||
import * as figlet from "figlet"; | ||
import { version, description } from "../package.json"; | ||
import { Component } from "./component"; | ||
import { App } from "./app"; | ||
// eslint-disable | ||
console.log(figlet.textSync("Fractal JS")); | ||
|
||
// add program | ||
const program = new Command(); | ||
|
||
program | ||
.version(version) | ||
.description(description) | ||
.option("-a, --app <value>", "Create a fractal js app") | ||
.option("-c, --c <value>", "Create a component") | ||
.parse(process.argv); | ||
|
||
const options = program.opts(); | ||
|
||
if (options.c) { | ||
const component = new Component(options.c); | ||
component.create(); | ||
} | ||
if (options.a) { | ||
new App(options.a).create(); | ||
} | ||
|
||
if (!process.argv.slice(2).length) { | ||
program.outputHelp(); | ||
} | ||
|
||
console.log(options.c); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
node_modules/ | ||
build/ | ||
/node_modules | ||
/build | ||
.dockerignore | ||
Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[*] | ||
charset=utf-8 | ||
end_of_line=lf | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
indent_style=space | ||
indent_size=4 | ||
|
||
[*.json] | ||
indent_style=space | ||
indent_size=2 | ||
|
||
[*.sass] | ||
indent_style=space | ||
indent_size=4 | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*.yaml] | ||
insert_final_newline = false | ||
|
||
[*.yml] | ||
insert_final_newline = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
RDBMS_DATABASE_URI="mysql://DATBASE_USER:DATABASE_PASSWORD@DATABASE_HOST:DATABASE_PORT/DATABASE_DB" | ||
NOSQL_DATABASE_URI="mongodb://DATABASE_HOST:DATABASE_PORT/DATABASE_DB" | ||
NOSQL_DATABASE_ADAPTER="mongodb" | ||
API_BASE='/v1/' | ||
JWT_SECRET='fractal-hello-world-dev' | ||
DEVELOPMENT_JWT_SECRET='fractal-hello-world-dev' | ||
ENVIRONMENT='development' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
Oops, something went wrong.