@anolilab/prettier-config 4.0.1 → 4.0.3

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 CHANGED
@@ -1,3 +1,18 @@
1
+ ## @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)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * use the projectPath from @anolilab/package-json-utils ([1574f21](https://github.com/anolilab/javascript-style-guide/commit/1574f2189e9d9e5db3aad4ad2d53ed2987a3afc4))
7
+
8
+ ## @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)
9
+
10
+
11
+
12
+ ### Dependencies
13
+
14
+ * **@anolilab/package-json-utils:** upgraded to 1.2.0
15
+
1
16
  ## @anolilab/prettier-config [4.0.1](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/prettier-config@4.0.0...@anolilab/prettier-config@4.0.1) (2023-06-10)
2
17
 
3
18
 
@@ -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),n=path.resolve(process.cwd(),"..","..","..");console.log("Configuring @anolilab/prettier-config",n,`
11
- `);var p=()=>{let e=path.join(n,`.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;
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")},f=()=>{let e=path.join(n,".prettierignore");return fs.existsSync(e)?(console.warn("\u26A0\uFE0F .prettierignore already exists"),Promise.resolve()):s(e,"","utf-8")};(async()=>{try{await Promise.all([p(),f()]),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);}})();
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
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/postinstall.ts"],"names":["packageIsTypeModule","existsSync","writeFile","join","resolve","promisify","writeFileAsync","projectPath","writePrettierRc","prettierPath","src_default","writePrettierIgnore","error"],"mappings":";wCAEA,OAAS,uBAAAA,MAA2B,+BACpC,OAAS,cAAAC,EAAY,aAAAC,MAAiB,KACtC,OAAS,QAAAC,EAAM,WAAAC,MAAe,OAC9B,OAAS,aAAAC,MAAiB,OAItB,QAAQ,IAAI,IAEZ,QAAQ,KAAK,CAAC,EAGlB,IAAMC,EAAiBD,EAAUH,CAAS,EAIpCK,EAAcH,EAAQ,QAAQ,IAAI,EAAG,KAAM,KAAM,IAAI,EAE3D,QAAQ,IAAI,wCAAyCG,EAAa;AAAA,CAAI,EAKtE,IAAMC,EAAkB,IAAM,CAC1B,IAAMC,EAAeN,EAAKI,EAAa,eAAeP,EAAsB,IAAM,OAAO,EAEzF,OAAIC,EAAWQ,CAAY,GAAKR,EAAWQ,EAAa,QAAQ,IAAIT,EAAsB,IAAM,QAAS,EAAE,CAAC,GACxG,QAAQ,KAAK,6BAAmBA,EAAsB,IAAM;AAAA;AAAA,EAElE,KAAK,UAAUU,EAAS,OAAW,CAAC;AAAA,CAAK,EAE5B,QAAQ,QAAQ,GAGpBJ,EACHG,EACA,GAAGT,EAAsB,iBAAmB,sBAAsB,KAAK,UAAUU,EAAS,OAAW,CAAC,EAAE,QACpG,kBACA,qBACJ;AAAA,EACA,OACJ,CACJ,EAKMC,EAAsB,IAAM,CAC9B,IAAMF,EAAeN,EAAKI,EAAa,iBAAiB,EAExD,OAAIN,EAAWQ,CAAY,GACvB,QAAQ,KAAK,8CAAoC,EAE1C,QAAQ,QAAQ,GAGpBH,EAAeG,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 } from \"@anolilab/package-json-utils\";\nimport { existsSync, writeFile } from \"node:fs\";\nimport { join, resolve } 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\n// get the path to the host project.\n// eslint-disable-next-line no-undef\nconst projectPath = resolve(process.cwd(), \"..\", \"..\", \"..\");\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"]}
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"]}
@@ -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 { resolve, join } from 'path';
5
+ import { join } from 'path';
6
6
  import { promisify } from 'util';
7
7
 
8
- process.env.CI&&process.exit(0);var s=promisify(writeFile),n=resolve(process.cwd(),"..","..","..");console.log("Configuring @anolilab/prettier-config",n,`
9
- `);var p=()=>{let e=join(n,`.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;
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")},f=()=>{let e=join(n,".prettierignore");return existsSync(e)?(console.warn("\u26A0\uFE0F .prettierignore already exists"),Promise.resolve()):s(e,"","utf-8")};(async()=>{try{await Promise.all([p(),f()]),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);}})();
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
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/postinstall.ts"],"names":["packageIsTypeModule","existsSync","writeFile","join","resolve","promisify","writeFileAsync","projectPath","writePrettierRc","prettierPath","src_default","writePrettierIgnore","error"],"mappings":";yCAEA,OAAS,uBAAAA,MAA2B,+BACpC,OAAS,cAAAC,EAAY,aAAAC,MAAiB,KACtC,OAAS,QAAAC,EAAM,WAAAC,MAAe,OAC9B,OAAS,aAAAC,MAAiB,OAItB,QAAQ,IAAI,IAEZ,QAAQ,KAAK,CAAC,EAGlB,IAAMC,EAAiBD,EAAUH,CAAS,EAIpCK,EAAcH,EAAQ,QAAQ,IAAI,EAAG,KAAM,KAAM,IAAI,EAE3D,QAAQ,IAAI,wCAAyCG,EAAa;AAAA,CAAI,EAKtE,IAAMC,EAAkB,IAAM,CAC1B,IAAMC,EAAeN,EAAKI,EAAa,eAAeP,EAAsB,IAAM,OAAO,EAEzF,OAAIC,EAAWQ,CAAY,GAAKR,EAAWQ,EAAa,QAAQ,IAAIT,EAAsB,IAAM,QAAS,EAAE,CAAC,GACxG,QAAQ,KAAK,6BAAmBA,EAAsB,IAAM;AAAA;AAAA,EAElE,KAAK,UAAUU,EAAS,OAAW,CAAC;AAAA,CAAK,EAE5B,QAAQ,QAAQ,GAGpBJ,EACHG,EACA,GAAGT,EAAsB,iBAAmB,sBAAsB,KAAK,UAAUU,EAAS,OAAW,CAAC,EAAE,QACpG,kBACA,qBACJ;AAAA,EACA,OACJ,CACJ,EAKMC,EAAsB,IAAM,CAC9B,IAAMF,EAAeN,EAAKI,EAAa,iBAAiB,EAExD,OAAIN,EAAWQ,CAAY,GACvB,QAAQ,KAAK,8CAAoC,EAE1C,QAAQ,QAAQ,GAGpBH,EAAeG,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 } from \"@anolilab/package-json-utils\";\nimport { existsSync, writeFile } from \"node:fs\";\nimport { join, resolve } 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\n// get the path to the host project.\n// eslint-disable-next-line no-undef\nconst projectPath = resolve(process.cwd(), \"..\", \"..\", \"..\");\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"]}
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.1",
3
+ "version": "4.0.3",
4
4
  "description": "Prettier shareable config for Anolilab.",
5
5
  "keywords": [
6
6
  "css",
@@ -56,7 +56,7 @@
56
56
  "postinstall": "node ./skip.js || node ./dist/postinstall.js"
57
57
  },
58
58
  "dependencies": {
59
- "@anolilab/package-json-utils": "1.1.0"
59
+ "@anolilab/package-json-utils": "1.2.0"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@anolilab/semantic-release-preset": "3.0.0"