@anolilab/prettier-config 4.0.2 → 4.0.4
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/CHANGELOG.md +15 -0
- package/dist/postinstall.js +3 -3
- package/dist/postinstall.js.map +1 -1
- package/dist/postinstall.mjs +8 -8
- package/dist/postinstall.mjs.map +1 -1
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## @anolilab/prettier-config [4.0.4](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/prettier-config@4.0.3...@anolilab/prettier-config@4.0.4) (2023-06-11)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Dependencies
|
|
6
|
+
|
|
7
|
+
* **@anolilab/semantic-release-preset:** upgraded to 3.1.0
|
|
8
|
+
|
|
9
|
+
## @anolilab/prettier-config [4.0.3](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/prettier-config@4.0.2...@anolilab/prettier-config@4.0.3) (2023-06-11)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* use the projectPath from @anolilab/package-json-utils ([1574f21](https://github.com/anolilab/javascript-style-guide/commit/1574f2189e9d9e5db3aad4ad2d53ed2987a3afc4))
|
|
15
|
+
|
|
1
16
|
## @anolilab/prettier-config [4.0.2](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/prettier-config@4.0.1...@anolilab/prettier-config@4.0.2) (2023-06-11)
|
|
2
17
|
|
|
3
18
|
|
package/dist/postinstall.js
CHANGED
|
@@ -7,11 +7,11 @@ var fs = require('fs');
|
|
|
7
7
|
var path = require('path');
|
|
8
8
|
var util = require('util');
|
|
9
9
|
|
|
10
|
-
process.env.CI&&process.exit(0);var s=util.promisify(fs.writeFile)
|
|
11
|
-
`);var
|
|
10
|
+
process.env.CI&&process.exit(0);var s=util.promisify(fs.writeFile);console.log("Configuring @anolilab/prettier-config",packageJsonUtils.projectPath,`
|
|
11
|
+
`);var a=()=>{let e=path.join(packageJsonUtils.projectPath,`.prettierrc.${packageJsonUtils.packageIsTypeModule?"m":"c"}js`);return fs.existsSync(e)||fs.existsSync(e.replace(`.${packageJsonUtils.packageIsTypeModule?"m":"c"}js`,""))?(console.warn(`\u26A0\uFE0F .prettierrc.${packageJsonUtils.packageIsTypeModule?"m":"c"}js already exists;
|
|
12
12
|
Make sure that it includes the following for @anolilab/prettier-config to work as it should:
|
|
13
13
|
${JSON.stringify(chunkNAA7XF5C_js.a,void 0,4)}
|
|
14
14
|
`),Promise.resolve()):s(e,`${packageJsonUtils.packageIsTypeModule?"export default":"module.exports ="} ${JSON.stringify(chunkNAA7XF5C_js.a,void 0,2).replace("rangeEnd: null,","rangeEnd: Infinity,")}
|
|
15
|
-
`,"utf-8")},
|
|
15
|
+
`,"utf-8")},p=()=>{let e=path.join(packageJsonUtils.projectPath,".prettierignore");return fs.existsSync(e)?(console.warn("\u26A0\uFE0F .prettierignore already exists"),Promise.resolve()):s(e,"","utf-8")};(async()=>{try{await Promise.all([a(),p()]),console.log("\u{1F60E} Everything went well, have fun!"),process.exit(0);}catch(e){console.log("\u{1F62C} something went wrong:"),console.error(e),process.exit(1);}})();
|
|
16
16
|
//# sourceMappingURL=out.js.map
|
|
17
17
|
//# sourceMappingURL=postinstall.js.map
|
package/dist/postinstall.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/postinstall.ts"],"names":["packageIsTypeModule","existsSync","writeFile","join","
|
|
1
|
+
{"version":3,"sources":["../src/postinstall.ts"],"names":["packageIsTypeModule","projectPath","existsSync","writeFile","join","promisify","writeFileAsync","writePrettierRc","prettierPath","src_default","writePrettierIgnore","error"],"mappings":";wCAEA,OAAS,uBAAAA,EAAqB,eAAAC,MAAmB,+BACjD,OAAS,cAAAC,EAAY,aAAAC,MAAiB,KACtC,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,MAAiB,OAItB,QAAQ,IAAI,IAEZ,QAAQ,KAAK,CAAC,EAGlB,IAAMC,EAAiBD,EAAUF,CAAS,EAE1C,QAAQ,IAAI,wCAAyCF,EAAa;AAAA,CAAI,EAKtE,IAAMM,EAAkB,IAAM,CAC1B,IAAMC,EAAeJ,EAAKH,EAAa,eAAeD,EAAsB,IAAM,OAAO,EAEzF,OAAIE,EAAWM,CAAY,GAAKN,EAAWM,EAAa,QAAQ,IAAIR,EAAsB,IAAM,QAAS,EAAE,CAAC,GACxG,QAAQ,KAAK,6BAAmBA,EAAsB,IAAM;AAAA;AAAA,EAElE,KAAK,UAAUS,EAAS,OAAW,CAAC;AAAA,CAAK,EAE5B,QAAQ,QAAQ,GAGpBH,EACHE,EACA,GAAGR,EAAsB,iBAAmB,sBAAsB,KAAK,UAAUS,EAAS,OAAW,CAAC,EAAE,QACpG,kBACA,qBACJ;AAAA,EACA,OACJ,CACJ,EAKMC,EAAsB,IAAM,CAC9B,IAAMF,EAAeJ,EAAKH,EAAa,iBAAiB,EAExD,OAAIC,EAAWM,CAAY,GACvB,QAAQ,KAAK,8CAAoC,EAE1C,QAAQ,QAAQ,GAGpBF,EAAeE,EAAc,GAAI,OAAO,CACnD,GAGC,SAAY,CACT,GAAI,CAEA,MAAM,QAAQ,IAAI,CAACD,EAAgB,EAAGG,EAAoB,CAAC,CAAC,EAE5D,QAAQ,IAAI,4CAAqC,EAGjD,QAAQ,KAAK,CAAC,CAClB,OAASC,EAAP,CACE,QAAQ,IAAI,kCAA2B,EACvC,QAAQ,MAAMA,CAAK,EAGnB,QAAQ,KAAK,CAAC,CAClB,CACJ,GAAG","sourcesContent":["#!/usr/bin/env node\n\nimport { packageIsTypeModule, projectPath } from \"@anolilab/package-json-utils\";\nimport { existsSync, writeFile } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { promisify } from \"node:util\";\n\nimport content from \"./index\";\n\nif (process.env[\"CI\"]) {\n // eslint-disable-next-line no-undef\n process.exit(0);\n}\n\nconst writeFileAsync = promisify(writeFile);\n\nconsole.log(\"Configuring @anolilab/prettier-config\", projectPath, \"\\n\");\n\n/**\n * Writes .prettierrc.${m|c}js if it doesn't exist. Warns if it exists.\n */\nconst writePrettierRc = () => {\n const prettierPath = join(projectPath, `.prettierrc.${packageIsTypeModule ? \"m\" : \"c\"}js`);\n\n if (existsSync(prettierPath) || existsSync(prettierPath.replace(`.${packageIsTypeModule ? \"m\" : \"c\"}js`, \"\"))) {\n console.warn(`⚠️ .prettierrc.${packageIsTypeModule ? \"m\" : \"c\"}js already exists;\nMake sure that it includes the following for @anolilab/prettier-config to work as it should:\n${JSON.stringify(content, undefined, 4)}\\n`);\n\n return Promise.resolve();\n }\n\n return writeFileAsync(\n prettierPath,\n `${packageIsTypeModule ? \"export default\" : \"module.exports =\"} ${JSON.stringify(content, undefined, 2).replace(\n \"rangeEnd: null,\",\n \"rangeEnd: Infinity,\",\n )}\\n`,\n \"utf-8\",\n );\n};\n\n/**\n * Writes .prettierignore if it doesn't exist. Warns if it exists.\n */\nconst writePrettierIgnore = () => {\n const prettierPath = join(projectPath, \".prettierignore\");\n\n if (existsSync(prettierPath)) {\n console.warn(\"⚠️ .prettierignore already exists\");\n\n return Promise.resolve();\n }\n\n return writeFileAsync(prettierPath, \"\", \"utf-8\");\n};\n\n// eslint-disable-next-line unicorn/prefer-top-level-await\n(async () => {\n try {\n // eslint-disable-next-line compat/compat\n await Promise.all([writePrettierRc(), writePrettierIgnore()]);\n\n console.log(\"😎 Everything went well, have fun!\");\n\n // eslint-disable-next-line no-undef\n process.exit(0);\n } catch (error) {\n console.log(\"😬 something went wrong:\");\n console.error(error);\n\n // eslint-disable-next-line no-undef\n process.exit(1);\n }\n})();\n"]}
|
package/dist/postinstall.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a } from './chunk-YVQ27E43.mjs';
|
|
3
|
-
import { packageIsTypeModule } from '@anolilab/package-json-utils';
|
|
2
|
+
import { a as a$1 } from './chunk-YVQ27E43.mjs';
|
|
3
|
+
import { projectPath, packageIsTypeModule } from '@anolilab/package-json-utils';
|
|
4
4
|
import { writeFile, existsSync } from 'fs';
|
|
5
|
-
import {
|
|
5
|
+
import { join } from 'path';
|
|
6
6
|
import { promisify } from 'util';
|
|
7
7
|
|
|
8
|
-
process.env.CI&&process.exit(0);var s=promisify(writeFile)
|
|
9
|
-
`);var
|
|
8
|
+
process.env.CI&&process.exit(0);var s=promisify(writeFile);console.log("Configuring @anolilab/prettier-config",projectPath,`
|
|
9
|
+
`);var a=()=>{let e=join(projectPath,`.prettierrc.${packageIsTypeModule?"m":"c"}js`);return existsSync(e)||existsSync(e.replace(`.${packageIsTypeModule?"m":"c"}js`,""))?(console.warn(`\u26A0\uFE0F .prettierrc.${packageIsTypeModule?"m":"c"}js already exists;
|
|
10
10
|
Make sure that it includes the following for @anolilab/prettier-config to work as it should:
|
|
11
|
-
${JSON.stringify(a,void 0,4)}
|
|
12
|
-
`),Promise.resolve()):s(e,`${packageIsTypeModule?"export default":"module.exports ="} ${JSON.stringify(a,void 0,2).replace("rangeEnd: null,","rangeEnd: Infinity,")}
|
|
13
|
-
`,"utf-8")},
|
|
11
|
+
${JSON.stringify(a$1,void 0,4)}
|
|
12
|
+
`),Promise.resolve()):s(e,`${packageIsTypeModule?"export default":"module.exports ="} ${JSON.stringify(a$1,void 0,2).replace("rangeEnd: null,","rangeEnd: Infinity,")}
|
|
13
|
+
`,"utf-8")},p=()=>{let e=join(projectPath,".prettierignore");return existsSync(e)?(console.warn("\u26A0\uFE0F .prettierignore already exists"),Promise.resolve()):s(e,"","utf-8")};(async()=>{try{await Promise.all([a(),p()]),console.log("\u{1F60E} Everything went well, have fun!"),process.exit(0);}catch(e){console.log("\u{1F62C} something went wrong:"),console.error(e),process.exit(1);}})();
|
|
14
14
|
//# sourceMappingURL=out.js.map
|
|
15
15
|
//# sourceMappingURL=postinstall.mjs.map
|
package/dist/postinstall.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/postinstall.ts"],"names":["packageIsTypeModule","existsSync","writeFile","join","
|
|
1
|
+
{"version":3,"sources":["../src/postinstall.ts"],"names":["packageIsTypeModule","projectPath","existsSync","writeFile","join","promisify","writeFileAsync","writePrettierRc","prettierPath","src_default","writePrettierIgnore","error"],"mappings":";yCAEA,OAAS,uBAAAA,EAAqB,eAAAC,MAAmB,+BACjD,OAAS,cAAAC,EAAY,aAAAC,MAAiB,KACtC,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,MAAiB,OAItB,QAAQ,IAAI,IAEZ,QAAQ,KAAK,CAAC,EAGlB,IAAMC,EAAiBD,EAAUF,CAAS,EAE1C,QAAQ,IAAI,wCAAyCF,EAAa;AAAA,CAAI,EAKtE,IAAMM,EAAkB,IAAM,CAC1B,IAAMC,EAAeJ,EAAKH,EAAa,eAAeD,EAAsB,IAAM,OAAO,EAEzF,OAAIE,EAAWM,CAAY,GAAKN,EAAWM,EAAa,QAAQ,IAAIR,EAAsB,IAAM,QAAS,EAAE,CAAC,GACxG,QAAQ,KAAK,6BAAmBA,EAAsB,IAAM;AAAA;AAAA,EAElE,KAAK,UAAUS,EAAS,OAAW,CAAC;AAAA,CAAK,EAE5B,QAAQ,QAAQ,GAGpBH,EACHE,EACA,GAAGR,EAAsB,iBAAmB,sBAAsB,KAAK,UAAUS,EAAS,OAAW,CAAC,EAAE,QACpG,kBACA,qBACJ;AAAA,EACA,OACJ,CACJ,EAKMC,EAAsB,IAAM,CAC9B,IAAMF,EAAeJ,EAAKH,EAAa,iBAAiB,EAExD,OAAIC,EAAWM,CAAY,GACvB,QAAQ,KAAK,8CAAoC,EAE1C,QAAQ,QAAQ,GAGpBF,EAAeE,EAAc,GAAI,OAAO,CACnD,GAGC,SAAY,CACT,GAAI,CAEA,MAAM,QAAQ,IAAI,CAACD,EAAgB,EAAGG,EAAoB,CAAC,CAAC,EAE5D,QAAQ,IAAI,4CAAqC,EAGjD,QAAQ,KAAK,CAAC,CAClB,OAASC,EAAP,CACE,QAAQ,IAAI,kCAA2B,EACvC,QAAQ,MAAMA,CAAK,EAGnB,QAAQ,KAAK,CAAC,CAClB,CACJ,GAAG","sourcesContent":["#!/usr/bin/env node\n\nimport { packageIsTypeModule, projectPath } from \"@anolilab/package-json-utils\";\nimport { existsSync, writeFile } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { promisify } from \"node:util\";\n\nimport content from \"./index\";\n\nif (process.env[\"CI\"]) {\n // eslint-disable-next-line no-undef\n process.exit(0);\n}\n\nconst writeFileAsync = promisify(writeFile);\n\nconsole.log(\"Configuring @anolilab/prettier-config\", projectPath, \"\\n\");\n\n/**\n * Writes .prettierrc.${m|c}js if it doesn't exist. Warns if it exists.\n */\nconst writePrettierRc = () => {\n const prettierPath = join(projectPath, `.prettierrc.${packageIsTypeModule ? \"m\" : \"c\"}js`);\n\n if (existsSync(prettierPath) || existsSync(prettierPath.replace(`.${packageIsTypeModule ? \"m\" : \"c\"}js`, \"\"))) {\n console.warn(`⚠️ .prettierrc.${packageIsTypeModule ? \"m\" : \"c\"}js already exists;\nMake sure that it includes the following for @anolilab/prettier-config to work as it should:\n${JSON.stringify(content, undefined, 4)}\\n`);\n\n return Promise.resolve();\n }\n\n return writeFileAsync(\n prettierPath,\n `${packageIsTypeModule ? \"export default\" : \"module.exports =\"} ${JSON.stringify(content, undefined, 2).replace(\n \"rangeEnd: null,\",\n \"rangeEnd: Infinity,\",\n )}\\n`,\n \"utf-8\",\n );\n};\n\n/**\n * Writes .prettierignore if it doesn't exist. Warns if it exists.\n */\nconst writePrettierIgnore = () => {\n const prettierPath = join(projectPath, \".prettierignore\");\n\n if (existsSync(prettierPath)) {\n console.warn(\"⚠️ .prettierignore already exists\");\n\n return Promise.resolve();\n }\n\n return writeFileAsync(prettierPath, \"\", \"utf-8\");\n};\n\n// eslint-disable-next-line unicorn/prefer-top-level-await\n(async () => {\n try {\n // eslint-disable-next-line compat/compat\n await Promise.all([writePrettierRc(), writePrettierIgnore()]);\n\n console.log(\"😎 Everything went well, have fun!\");\n\n // eslint-disable-next-line no-undef\n process.exit(0);\n } catch (error) {\n console.log(\"😬 something went wrong:\");\n console.error(error);\n\n // eslint-disable-next-line no-undef\n process.exit(1);\n }\n})();\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anolilab/prettier-config",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.4",
|
|
4
4
|
"description": "Prettier shareable config for Anolilab.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"css",
|
|
@@ -59,7 +59,8 @@
|
|
|
59
59
|
"@anolilab/package-json-utils": "1.2.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"
|
|
62
|
+
"semantic-release": "^21.0.4",
|
|
63
|
+
"@anolilab/semantic-release-preset": "3.1.0"
|
|
63
64
|
},
|
|
64
65
|
"peerDependencies": {
|
|
65
66
|
"prettier": "2.x"
|