@p8ec/shared 1.1.0 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # P(8) Global Shared Library for Node.js and TypeScript/JavaScript.
1
+ # P(8) Global Shared Library for Node.js and TypeScript/JavaScript
2
2
 
3
3
  This repository contains the shared library for all P(8) products.
4
4
 
@@ -20,7 +20,7 @@ npm i -D @p8ec/shared
20
20
  p8-shared-cli init
21
21
  ```
22
22
 
23
- This command will create the following files in your project:
23
+ This command will create the following files in your project and remove corresponding configuration entries from `package.json`:
24
24
 
25
25
  #### **`.eslintrc.js`**
26
26
 
@@ -64,10 +64,17 @@ Commands:
64
64
  const init = () => {
65
65
  // eslint-disable-next-line no-console
66
66
  console.log('Creating .eslintrc.js...');
67
- fs.writeFileSync(path.join(path.resolve(__dirname), '.eslintrc.js'), `module.exports = require('@p8ec/shared').eslintConfigRecommended;`);
67
+ fs.writeFileSync(path.join(process.cwd(), '.eslintrc.js'), `module.exports = require('@p8ec/shared').eslintConfigRecommended;`);
68
68
  // eslint-disable-next-line no-console
69
69
  console.log('Creating .prettierrc.js...');
70
- fs.writeFileSync(path.join(path.resolve(__dirname), '.prettierrc.js'), `module.exports = require('@p8ec/shared').prettierConfigRecommended;`);
70
+ fs.writeFileSync(path.join(process.cwd(), '.prettierrc.js'), `module.exports = require('@p8ec/shared').prettierConfigRecommended;`);
71
+ // Remove eslintConfig and prettier from package.json
72
+ // eslint-disable-next-line no-console
73
+ console.log('Removing eslintConfig and prettier from package.json...');
74
+ const packageJson = JSON.parse(String(fs.readFileSync(path.join(process.cwd(), 'package.json'))));
75
+ delete packageJson['eslintConfig'];
76
+ delete packageJson['prettier'];
77
+ fs.writeFileSync(path.join(process.cwd(), 'package.json'), JSON.stringify(packageJson, null, 2));
71
78
  };
72
79
  switch (args[0]) {
73
80
  case 'init':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@p8ec/shared",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "P(8) Global Shared Library",
5
5
  "repository": {
6
6
  "type": "git",