Skip to content

Commit

Permalink
version 2 Init
Browse files Browse the repository at this point in the history
  • Loading branch information
Arylo committed Jun 14, 2018
1 parent f241542 commit c701296
Show file tree
Hide file tree
Showing 29 changed files with 273 additions and 628 deletions.
6 changes: 4 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 2
indent_size = 4

[*.md]
[*.{md,json,yml,yaml}]
trim_trailing_whitespace = false
indent_style = space
indent_size = 2
33 changes: 17 additions & 16 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
env:
commonjs: true
es6: true
mocha: true
jasmine: true
node: true
extends: 'eslint:recommended'
parserOptions:
sourceType: module
extends: "standard"
plugins:
- "standard"
- "promise"
- "node"
rules:
indent:
- error
- 2
linebreak-style:
- error
- unix
- "warn"
- 4
semi:
- error
- always
- "warn"
- "always"
semi-style:
- "warn"
- "last"
semi-spacing:
- "error"
-
before: false
after: true
29 changes: 25 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
Expand All @@ -20,21 +23,39 @@ coverage
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
jspm_packages
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Export Folder
lib/
# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# Node Export Files
/dist
23 changes: 13 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
sudo: false

language: node_js

node_js:
- "6"
- "8"
- "node"
- "lts/*"
- "8"
- "6"

before_instnall:
- echo '' > .npmrc

install: npm install
before_script:
- "npm install nyc --global"

script:
- npm run test
- "npm run build"
- "nyc npm test"

after_success:
- "npm install coveralls@~3.0.0 --global"
- "nyc report --reporter=text-lcov | coveralls"

before_deploy:
- npm run build
- "npm run clean"
- "npm run build -- -P ./tsconfig.prod.json"

deploy:
skip_cleanup: true
Expand All @@ -26,3 +28,4 @@ deploy:
api_key: "${NPM_TOKEN}"
on:
branch: master
node_js: "node"
20 changes: 0 additions & 20 deletions Changelog.md

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 AryloYueng
Copyright (c) 2017-2018 Arylo Yeung

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
83 changes: 24 additions & 59 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,61 +1,26 @@
# y-config

Create public configuration for the project

[![node](https://img.shields.io/node/v/y-config.svg?style=flat-square)](https://www.npmjs.com/package/y-config)
[![David](https://img.shields.io/david/Arylo/y-config.svg?style=flat-square)][REPO]
[![Travis](https://img.shields.io/travis/Arylo/y-config.svg?style=flat-square)](https://travis-ci.org/Arylo/y-config)
[![Author](https://img.shields.io/badge/Author-AryloYeung-blue.svg?style=flat-square)](https://github.com/arylo)
[![license](https://img.shields.io/github/license/Arylo/y-config.svg?style=flat-square)][REPO]

[![NPM](https://nodei.co/npm/y-config.png)](https://nodei.co/npm/y-config/)

## Installation
```bash
npm install --save y-config
```

## Load Module

```javascript
// Without config file
let config = require('y-config');
// Load config file
let config = require('y-config');
config.setConfigPath(...);
// Load Default+Custom config file
let config = require('y-config');
config.setConfigPath(...);
config.setCustomConfigPath(...);
```

## Get Config Data
```javascript
let config = require('y-config');
config.getConfig()
// or
config
```
## Add Config Object
```javascript
let config = require('y-config');
config.module = 'y-config';
config.author = 'AryloYeung';
// {
// "module": "y-config",
// "author": "AryloYeung"
// }
config.setConfig({ "author": { "name": "y-config" } });
// {
// "module": "y-config",
// "author": {
// "name": "AryloYeung"
// }
// }
console.log(config.author);
// "author": {
// "name": "AryloYeung"
// }
```

[REPO]: https://github.com/Arylo/y-config
The project is generated in [`arylo-init`](https://www.npmjs.com/package/arylo-init)

[![node][NPM_URL]][NPM_HREF]
[![Travis][TRAVIS_URL]][TRAVIS_HREF]
[![Coveralls][COVERALLS_URL]][COVERALLS_HREF]
[![Known Vulnerabilities][SNYK_URL]][SNYK_HREF]
[![David][DAVID_URL]][DAVID_HREF]
[![Author][AUTHOR_URL]][AUTHOR_HREF]
[![license][LICENSE_URL]][LICENSE_HREF]

[NPM_URL]: https://img.shields.io/node/v/y-config.svg?style=flat-square&maxAge=600
[NPM_HREF]: https://www.npmjs.com/package/y-config
[TRAVIS_URL]: https://img.shields.io/travis/Arylo/y-config.svg?style=flat-square&logo=travis&maxAge=600
[TRAVIS_HREF]: https://travis-ci.org/Arylo/y-config
[COVERALLS_URL]: https://img.shields.io/coveralls/github/Arylo/y-config.svg?style=flat-square&maxAge=600
[COVERALLS_HREF]: https://coveralls.io/github/Arylo/y-config
[SNYK_URL]: https://snyk.io/test/github/Arylo/y-config/badge.svg?style=flat-square&maxAge=600
[SNYK_HREF]: https://snyk.io/test/github/Arylo/y-config
[DAVID_URL]: https://img.shields.io/david/Arylo/y-config.svg?style=flat-square&maxAge=600
[DAVID_HREF]: https://github.com/Arylo/y-config
[AUTHOR_URL]: https://img.shields.io/badge/Author-AryloYeung-blue.svg?style=flat-square&maxAge=7200
[AUTHOR_HREF]: https://github.com/arylo
[LICENSE_URL]: https://img.shields.io/github/license/Arylo/npm-project-init.svg?style=flat-square&maxAge=7200
[LICENSE_HREF]: https://opensource.org/licenses/MIT
48 changes: 0 additions & 48 deletions dts.d.ts

This file was deleted.

4 changes: 0 additions & 4 deletions examples/custom_config_module/index.ts

This file was deleted.

15 changes: 0 additions & 15 deletions examples/custom_config_module/package.json

This file was deleted.

8 changes: 0 additions & 8 deletions examples/custom_config_module/test.d.ts

This file was deleted.

11 changes: 0 additions & 11 deletions examples/custom_config_module/test.ts

This file was deleted.

13 changes: 0 additions & 13 deletions examples/custom_config_module/tsconfig.json

This file was deleted.

5 changes: 0 additions & 5 deletions index.d.ts

This file was deleted.

3 changes: 0 additions & 3 deletions index.js

This file was deleted.

Empty file added lib/.gitkeep
Empty file.
Loading

0 comments on commit c701296

Please sign in to comment.