@anolilab/prettier-config 5.0.6 → 5.0.8

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,35 @@
1
+ ## @anolilab/prettier-config [5.0.8](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/prettier-config@5.0.7...@anolilab/prettier-config@5.0.8) (2023-09-26)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Various project dependencies have been updated to their respective newer versions. This covers multiple packages such as '@babel/cli', '@babel/core', '@nrwl/js', and 'eslint' among others within the package.json file. This upgrade is necessary to ensure the utilization of the most recent features, optimization and security improvements of the updated packages, and it also helps to maintain overall project consistency. ([38535ab](https://github.com/anolilab/javascript-style-guide/commit/38535abf2557680e3f22e1ff74372764ca11c2f1))
7
+
8
+
9
+ ### Styles
10
+
11
+ * cs fixes ([e053d90](https://github.com/anolilab/javascript-style-guide/commit/e053d90a4ab7a6466699c17d5afec1a7adc2459d))
12
+
13
+
14
+
15
+ ### Dependencies
16
+
17
+ * **@anolilab/package-json-utils:** upgraded to 3.0.6
18
+ * **@anolilab/semantic-release-preset:** upgraded to 7.0.3
19
+
20
+ ## @anolilab/prettier-config [5.0.7](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/prettier-config@5.0.6...@anolilab/prettier-config@5.0.7) (2023-09-22)
21
+
22
+
23
+ ### Styles
24
+
25
+ * cs fixes ([8e66dc2](https://github.com/anolilab/javascript-style-guide/commit/8e66dc261129837075a52a4364036918f1bbc115))
26
+
27
+
28
+
29
+ ### Dependencies
30
+
31
+ * **@anolilab/semantic-release-preset:** upgraded to 7.0.2
32
+
1
33
  ## @anolilab/prettier-config [5.0.6](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/prettier-config@5.0.5...@anolilab/prettier-config@5.0.6) (2023-09-21)
2
34
 
3
35
 
@@ -3,20 +3,21 @@
3
3
  var chunk3OYUO3P4_js = require('./chunk-3OYUO3P4.js');
4
4
  var fs = require('fs');
5
5
  var path = require('path');
6
+ var process = require('process');
6
7
  var util = require('util');
7
8
  var packageJsonUtils = require('@anolilab/package-json-utils');
8
9
 
9
- process.env.CI&&process.exit(0);var l=util.promisify(fs.writeFile);console.log("Configuring @anolilab/prettier-config",packageJsonUtils.projectPath,`
10
- `);var e=".prettierrc",g=async()=>{for(let i of [e,`${e}.js`,`${e}.cjs`,`${e}.json`,`${e}.json5`,`${e}.yaml`,`${e}.yml`,`${e}.toml`,"prettier.config.js","prettier.config.cjs"])if(fs.existsSync(path.join(packageJsonUtils.projectPath,i))){console.warn(`\u26A0\uFE0F ${i} already exists;
10
+ process.env.CI!==void 0&&process.exit(0);var a=util.promisify(fs.writeFile);console.log("Configuring @anolilab/prettier-config",packageJsonUtils.projectPath,`
11
+ `);var e=".prettierrc",m=async()=>{for(let n of [e,`${e}.js`,`${e}.cjs`,`${e}.json`,`${e}.json5`,`${e}.yaml`,`${e}.yml`,`${e}.toml`,"prettier.config.js","prettier.config.cjs"])if(fs.existsSync(path.join(packageJsonUtils.projectPath,n))){console.warn(`\u26A0\uFE0F ${n} already exists;
11
12
  Make sure that it includes the following for @anolilab/prettier-config to work as it should:
12
13
  ${JSON.stringify(chunk3OYUO3P4_js.a,void 0,4)}
13
- `);return}let r=path.join(packageJsonUtils.projectPath,".prettierrc.js");await l(r,`${packageJsonUtils.packageIsTypeModule?'import config from "@anolilab/prettier-config";':'var config = require("@anolilab/prettier-config");'}
14
+ `);return}let r=path.join(packageJsonUtils.projectPath,".prettierrc.js");await a(r,`${packageJsonUtils.packageIsTypeModule?'import config from "@anolilab/prettier-config";':'var config = require("@anolilab/prettier-config");'}
14
15
 
15
16
  ${packageJsonUtils.packageIsTypeModule?"export default":"module.exports ="} {
16
17
  ...config,
17
18
  }
18
- `,"utf8");},p=async()=>{let r=path.join(packageJsonUtils.projectPath,".prettierignore");if(fs.existsSync(r)){console.warn("\u26A0\uFE0F .prettierignore already exists");return}await l(r,`${["*.md","*.sh","*.yml","*.svg","*.gif","*.log",".DS_Store","CNAME","AUTHORS","LICENSE","es/","lib/","dist/","coverage/"].join(`
19
+ `,"utf8");},u=async()=>{let r=path.join(packageJsonUtils.projectPath,".prettierignore");if(fs.existsSync(r)){console.warn("\u26A0\uFE0F .prettierignore already exists");return}await a(r,`${["*.md","*.sh","*.yml","*.svg","*.gif","*.log",".DS_Store","CNAME","AUTHORS","LICENSE","es/","lib/","dist/","coverage/"].join(`
19
20
  `)}
20
- `,"utf8");};(async()=>{try{await Promise.all([g(),p()]),console.log("\u{1F60E} Everything went well, have fun!"),process.exit(0);}catch(r){console.log("\u{1F62C} something went wrong:"),console.error(r),process.exit(1);}})();
21
+ `,"utf8");};(async()=>{try{await Promise.all([m(),u()]),console.log("\u{1F60E} Everything went well, have fun!"),process.exit(0);}catch(r){console.log("\u{1F62C} something went wrong:"),console.error(r),process.exit(1);}})();
21
22
  //# sourceMappingURL=out.js.map
22
23
  //# sourceMappingURL=postinstall.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/postinstall.ts"],"names":["existsSync","writeFile","join","promisify","packageIsTypeModule","projectPath","writeFileAsync","configFile","writePrettierRc","filename","src_default","prettierPath","writePrettierIgnore","error"],"mappings":"wCAAA,OAAS,cAAAA,EAAY,aAAAC,MAAiB,KACtC,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,MAAiB,OAE1B,OAAS,uBAAAC,EAAqB,eAAAC,MAAmB,+BAI7C,QAAQ,IAAI,IAEZ,QAAQ,KAAK,CAAC,EAGlB,IAAMC,EAAiBH,EAAUF,CAAS,EAE1C,QAAQ,IAAI,wCAAyCI,EAAa;AAAA,CAAI,EAEtE,IAAME,EAAa,cAKbC,EAAkB,SAAY,CAEhC,QAAWC,IAAY,CACnBF,EACA,GAAGA,CAAU,MACb,GAAGA,CAAU,OACb,GAAGA,CAAU,QACb,GAAGA,CAAU,SACb,GAAGA,CAAU,QACb,GAAGA,CAAU,OACb,GAAGA,CAAU,QACb,qBACA,qBACJ,EAEI,GAAIP,EAAWE,EAAKG,EAAaI,CAAQ,CAAC,EAAG,CACzC,QAAQ,KAAK,iBAAOA,CAAQ;AAAA;AAAA,EAEtC,KAAK,UAAUC,EAAS,OAAW,CAAC,CAAC;AAAA,CAAI,EAE/B,MACJ,CAGJ,IAAMC,EAAeT,EAAKG,EAAa,gBAAgB,EAEvD,MAAMC,EACFK,EACA,GAAGP,EAAsB,kDAAoD,oDAAoD;AAAA;AAAA,EAEvIA,EAAsB,iBAAmB,kBAAkB;AAAA;AAAA;AAAA,EAIrD,MACJ,CACJ,EAKMQ,EAAsB,SAAY,CACpC,IAAMD,EAAeT,EAAKG,EAAa,iBAAiB,EAGxD,GAAIL,EAAWW,CAAY,EAAG,CAC1B,QAAQ,KAAK,8CAAoC,EAEjD,MACJ,CAEA,MAAML,EACFK,EACA,GAAG,CAAC,OAAQ,OAAQ,QAAS,QAAS,QAAS,QAAS,YAAa,QAAS,UAAW,UAAW,MAAO,OAAQ,QAAS,WAAW,EAAE,KAAK;AAAA,CAAI,CAAC;AAAA,EACnJ,MACJ,CACJ,GAGC,SAAY,CACT,GAAI,CAEA,MAAM,QAAQ,IAAI,CAACH,EAAgB,EAAGI,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":["import { existsSync, writeFile } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { promisify } from \"node:util\";\n\nimport { packageIsTypeModule, projectPath } from \"@anolilab/package-json-utils\";\n\nimport content from \".\";\n\nif (process.env[\"CI\"]) {\n // eslint-disable-next-line unicorn/no-process-exit\n process.exit(0);\n}\n\nconst writeFileAsync = promisify(writeFile);\n\nconsole.log(\"Configuring @anolilab/prettier-config\", projectPath, \"\\n\");\n\nconst configFile = \".prettierrc\";\n\n/**\n * Writes .prettierrc.${m|c}js if it doesn't exist. Warns if it exists.\n */\nconst writePrettierRc = async () => {\n // eslint-disable-next-line no-restricted-syntax\n for (const filename of [\n configFile,\n `${configFile}.js`,\n `${configFile}.cjs`,\n `${configFile}.json`,\n `${configFile}.json5`,\n `${configFile}.yaml`,\n `${configFile}.yml`,\n `${configFile}.toml`,\n \"prettier.config.js\",\n \"prettier.config.cjs\",\n ]) {\n // eslint-disable-next-line security/detect-non-literal-fs-filename\n if (existsSync(join(projectPath, filename))) {\n console.warn(`⚠️ ${filename} 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;\n }\n }\n\n const prettierPath = join(projectPath, \".prettierrc.js\");\n\n await writeFileAsync(\n prettierPath,\n `${packageIsTypeModule ? 'import config from \"@anolilab/prettier-config\";' : 'var config = require(\"@anolilab/prettier-config\");'}\n\n${packageIsTypeModule ? \"export default\" : \"module.exports =\"} {\n ...config,\n}\n`,\n \"utf8\",\n );\n};\n\n/**\n * Writes .prettierignore if it doesn't exist. Warns if it exists.\n */\nconst writePrettierIgnore = async () => {\n const prettierPath = join(projectPath, \".prettierignore\");\n\n // eslint-disable-next-line security/detect-non-literal-fs-filename\n if (existsSync(prettierPath)) {\n console.warn(\"⚠️ .prettierignore already exists\");\n\n return;\n }\n\n await writeFileAsync(\n prettierPath,\n `${[\"*.md\", \"*.sh\", \"*.yml\", \"*.svg\", \"*.gif\", \"*.log\", \".DS_Store\", \"CNAME\", \"AUTHORS\", \"LICENSE\", \"es/\", \"lib/\", \"dist/\", \"coverage/\"].join(\"\\n\")}\\n`,\n \"utf8\",\n );\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 unicorn/no-process-exit\n process.exit(0);\n } catch (error) {\n console.log(\"😬 something went wrong:\");\n console.error(error);\n\n // eslint-disable-next-line unicorn/no-process-exit\n process.exit(1);\n }\n})();\n"]}
1
+ {"version":3,"sources":["../src/postinstall.ts"],"names":["existsSync","writeFile","join","env","exit","promisify","packageIsTypeModule","projectPath","writeFileAsync","configFile","writePrettierRc","filename","src_default","prettierPath","writePrettierIgnore","error"],"mappings":"wCAAA,OAAS,cAAAA,EAAY,aAAAC,MAAiB,KACtC,OAAS,QAAAC,MAAY,OACrB,OAAS,OAAAC,EAAK,QAAAC,MAAY,UAC1B,OAAS,aAAAC,MAAiB,OAE1B,OAAS,uBAAAC,EAAqB,eAAAC,MAAmB,+BAI7CJ,EAAI,KAAU,QACdC,EAAK,CAAC,EAGV,IAAMI,EAAiBH,EAAUJ,CAAS,EAE1C,QAAQ,IAAI,wCAAyCM,EAAa;AAAA,CAAI,EAEtE,IAAME,EAAa,cAKbC,EAAkB,SAAY,CAEhC,QAAWC,IAAY,CACnBF,EACA,GAAGA,CAAU,MACb,GAAGA,CAAU,OACb,GAAGA,CAAU,QACb,GAAGA,CAAU,SACb,GAAGA,CAAU,QACb,GAAGA,CAAU,OACb,GAAGA,CAAU,QACb,qBACA,qBACJ,EAEI,GAAIT,EAAWE,EAAKK,EAAaI,CAAQ,CAAC,EAAG,CACzC,QAAQ,KAAK,iBAAOA,CAAQ;AAAA;AAAA,EAEtC,KAAK,UAAUC,EAAS,OAAW,CAAC,CAAC;AAAA,CAAI,EAE/B,MACJ,CAGJ,IAAMC,EAAeX,EAAKK,EAAa,gBAAgB,EAEvD,MAAMC,EACFK,EACA,GAAGP,EAAsB,kDAAoD,oDAAoD;AAAA;AAAA,EAEvIA,EAAsB,iBAAmB,kBAAkB;AAAA;AAAA;AAAA,EAIrD,MACJ,CACJ,EAKMQ,EAAsB,SAAY,CACpC,IAAMD,EAAeX,EAAKK,EAAa,iBAAiB,EAGxD,GAAIP,EAAWa,CAAY,EAAG,CAC1B,QAAQ,KAAK,8CAAoC,EAEjD,MACJ,CAEA,MAAML,EACFK,EACA,GAAG,CAAC,OAAQ,OAAQ,QAAS,QAAS,QAAS,QAAS,YAAa,QAAS,UAAW,UAAW,MAAO,OAAQ,QAAS,WAAW,EAAE,KAAK;AAAA,CAAI,CAAC;AAAA,EACnJ,MACJ,CACJ,GAGC,SAAY,CACT,GAAI,CAEA,MAAM,QAAQ,IAAI,CAACH,EAAgB,EAAGI,EAAoB,CAAC,CAAC,EAE5D,QAAQ,IAAI,4CAAqC,EAEjDV,EAAK,CAAC,CACV,OAASW,EAAO,CACZ,QAAQ,IAAI,kCAA2B,EACvC,QAAQ,MAAMA,CAAK,EAEnBX,EAAK,CAAC,CACV,CACJ,GAAG","sourcesContent":["import { existsSync, writeFile } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { env, exit } from \"node:process\";\nimport { promisify } from \"node:util\";\n\nimport { packageIsTypeModule, projectPath } from \"@anolilab/package-json-utils\";\n\nimport content from \".\";\n\nif (env[\"CI\"] !== undefined) {\n exit(0);\n}\n\nconst writeFileAsync = promisify(writeFile);\n\nconsole.log(\"Configuring @anolilab/prettier-config\", projectPath, \"\\n\");\n\nconst configFile = \".prettierrc\";\n\n/**\n * Writes .prettierrc.${m|c}js if it doesn't exist. Warns if it exists.\n */\nconst writePrettierRc = async () => {\n // eslint-disable-next-line no-restricted-syntax,no-loops/no-loops\n for (const filename of [\n configFile,\n `${configFile}.js`,\n `${configFile}.cjs`,\n `${configFile}.json`,\n `${configFile}.json5`,\n `${configFile}.yaml`,\n `${configFile}.yml`,\n `${configFile}.toml`,\n \"prettier.config.js\",\n \"prettier.config.cjs\",\n ]) {\n // eslint-disable-next-line security/detect-non-literal-fs-filename\n if (existsSync(join(projectPath, filename))) {\n console.warn(`⚠️ ${filename} 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;\n }\n }\n\n const prettierPath = join(projectPath, \".prettierrc.js\");\n\n await writeFileAsync(\n prettierPath,\n `${packageIsTypeModule ? 'import config from \"@anolilab/prettier-config\";' : 'var config = require(\"@anolilab/prettier-config\");'}\n\n${packageIsTypeModule ? \"export default\" : \"module.exports =\"} {\n ...config,\n}\n`,\n \"utf8\",\n );\n};\n\n/**\n * Writes .prettierignore if it doesn't exist. Warns if it exists.\n */\nconst writePrettierIgnore = async () => {\n const prettierPath = join(projectPath, \".prettierignore\");\n\n // eslint-disable-next-line security/detect-non-literal-fs-filename\n if (existsSync(prettierPath)) {\n console.warn(\"⚠️ .prettierignore already exists\");\n\n return;\n }\n\n await writeFileAsync(\n prettierPath,\n `${[\"*.md\", \"*.sh\", \"*.yml\", \"*.svg\", \"*.gif\", \"*.log\", \".DS_Store\", \"CNAME\", \"AUTHORS\", \"LICENSE\", \"es/\", \"lib/\", \"dist/\", \"coverage/\"].join(\"\\n\")}\\n`,\n \"utf8\",\n );\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 exit(0);\n } catch (error) {\n console.log(\"😬 something went wrong:\");\n console.error(error);\n\n exit(1);\n }\n})();\n"]}
@@ -1,20 +1,21 @@
1
- import { a } from './chunk-WDFZ7A7B.mjs';
1
+ import { a as a$1 } from './chunk-WDFZ7A7B.mjs';
2
2
  import { writeFile, existsSync } from 'fs';
3
3
  import { join } from 'path';
4
+ import { env, exit } from 'process';
4
5
  import { promisify } from 'util';
5
6
  import { projectPath, packageIsTypeModule } from '@anolilab/package-json-utils';
6
7
 
7
- process.env.CI&&process.exit(0);var l=promisify(writeFile);console.log("Configuring @anolilab/prettier-config",projectPath,`
8
- `);var e=".prettierrc",g=async()=>{for(let i of [e,`${e}.js`,`${e}.cjs`,`${e}.json`,`${e}.json5`,`${e}.yaml`,`${e}.yml`,`${e}.toml`,"prettier.config.js","prettier.config.cjs"])if(existsSync(join(projectPath,i))){console.warn(`\u26A0\uFE0F ${i} already exists;
8
+ env.CI!==void 0&&exit(0);var a=promisify(writeFile);console.log("Configuring @anolilab/prettier-config",projectPath,`
9
+ `);var e=".prettierrc",m=async()=>{for(let n of [e,`${e}.js`,`${e}.cjs`,`${e}.json`,`${e}.json5`,`${e}.yaml`,`${e}.yml`,`${e}.toml`,"prettier.config.js","prettier.config.cjs"])if(existsSync(join(projectPath,n))){console.warn(`\u26A0\uFE0F ${n} already exists;
9
10
  Make sure that it includes the following for @anolilab/prettier-config to work as it should:
10
- ${JSON.stringify(a,void 0,4)}
11
- `);return}let r=join(projectPath,".prettierrc.js");await l(r,`${packageIsTypeModule?'import config from "@anolilab/prettier-config";':'var config = require("@anolilab/prettier-config");'}
11
+ ${JSON.stringify(a$1,void 0,4)}
12
+ `);return}let r=join(projectPath,".prettierrc.js");await a(r,`${packageIsTypeModule?'import config from "@anolilab/prettier-config";':'var config = require("@anolilab/prettier-config");'}
12
13
 
13
14
  ${packageIsTypeModule?"export default":"module.exports ="} {
14
15
  ...config,
15
16
  }
16
- `,"utf8");},p=async()=>{let r=join(projectPath,".prettierignore");if(existsSync(r)){console.warn("\u26A0\uFE0F .prettierignore already exists");return}await l(r,`${["*.md","*.sh","*.yml","*.svg","*.gif","*.log",".DS_Store","CNAME","AUTHORS","LICENSE","es/","lib/","dist/","coverage/"].join(`
17
+ `,"utf8");},u=async()=>{let r=join(projectPath,".prettierignore");if(existsSync(r)){console.warn("\u26A0\uFE0F .prettierignore already exists");return}await a(r,`${["*.md","*.sh","*.yml","*.svg","*.gif","*.log",".DS_Store","CNAME","AUTHORS","LICENSE","es/","lib/","dist/","coverage/"].join(`
17
18
  `)}
18
- `,"utf8");};(async()=>{try{await Promise.all([g(),p()]),console.log("\u{1F60E} Everything went well, have fun!"),process.exit(0);}catch(r){console.log("\u{1F62C} something went wrong:"),console.error(r),process.exit(1);}})();
19
+ `,"utf8");};(async()=>{try{await Promise.all([m(),u()]),console.log("\u{1F60E} Everything went well, have fun!"),exit(0);}catch(r){console.log("\u{1F62C} something went wrong:"),console.error(r),exit(1);}})();
19
20
  //# sourceMappingURL=out.js.map
20
21
  //# sourceMappingURL=postinstall.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/postinstall.ts"],"names":["existsSync","writeFile","join","promisify","packageIsTypeModule","projectPath","writeFileAsync","configFile","writePrettierRc","filename","src_default","prettierPath","writePrettierIgnore","error"],"mappings":"yCAAA,OAAS,cAAAA,EAAY,aAAAC,MAAiB,KACtC,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,MAAiB,OAE1B,OAAS,uBAAAC,EAAqB,eAAAC,MAAmB,+BAI7C,QAAQ,IAAI,IAEZ,QAAQ,KAAK,CAAC,EAGlB,IAAMC,EAAiBH,EAAUF,CAAS,EAE1C,QAAQ,IAAI,wCAAyCI,EAAa;AAAA,CAAI,EAEtE,IAAME,EAAa,cAKbC,EAAkB,SAAY,CAEhC,QAAWC,IAAY,CACnBF,EACA,GAAGA,CAAU,MACb,GAAGA,CAAU,OACb,GAAGA,CAAU,QACb,GAAGA,CAAU,SACb,GAAGA,CAAU,QACb,GAAGA,CAAU,OACb,GAAGA,CAAU,QACb,qBACA,qBACJ,EAEI,GAAIP,EAAWE,EAAKG,EAAaI,CAAQ,CAAC,EAAG,CACzC,QAAQ,KAAK,iBAAOA,CAAQ;AAAA;AAAA,EAEtC,KAAK,UAAUC,EAAS,OAAW,CAAC,CAAC;AAAA,CAAI,EAE/B,MACJ,CAGJ,IAAMC,EAAeT,EAAKG,EAAa,gBAAgB,EAEvD,MAAMC,EACFK,EACA,GAAGP,EAAsB,kDAAoD,oDAAoD;AAAA;AAAA,EAEvIA,EAAsB,iBAAmB,kBAAkB;AAAA;AAAA;AAAA,EAIrD,MACJ,CACJ,EAKMQ,EAAsB,SAAY,CACpC,IAAMD,EAAeT,EAAKG,EAAa,iBAAiB,EAGxD,GAAIL,EAAWW,CAAY,EAAG,CAC1B,QAAQ,KAAK,8CAAoC,EAEjD,MACJ,CAEA,MAAML,EACFK,EACA,GAAG,CAAC,OAAQ,OAAQ,QAAS,QAAS,QAAS,QAAS,YAAa,QAAS,UAAW,UAAW,MAAO,OAAQ,QAAS,WAAW,EAAE,KAAK;AAAA,CAAI,CAAC;AAAA,EACnJ,MACJ,CACJ,GAGC,SAAY,CACT,GAAI,CAEA,MAAM,QAAQ,IAAI,CAACH,EAAgB,EAAGI,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":["import { existsSync, writeFile } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { promisify } from \"node:util\";\n\nimport { packageIsTypeModule, projectPath } from \"@anolilab/package-json-utils\";\n\nimport content from \".\";\n\nif (process.env[\"CI\"]) {\n // eslint-disable-next-line unicorn/no-process-exit\n process.exit(0);\n}\n\nconst writeFileAsync = promisify(writeFile);\n\nconsole.log(\"Configuring @anolilab/prettier-config\", projectPath, \"\\n\");\n\nconst configFile = \".prettierrc\";\n\n/**\n * Writes .prettierrc.${m|c}js if it doesn't exist. Warns if it exists.\n */\nconst writePrettierRc = async () => {\n // eslint-disable-next-line no-restricted-syntax\n for (const filename of [\n configFile,\n `${configFile}.js`,\n `${configFile}.cjs`,\n `${configFile}.json`,\n `${configFile}.json5`,\n `${configFile}.yaml`,\n `${configFile}.yml`,\n `${configFile}.toml`,\n \"prettier.config.js\",\n \"prettier.config.cjs\",\n ]) {\n // eslint-disable-next-line security/detect-non-literal-fs-filename\n if (existsSync(join(projectPath, filename))) {\n console.warn(`⚠️ ${filename} 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;\n }\n }\n\n const prettierPath = join(projectPath, \".prettierrc.js\");\n\n await writeFileAsync(\n prettierPath,\n `${packageIsTypeModule ? 'import config from \"@anolilab/prettier-config\";' : 'var config = require(\"@anolilab/prettier-config\");'}\n\n${packageIsTypeModule ? \"export default\" : \"module.exports =\"} {\n ...config,\n}\n`,\n \"utf8\",\n );\n};\n\n/**\n * Writes .prettierignore if it doesn't exist. Warns if it exists.\n */\nconst writePrettierIgnore = async () => {\n const prettierPath = join(projectPath, \".prettierignore\");\n\n // eslint-disable-next-line security/detect-non-literal-fs-filename\n if (existsSync(prettierPath)) {\n console.warn(\"⚠️ .prettierignore already exists\");\n\n return;\n }\n\n await writeFileAsync(\n prettierPath,\n `${[\"*.md\", \"*.sh\", \"*.yml\", \"*.svg\", \"*.gif\", \"*.log\", \".DS_Store\", \"CNAME\", \"AUTHORS\", \"LICENSE\", \"es/\", \"lib/\", \"dist/\", \"coverage/\"].join(\"\\n\")}\\n`,\n \"utf8\",\n );\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 unicorn/no-process-exit\n process.exit(0);\n } catch (error) {\n console.log(\"😬 something went wrong:\");\n console.error(error);\n\n // eslint-disable-next-line unicorn/no-process-exit\n process.exit(1);\n }\n})();\n"]}
1
+ {"version":3,"sources":["../src/postinstall.ts"],"names":["existsSync","writeFile","join","env","exit","promisify","packageIsTypeModule","projectPath","writeFileAsync","configFile","writePrettierRc","filename","src_default","prettierPath","writePrettierIgnore","error"],"mappings":"yCAAA,OAAS,cAAAA,EAAY,aAAAC,MAAiB,KACtC,OAAS,QAAAC,MAAY,OACrB,OAAS,OAAAC,EAAK,QAAAC,MAAY,UAC1B,OAAS,aAAAC,MAAiB,OAE1B,OAAS,uBAAAC,EAAqB,eAAAC,MAAmB,+BAI7CJ,EAAI,KAAU,QACdC,EAAK,CAAC,EAGV,IAAMI,EAAiBH,EAAUJ,CAAS,EAE1C,QAAQ,IAAI,wCAAyCM,EAAa;AAAA,CAAI,EAEtE,IAAME,EAAa,cAKbC,EAAkB,SAAY,CAEhC,QAAWC,IAAY,CACnBF,EACA,GAAGA,CAAU,MACb,GAAGA,CAAU,OACb,GAAGA,CAAU,QACb,GAAGA,CAAU,SACb,GAAGA,CAAU,QACb,GAAGA,CAAU,OACb,GAAGA,CAAU,QACb,qBACA,qBACJ,EAEI,GAAIT,EAAWE,EAAKK,EAAaI,CAAQ,CAAC,EAAG,CACzC,QAAQ,KAAK,iBAAOA,CAAQ;AAAA;AAAA,EAEtC,KAAK,UAAUC,EAAS,OAAW,CAAC,CAAC;AAAA,CAAI,EAE/B,MACJ,CAGJ,IAAMC,EAAeX,EAAKK,EAAa,gBAAgB,EAEvD,MAAMC,EACFK,EACA,GAAGP,EAAsB,kDAAoD,oDAAoD;AAAA;AAAA,EAEvIA,EAAsB,iBAAmB,kBAAkB;AAAA;AAAA;AAAA,EAIrD,MACJ,CACJ,EAKMQ,EAAsB,SAAY,CACpC,IAAMD,EAAeX,EAAKK,EAAa,iBAAiB,EAGxD,GAAIP,EAAWa,CAAY,EAAG,CAC1B,QAAQ,KAAK,8CAAoC,EAEjD,MACJ,CAEA,MAAML,EACFK,EACA,GAAG,CAAC,OAAQ,OAAQ,QAAS,QAAS,QAAS,QAAS,YAAa,QAAS,UAAW,UAAW,MAAO,OAAQ,QAAS,WAAW,EAAE,KAAK;AAAA,CAAI,CAAC;AAAA,EACnJ,MACJ,CACJ,GAGC,SAAY,CACT,GAAI,CAEA,MAAM,QAAQ,IAAI,CAACH,EAAgB,EAAGI,EAAoB,CAAC,CAAC,EAE5D,QAAQ,IAAI,4CAAqC,EAEjDV,EAAK,CAAC,CACV,OAASW,EAAO,CACZ,QAAQ,IAAI,kCAA2B,EACvC,QAAQ,MAAMA,CAAK,EAEnBX,EAAK,CAAC,CACV,CACJ,GAAG","sourcesContent":["import { existsSync, writeFile } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { env, exit } from \"node:process\";\nimport { promisify } from \"node:util\";\n\nimport { packageIsTypeModule, projectPath } from \"@anolilab/package-json-utils\";\n\nimport content from \".\";\n\nif (env[\"CI\"] !== undefined) {\n exit(0);\n}\n\nconst writeFileAsync = promisify(writeFile);\n\nconsole.log(\"Configuring @anolilab/prettier-config\", projectPath, \"\\n\");\n\nconst configFile = \".prettierrc\";\n\n/**\n * Writes .prettierrc.${m|c}js if it doesn't exist. Warns if it exists.\n */\nconst writePrettierRc = async () => {\n // eslint-disable-next-line no-restricted-syntax,no-loops/no-loops\n for (const filename of [\n configFile,\n `${configFile}.js`,\n `${configFile}.cjs`,\n `${configFile}.json`,\n `${configFile}.json5`,\n `${configFile}.yaml`,\n `${configFile}.yml`,\n `${configFile}.toml`,\n \"prettier.config.js\",\n \"prettier.config.cjs\",\n ]) {\n // eslint-disable-next-line security/detect-non-literal-fs-filename\n if (existsSync(join(projectPath, filename))) {\n console.warn(`⚠️ ${filename} 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;\n }\n }\n\n const prettierPath = join(projectPath, \".prettierrc.js\");\n\n await writeFileAsync(\n prettierPath,\n `${packageIsTypeModule ? 'import config from \"@anolilab/prettier-config\";' : 'var config = require(\"@anolilab/prettier-config\");'}\n\n${packageIsTypeModule ? \"export default\" : \"module.exports =\"} {\n ...config,\n}\n`,\n \"utf8\",\n );\n};\n\n/**\n * Writes .prettierignore if it doesn't exist. Warns if it exists.\n */\nconst writePrettierIgnore = async () => {\n const prettierPath = join(projectPath, \".prettierignore\");\n\n // eslint-disable-next-line security/detect-non-literal-fs-filename\n if (existsSync(prettierPath)) {\n console.warn(\"⚠️ .prettierignore already exists\");\n\n return;\n }\n\n await writeFileAsync(\n prettierPath,\n `${[\"*.md\", \"*.sh\", \"*.yml\", \"*.svg\", \"*.gif\", \"*.log\", \".DS_Store\", \"CNAME\", \"AUTHORS\", \"LICENSE\", \"es/\", \"lib/\", \"dist/\", \"coverage/\"].join(\"\\n\")}\\n`,\n \"utf8\",\n );\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 exit(0);\n } catch (error) {\n console.log(\"😬 something went wrong:\");\n console.error(error);\n\n exit(1);\n }\n})();\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anolilab/prettier-config",
3
- "version": "5.0.6",
3
+ "version": "5.0.8",
4
4
  "description": "Prettier shareable config for Anolilab.",
5
5
  "keywords": [
6
6
  "css",
@@ -57,12 +57,12 @@
57
57
  "postinstall": "node ./skip.js || node ./dist/postinstall.js"
58
58
  },
59
59
  "dependencies": {
60
- "@anolilab/package-json-utils": "3.0.5"
60
+ "@anolilab/package-json-utils": "3.0.6"
61
61
  },
62
62
  "devDependencies": {
63
- "@anolilab/semantic-release-preset": "7.0.0",
63
+ "@anolilab/semantic-release-preset": "7.0.3",
64
64
  "prettier": "^3.0.3",
65
- "rimraf": "^5.0.1",
65
+ "rimraf": "^5.0.2",
66
66
  "semantic-release": "^21.1.2",
67
67
  "tsup": "^7.2.0",
68
68
  "vitest": "^0.34.5"