@teambit/workspace-config-files 0.0.1
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/config-writer-entry.d.ts +94 -0
- package/dist/config-writer-entry.js +3 -0
- package/dist/config-writer-entry.js.map +1 -0
- package/dist/dedup-paths.d.ts +28 -0
- package/dist/dedup-paths.js +121 -0
- package/dist/dedup-paths.js.map +1 -0
- package/dist/dedup-paths.spec.d.ts +1 -0
- package/dist/dedup-paths.spec.js +198 -0
- package/dist/dedup-paths.spec.js.map +1 -0
- package/dist/format-outputs.d.ts +5 -0
- package/dist/format-outputs.js +105 -0
- package/dist/format-outputs.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/preview-1679542267429.js +7 -0
- package/dist/workspace-config-files.aspect.d.ts +2 -0
- package/dist/workspace-config-files.aspect.js +19 -0
- package/dist/workspace-config-files.aspect.js.map +1 -0
- package/dist/workspace-config-files.docs.mdx +21 -0
- package/dist/workspace-config-files.main.runtime.d.ts +147 -0
- package/dist/workspace-config-files.main.runtime.js +480 -0
- package/dist/workspace-config-files.main.runtime.js.map +1 -0
- package/dist/ws-config.cmd.d.ts +63 -0
- package/dist/ws-config.cmd.js +163 -0
- package/dist/ws-config.cmd.js.map +1 -0
- package/package-tar/teambit-workspace-config-files-0.0.1.tgz +0 -0
- package/package.json +65 -0
- package/tsconfig.json +40 -0
- package/types/asset.d.ts +29 -0
- package/types/style.d.ts +42 -0
- package/workspace-config-files.docs.mdx +21 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
require("core-js/modules/es.array.iterator.js");
|
|
5
|
+
require("core-js/modules/es.promise.js");
|
|
6
|
+
require("core-js/modules/es.regexp.exec.js");
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.WsConfigWriteCmd = exports.WsConfigListCmd = exports.WsConfigCmd = exports.WsConfigCleanCmd = void 0;
|
|
11
|
+
function _defineProperty2() {
|
|
12
|
+
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
+
_defineProperty2 = function () {
|
|
14
|
+
return data;
|
|
15
|
+
};
|
|
16
|
+
return data;
|
|
17
|
+
}
|
|
18
|
+
function _lodash() {
|
|
19
|
+
const data = require("lodash");
|
|
20
|
+
_lodash = function () {
|
|
21
|
+
return data;
|
|
22
|
+
};
|
|
23
|
+
return data;
|
|
24
|
+
}
|
|
25
|
+
function _chalk() {
|
|
26
|
+
const data = _interopRequireDefault(require("chalk"));
|
|
27
|
+
_chalk = function () {
|
|
28
|
+
return data;
|
|
29
|
+
};
|
|
30
|
+
return data;
|
|
31
|
+
}
|
|
32
|
+
function _formatOutputs() {
|
|
33
|
+
const data = require("./format-outputs");
|
|
34
|
+
_formatOutputs = function () {
|
|
35
|
+
return data;
|
|
36
|
+
};
|
|
37
|
+
return data;
|
|
38
|
+
}
|
|
39
|
+
/* eslint-disable max-classes-per-file */
|
|
40
|
+
|
|
41
|
+
const COMMAND_NAME = 'ws-config';
|
|
42
|
+
class WsConfigCmd {
|
|
43
|
+
constructor() {
|
|
44
|
+
(0, _defineProperty2().default)(this, "name", `${COMMAND_NAME} <sub-command>`);
|
|
45
|
+
(0, _defineProperty2().default)(this, "alias", 'workspace-config');
|
|
46
|
+
(0, _defineProperty2().default)(this, "description", 'manage workspace config files');
|
|
47
|
+
(0, _defineProperty2().default)(this, "options", []);
|
|
48
|
+
(0, _defineProperty2().default)(this, "group", 'development');
|
|
49
|
+
(0, _defineProperty2().default)(this, "commands", []);
|
|
50
|
+
}
|
|
51
|
+
// helpUrl = '';
|
|
52
|
+
|
|
53
|
+
async report([unrecognizedSubcommand]) {
|
|
54
|
+
return _chalk().default.red(`"${unrecognizedSubcommand}" is not a subcommand of "ws-config", please run "bit ws-config --help" to list the subcommands`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.WsConfigCmd = WsConfigCmd;
|
|
58
|
+
class WsConfigWriteCmd {
|
|
59
|
+
constructor(workspaceConfigFilesMain) {
|
|
60
|
+
this.workspaceConfigFilesMain = workspaceConfigFilesMain;
|
|
61
|
+
(0, _defineProperty2().default)(this, "name", 'write');
|
|
62
|
+
(0, _defineProperty2().default)(this, "description", 'EXPERIMENTAL. write config files in the workspace. useful for IDEs');
|
|
63
|
+
(0, _defineProperty2().default)(this, "alias", '');
|
|
64
|
+
(0, _defineProperty2().default)(this, "group", 'development');
|
|
65
|
+
(0, _defineProperty2().default)(this, "options", [['c', 'clean', 'delete existing config files from the workspace. highly recommended to run it with "--dry-run" first'], ['w', 'writers <writers>', `only write config files for the given writers. use comma to separate multiple writers. use ${COMMAND_NAME} list to see all writers`], ['s', 'silent', 'do not prompt for confirmation'], ['', 'no-dedupe', "write configs inside each one of the component's dir, avoid deduping"], ['', 'dry-run', 'show the paths that configs will be written per env'], ['', 'dry-run-with-content', 'use with --json flag. show the config content and the paths it will be written per env'], ['j', 'json', 'json format']]);
|
|
66
|
+
}
|
|
67
|
+
async report(_args, flags) {
|
|
68
|
+
const results = await this.json(_args, flags);
|
|
69
|
+
if (flags.dryRunWithContent) {
|
|
70
|
+
throw new Error(`use --json flag along with --dry-run-with-content`);
|
|
71
|
+
}
|
|
72
|
+
return (0, _formatOutputs().formatWriteOutput)(results, flags);
|
|
73
|
+
}
|
|
74
|
+
async json(_args, flags) {
|
|
75
|
+
const {
|
|
76
|
+
clean,
|
|
77
|
+
silent,
|
|
78
|
+
noDedupe,
|
|
79
|
+
dryRunWithContent,
|
|
80
|
+
writers
|
|
81
|
+
} = flags;
|
|
82
|
+
const dryRun = dryRunWithContent ? true : flags.dryRun;
|
|
83
|
+
const {
|
|
84
|
+
cleanResults,
|
|
85
|
+
writeResults,
|
|
86
|
+
wsDir
|
|
87
|
+
} = await this.workspaceConfigFilesMain.writeConfigFiles({
|
|
88
|
+
clean,
|
|
89
|
+
dedupe: !noDedupe,
|
|
90
|
+
dryRun,
|
|
91
|
+
dryRunWithContent,
|
|
92
|
+
silent,
|
|
93
|
+
writers: writers === null || writers === void 0 ? void 0 : writers.split(',')
|
|
94
|
+
});
|
|
95
|
+
if (dryRun) {
|
|
96
|
+
const aspectsWritersResults = dryRunWithContent ? writeResults.aspectsWritersResults : writeResults.aspectsWritersResults.map(s => (0, _lodash().omit)(s, ['content']));
|
|
97
|
+
// return JSON.stringify({ cleanResults, writeResults: writeJson }, undefined, 2);
|
|
98
|
+
return {
|
|
99
|
+
wsDir,
|
|
100
|
+
cleanResults,
|
|
101
|
+
writeResults: {
|
|
102
|
+
totalWrittenFiles: writeResults.totalWrittenFiles,
|
|
103
|
+
aspectsWritersResults
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
return {
|
|
108
|
+
wsDir,
|
|
109
|
+
cleanResults,
|
|
110
|
+
writeResults
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
exports.WsConfigWriteCmd = WsConfigWriteCmd;
|
|
115
|
+
class WsConfigCleanCmd {
|
|
116
|
+
constructor(workspaceConfigFilesMain) {
|
|
117
|
+
this.workspaceConfigFilesMain = workspaceConfigFilesMain;
|
|
118
|
+
(0, _defineProperty2().default)(this, "name", 'clean');
|
|
119
|
+
(0, _defineProperty2().default)(this, "description", 'EXPERIMENTAL. clean (delete) written config files in the workspace. useful for IDEs');
|
|
120
|
+
(0, _defineProperty2().default)(this, "alias", '');
|
|
121
|
+
(0, _defineProperty2().default)(this, "group", 'development');
|
|
122
|
+
(0, _defineProperty2().default)(this, "options", [['s', 'silent', 'do not prompt for confirmation'], ['w', 'writers <writers>', `only write config files for the given writers. use comma to separate multiple writers. use ${COMMAND_NAME} list to see all writers`], ['', 'dry-run', 'show the paths that configs will be written per env'], ['j', 'json', 'json format']]);
|
|
123
|
+
}
|
|
124
|
+
async report(_args, flags) {
|
|
125
|
+
const results = await this.json(_args, flags);
|
|
126
|
+
return (0, _formatOutputs().formatCleanOutput)(results, flags);
|
|
127
|
+
}
|
|
128
|
+
async json(_args, flags) {
|
|
129
|
+
var _flags$writers;
|
|
130
|
+
const {
|
|
131
|
+
silent,
|
|
132
|
+
dryRun
|
|
133
|
+
} = flags;
|
|
134
|
+
const cleanResults = await this.workspaceConfigFilesMain.cleanConfigFiles({
|
|
135
|
+
dryRun,
|
|
136
|
+
silent,
|
|
137
|
+
writers: (_flags$writers = flags.writers) === null || _flags$writers === void 0 ? void 0 : _flags$writers.split(',')
|
|
138
|
+
});
|
|
139
|
+
return cleanResults;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
exports.WsConfigCleanCmd = WsConfigCleanCmd;
|
|
143
|
+
class WsConfigListCmd {
|
|
144
|
+
constructor(workspaceConfigFilesMain) {
|
|
145
|
+
this.workspaceConfigFilesMain = workspaceConfigFilesMain;
|
|
146
|
+
(0, _defineProperty2().default)(this, "name", 'list');
|
|
147
|
+
(0, _defineProperty2().default)(this, "description", 'EXPERIMENTAL. list config writers');
|
|
148
|
+
(0, _defineProperty2().default)(this, "alias", '');
|
|
149
|
+
(0, _defineProperty2().default)(this, "group", 'development');
|
|
150
|
+
(0, _defineProperty2().default)(this, "options", [['j', 'json', 'json format']]);
|
|
151
|
+
}
|
|
152
|
+
async report() {
|
|
153
|
+
const results = await this.json();
|
|
154
|
+
return (0, _formatOutputs().formatListOutput)(results);
|
|
155
|
+
}
|
|
156
|
+
async json() {
|
|
157
|
+
const cleanResults = await this.workspaceConfigFilesMain.listConfigWriters();
|
|
158
|
+
return cleanResults;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
exports.WsConfigListCmd = WsConfigListCmd;
|
|
162
|
+
|
|
163
|
+
//# sourceMappingURL=ws-config.cmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["COMMAND_NAME","WsConfigCmd","report","unrecognizedSubcommand","chalk","red","WsConfigWriteCmd","constructor","workspaceConfigFilesMain","_args","flags","results","json","dryRunWithContent","Error","formatWriteOutput","clean","silent","noDedupe","writers","dryRun","cleanResults","writeResults","wsDir","writeConfigFiles","dedupe","split","aspectsWritersResults","map","s","omit","totalWrittenFiles","WsConfigCleanCmd","formatCleanOutput","cleanConfigFiles","WsConfigListCmd","formatListOutput","listConfigWriters"],"sources":["ws-config.cmd.ts"],"sourcesContent":["/* eslint-disable max-classes-per-file */\n\nimport { omit } from 'lodash';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport {\n WorkspaceConfigFilesMain,\n WriteConfigFilesResult\n} from './workspace-config-files.main.runtime';\nimport { formatCleanOutput, formatListOutput, formatWriteOutput } from './format-outputs';\n\nexport type CleanConfigCmdFlags = {\n dryRun?: boolean;\n silent?: boolean;\n};\n\nexport type WriteConfigCmdFlags = {\n dryRun?: boolean;\n writers?: string;\n noDedupe?: boolean;\n dryRunWithContent?: boolean;\n clean?: boolean;\n silent?: boolean;\n};\n\nconst COMMAND_NAME = 'ws-config';\n\nexport class WsConfigCmd implements Command {\n name = `${COMMAND_NAME} <sub-command>`;\n alias = 'workspace-config';\n description = 'manage workspace config files';\n options = [];\n group = 'development';\n commands: Command[] = [];\n // helpUrl = '';\n\n async report([unrecognizedSubcommand]: [string]) {\n return chalk.red(\n `\"${unrecognizedSubcommand}\" is not a subcommand of \"ws-config\", please run \"bit ws-config --help\" to list the subcommands`\n );\n }\n}\n\nexport class WsConfigWriteCmd implements Command {\n name = 'write';\n description = 'EXPERIMENTAL. write config files in the workspace. useful for IDEs';\n alias = '';\n group = 'development';\n options = [\n [\n 'c',\n 'clean',\n 'delete existing config files from the workspace. highly recommended to run it with \"--dry-run\" first',\n ],\n ['w', 'writers <writers>', `only write config files for the given writers. use comma to separate multiple writers. use ${COMMAND_NAME} list to see all writers`],\n ['s', 'silent', 'do not prompt for confirmation'],\n ['', 'no-dedupe', \"write configs inside each one of the component's dir, avoid deduping\"],\n ['', 'dry-run', 'show the paths that configs will be written per env'],\n [\n '',\n 'dry-run-with-content',\n 'use with --json flag. show the config content and the paths it will be written per env',\n ],\n ['j', 'json', 'json format'],\n ] as CommandOptions;\n\n constructor(private workspaceConfigFilesMain: WorkspaceConfigFilesMain) {}\n\n async report(_args, flags: WriteConfigCmdFlags) {\n const results = (await this.json(_args, flags)) as WriteConfigFilesResult;\n if (flags.dryRunWithContent) {\n throw new Error(`use --json flag along with --dry-run-with-content`);\n }\n return formatWriteOutput(results, flags);\n }\n\n async json(_args, flags: WriteConfigCmdFlags) {\n const { clean, silent, noDedupe, dryRunWithContent, writers } = flags;\n const dryRun = dryRunWithContent ? true : flags.dryRun;\n const { cleanResults, writeResults, wsDir } = await this.workspaceConfigFilesMain.writeConfigFiles({\n clean,\n dedupe: !noDedupe,\n dryRun,\n dryRunWithContent,\n silent,\n writers: writers?.split(',')\n });\n\n if (dryRun) {\n const aspectsWritersResults = dryRunWithContent\n ? writeResults.aspectsWritersResults\n : writeResults.aspectsWritersResults.map((s) => omit(s, ['content']));\n // return JSON.stringify({ cleanResults, writeResults: writeJson }, undefined, 2);\n return {\n wsDir,\n cleanResults,\n writeResults: { totalWrittenFiles: writeResults.totalWrittenFiles, aspectsWritersResults },\n };\n }\n return { wsDir, cleanResults, writeResults };\n }\n}\n\nexport class WsConfigCleanCmd implements Command {\n name = 'clean';\n description = 'EXPERIMENTAL. clean (delete) written config files in the workspace. useful for IDEs';\n alias = '';\n group = 'development';\n options = [\n ['s', 'silent', 'do not prompt for confirmation'],\n ['w', 'writers <writers>', `only write config files for the given writers. use comma to separate multiple writers. use ${COMMAND_NAME} list to see all writers`],\n ['', 'dry-run', 'show the paths that configs will be written per env'],\n ['j', 'json', 'json format'],\n ] as CommandOptions;\n\n constructor(private workspaceConfigFilesMain: WorkspaceConfigFilesMain) {}\n\n async report(_args, flags: CleanConfigCmdFlags) {\n const results = await this.json(_args, flags);\n return formatCleanOutput(results, flags);\n }\n\n async json(_args, flags: WriteConfigCmdFlags) {\n const { silent, dryRun } = flags;\n const cleanResults = await this.workspaceConfigFilesMain.cleanConfigFiles({\n dryRun,\n silent,\n writers: flags.writers?.split(','),\n });\n return cleanResults;\n }\n}\n\nexport class WsConfigListCmd implements Command {\n name = 'list';\n description = 'EXPERIMENTAL. list config writers';\n alias = '';\n group = 'development';\n options = [\n ['j', 'json', 'json format'],\n ] as CommandOptions;\n\n constructor(private workspaceConfigFilesMain: WorkspaceConfigFilesMain) {}\n\n async report() {\n const results = await this.json();\n return formatListOutput(results);\n }\n\n async json() {\n const cleanResults = await this.workspaceConfigFilesMain.listConfigWriters();\n return cleanResults;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAKA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AATA;;AAyBA,MAAMA,YAAY,GAAG,WAAW;AAEzB,MAAMC,WAAW,CAAoB;EAAA;IAAA,8CAClC,GAAED,YAAa,gBAAe;IAAA,+CAC9B,kBAAkB;IAAA,qDACZ,+BAA+B;IAAA,iDACnC,EAAE;IAAA,+CACJ,aAAa;IAAA,kDACC,EAAE;EAAA;EACxB;;EAEA,MAAME,MAAM,CAAC,CAACC,sBAAsB,CAAW,EAAE;IAC/C,OAAOC,gBAAK,CAACC,GAAG,CACb,IAAGF,sBAAuB,iGAAgG,CAC5H;EACH;AACF;AAAC;AAEM,MAAMG,gBAAgB,CAAoB;EAuB/CC,WAAW,CAASC,wBAAkD,EAAE;IAAA,KAApDA,wBAAkD,GAAlDA,wBAAkD;IAAA,8CAtB/D,OAAO;IAAA,qDACA,oEAAoE;IAAA,+CAC1E,EAAE;IAAA,+CACF,aAAa;IAAA,iDACX,CACR,CACE,GAAG,EACH,OAAO,EACP,sGAAsG,CACvG,EACD,CAAC,GAAG,EAAE,mBAAmB,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C;IACF,OAAOL,YAAY;EACrB;AACF;AAAC;AAEM,MAAMc,eAAe,CAAoB;EAS9C5B,WAAW,CAASC,wBAAkD,EAAE;IAAA,KAApDA,wBAAkD,GAAlDA,wBAAkD;IAAA,8CAR/D,MAAM;IAAA,qDACC,mCAAmC;IAAA,+CACzC,EAAE;IAAA,+CACF,aAAa;IAAA,iDACX,CACR,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,CAAC,CAC7B;EAEwE;EAEzE,MAAMN,MAAM,GAAG;IACb,MAAMS,OAAO,GAAG,MAAM,IAAI,CAACC,IAAI,EAAE;IACjC,OAAO,IAAAwB,iCAAgB,EAACzB,OAAO,CAAC;EAClC;EAEA,MAAMC,IAAI,GAAG;IACX,MAAMS,YAAY,GAAG,MAAM,IAAI,CAACb,wBAAwB,CAAC6B,iBAAiB,EAAE;IAC5E,OAAOhB,YAAY;EACrB;AACF;AAAC"}
|
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@teambit/workspace-config-files",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"componentId": {
|
|
6
|
+
"scope": "teambit.workspace",
|
|
7
|
+
"name": "workspace-config-files",
|
|
8
|
+
"version": "0.0.1"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"lodash": "4.17.21",
|
|
12
|
+
"chalk": "2.4.2",
|
|
13
|
+
"cli-table": "0.3.6",
|
|
14
|
+
"fs-extra": "10.0.0",
|
|
15
|
+
"globby": "11.0.1",
|
|
16
|
+
"p-map-series": "2.1.0",
|
|
17
|
+
"string-format": "0.5.0",
|
|
18
|
+
"yesno": "0.4.0",
|
|
19
|
+
"core-js": "^3.0.0",
|
|
20
|
+
"@babel/runtime": "7.20.0",
|
|
21
|
+
"@teambit/harmony": "0.4.6",
|
|
22
|
+
"@teambit/envs": "0.0.1021",
|
|
23
|
+
"@teambit/cli": "0.0.684",
|
|
24
|
+
"@teambit/logger": "0.0.777",
|
|
25
|
+
"@teambit/workspace": "0.0.1021"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"chai": "4.3.0",
|
|
29
|
+
"@types/chai": "4.2.15",
|
|
30
|
+
"@types/lodash": "4.14.165",
|
|
31
|
+
"@types/cli-table": "^0.3.0",
|
|
32
|
+
"@types/fs-extra": "9.0.7",
|
|
33
|
+
"@types/mocha": "9.1.0",
|
|
34
|
+
"@types/node": "12.20.4",
|
|
35
|
+
"@types/react": "^17.0.8",
|
|
36
|
+
"@types/react-dom": "^17.0.5",
|
|
37
|
+
"@types/jest": "^26.0.0",
|
|
38
|
+
"@types/testing-library__jest-dom": "5.9.5"
|
|
39
|
+
},
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"@teambit/legacy": "1.0.464",
|
|
42
|
+
"react": "^16.8.0 || ^17.0.0",
|
|
43
|
+
"react-dom": "^16.8.0 || ^17.0.0"
|
|
44
|
+
},
|
|
45
|
+
"license": "Apache-2.0",
|
|
46
|
+
"private": false,
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": ">=12.22.0"
|
|
49
|
+
},
|
|
50
|
+
"repository": {
|
|
51
|
+
"type": "git",
|
|
52
|
+
"url": "https://github.com/teambit/bit"
|
|
53
|
+
},
|
|
54
|
+
"keywords": [
|
|
55
|
+
"bit",
|
|
56
|
+
"bit-aspect",
|
|
57
|
+
"components",
|
|
58
|
+
"collaboration",
|
|
59
|
+
"web",
|
|
60
|
+
"react",
|
|
61
|
+
"react-components",
|
|
62
|
+
"angular",
|
|
63
|
+
"angular-components"
|
|
64
|
+
]
|
|
65
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"lib": [
|
|
4
|
+
"es2019",
|
|
5
|
+
"DOM",
|
|
6
|
+
"ES6",
|
|
7
|
+
"DOM.Iterable",
|
|
8
|
+
"ScriptHost"
|
|
9
|
+
],
|
|
10
|
+
"target": "es2015",
|
|
11
|
+
"module": "commonjs",
|
|
12
|
+
"jsx": "react",
|
|
13
|
+
"allowJs": true,
|
|
14
|
+
"composite": true,
|
|
15
|
+
"declaration": true,
|
|
16
|
+
"sourceMap": true,
|
|
17
|
+
"skipLibCheck": true,
|
|
18
|
+
"experimentalDecorators": true,
|
|
19
|
+
"outDir": "dist",
|
|
20
|
+
"moduleResolution": "node",
|
|
21
|
+
"esModuleInterop": true,
|
|
22
|
+
"rootDir": ".",
|
|
23
|
+
"resolveJsonModule": true,
|
|
24
|
+
"emitDeclarationOnly": true,
|
|
25
|
+
"emitDecoratorMetadata": true,
|
|
26
|
+
"allowSyntheticDefaultImports": true,
|
|
27
|
+
"strictPropertyInitialization": false,
|
|
28
|
+
"strict": true,
|
|
29
|
+
"noImplicitAny": false,
|
|
30
|
+
"preserveConstEnums": true
|
|
31
|
+
},
|
|
32
|
+
"exclude": [
|
|
33
|
+
"dist",
|
|
34
|
+
"package.json"
|
|
35
|
+
],
|
|
36
|
+
"include": [
|
|
37
|
+
"**/*",
|
|
38
|
+
"**/*.json"
|
|
39
|
+
]
|
|
40
|
+
}
|
package/types/asset.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
declare module '*.png' {
|
|
2
|
+
const value: any;
|
|
3
|
+
export = value;
|
|
4
|
+
}
|
|
5
|
+
declare module '*.svg' {
|
|
6
|
+
import type { FunctionComponent, SVGProps } from 'react';
|
|
7
|
+
|
|
8
|
+
export const ReactComponent: FunctionComponent<SVGProps<SVGSVGElement> & { title?: string }>;
|
|
9
|
+
const src: string;
|
|
10
|
+
export default src;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// @TODO Gilad
|
|
14
|
+
declare module '*.jpg' {
|
|
15
|
+
const value: any;
|
|
16
|
+
export = value;
|
|
17
|
+
}
|
|
18
|
+
declare module '*.jpeg' {
|
|
19
|
+
const value: any;
|
|
20
|
+
export = value;
|
|
21
|
+
}
|
|
22
|
+
declare module '*.gif' {
|
|
23
|
+
const value: any;
|
|
24
|
+
export = value;
|
|
25
|
+
}
|
|
26
|
+
declare module '*.bmp' {
|
|
27
|
+
const value: any;
|
|
28
|
+
export = value;
|
|
29
|
+
}
|
package/types/style.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
declare module '*.module.css' {
|
|
2
|
+
const classes: { readonly [key: string]: string };
|
|
3
|
+
export default classes;
|
|
4
|
+
}
|
|
5
|
+
declare module '*.module.scss' {
|
|
6
|
+
const classes: { readonly [key: string]: string };
|
|
7
|
+
export default classes;
|
|
8
|
+
}
|
|
9
|
+
declare module '*.module.sass' {
|
|
10
|
+
const classes: { readonly [key: string]: string };
|
|
11
|
+
export default classes;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare module '*.module.less' {
|
|
15
|
+
const classes: { readonly [key: string]: string };
|
|
16
|
+
export default classes;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare module '*.less' {
|
|
20
|
+
const classes: { readonly [key: string]: string };
|
|
21
|
+
export default classes;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare module '*.css' {
|
|
25
|
+
const classes: { readonly [key: string]: string };
|
|
26
|
+
export default classes;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
declare module '*.sass' {
|
|
30
|
+
const classes: { readonly [key: string]: string };
|
|
31
|
+
export default classes;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
declare module '*.scss' {
|
|
35
|
+
const classes: { readonly [key: string]: string };
|
|
36
|
+
export default classes;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare module '*.mdx' {
|
|
40
|
+
const component: any;
|
|
41
|
+
export default component;
|
|
42
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Write config files in the workspace.
|
|
3
|
+
labels: ['core aspect', 'cli', 'configuration', 'workspace']
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
This aspect provides the ability to write configuration files in the workspace.
|
|
7
|
+
It provides an API to write configuration files in the workspace, and also provides cli commands to write configuration files.
|
|
8
|
+
|
|
9
|
+
### Register configuration writers
|
|
10
|
+
|
|
11
|
+
This aspect provides a `registerConfigWriter` function to register configuration writers.
|
|
12
|
+
It accpets an array of `ConfigWriterEntry`.
|
|
13
|
+
See the exported interface for more details.
|
|
14
|
+
|
|
15
|
+
### Commands
|
|
16
|
+
|
|
17
|
+
Main command is `bit ws-config` which has the following sub commands:
|
|
18
|
+
- `bit ws-config write` - write configuration files according to the components' envs
|
|
19
|
+
- `bit ws-config clean` - remove all configuration files from the workspace
|
|
20
|
+
- `bit ws-config list` - list all registered configuration writers.
|
|
21
|
+
this is useful for filtering used configuration writers when using the `--writers` flag in the write/clean commands.
|