@teambit/prettier 0.0.573 → 0.0.575
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/dist/prettier-config-writer.js.map +1 -1
- package/dist/prettier-formatter-interface.d.ts +1 -1
- package/dist/prettier-formatter-interface.js.map +1 -1
- package/dist/{preview-1679607263760.js → preview-1679974224627.js} +1 -1
- package/package-tar/teambit-prettier-0.0.575.tgz +0 -0
- package/package.json +8 -8
- package/package-tar/teambit-prettier-0.0.573.tgz +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CONFIG_NAME","BIT_GENERATED_PRETTIER_CONFIG_COMMENT","PrettierConfigWriter","constructor","formatter","calcConfigFiles","executionContext","getFormatter","undefined","id","toLowerCase","includes","config","generateIdeConfig","prettierConfig","content","JSON","stringify","prettierConfigFile","name","generateExtendingFile","writtenConfigFiles","configContent","filePath","extendingTarget","calcName","hash","isBitGenerated","fs","readFileSync","toString"],"sources":["prettier-config-writer.ts"],"sourcesContent":["import fs from 'fs-extra';\nimport { ExecutionContext } from '@teambit/envs';\nimport type {
|
|
1
|
+
{"version":3,"names":["CONFIG_NAME","BIT_GENERATED_PRETTIER_CONFIG_COMMENT","PrettierConfigWriter","constructor","formatter","calcConfigFiles","executionContext","getFormatter","undefined","id","toLowerCase","includes","config","generateIdeConfig","prettierConfig","content","JSON","stringify","prettierConfigFile","name","generateExtendingFile","writtenConfigFiles","configContent","filePath","extendingTarget","calcName","hash","isBitGenerated","fs","readFileSync","toString"],"sources":["prettier-config-writer.ts"],"sourcesContent":["import fs from 'fs-extra';\nimport { ExecutionContext } from '@teambit/envs';\nimport type {\n ConfigWriterEntry,\n WrittenConfigFile,\n ExtendingConfigFile,\n ConfigFile,\n} from '@teambit/workspace-config-files';\nimport { FormatterMain } from '@teambit/formatter';\nimport { PrettierFormatterInterface } from './prettier-formatter-interface';\n\nconst CONFIG_NAME = '.prettierrc.cjs';\nconst BIT_GENERATED_PRETTIER_CONFIG_COMMENT = '// bit-generated-prettier-config';\n\nexport class PrettierConfigWriter implements ConfigWriterEntry {\n name = 'PrettierConfigWriter';\n cliName = 'prettier';\n\n constructor(private formatter: FormatterMain) {}\n patterns: string[] = [`**/${CONFIG_NAME}`];\n\n calcConfigFiles(executionContext: ExecutionContext): ConfigFile[] | undefined {\n const formatter = this.formatter.getFormatter(executionContext, {}) as PrettierFormatterInterface;\n if (!formatter) return undefined;\n if (!formatter.id.toLowerCase().includes('prettier')) return undefined;\n const config = formatter.generateIdeConfig?.();\n if (!config || !config.prettierConfig) return undefined;\n const content = `module.exports = ${JSON.stringify(config.prettierConfig, null, 2)}`;\n const prettierConfigFile = {\n content,\n name: '.prettierrc.bit.{hash}.cjs',\n };\n return [prettierConfigFile];\n }\n\n generateExtendingFile(writtenConfigFiles: WrittenConfigFile[]): ExtendingConfigFile | undefined {\n const prettierConfigFile = writtenConfigFiles[0];\n const configContent = `module.exports = {\n ...require('${prettierConfigFile.filePath}')\n}`;\n const content = `${BIT_GENERATED_PRETTIER_CONFIG_COMMENT}\\n${configContent}`;\n return { content, name: CONFIG_NAME, extendingTarget: prettierConfigFile.filePath };\n }\n calcName(hash: string): string {\n return `.prettierrc.bit.${hash}.cjs`;\n }\n\n isBitGenerated(filePath: string): boolean {\n const content = fs.readFileSync(filePath).toString();\n return content.includes(BIT_GENERATED_PRETTIER_CONFIG_COMMENT);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAWA,MAAMA,WAAW,GAAG,iBAAiB;AACrC,MAAMC,qCAAqC,GAAG,kCAAkC;AAEzE,MAAMC,oBAAoB,CAA8B;EAI7DC,WAAW,CAASC,SAAwB,EAAE;IAAA,KAA1BA,SAAwB,GAAxBA,SAAwB;IAAA,8CAHrC,sBAAsB;IAAA,iDACnB,UAAU;IAAA,kDAGC,CAAE,MAAKJ,WAAY,EAAC,CAAC;EADK;EAG/CK,eAAe,CAACC,g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ACF;AAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["prettier-formatter-interface.ts"],"sourcesContent":["import { Formatter } from
|
|
1
|
+
{"version":3,"names":[],"sources":["prettier-formatter-interface.ts"],"sourcesContent":["import { Formatter } from '@teambit/formatter';\n\nexport type IdeConfig = {\n prettierConfig: Object;\n};\n\nexport interface PrettierFormatterInterface extends Formatter {\n generateIdeConfig?: () => IdeConfig;\n}\n"],"mappings":""}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.defender_prettier@0.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.defender_prettier@0.0.575/dist/prettier.composition.js';
|
|
2
2
|
;
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/prettier",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.575",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/defender/prettier",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.defender",
|
|
8
8
|
"name": "prettier",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.575"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"fs-extra": "10.0.0",
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
"core-js": "^3.0.0",
|
|
16
16
|
"@babel/runtime": "7.20.0",
|
|
17
17
|
"@teambit/harmony": "0.4.6",
|
|
18
|
-
"@teambit/envs": "0.0.
|
|
19
|
-
"@teambit/formatter": "0.0.
|
|
20
|
-
"@teambit/workspace-config-files": "0.0.
|
|
21
|
-
"@teambit/logger": "0.0.
|
|
22
|
-
"@teambit/cli": "0.0.
|
|
18
|
+
"@teambit/envs": "0.0.1024",
|
|
19
|
+
"@teambit/formatter": "0.0.575",
|
|
20
|
+
"@teambit/workspace-config-files": "0.0.4",
|
|
21
|
+
"@teambit/logger": "0.0.780",
|
|
22
|
+
"@teambit/cli": "0.0.687",
|
|
23
23
|
"@teambit/defender.prettier.config-mutator": "0.0.90"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@types/testing-library__jest-dom": "5.9.5"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@teambit/legacy": "1.0.
|
|
36
|
+
"@teambit/legacy": "1.0.467",
|
|
37
37
|
"react": "^16.8.0 || ^17.0.0",
|
|
38
38
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
39
39
|
},
|
|
Binary file
|