Skip to content

Commit

Permalink
Merge pull request #2 from frouriojs/develop
Browse files Browse the repository at this point in the history
chore(release): 0.9.0
  • Loading branch information
solufa authored Jun 29, 2020
2 parents 7a62a3b + a9a8f34 commit 0f15a10
Show file tree
Hide file tree
Showing 58 changed files with 666 additions and 564 deletions.
19 changes: 0 additions & 19 deletions .dependabot/config.yml

This file was deleted.

16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
target-branch: "develop"
versioning-strategy: "increase"
commit-message:
prefix: "fix"
prefix-development: "chore"
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
CHANGELOG.md
templates/front/*/tsconfig.json
templates/server/package.json
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [0.9.0](https://github.com/frouriojs/create-frourio-app/compare/v0.8.0...v0.9.0) (2020-06-29)


### Features

* **next:** separate package.json ([26466d1](https://github.com/frouriojs/create-frourio-app/commit/26466d1c377fb9d76cba8ccbd25c2b10a50ff991))
* **none:** separete package.json ([2e688e2](https://github.com/frouriojs/create-frourio-app/commit/2e688e27299e26877874f6a9f4b95199e31caefa))
* **nuxt:** separate package.json ([99863fb](https://github.com/frouriojs/create-frourio-app/commit/99863fb9d647e1d35c9019e8ebad7f572dbf043d))
* **nuxt:** update 2.13.0 ([834e3c4](https://github.com/frouriojs/create-frourio-app/commit/834e3c4b3abac44db13a22b1fa5e3b22906649b6))
* update [email protected] ([cbb049a](https://github.com/frouriojs/create-frourio-app/commit/cbb049af4b061dc6431e1236c102032ccb2a38be))


### Bug Fixes

* pm2 package.json ([eaaf9f2](https://github.com/frouriojs/create-frourio-app/commit/eaaf9f2c0e4eb7108e03d1d14e08a51e186052f2))
* pm2.config.json ([b0b204a](https://github.com/frouriojs/create-frourio-app/commit/b0b204aae2ac7e8875704d96af0dc4d81486d455))

## [0.8.0](https://github.com/frouriojs/create-frourio-app/compare/v0.7.2...v0.8.0) (2020-06-18)


Expand Down
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,26 @@ yarn create frourio-app <my-project>

## Features :tada:

1. Choose frontend framework
1. Frontend framework:
- [Next.js](https://nextjs.org/learn/excel/typescript)
- [Nuxt.js](https://typescript.nuxtjs.org/)
- None
1. Choose HTTP client of aspida
1. Nuxt.js rendering mode:
- [Universal (SSR / Static)](https://nuxtjs.org/guide/#server-rendered-universal-ssr-)
- [SPA](https://nuxtjs.org/guide/#single-page-applications-spa-)
1. Nuxt.js deployment target:
- [Server (Node.js hosting)](https://nuxtjs.org/api/configuration-target)
- [Static (Static/JAMStack hosting)](https://nuxtjs.org/api/configuration-target)
1. HTTP client of aspida:
- [axios](https://github.com/axios/axios)
- [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)
1. Choose the package manager
1. Package manager:
- Yarn
- Npm
1. Choose the daemon process manager
1. Daemon process manager:
- None
- [PM2](https://pm2.keymetrics.io/)
1. Choose the database type of TypeORM
1. Database type of TypeORM:
- None
- [MySQL](https://www.mysql.com/)
- [PostgreSQL](https://www.postgresql.org/)
Expand Down
2 changes: 2 additions & 0 deletions lib/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ module.exports = {
})
}

if (pkgs.length === 1) return pkgs[0]

const pkg = merge(...pkgs)
pkg.dependencies = sortByKey(pkg.dependencies)
pkg.devDependencies = sortByKey(pkg.devDependencies)
Expand Down
27 changes: 19 additions & 8 deletions lib/prompts.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ const dbInfo = require('./dbInfo')
module.exports = [
{
name: 'name',
message: 'Project name',
message: 'Project name:',
default: '{outFolder}'
},
{
name: 'front',
message: 'Choose frontend framework',
message: 'Frontend framework:',
choices: [
{ name: 'Next.js', value: 'next' },
{ name: 'Nuxt.js', value: 'nuxt' },
Expand All @@ -19,18 +19,29 @@ module.exports = [
},
{
name: 'mode',
message: 'Choose rendering mode',
message: 'Rendering mode:',
type: 'list',
choices: [
{ name: 'Universal (SSR / Static)', value: 'universal' },
{ name: 'Universal (SSR / SSG)', value: 'universal' },
{ name: 'Single Page App', value: 'spa' }
],
default: 'universal',
when: answers => answers.front === 'nuxt'
},
{
name: 'target',
message: 'Deployment target:',
type: 'list',
choices: [
{ name: 'Server (Node.js hosting)', value: 'server' },
{ name: 'Static (Static/JAMStack hosting)', value: 'static' }
],
default: 'server',
when: answers => answers.front === 'nuxt'
},
{
name: 'aspida',
message: 'Choose HTTP client of aspida',
message: 'HTTP client of aspida:',
choices: [
{ name: 'axios', value: 'axios' },
{ name: 'fetch', value: 'fetch' }
Expand All @@ -41,7 +52,7 @@ module.exports = [
},
{
name: 'pm',
message: 'Choose the package manager',
message: 'Package manager:',
choices: [
{ name: 'Yarn', value: 'yarn' },
{ name: 'Npm', value: 'npm' }
Expand All @@ -51,7 +62,7 @@ module.exports = [
},
{
name: 'daemon',
message: 'Choose the daemon process manager',
message: 'Daemon process manager:',
choices: [
{ name: 'None', value: 'none' },
{ name: 'PM2', value: 'pm2' }
Expand All @@ -61,7 +72,7 @@ module.exports = [
},
{
name: 'dbType',
message: 'Choose the database type of TypeORM',
message: 'Database type of TypeORM:',
choices: [
{ name: 'None', value: 'none' },
{ name: 'MySQL', value: 'mysql' },
Expand Down
5 changes: 3 additions & 2 deletions lib/saofile.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ module.exports = {
},
{
type: 'add',
files: '**',
templateDir: resolve(__dirname, '../templates/common')
files: 'server/**',
templateDir: resolve(__dirname, '../templates')
},
...addedList,
{
Expand All @@ -84,6 +84,7 @@ module.exports = {
this.gitInit()

await this.npmInstall({ npmClient: this.answers.pm })
await this.npmInstall({ npmClient: this.answers.pm, cwd: `${this.outDir}/server` })

spawn.sync(this.answers.pm, ['run', 'build:apis'], {
cwd: this.outDir,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-frourio-app",
"version": "0.8.0",
"version": "0.9.0",
"description": "Create a frourio project in seconds",
"author": "Solufa <[email protected]>",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion templates/aspida/next/axios/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"dependencies": {
"@aspida/axios": "^0.8.0",
"@aspida/axios": "^0.9.3",
"axios": "^0.19.2"
}
}
5 changes: 0 additions & 5 deletions templates/aspida/next/axios/utils/apiClient.ts

This file was deleted.

2 changes: 1 addition & 1 deletion templates/aspida/next/fetch/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"dependencies": {
"@aspida/fetch": "^0.6.0"
"@aspida/fetch": "^0.7.3"
}
}
4 changes: 0 additions & 4 deletions templates/aspida/next/fetch/utils/apiClient.ts

This file was deleted.

25 changes: 18 additions & 7 deletions templates/aspida/nuxt/axios/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
import { Configuration } from '@nuxt/types'
import dotenv from 'dotenv'

dotenv.config()

const config: Configuration = {
/*
** Nuxt rendering mode
** See https://nuxtjs.org/api/configuration-mode
*/
mode: '<%= mode %>',
/*
** Nuxt target
** See https://nuxtjs.org/api/configuration-target
*/
target: '<%= target %>',
/*
** Headers of the page
** See https://nuxtjs.org/api/configuration-head
*/
head: {
title: process.env.npm_package_name || '',
Expand All @@ -31,15 +38,18 @@ const config: Configuration = {
css: [],
/*
** Plugins to load before mounting the App
** https://nuxtjs.org/guide/plugins
*/
plugins: ['~/plugins/api'],
/*
** Nuxt.js dev-modules
** Auto import components
** See https://nuxtjs.org/api/configuration-components
*/
components: true,
/*
** Nuxt.js dev-modules
*/
buildModules: [
// TODO: Remove when upgrading to nuxt 2.13+
'@nuxt/components',
'@nuxt/typescript-build',
// Doc: https://github.com/nuxt-community/stylelint-module
'@nuxtjs/stylelint-module'
Expand All @@ -56,10 +66,11 @@ const config: Configuration = {
** See https://axios.nuxtjs.org/options
*/
axios: {
baseURL: `http://localhost:${process.env.SERVER_PORT}${process.env.BASE_PATH}`
baseURL: require('./aspida.config').baseURL
},
/*
** Build configuration
** See https://nuxtjs.org/api/configuration-build/
*/
build: {
/*
Expand Down
4 changes: 2 additions & 2 deletions templates/aspida/nuxt/axios/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"dependencies": {
"@aspida/axios": "^0.8.0",
"axios": "^0.19.2"
"@aspida/axios": "^0.9.4",
"@nuxtjs/axios": "^5.11.0"
}
}
28 changes: 18 additions & 10 deletions templates/aspida/nuxt/fetch/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
import { Configuration } from '@nuxt/types'
import dotenv from 'dotenv'

dotenv.config()

const config: Configuration = {
mode: 'universal',
env: {
BASE_URL: `http://localhost:${process.env.SERVER_PORT}${process.env.BASE_PATH}`
},
/*
** Nuxt rendering mode
** See https://nuxtjs.org/api/configuration-mode
*/
mode: '<%= mode %>',
/*
** Nuxt target
** See https://nuxtjs.org/api/configuration-target
*/
target: '<%= target %>',
/*
** Headers of the page
** See https://nuxtjs.org/api/configuration-head
*/
head: {
title: process.env.npm_package_name || '',
Expand All @@ -34,15 +38,18 @@ const config: Configuration = {
css: [],
/*
** Plugins to load before mounting the App
** https://nuxtjs.org/guide/plugins
*/
plugins: ['~/plugins/api'],
/*
** Nuxt.js dev-modules
** Auto import components
** See https://nuxtjs.org/api/configuration-components
*/
components: true,
/*
** Nuxt.js dev-modules
*/
buildModules: [
// TODO: Remove when upgrading to nuxt 2.13+
'@nuxt/components',
'@nuxt/typescript-build',
// Doc: https://github.com/nuxt-community/stylelint-module
'@nuxtjs/stylelint-module'
Expand All @@ -53,6 +60,7 @@ const config: Configuration = {
modules: [],
/*
** Build configuration
** See https://nuxtjs.org/api/configuration-build/
*/
build: {
/*
Expand Down
2 changes: 1 addition & 1 deletion templates/aspida/nuxt/fetch/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"dependencies": {
"@aspida/fetch": "^0.6.0"
"@aspida/fetch": "^0.7.4"
}
}
3 changes: 1 addition & 2 deletions templates/aspida/nuxt/fetch/plugins/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ declare module 'vuex/types/index' {
}
}

const plugin: Plugin = (_, inject) =>
inject('api', api(aspida(fetch, { baseURL: process.env.BASE_URL })))
const plugin: Plugin = (_, inject) => inject('api', api(aspida(fetch)))

export default plugin
13 changes: 5 additions & 8 deletions templates/daemon/pm2/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
{
"scripts": {
"pm2:start": "pm2 start server/pm2.config.json --env production",
"pm2:stop": "pm2 stop server/pm2.config.json",
"pm2:delete": "pm2 delete server/pm2.config.json",
"pm2:logs": "pm2 logs",
"pm2:monit": "pm2 monit"
},
"dependencies": {
"pm2": "^4.4.0"
"pm2:start": "cd server && node_modules/.bin/pm2 start pm2.config.json --env production",
"pm2:stop": "cd server && node_modules/.bin/pm2 stop pm2.config.json",
"pm2:delete": "cd server && node_modules/.bin/pm2 delete pm2.config.json",
"pm2:logs": "cd server && node_modules/.bin/pm2 logs",
"pm2:monit": "cd server && node_modules/.bin/pm2 monit"
}
}
2 changes: 1 addition & 1 deletion templates/daemon/pm2/server/pm2.config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "<%= name %>",
"script": "server/index.js",
"script": "index.js",
"env_production": {
"NODE_ENV": "production"
}
Expand Down
Loading

0 comments on commit 0f15a10

Please sign in to comment.