@teambit/ui 0.0.918 → 0.0.920
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/create-root.js +1 -1
- package/dist/create-root.js.map +1 -1
- package/{preview-1669765084342.js → dist/preview-1669911866429.js} +2 -2
- package/dist/ui-build.cmd.d.ts +1 -0
- package/dist/ui-build.cmd.js +1 -0
- package/dist/ui-build.cmd.js.map +1 -1
- package/package-tar/teambit-ui-0.0.920.tgz +0 -0
- package/package.json +19 -19
- package/ui-build.cmd.tsx +1 -0
- package/package-tar/teambit-ui-0.0.918.tgz +0 -0
package/dist/create-root.js
CHANGED
|
@@ -84,7 +84,7 @@ if (isBrowser) render();
|
|
|
84
84
|
function createImports(aspectDefs) {
|
|
85
85
|
const defs = aspectDefs.filter(def => def.runtimePath);
|
|
86
86
|
return `import { Harmony } from '@teambit/harmony';
|
|
87
|
-
${getImportStatements(aspectDefs, '
|
|
87
|
+
${getImportStatements(aspectDefs, 'aspectFilePath', 'Aspect')}
|
|
88
88
|
${getImportStatements(defs, 'runtimePath', 'Runtime')}`;
|
|
89
89
|
}
|
|
90
90
|
function getImportStatements(aspectDefs, pathProp, suffix) {
|
package/dist/create-root.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createRoot","aspectDefs","rootExtensionName","rootAspect","UIAspect","id","runtime","config","rootId","identifiers","getIdentifiers","idSetters","getIdSetters","stringifiedConfig","toWindowsCompatiblePath","JSON","stringify","replace","createImports","join","defs","filter","def","runtimePath","getImportStatements","pathProp","suffix","map","aspectDef","getIdentifier","getId","undefined","val","component","local","getCoreIdentifier","aspectPath","getRegularAspectIdentifier","camelCase","parse","base","path","name","split"],"sources":["create-root.ts"],"sourcesContent":["import { AspectDefinition } from '@teambit/aspect-loader';\nimport { toWindowsCompatiblePath } from '@teambit/toolbox.path.to-windows-compatible-path';\nimport { camelCase } from 'lodash';\nimport { parse } from 'path';\n\nimport { UIAspect } from './ui.aspect';\n\nexport async function createRoot(\n aspectDefs: AspectDefinition[],\n rootExtensionName?: string,\n rootAspect = UIAspect.id,\n runtime = 'ui',\n config = {}\n) {\n const rootId = rootExtensionName ? `'${rootExtensionName}'` : '';\n const identifiers = getIdentifiers(aspectDefs, 'Aspect');\n\n const idSetters = getIdSetters(aspectDefs, 'Aspect');\n config['teambit.harmony/bit'] = rootExtensionName;\n // Escaping \"'\" in case for example in the config you have something like:\n // description: \"team's scope\"\n const stringifiedConfig = toWindowsCompatiblePath(JSON.stringify(config)).replace(/'/g, \"\\\\'\");\n\n return `\n${createImports(aspectDefs)}\n\nconst isBrowser = typeof window !== \"undefined\";\nconst config = JSON.parse('${stringifiedConfig}');\n${idSetters.join('\\n')}\nexport default function render(...props){\n return Harmony.load([${identifiers.join(', ')}], '${runtime}', config)\n .then((harmony) => {\n return harmony\n .run()\n .then(() => harmony.get('${rootAspect}'))\n .then((rootExtension) => {\n const ssrSetup = !isBrowser && rootExtension.setupSsr;\n const setup = rootExtension.setup;\n const setupFunc = (ssrSetup || setup || function noop(){}).bind(rootExtension);\n\n return (\n Promise.resolve(setupFunc())\n .then(() => rootExtension)\n );\n })\n .then((rootExtension) => {\n if (isBrowser) {\n return rootExtension.render(${rootId}, ...props);\n } else {\n return rootExtension.renderSsr(${rootId}, ...props);\n }\n })\n .catch((err) => {\n throw err;\n });\n });\n}\n\nif (isBrowser) render();\n`;\n}\n\nfunction createImports(aspectDefs: AspectDefinition[]) {\n const defs = aspectDefs.filter((def) => def.runtimePath);\n\n return `import { Harmony } from '@teambit/harmony';\n${getImportStatements(aspectDefs, '
|
|
1
|
+
{"version":3,"names":["createRoot","aspectDefs","rootExtensionName","rootAspect","UIAspect","id","runtime","config","rootId","identifiers","getIdentifiers","idSetters","getIdSetters","stringifiedConfig","toWindowsCompatiblePath","JSON","stringify","replace","createImports","join","defs","filter","def","runtimePath","getImportStatements","pathProp","suffix","map","aspectDef","getIdentifier","getId","undefined","val","component","local","getCoreIdentifier","aspectPath","getRegularAspectIdentifier","camelCase","parse","base","path","name","split"],"sources":["create-root.ts"],"sourcesContent":["import { AspectDefinition } from '@teambit/aspect-loader';\nimport { toWindowsCompatiblePath } from '@teambit/toolbox.path.to-windows-compatible-path';\nimport { camelCase } from 'lodash';\nimport { parse } from 'path';\n\nimport { UIAspect } from './ui.aspect';\n\nexport async function createRoot(\n aspectDefs: AspectDefinition[],\n rootExtensionName?: string,\n rootAspect = UIAspect.id,\n runtime = 'ui',\n config = {}\n) {\n const rootId = rootExtensionName ? `'${rootExtensionName}'` : '';\n const identifiers = getIdentifiers(aspectDefs, 'Aspect');\n\n const idSetters = getIdSetters(aspectDefs, 'Aspect');\n config['teambit.harmony/bit'] = rootExtensionName;\n // Escaping \"'\" in case for example in the config you have something like:\n // description: \"team's scope\"\n const stringifiedConfig = toWindowsCompatiblePath(JSON.stringify(config)).replace(/'/g, \"\\\\'\");\n\n return `\n${createImports(aspectDefs)}\n\nconst isBrowser = typeof window !== \"undefined\";\nconst config = JSON.parse('${stringifiedConfig}');\n${idSetters.join('\\n')}\nexport default function render(...props){\n return Harmony.load([${identifiers.join(', ')}], '${runtime}', config)\n .then((harmony) => {\n return harmony\n .run()\n .then(() => harmony.get('${rootAspect}'))\n .then((rootExtension) => {\n const ssrSetup = !isBrowser && rootExtension.setupSsr;\n const setup = rootExtension.setup;\n const setupFunc = (ssrSetup || setup || function noop(){}).bind(rootExtension);\n\n return (\n Promise.resolve(setupFunc())\n .then(() => rootExtension)\n );\n })\n .then((rootExtension) => {\n if (isBrowser) {\n return rootExtension.render(${rootId}, ...props);\n } else {\n return rootExtension.renderSsr(${rootId}, ...props);\n }\n })\n .catch((err) => {\n throw err;\n });\n });\n}\n\nif (isBrowser) render();\n`;\n}\n\nfunction createImports(aspectDefs: AspectDefinition[]) {\n const defs = aspectDefs.filter((def) => def.runtimePath);\n\n return `import { Harmony } from '@teambit/harmony';\n${getImportStatements(aspectDefs, 'aspectFilePath', 'Aspect')}\n${getImportStatements(defs, 'runtimePath', 'Runtime')}`;\n}\n\nfunction getImportStatements(aspectDefs: AspectDefinition[], pathProp: string, suffix: string): string {\n return aspectDefs\n .map(\n (aspectDef) =>\n `import ${getIdentifier(aspectDef, suffix)} from '${toWindowsCompatiblePath(aspectDef[pathProp])}';`\n )\n .join('\\n');\n}\n\nfunction getIdentifiers(aspectDefs: AspectDefinition[], suffix: string): string[] {\n return aspectDefs.map((aspectDef) => `${getIdentifier(aspectDef, suffix)}`);\n}\n\nfunction getIdSetters(defs: AspectDefinition[], suffix: string) {\n return defs\n .map((def) => {\n if (!def.getId) return undefined;\n return `${getIdentifier(def, suffix)}.id = '${def.getId}';`;\n })\n .filter((val) => !!val);\n}\n\nfunction getIdentifier(aspectDef: AspectDefinition, suffix: string): string {\n if (!aspectDef.component && !aspectDef.local) {\n return getCoreIdentifier(aspectDef.aspectPath, suffix);\n }\n return getRegularAspectIdentifier(aspectDef, suffix);\n}\n\nfunction getRegularAspectIdentifier(aspectDef: AspectDefinition, suffix: string): string {\n return camelCase(`${parse(aspectDef.aspectPath).base.replace(/\\./, '__').replace('@', '__')}${suffix}`);\n}\n\nfunction getCoreIdentifier(path: string, suffix: string): string {\n return camelCase(`${parse(path).name.split('.')[0]}${suffix}`);\n}\n"],"mappings":";;;;;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,eAAeA,UAAU,CAC9BC,UAA8B,EAC9BC,iBAA0B,EAC1BC,UAAU,GAAGC,cAAQ,CAACC,EAAE,EACxBC,OAAO,GAAG,IAAI,EACdC,MAAM,GAAG,CAAC,CAAC,EACX;EACA,MAAMC,MAAM,GAAGN,iBAAiB,GAAI,IAAGA,iBAAkB,GAAE,GAAG,EAAE;EAChE,MAAMO,WAAW,GAAGC,cAAc,CAACT,UAA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,MAAO,EAAC,CAAC;AAChE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.ui-foundation_ui@0.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.ui-foundation_ui@0.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.ui-foundation_ui@0.0.920/dist/ui.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.ui-foundation_ui@0.0.920/dist/ui.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
package/dist/ui-build.cmd.d.ts
CHANGED
package/dist/ui-build.cmd.js
CHANGED
|
@@ -33,6 +33,7 @@ class UIBuildCmd {
|
|
|
33
33
|
(0, _defineProperty2().default)(this, "alias", 'c');
|
|
34
34
|
(0, _defineProperty2().default)(this, "group", 'development');
|
|
35
35
|
(0, _defineProperty2().default)(this, "options", []);
|
|
36
|
+
(0, _defineProperty2().default)(this, "private", true);
|
|
36
37
|
}
|
|
37
38
|
async report([type]) {
|
|
38
39
|
// teambit.workspace/variants should be the one to take care of component patterns.
|
package/dist/ui-build.cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["UIBuildCmd","constructor","ui","report","type","stats","build","UnknownBuildError","toString"],"sources":["ui-build.cmd.tsx"],"sourcesContent":["import { Command } from '@teambit/cli';\nimport { UnknownBuildError } from './exceptions';\n\nimport { UiMain } from './ui.main.runtime';\n\nexport class UIBuildCmd implements Command {\n name = 'ui-build [type]';\n description = 'build production assets for deployment.';\n alias = 'c';\n group = 'development';\n options = [];\n\n constructor(\n /**\n * access to the extension instance.\n */\n private ui: UiMain\n ) {}\n\n async report([type]: [string]): Promise<string> {\n // teambit.workspace/variants should be the one to take care of component patterns.\n const stats = await this.ui.build(type);\n if (!stats) throw new UnknownBuildError();\n return stats.toString();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAIO,MAAMA,UAAU,CAAoB;
|
|
1
|
+
{"version":3,"names":["UIBuildCmd","constructor","ui","report","type","stats","build","UnknownBuildError","toString"],"sources":["ui-build.cmd.tsx"],"sourcesContent":["import { Command } from '@teambit/cli';\nimport { UnknownBuildError } from './exceptions';\n\nimport { UiMain } from './ui.main.runtime';\n\nexport class UIBuildCmd implements Command {\n name = 'ui-build [type]';\n description = 'build production assets for deployment.';\n alias = 'c';\n group = 'development';\n options = [];\n private = true;\n\n constructor(\n /**\n * access to the extension instance.\n */\n private ui: UiMain\n ) {}\n\n async report([type]: [string]): Promise<string> {\n // teambit.workspace/variants should be the one to take care of component patterns.\n const stats = await this.ui.build(type);\n if (!stats) throw new UnknownBuildError();\n return stats.toString();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAIO,MAAMA,UAAU,CAAoB;EAQzCC,WAAW;EACT;AACJ;AACA;EACYC,EAAU,EAClB;IAAA,KADQA,EAAU,GAAVA,EAAU;IAAA,8CAXb,iBAAiB;IAAA,qDACV,yCAAyC;IAAA,+CAC/C,GAAG;IAAA,+CACH,aAAa;IAAA,iDACX,EAAE;IAAA,iDACF,IAAI;EAOX;EAEH,MAAMC,MAAM,CAAC,CAACC,IAAI,CAAW,EAAmB;IAC9C;IACA,MAAMC,KAAK,GAAG,MAAM,IAAI,CAACH,EAAE,CAACI,KAAK,CAACF,IAAI,CAAC;IACvC,IAAI,CAACC,KAAK,EAAE,MAAM,KAAIE,+BAAiB,GAAE;IACzC,OAAOF,KAAK,CAACG,QAAQ,EAAE;EACzB;AACF;AAAC"}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.920",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/ui-foundation/ui",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.ui-foundation",
|
|
8
8
|
"name": "ui",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.920"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"lodash": "4.17.21",
|
|
@@ -50,28 +50,28 @@
|
|
|
50
50
|
"@teambit/base-ui.loaders.loader-ribbon": "1.0.0",
|
|
51
51
|
"@teambit/base-ui.theme.fonts.roboto": "1.0.0",
|
|
52
52
|
"@teambit/design.themes.theme-toggler": "0.1.3",
|
|
53
|
-
"@teambit/aspect-loader": "0.0.
|
|
53
|
+
"@teambit/aspect-loader": "0.0.920",
|
|
54
54
|
"@teambit/toolbox.path.to-windows-compatible-path": "0.0.490",
|
|
55
|
-
"@teambit/ui-foundation.ui.hooks.use-data-query": "0.0.
|
|
55
|
+
"@teambit/ui-foundation.ui.hooks.use-data-query": "0.0.499",
|
|
56
56
|
"@teambit/bit-error": "0.0.402",
|
|
57
|
-
"@teambit/cli": "0.0.
|
|
58
|
-
"@teambit/logger": "0.0.
|
|
57
|
+
"@teambit/cli": "0.0.616",
|
|
58
|
+
"@teambit/logger": "0.0.709",
|
|
59
59
|
"@teambit/ui-foundation.cli.ui-server-console": "0.0.498",
|
|
60
|
-
"@teambit/bundler": "0.0.
|
|
61
|
-
"@teambit/component": "0.0.
|
|
62
|
-
"@teambit/express": "0.0.
|
|
63
|
-
"@teambit/graphql": "0.0.
|
|
60
|
+
"@teambit/bundler": "0.0.920",
|
|
61
|
+
"@teambit/component": "0.0.920",
|
|
62
|
+
"@teambit/express": "0.0.714",
|
|
63
|
+
"@teambit/graphql": "0.0.920",
|
|
64
64
|
"@teambit/toolbox.network.get-port": "0.0.121",
|
|
65
|
-
"@teambit/aspect": "0.0.
|
|
66
|
-
"@teambit/cache": "0.0.
|
|
67
|
-
"@teambit/pubsub": "0.0.
|
|
68
|
-
"@teambit/react-router": "0.0.
|
|
69
|
-
"@teambit/design.theme.icons-font": "2.0.24",
|
|
70
|
-
"@teambit/design.ui.tooltip": "0.0.359",
|
|
71
|
-
"@teambit/ui-foundation.ui.global-loader": "0.0.495",
|
|
65
|
+
"@teambit/aspect": "0.0.920",
|
|
66
|
+
"@teambit/cache": "0.0.709",
|
|
67
|
+
"@teambit/pubsub": "0.0.920",
|
|
68
|
+
"@teambit/react-router": "0.0.920",
|
|
72
69
|
"@teambit/webpack.modules.generate-style-loaders": "0.0.110",
|
|
73
70
|
"@teambit/webpack.modules.style-regexps": "0.0.139",
|
|
74
|
-
"@teambit/webpack": "0.0.
|
|
71
|
+
"@teambit/webpack": "0.0.920",
|
|
72
|
+
"@teambit/design.theme.icons-font": "2.0.25",
|
|
73
|
+
"@teambit/design.ui.tooltip": "0.0.360",
|
|
74
|
+
"@teambit/ui-foundation.ui.global-loader": "0.0.496"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@types/lodash": "4.14.165",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"peerDependencies": {
|
|
93
93
|
"@apollo/client": "^3.6.0",
|
|
94
94
|
"react-router-dom": "^6.0.0",
|
|
95
|
-
"@teambit/legacy": "1.0.
|
|
95
|
+
"@teambit/legacy": "1.0.397",
|
|
96
96
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
97
97
|
"react": "^16.8.0 || ^17.0.0"
|
|
98
98
|
},
|
package/ui-build.cmd.tsx
CHANGED
|
Binary file
|