diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 982da60..84c613f 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -26,6 +26,8 @@ cross-component development and builds all components. **`npm run commit`**: to commit the changes. +**`npm run create --component=Share_TEST`**: to create a component along with necessary files + ## Think you found a bug? Please conform to the issue template and provide a clear path to reproduction diff --git a/.github/SETUP.md b/.github/SETUP.md index 1d3a0bf..53d774f 100644 --- a/.github/SETUP.md +++ b/.github/SETUP.md @@ -3,7 +3,7 @@ Clone the repository and run the following commands from the root directory of f ## Local setup -#### 1. Go to the fe-pilot repo location in your terminal and do +#### 1. Go to the fe-pilot repo location in your terminal and do ``` npm install npm start @@ -37,8 +37,8 @@ import { TextToSpeechInit, TextToSpeechStart, TextToSpeechStop } from 'fe-pilot/ ## Folder Structure ``` fe-pilot - └── __app - └── component + └── __app + └── component ├──TextToSpeech (component name) | ├──TextToSpeech.js (top level exports/re-exports) | ├──TextToSpeechInit.js (parent component) diff --git a/__app/script/boilerPlate.js b/__app/script/boilerPlate.js index b1f80d1..5c9b4c7 100644 --- a/__app/script/boilerPlate.js +++ b/__app/script/boilerPlate.js @@ -12,11 +12,10 @@ const ignoreFiles = [ 'services', 'Wrapper', ]; - // generate exports for all platforms const srcPath = path.resolve(__dirname, '../component'); -const { COMPONENT } = process.env; +const COMPONENT = process.env.npm_config_component; // const srcPath = path.resolve(__dirname, '__app/component'); const componentDir = path.resolve(`${__dirname}`, `../component/${COMPONENT}`); diff --git a/package.json b/package.json index 7e2133f..44e73ed 100644 --- a/package.json +++ b/package.json @@ -5,19 +5,19 @@ "main": "index.js", "scripts": { "test": "echo \"Success: Verified\"", + "precreate": "npm pkg set keywords[].=$npm_config_component", "create": "node ./__app/script/boilerPlate.js", + "postcreate": "npm pkg set files[].=$npm_config_component/", "start": "npm run local", - "local": "npm run local:indexfile && npm run local:component", - "local:indexfile": "node ./__app/script/generateIndex.js", - "local:component": "babel __app/component -d __build --watch", - "prod": "npm run prod:indexfile && npm run prod:componentmin", - "prod:indexfile": "node ./__app/script/generateIndex.js", - "prod:component": "NODE_ENV=production babel __app/component -d __build", - "prod:componentmin": "NODE_ENV=production BABEL_ENV=minify babel __app/component -d __build --out-file-extension .js", + "prelocal": "node ./__app/script/generateIndex.js", + "local": "NODE_ENV=development babel __app/component -d __build --watch", + "preprod": "node ./__app/script/generateIndex.js", + "prod": "NODE_ENV=production BABEL_ENV=minify babel __app/component -d __build --out-file-extension .js", "commit": "npm run lint:check && git-cz", "lint:check": "lint-staged", "lint:fix": "eslint . --fix", - "semantic-release": "semantic-release --branches master" + "semantic-release": "semantic-release --branches master", + "prod:unminified": "NODE_ENV=production babel __app/component -d __build" }, "author": "Himanshu Gupta", "license": "MIT", @@ -59,7 +59,8 @@ "livelocationtracking", "detectmylocation", "colorpicker", - "wakelock" + "wakelock", + "ABCKEFG" ], "config": { "commitizen": {