Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
0e3a25f
Merge pull request #47 from Mindsers/hotfix/support
mindsers Aug 15, 2018
f55166c
Remove useless declarations
mindsers Nov 5, 2017
2d39e98
New AlterationLogger service
mindsers Nov 5, 2017
fb8624b
Init data folder
mindsers Nov 5, 2017
6235675
Add file / remove file
mindsers Nov 5, 2017
c126061
Add types for node objects
mindsers Nov 12, 2017
c0ed5ce
Write raw data
mindsers Nov 12, 2017
5d08e58
No duplicate data
mindsers Nov 12, 2017
1ed86d3
Update barrels for services
Mar 1, 2018
fbc8c94
Fix barrels for commands
Mar 1, 2018
11ed9bc
Use new barrels
Mar 1, 2018
96a0f4c
Home page for documentation
Mar 1, 2018
2408f2e
Externalize run method in their own class
mindsers Mar 1, 2018
94774b6
eorganize files
mindsers Mar 1, 2018
d8e2c1c
Create deploy service
mindsers Mar 1, 2018
72f062a
Use DeployService
mindsers Mar 1, 2018
01575ea
Create InjectorService
mindsers Mar 2, 2018
4030c4d
Allow injection via useClass
mindsers Mar 2, 2018
a89f59a
Reorganize injector class
mindsers Mar 2, 2018
2ca2b32
Move alone file service
mindsers Mar 2, 2018
c6679c5
Create EventManager
mindsers Mar 2, 2018
bf5e07a
Fix documentation
mindsers Mar 2, 2018
175be7b
Add event on the global deployment process
mindsers Mar 6, 2018
9659fd0
Update git url regex
mindsers Sep 8, 2018
98f2b03
👷🏽‍♂️ Hide git url static logic into static method
mindsers Sep 8, 2018
0805cd2
Update CHANGELOG
mindsers Sep 8, 2018
6a7db25
Add Steve Andriani in the sponsors page
mindsers Sep 8, 2018
2c934ee
Update changelog
mindsers Sep 8, 2018
a1cd7b6
Remove alteration service as WIP
mindsers Sep 12, 2018
be88c7b
Remove event-manager
mindsers Sep 12, 2018
6175b1f
Fix tests imports
mindsers Sep 12, 2018
36faa24
Fix tests
mindsers Sep 12, 2018
9c043d5
Use caching in FileService
mindsers Sep 13, 2018
cc5f3eb
Update all packages
mindsers Oct 25, 2018
0f34b30
Install yabf@2.0.0
mindsers Oct 25, 2018
0dc4dd0
Install esm@3.0.84
mindsers Oct 25, 2018
2c6ef42
Create a new class to add an abstraction on top of configfile command
mindsers Nov 7, 2018
2900aa2
Create a yabf application specific to configfile
mindsers Nov 7, 2018
ac385cc
Temp import keyword handler
mindsers Nov 7, 2018
9aac1cb
Yabf version of `configfile scripts list` command
mindsers Nov 7, 2018
201d48c
Create the yabf version for `configfile scripts run` command
mindsers Nov 8, 2018
599cf96
Export service and yabf version of commands to be available for binaries
mindsers Nov 8, 2018
70b2d19
Remove old version of commands
mindsers Nov 8, 2018
f16e8a3
Create the yabf version of configfile modules list
mindsers Nov 8, 2018
ef2c16a
Create a yabf version of configfile modules deploy
mindsers Nov 8, 2018
15610c2
Create yabf version of `configfile init` command
mindsers Nov 8, 2018
e6b98af
Update binary endpoint to use the new yabf configuration
mindsers Nov 8, 2018
db2cc4f
Show command version
mindsers Nov 8, 2018
ccff733
Add description for program
mindsers Nov 10, 2018
1b8d202
Use ES6 import syntax in utils
mindsers Nov 10, 2018
5148e6d
Use ES6 import syntax in errors
mindsers Nov 10, 2018
f8ad8a0
Use ES6 import syntax in services
mindsers Nov 10, 2018
94df170
Use ES6 import syntax in commands
mindsers Nov 10, 2018
0e3d4eb
Reorganize commands folder
mindsers Nov 10, 2018
717b9d6
Update the CHANGELOG
mindsers Nov 10, 2018
c321210
src/index.js is not an executable
mindsers Nov 10, 2018
403855d
Fix unit tets
mindsers Nov 10, 2018
d05c249
Move shared errors to shared/errors/ folder
mindsers Nov 10, 2018
83a15e2
Export only commands
mindsers Nov 10, 2018
fa29abe
Fix documentation
mindsers Nov 10, 2018
616e34e
Add missing options in documentation
mindsers Nov 10, 2018
b47504e
Wrap actions for error handling
mindsers Nov 10, 2018
262c970
Refactor init command
mindsers Nov 10, 2018
e70629d
Refactor action wrapping
mindsers Nov 10, 2018
a442730
Refactor deploy command
mindsers Nov 11, 2018
f0c0cf4
Rethrow errors
mindsers Nov 11, 2018
d519163
Add documentation
mindsers Nov 11, 2018
ed52082
Create a new logger service
mindsers Nov 13, 2018
3cdd50b
Use logger for configfile.js
mindsers Nov 13, 2018
1a36a1e
Use the logger service
mindsers Nov 14, 2018
90dec57
Create a new service responsible to show text
mindsers Nov 16, 2018
9beaeee
Use MessageService in init command
mindsers Nov 16, 2018
6f9ade2
Use messageService in TermApp
mindsers Nov 16, 2018
344b50a
Fix new line character
mindsers Nov 16, 2018
0590861
Use MessageService in ListScriptsCommand
mindsers Nov 16, 2018
251410a
Use MessageService in RunScriptCommand
mindsers Nov 16, 2018
09a7d92
Use MessageService into Modules
mindsers Nov 16, 2018
605b93c
Use MessageService in other services
mindsers Nov 16, 2018
75a741f
Use MessageService in TermApplication
mindsers Nov 16, 2018
a70639e
Remove LogUtils
mindsers Nov 16, 2018
7b11b4c
Add logs on TermApplication
mindsers Nov 16, 2018
7a813b6
Fix space generator in log
mindsers Nov 17, 2018
3a41625
Set log level to ERROR
mindsers Nov 17, 2018
1055e7a
Update CHANGELOG for logs
mindsers Nov 17, 2018
c1bd616
Link script's stdois to configfile's stdios
mindsers Nov 17, 2018
5b3bc45
Refactor ExecService
mindsers Nov 17, 2018
d6cafe2
Remove MessageScript injection for ExecService
mindsers Nov 17, 2018
92e4272
Remove message fake pipe method from MessageService
mindsers Nov 17, 2018
6106338
Update CHANGELOG
mindsers Nov 17, 2018
0fb4426
Detect folders which contain index script
mindsers Nov 21, 2018
eacf84a
Refactor the path building
mindsers Nov 22, 2018
c3ee052
Rename some method
mindsers Nov 22, 2018
741bf1a
ConfigService can create alteration logs
mindsers Nov 22, 2018
1d2f9cc
Create subfolder into ~/.configfile
mindsers Nov 22, 2018
db61276
Check if all needed folders exist
mindsers Nov 22, 2018
7b14995
New folder structure explain
mindsers Nov 22, 2018
2a308e7
Load all alterations
mindsers Dec 23, 2018
e30a1bf
Create alreration service
mindsers Dec 24, 2018
682adf5
Export alteration service
mindsers Dec 24, 2018
cf2f2c3
Create first alterations
mindsers Dec 24, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,26 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- Add new contrubitor to SPONSORS.md
- Configfile will emit log to make debug easier ([!57](https://github.com/Mindsers/configfile/pull/57))

### Changed
- Use [Yabf](https://github.com/Mindsers/yabf) as base to build the next configfile.
- Fix Git url verification in `init` command.

### Fixed
- Git URL verification in `init` command is less strict. ([#48](https://github.com/Mindsers/configfile/issues/48))
- Script standard outputs are correctly displayed ([!57](https://github.com/Mindsers/configfile/pull/57), [#13](https://github.com/Mindsers/configfile/issues/13))

## [0.3.1] - 2018-08-05
### Fixed
- Fix module data collection
- Fix module data collection.

## [0.3.0] - 2017-11-15
### Added
- A contribution guide (CONTRIBUTING.md) to help new contributors.
- The local deployment of configuration file. (`-l` on `modules deploy`)
- The local deployment of configuration file. (`-l` on `modules deploy`).

### Changed
- Adopte a git like command style: `configfile run` => `configfile scritps run`.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ yarn global add configfile@latest
## Usage

- `configfile init` or `configfile i`: Initialize *configfile* on the current user session.
- `-f, --force` force current configuration to be overwritten.
- `configfile modules list` or `configfile m l`: Display a list of all modules available via *Configfile*.
- `configfile modules deploy [moduleName...]` or `configfile m d [moduleName...]`: Deploy the configuration files for the given module name.
- `-l, --local` deploy authorized file to the current directory.
Expand Down
14 changes: 9 additions & 5 deletions SPONSORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ This file is an extension of the **Support** section in `README.md`. You can fin

[Who are the people behind this project?](#who-are-the-people-behind-this-project)

<!-- * [Sponsors](#sponsors)
* [Supporters](#supporters) -->
* [Sponsors](#sponsors)
* [Supporters](#supporters)

## How can I support this project?

Expand All @@ -25,8 +25,12 @@ Be sure your effort to support this project will be greatly appreciated.

## Who are the people behind this project?

No one support this project for now. Be the first! Read the **How can I support this project** section above.
### Sponsors

<!-- ### Sponsors
No one is in the **Sponsors** section for now. Be the first! Read the **How can I support this project** section above.

### Supporters -->
### Supporters

The best supporters are listed below:

- Steve Andriani ([LinkedIn](https://www.linkedin.com/in/steve-andriani-648661136/?originalSubdomain=fr))
65 changes: 32 additions & 33 deletions bin/configfile-modules.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
#!/usr/bin/env node

const program = require('commander')
const fs = require('fs')
const path = require('path')

const { deployCommand, modulesCommand } = require('../src/commands')

const { ConfigService } = require('../src/services/config')
const { FileService } = require('../src/services/file')

const packageData = JSON.parse(fs.readFileSync(path.join(__dirname, '../package.json')))
const optionsFilePath = packageData.config.optionsFilePath.replace('~', process.env.HOME)

const configService = new ConfigService(optionsFilePath)
const fileService = new FileService(configService)

program
.version(packageData.version)
.description('Configuration modules manager.')

program
.command('list')
.alias('l')
.description('list all modules available.')
.action(modulesCommand(fileService))

program
.command('deploy [modules...]')
.alias('d')
.description('deploy configuration files.')
.option('-l, --local', 'deploy only local files of the module(s) in the current folder')
.action(deployCommand(fileService))

program.parse(process.argv)
const {
FileService,
TermApplication,
ListModulesCommand,
DeployModuleCommand,
DeployService,
ConfigService,
OPTION_PATH_FILE_TOKEN,
getOptionsFilePath,
getPackageData,
MessageService,
AlterationService
} = require('../src')

;(() => {
const cli = TermApplication.createInstance()
const pkg = getPackageData()

cli.version = pkg.version
cli.description = 'Configuration modules manager.'

cli.register(ListModulesCommand, [FileService, MessageService])
cli.register(DeployModuleCommand, [FileService, DeployService, MessageService])

cli.provide({ identity: OPTION_PATH_FILE_TOKEN, useValue: getOptionsFilePath() })
cli.provide(FileService, [ConfigService, MessageService])
cli.provide(DeployService, [MessageService, AlterationService])
cli.provide(AlterationService, [ConfigService])
cli.provide(ConfigService, [OPTION_PATH_FILE_TOKEN])

cli.start()
})()
62 changes: 30 additions & 32 deletions bin/configfile-scripts.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@
#!/usr/bin/env node

const program = require('commander')
const fs = require('fs')
const path = require('path')

const { runCommand, scriptsCommand } = require('../src/commands')

const { ConfigService } = require('../src/services/config')
const { FileService } = require('../src/services/file')

const packageData = JSON.parse(fs.readFileSync(path.join(__dirname, '../package.json')))
const optionsFilePath = packageData.config.optionsFilePath.replace('~', process.env.HOME)

const configService = new ConfigService(optionsFilePath)
const fileService = new FileService(configService)

program
.version(packageData.version)
.description('Custom scripts manager.')

program
.command('list')
.alias('l')
.description('list all custom configuration scripts available.')
.action(scriptsCommand(fileService))

program
.command('run <name>')
.alias('r')
.description('run custom configuration scripts.')
.action(runCommand(configService, fileService))

program.parse(process.argv)
const {
FileService,
ExecService,
TermApplication,
ListScriptsCommand,
RunScriptCommand,
ConfigService,
OPTION_PATH_FILE_TOKEN,
getOptionsFilePath,
getPackageData,
MessageService
} = require('../src')

;(() => {
const cli = TermApplication.createInstance()
const pkg = getPackageData()

cli.version = pkg.version
cli.description = 'Custom scripts manager.'

cli.register(RunScriptCommand, [ExecService, FileService, MessageService])
cli.register(ListScriptsCommand, [FileService, MessageService])

cli.provide({ identity: OPTION_PATH_FILE_TOKEN, useValue: getOptionsFilePath() })
cli.provide(FileService, [ConfigService, MessageService])
cli.provide(ExecService)
cli.provide(ConfigService, [OPTION_PATH_FILE_TOKEN])

cli.start()
})()
87 changes: 54 additions & 33 deletions bin/configfile.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,56 @@
#!/usr/bin/env node

const program = require('commander')
const fs = require('fs')
const path = require('path')

const { ConfigService } = require('../src/services/config')

const { initCommand } = require('../src/commands')

const packageData = JSON.parse(fs.readFileSync(path.join(__dirname, '../package.json')))
const optionsFilePath = packageData.config.optionsFilePath.replace('~', process.env.HOME)

const configService = new ConfigService(optionsFilePath)

program
.version(packageData.version)
.description('Configuration files manager.')

program
.command('init')
.alias('i')
.description('activate configfiles on user session.')
.option('-f, --force', 'force parameters file overwrite.')
.action(initCommand(configService))

program
.command('scripts', 'work with custom scripts available.')
.alias('s')

program
.command('modules', 'work with modules available.')
.alias('m')

program.parse(process.argv)
const {
TermApplication,
Command,
InitCommand,
ConfigService,
OPTION_PATH_FILE_TOKEN,
getOptionsFilePath,
getPackageData,
LoggerService,
MessageService
} = require('../src');

(() => {
const cli = TermApplication.createInstance()
const pkg = getPackageData()

cli.version = pkg.version
cli.description = 'Configuration files manager.'

cli.provide({ identity: OPTION_PATH_FILE_TOKEN, useValue: getOptionsFilePath() })

cli.provide(ConfigService, [OPTION_PATH_FILE_TOKEN])

cli.register(InitCommand, [ConfigService, LoggerService, MessageService])
cli.register(class extends Command { // modules namespace
get commandName() {
return 'modules'
}

get alias() {
return 'm'
}

get description() {
return 'work with modules available.'
}
})

cli.register(class extends Command { // scripts namespace
get commandName() {
return 'scripts'
}

get alias() {
return 's'
}

get description() {
return 'work with custom scripts available.'
}
})

cli.start()
})()
41 changes: 41 additions & 0 deletions docs/home.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Configfile

Configfile is a command line interface application to help developer manages their development setup.

## Getting Started

To install Configfile:

```bash
npm install -g configfile@latest
# or
yarn global add configfile@latest
```

Generating first configuration:

```bash
configfile init
```

It is an interactive command. Answer questions.

### Running unit tests

Unit test will be available via:

```bash
yarn test
```

### Additional commands

- [configfile modules list]()
- [configfile modules deploy]()
- [configfile scripts list]()
- [configfile scripts run]()

## Configfiles Configuration

- [Data folder structure]()
- [Module settings]()
15 changes: 15 additions & 0 deletions docs/settings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Settings

Temporary settings architecture:

```
~/
.configfilerc
.configfile/
logs/
[time]-[level].json
recovery/
alterations/
[module].json
status.json
```
29 changes: 16 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,24 @@
"test": "yarn test:lint && yarn test:unit:coverage"
},
"dependencies": {
"chalk": "^2.1.0",
"commander": "^2.11.0",
"gift": "^0.10.0",
"inquirer": "^3.2.3"
"chalk": "^2.4.1",
"commander": "^2.19.0",
"esm": "^3.0.84",
"gift": "^0.10.2",
"inquirer": "^6.2.0",
"yabf": "^2.0.0"
},
"devDependencies": {
"ava": "^0.22.0",
"eslint": "^4.9.0",
"eslint-config-standard": "^10.2.1",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-node": "^5.2.0",
"eslint-plugin-promise": "^3.6.0",
"eslint-plugin-standard": "^3.0.1",
"nyc": "^11.2.1",
"@types/node": "^10.12.0",
"ava": "^0.25.0",
"eslint": "^5.7.0",
"eslint-config-standard": "^12.0.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-node": "^7.0.1",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0",
"nyc": "^13.1.0",
"rimraf": "^2.6.2",
"sinon": "^4.0.1"
"sinon": "^7.0.0"
}
}
13 changes: 0 additions & 13 deletions src/commands.js

This file was deleted.

Loading