@teambit/pkg.aspect-docs.pkg 0.0.0-96af1a186d7e33351b25fd4a290b75653da81de6

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.
@@ -0,0 +1 @@
1
+ export { default as Pkg } from './pkg.mdx';
package/dist/index.js ADDED
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Pkg = void 0;
7
+ var pkg_mdx_1 = require("./pkg.mdx");
8
+ Object.defineProperty(exports, "Pkg", { enumerable: true, get: function () { return __importDefault(pkg_mdx_1).default; } });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;AAAA,qCAA2C;AAAlC,+GAAA,OAAO,OAAO"}
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const PkgDocs: () => React.JSX.Element;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.PkgDocs = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const documenter_theme_theme_compositions_1 = require("@teambit/documenter.theme.theme-compositions");
9
+ const mdx_ui_mdx_layout_1 = require("@teambit/mdx.ui.mdx-layout");
10
+ const index_1 = require("./index");
11
+ const PkgDocs = () => (react_1.default.createElement(documenter_theme_theme_compositions_1.ThemeCompositions, null,
12
+ react_1.default.createElement(mdx_ui_mdx_layout_1.MDXLayout, null,
13
+ react_1.default.createElement(index_1.Pkg, null))));
14
+ exports.PkgDocs = PkgDocs;
15
+ //# sourceMappingURL=pkg.composition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pkg.composition.js","sourceRoot":"","sources":["../pkg.composition.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,sGAAiF;AACjF,kEAAuD;AACvD,mCAA8B;AAEvB,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,CAC3B,8BAAC,uDAAiB;IAChB,8BAAC,6BAAS;QACR,8BAAC,WAAG,OAAG,CACG,CACM,CACrB,CAAC;AANW,QAAA,OAAO,WAMlB"}
@@ -0,0 +1,34 @@
1
+ ---
2
+ description: 'Docs for Pkg aspect'
3
+ labels: ['docs', 'aspect', 'extensions']
4
+ ---
5
+
6
+ import { Pkg } from './index';
7
+
8
+ ## Static Content Page in Pkg
9
+
10
+ Docs for Pkg aspect
11
+
12
+ ### Component usage
13
+
14
+ Use your component in any Pkg file:
15
+
16
+ ```js
17
+ import { Pkg } from '@teambit/aspect-docs.pkg';
18
+
19
+ <Pkg />;
20
+ ```
21
+
22
+ ### Render with theme and Pkg providers
23
+
24
+ ```js
25
+ import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions';
26
+ import { PkgLayout } from '@teambit/ui.Pkg-layout';
27
+ import { Pkg } from '@teambit/aspect-docs.pkg';
28
+
29
+ <ThemeCompositions>
30
+ <PkgLayout>
31
+ <Pkg />
32
+ </PkgLayout>
33
+ </ThemeCompositions>;
34
+ ```
@@ -0,0 +1,164 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = MDXContent;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _react2 = require("@mdx-js/react");
9
+ var _excluded = ["components"]; // @ts-nocheck
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
11
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
12
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
13
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
14
+ /* @jsxRuntime classic */
15
+ /* @jsx mdx */
16
+
17
+ var layoutProps = {};
18
+ var MDXLayout = "wrapper";
19
+ function MDXContent(_ref) {
20
+ var components = _ref.components,
21
+ props = _objectWithoutProperties(_ref, _excluded);
22
+ return (0, _react2.mdx)(MDXLayout, _extends({}, layoutProps, props, {
23
+ components: components,
24
+ mdxType: "MDXLayout"
25
+ }), (0, _react2.mdx)("p", null, "Bit components can be thought of as a super-set of standard packaged node modules.\nEach component contains a consumable package in addition to its documentation, history and other information that enables it to be independently developed and maintained."), (0, _react2.mdx)("p", null, "The PKG aspect handles the configuration, publishing and packing of component packages.\nIt adds its own build task to the build pipeline, to create component packages and include them in as part of the component artifacts.\nThis automation includes generating the package name and other properties according to the component's details."), (0, _react2.mdx)("h4", null, "Features"), (0, _react2.mdx)("ul", null, (0, _react2.mdx)("li", {
26
+ parentName: "ul"
27
+ }, (0, _react2.mdx)("strong", {
28
+ parentName: "li"
29
+ }, "Efficient ", (0, _react2.mdx)("inlineCode", {
30
+ parentName: "strong"
31
+ }, "package.json"), " configuration:"), " Use the PKG's workspace config API to add or override ", (0, _react2.mdx)("inlineCode", {
32
+ parentName: "li"
33
+ }, "package.json"), " properties to a group of components, all at once.\nUse PKG's 'placeholders' to integrate component-specific data into the component's package configurations."), (0, _react2.mdx)("li", {
34
+ parentName: "ul"
35
+ }, (0, _react2.mdx)("strong", {
36
+ parentName: "li"
37
+ }, "An API for programmable ", (0, _react2.mdx)("inlineCode", {
38
+ parentName: "strong"
39
+ }, "package.json"), " configuration:"), " Use PKG's API to provide your extensions with \"packaging capabilities\". Modify the ", (0, _react2.mdx)("inlineCode", {
40
+ parentName: "li"
41
+ }, "package.json"), " to suit your extension's needs, whether it is an environment or any other type of extension."), (0, _react2.mdx)("li", {
42
+ parentName: "ul"
43
+ }, (0, _react2.mdx)("strong", {
44
+ parentName: "li"
45
+ }, "Automated packing and publishing:"), " - PKG is registered to your build pipeline. That means every 'build' will also test 'packing' and every tagging of a new release version will also include 'publishing'. Your components and packages versions are alway in-sync."), (0, _react2.mdx)("li", {
46
+ parentName: "ul"
47
+ }, (0, _react2.mdx)("strong", {
48
+ parentName: "li"
49
+ }, "\"On-demand\" packing and publishing:"), " - PKG offers the ", (0, _react2.mdx)("inlineCode", {
50
+ parentName: "li"
51
+ }, "pack"), " and ", (0, _react2.mdx)("inlineCode", {
52
+ parentName: "li"
53
+ }, "preview"), " CLI commands for a manual and on-demand usage.")), (0, _react2.mdx)("h3", null, "Quickstart & configuration"), (0, _react2.mdx)("blockquote", null, (0, _react2.mdx)("p", {
54
+ parentName: "blockquote"
55
+ }, "This aspect is only configurable using the 'variants' workspace API.")), (0, _react2.mdx)("h4", null, "Package properties"), (0, _react2.mdx)("p", null, "Use the ", (0, _react2.mdx)("inlineCode", {
56
+ parentName: "p"
57
+ }, "packageJson"), " property to add or override the default ", (0, _react2.mdx)("inlineCode", {
58
+ parentName: "p"
59
+ }, "package.json"), " for your component packages."), (0, _react2.mdx)("blockquote", null, (0, _react2.mdx)("p", {
60
+ parentName: "blockquote"
61
+ }, "Warning! Packages with a modified ", (0, _react2.mdx)("inlineCode", {
62
+ parentName: "p"
63
+ }, "name"), " property will not be published to Bit.dev's registry.")), (0, _react2.mdx)("pre", null, (0, _react2.mdx)("code", {
64
+ parentName: "pre",
65
+ "className": "language-js"
66
+ }, "{\n \"ui/*\": {\n \"teambit.pkg/pkg\": {\n \"packageJson\": {\n \"name\": \"@{scope}/{name}\",\n \"private\": false,\n \"main\": \"dist/{main}.js\",\n \"custom-prop\": \"value\"\n }\n }\n }\n}\n")), (0, _react2.mdx)("h4", null, "Publish"), (0, _react2.mdx)("blockquote", null, (0, _react2.mdx)("p", {
67
+ parentName: "blockquote"
68
+ }, "If ", (0, _react2.mdx)("inlineCode", {
69
+ parentName: "p"
70
+ }, "publishConfig"), " or ", (0, _react2.mdx)("inlineCode", {
71
+ parentName: "p"
72
+ }, "name"), " are not set, packages will be published to Bit.dev's registry.")), (0, _react2.mdx)("h5", null, "npm arguments"), (0, _react2.mdx)("p", null, "You can specify additional arguments to the ", (0, _react2.mdx)("inlineCode", {
73
+ parentName: "p"
74
+ }, "npm publish"), " command by adding an array of args to ", (0, _react2.mdx)("inlineCode", {
75
+ parentName: "p"
76
+ }, "packageManagerPublishArgs"), "."), (0, _react2.mdx)("p", null, "For example:"), (0, _react2.mdx)("pre", null, (0, _react2.mdx)("code", {
77
+ parentName: "pre",
78
+ "className": "language-js"
79
+ }, "\"ui/*\": {\n \"teambit.pkg/pkg\": {\n \"packageManagerPublishArgs\": [\"--access public\"]\n }\n}\n")), (0, _react2.mdx)("h4", null, "npmjs Registry"), (0, _react2.mdx)("ul", null, (0, _react2.mdx)("li", {
80
+ parentName: "ul"
81
+ }, "Use the ", (0, _react2.mdx)("inlineCode", {
82
+ parentName: "li"
83
+ }, "name"), " property to set the publishing process to your ", (0, _react2.mdx)("a", {
84
+ parentName: "li",
85
+ "href": "https://docs.npmjs.com/cli/v6/using-npm/scope"
86
+ }, "npm scope"), "."), (0, _react2.mdx)("li", {
87
+ parentName: "ul"
88
+ }, "Use the ", (0, _react2.mdx)("inlineCode", {
89
+ parentName: "li"
90
+ }, "private"), " ", (0, _react2.mdx)("em", {
91
+ parentName: "li"
92
+ }, "(boolean)"), " property to set packages to be published with either private or public access.")), (0, _react2.mdx)("pre", null, (0, _react2.mdx)("code", {
93
+ parentName: "pre",
94
+ "className": "language-js"
95
+ }, "{\n \"ui/*\": {\n \"teambit.pkg/pkg\": {\n \"packageJson\": {\n \"name\": \"@{scope}/{name}\",\n \"private\": false,\n }\n }\n }\n}\n")), (0, _react2.mdx)("ul", null, (0, _react2.mdx)("li", {
96
+ parentName: "ul"
97
+ }, "By default, when specifying ", (0, _react2.mdx)("inlineCode", {
98
+ parentName: "li"
99
+ }, "name"), " or ", (0, _react2.mdx)("inlineCode", {
100
+ parentName: "li"
101
+ }, "publishConfig"), ", it'll publish to NPM. In some rare cases, this is not desired, to cancel it, add the config ", (0, _react2.mdx)("inlineCode", {
102
+ parentName: "li"
103
+ }, "\"avoidPublishToNPM\": true"))), (0, _react2.mdx)("h4", null, "Private registry"), (0, _react2.mdx)("p", null, "Use the ", (0, _react2.mdx)("inlineCode", {
104
+ parentName: "p"
105
+ }, "scope"), " and ", (0, _react2.mdx)("inlineCode", {
106
+ parentName: "p"
107
+ }, "registry"), " properties to configure the publishing process to your own private registry (and scope)."), (0, _react2.mdx)("pre", null, (0, _react2.mdx)("code", {
108
+ parentName: "pre",
109
+ "className": "language-js"
110
+ }, "\"ui/*\": {\n \"teambit.pkg/pkg\": {\n \"packageJson\": {\n \"publishConfig\": {\n \"scope\": \"@custom\",\n \"registry\": \"http://localhost:4873\"\n }\n }\n }\n}\n")), (0, _react2.mdx)("blockquote", null, (0, _react2.mdx)("p", {
111
+ parentName: "blockquote"
112
+ }, "Packages with a modified ", (0, _react2.mdx)("inlineCode", {
113
+ parentName: "p"
114
+ }, "publishConfig"), " property will not be published to Bit.dev's registry.")), (0, _react2.mdx)("h4", null, "Placeholders"), (0, _react2.mdx)("p", null, "Placeholders are an easy way to inject component-specific information into the 'pkg' configurations."), (0, _react2.mdx)("ul", null, (0, _react2.mdx)("li", {
115
+ parentName: "ul"
116
+ }, (0, _react2.mdx)("inlineCode", {
117
+ parentName: "li"
118
+ }, "{name}"), " - The name of the component."), (0, _react2.mdx)("li", {
119
+ parentName: "ul"
120
+ }, (0, _react2.mdx)("inlineCode", {
121
+ parentName: "li"
122
+ }, "{scope}"), " - The name of the component scope."), (0, _react2.mdx)("li", {
123
+ parentName: "ul"
124
+ }, (0, _react2.mdx)("inlineCode", {
125
+ parentName: "li"
126
+ }, "{main}"), " - the name of the main file (leaving out the extension) - for example ", (0, _react2.mdx)("inlineCode", {
127
+ parentName: "li"
128
+ }, "index.js"), " will be ", (0, _react2.mdx)("inlineCode", {
129
+ parentName: "li"
130
+ }, "index"), ".")), (0, _react2.mdx)("p", null, "For example:"), (0, _react2.mdx)("pre", null, (0, _react2.mdx)("code", {
131
+ parentName: "pre",
132
+ "className": "language-js"
133
+ }, " \"packageJson\": {\n \"main\": \"dist/{main}.js\"\n }\n")), (0, _react2.mdx)("h4", null, ".npmignore"), (0, _react2.mdx)("p", null, "Add records to the .npmignore file before a package is published or pack.\nFor example, if you don't want the source files to be part of the package, you can add them to the .npmignore."), (0, _react2.mdx)("p", null, "The API to add records to this file is exposed in the environment: ", (0, _react2.mdx)("inlineCode", {
134
+ parentName: "p"
135
+ }, "getNpmIgnore()"), "."), (0, _react2.mdx)("p", null, "For example, the following was added to the Aspect env."), (0, _react2.mdx)("pre", null, (0, _react2.mdx)("code", {
136
+ parentName: "pre",
137
+ "className": "language-js"
138
+ }, "getNpmIgnore() {\n // ignores only .ts files in the root directory, so d.ts files inside dists are unaffected.\n return ['/*.ts']\n}\n")), (0, _react2.mdx)("h3", null, "CLI Reference"), (0, _react2.mdx)("h4", null, "Pack"), (0, _react2.mdx)("p", null, "Creates a TAR file (to be published to a node package registry):"), (0, _react2.mdx)("pre", null, (0, _react2.mdx)("code", {
139
+ parentName: "pre",
140
+ "className": "language-shell"
141
+ }, "bit pack <component-id>\n")), (0, _react2.mdx)("p", null, "Overrides the existing TAR file (in the same location):"), (0, _react2.mdx)("pre", null, (0, _react2.mdx)("code", {
142
+ parentName: "pre",
143
+ "className": "language-shell"
144
+ }, "bit pack <component-id> --override\n\nbit pack <component-id> -o\n")), (0, _react2.mdx)("p", null, "Returns the output in a JSON format:"), (0, _react2.mdx)("pre", null, (0, _react2.mdx)("code", {
145
+ parentName: "pre",
146
+ "className": "language-shell"
147
+ }, "bit pack <component-id> --json\n\nbit pack <component-id> -j\n")), (0, _react2.mdx)("h4", null, "Publish"), (0, _react2.mdx)("p", null, "Publishes an exported component:"), (0, _react2.mdx)("pre", null, (0, _react2.mdx)("code", {
148
+ parentName: "pre",
149
+ "className": "language-shell"
150
+ }, "bit publish <componentId>\n")), (0, _react2.mdx)("p", null, "Publishes a staged component that has not yet been exported:"), (0, _react2.mdx)("pre", null, (0, _react2.mdx)("code", {
151
+ parentName: "pre",
152
+ "className": "language-shell"
153
+ }, "bit publish <component-id> --allow-staged\n")), (0, _react2.mdx)("p", null, "Checks if the publishing process will be done successfully (without publishing):"), (0, _react2.mdx)("pre", null, (0, _react2.mdx)("code", {
154
+ parentName: "pre",
155
+ "className": "language-shell"
156
+ }, "bit publish <component-id> --dry-run\n\nbit publish <component-id> -d\n")), (0, _react2.mdx)("p", null, "Returns the output as JSON:"), (0, _react2.mdx)("pre", null, (0, _react2.mdx)("code", {
157
+ parentName: "pre",
158
+ "className": "language-shell"
159
+ }, "bit publish <component-id> --json\n\nbit publish <component-id> --j\n")));
160
+ }
161
+ ;
162
+ MDXContent.isMDXComponent = true;
163
+
164
+ //# sourceMappingURL=pkg.mdx.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_react2","_excluded","e","__esModule","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","_objectWithoutProperties","o","i","_objectWithoutPropertiesLoose","getOwnPropertySymbols","indexOf","propertyIsEnumerable","layoutProps","MDXLayout","MDXContent","_ref","components","props","mdx","mdxType","parentName","isMDXComponent"],"sourceRoot":"/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.pkg_aspect-docs_pkg@96af1a186d7e33351b25fd4a290b75653da81de6","sources":["pkg.mdx.js"],"sourcesContent":["\n// @ts-nocheck\nimport React from 'react'\nimport { mdx } from '@mdx-js/react'\n\n/* @jsxRuntime classic */\n/* @jsx mdx */\n\n\n\n\nconst layoutProps = {\n \n};\nconst MDXLayout = \"wrapper\"\nexport default function MDXContent({\n components,\n ...props\n}) {\n return <MDXLayout {...layoutProps} {...props} components={components} mdxType=\"MDXLayout\">\n <p>{`Bit components can be thought of as a super-set of standard packaged node modules.\nEach component contains a consumable package in addition to its documentation, history and other information that enables it to be independently developed and maintained.`}</p>\n <p>{`The PKG aspect handles the configuration, publishing and packing of component packages.\nIt adds its own build task to the build pipeline, to create component packages and include them in as part of the component artifacts.\nThis automation includes generating the package name and other properties according to the component's details.`}</p>\n <h4>{`Features`}</h4>\n <ul>\n <li parentName=\"ul\"><strong parentName=\"li\">{`Efficient `}<inlineCode parentName=\"strong\">{`package.json`}</inlineCode>{` configuration:`}</strong>{` Use the PKG's workspace config API to add or override `}<inlineCode parentName=\"li\">{`package.json`}</inlineCode>{` properties to a group of components, all at once.\nUse PKG's 'placeholders' to integrate component-specific data into the component's package configurations.`}</li>\n <li parentName=\"ul\"><strong parentName=\"li\">{`An API for programmable `}<inlineCode parentName=\"strong\">{`package.json`}</inlineCode>{` configuration:`}</strong>{` Use PKG's API to provide your extensions with \"packaging capabilities\". Modify the `}<inlineCode parentName=\"li\">{`package.json`}</inlineCode>{` to suit your extension's needs, whether it is an environment or any other type of extension.`}</li>\n <li parentName=\"ul\"><strong parentName=\"li\">{`Automated packing and publishing:`}</strong>{` - PKG is registered to your build pipeline. That means every 'build' will also test 'packing' and every tagging of a new release version will also include 'publishing'. Your components and packages versions are alway in-sync.`}</li>\n <li parentName=\"ul\"><strong parentName=\"li\">{`\"On-demand\" packing and publishing:`}</strong>{` - PKG offers the `}<inlineCode parentName=\"li\">{`pack`}</inlineCode>{` and `}<inlineCode parentName=\"li\">{`preview`}</inlineCode>{` CLI commands for a manual and on-demand usage.`}</li>\n </ul>\n <h3>{`Quickstart & configuration`}</h3>\n <blockquote>\n <p parentName=\"blockquote\">{`This aspect is only configurable using the 'variants' workspace API.`}</p>\n </blockquote>\n <h4>{`Package properties`}</h4>\n <p>{`Use the `}<inlineCode parentName=\"p\">{`packageJson`}</inlineCode>{` property to add or override the default `}<inlineCode parentName=\"p\">{`package.json`}</inlineCode>{` for your component packages.`}</p>\n <blockquote>\n <p parentName=\"blockquote\">{`Warning! Packages with a modified `}<inlineCode parentName=\"p\">{`name`}</inlineCode>{` property will not be published to Bit.dev's registry.`}</p>\n </blockquote>\n <pre><code parentName=\"pre\" {...{\n \"className\": \"language-js\"\n }}>{`{\n \"ui/*\": {\n \"teambit.pkg/pkg\": {\n \"packageJson\": {\n \"name\": \"@{scope}/{name}\",\n \"private\": false,\n \"main\": \"dist/{main}.js\",\n \"custom-prop\": \"value\"\n }\n }\n }\n}\n`}</code></pre>\n <h4>{`Publish`}</h4>\n <blockquote>\n <p parentName=\"blockquote\">{`If `}<inlineCode parentName=\"p\">{`publishConfig`}</inlineCode>{` or `}<inlineCode parentName=\"p\">{`name`}</inlineCode>{` are not set, packages will be published to Bit.dev's registry.`}</p>\n </blockquote>\n <h5>{`npm arguments`}</h5>\n <p>{`You can specify additional arguments to the `}<inlineCode parentName=\"p\">{`npm publish`}</inlineCode>{` command by adding an array of args to `}<inlineCode parentName=\"p\">{`packageManagerPublishArgs`}</inlineCode>{`.`}</p>\n <p>{`For example:`}</p>\n <pre><code parentName=\"pre\" {...{\n \"className\": \"language-js\"\n }}>{`\"ui/*\": {\n \"teambit.pkg/pkg\": {\n \"packageManagerPublishArgs\": [\"--access public\"]\n }\n}\n`}</code></pre>\n <h4>{`npmjs Registry`}</h4>\n <ul>\n <li parentName=\"ul\">{`Use the `}<inlineCode parentName=\"li\">{`name`}</inlineCode>{` property to set the publishing process to your `}<a parentName=\"li\" {...{\n \"href\": \"https://docs.npmjs.com/cli/v6/using-npm/scope\"\n }}>{`npm scope`}</a>{`.`}</li>\n <li parentName=\"ul\">{`Use the `}<inlineCode parentName=\"li\">{`private`}</inlineCode>{` `}<em parentName=\"li\">{`(boolean)`}</em>{` property to set packages to be published with either private or public access.`}</li>\n </ul>\n <pre><code parentName=\"pre\" {...{\n \"className\": \"language-js\"\n }}>{`{\n \"ui/*\": {\n \"teambit.pkg/pkg\": {\n \"packageJson\": {\n \"name\": \"@{scope}/{name}\",\n \"private\": false,\n }\n }\n }\n}\n`}</code></pre>\n <ul>\n <li parentName=\"ul\">{`By default, when specifying `}<inlineCode parentName=\"li\">{`name`}</inlineCode>{` or `}<inlineCode parentName=\"li\">{`publishConfig`}</inlineCode>{`, it'll publish to NPM. In some rare cases, this is not desired, to cancel it, add the config `}<inlineCode parentName=\"li\">{`\"avoidPublishToNPM\": true`}</inlineCode></li>\n </ul>\n <h4>{`Private registry`}</h4>\n <p>{`Use the `}<inlineCode parentName=\"p\">{`scope`}</inlineCode>{` and `}<inlineCode parentName=\"p\">{`registry`}</inlineCode>{` properties to configure the publishing process to your own private registry (and scope).`}</p>\n <pre><code parentName=\"pre\" {...{\n \"className\": \"language-js\"\n }}>{`\"ui/*\": {\n \"teambit.pkg/pkg\": {\n \"packageJson\": {\n \"publishConfig\": {\n \"scope\": \"@custom\",\n \"registry\": \"http://localhost:4873\"\n }\n }\n }\n}\n`}</code></pre>\n <blockquote>\n <p parentName=\"blockquote\">{`Packages with a modified `}<inlineCode parentName=\"p\">{`publishConfig`}</inlineCode>{` property will not be published to Bit.dev's registry.`}</p>\n </blockquote>\n <h4>{`Placeholders`}</h4>\n <p>{`Placeholders are an easy way to inject component-specific information into the 'pkg' configurations.`}</p>\n <ul>\n <li parentName=\"ul\"><inlineCode parentName=\"li\">{`{name}`}</inlineCode>{` - The name of the component.`}</li>\n <li parentName=\"ul\"><inlineCode parentName=\"li\">{`{scope}`}</inlineCode>{` - The name of the component scope.`}</li>\n <li parentName=\"ul\"><inlineCode parentName=\"li\">{`{main}`}</inlineCode>{` - the name of the main file (leaving out the extension) - for example `}<inlineCode parentName=\"li\">{`index.js`}</inlineCode>{` will be `}<inlineCode parentName=\"li\">{`index`}</inlineCode>{`.`}</li>\n </ul>\n <p>{`For example:`}</p>\n <pre><code parentName=\"pre\" {...{\n \"className\": \"language-js\"\n }}>{` \"packageJson\": {\n \"main\": \"dist/{main}.js\"\n }\n`}</code></pre>\n <h4>{`.npmignore`}</h4>\n <p>{`Add records to the .npmignore file before a package is published or pack.\nFor example, if you don't want the source files to be part of the package, you can add them to the .npmignore.`}</p>\n <p>{`The API to add records to this file is exposed in the environment: `}<inlineCode parentName=\"p\">{`getNpmIgnore()`}</inlineCode>{`.`}</p>\n <p>{`For example, the following was added to the Aspect env.`}</p>\n <pre><code parentName=\"pre\" {...{\n \"className\": \"language-js\"\n }}>{`getNpmIgnore() {\n // ignores only .ts files in the root directory, so d.ts files inside dists are unaffected.\n return ['/*.ts']\n}\n`}</code></pre>\n <h3>{`CLI Reference`}</h3>\n <h4>{`Pack`}</h4>\n <p>{`Creates a TAR file (to be published to a node package registry):`}</p>\n <pre><code parentName=\"pre\" {...{\n \"className\": \"language-shell\"\n }}>{`bit pack <component-id>\n`}</code></pre>\n <p>{`Overrides the existing TAR file (in the same location):`}</p>\n <pre><code parentName=\"pre\" {...{\n \"className\": \"language-shell\"\n }}>{`bit pack <component-id> --override\n\nbit pack <component-id> -o\n`}</code></pre>\n <p>{`Returns the output in a JSON format:`}</p>\n <pre><code parentName=\"pre\" {...{\n \"className\": \"language-shell\"\n }}>{`bit pack <component-id> --json\n\nbit pack <component-id> -j\n`}</code></pre>\n <h4>{`Publish`}</h4>\n <p>{`Publishes an exported component:`}</p>\n <pre><code parentName=\"pre\" {...{\n \"className\": \"language-shell\"\n }}>{`bit publish <componentId>\n`}</code></pre>\n <p>{`Publishes a staged component that has not yet been exported:`}</p>\n <pre><code parentName=\"pre\" {...{\n \"className\": \"language-shell\"\n }}>{`bit publish <component-id> --allow-staged\n`}</code></pre>\n <p>{`Checks if the publishing process will be done successfully (without publishing):`}</p>\n <pre><code parentName=\"pre\" {...{\n \"className\": \"language-shell\"\n }}>{`bit publish <component-id> --dry-run\n\nbit publish <component-id> -d\n`}</code></pre>\n <p>{`Returns the output as JSON:`}</p>\n <pre><code parentName=\"pre\" {...{\n \"className\": \"language-shell\"\n }}>{`bit publish <component-id> --json\n\nbit publish <component-id> --j\n`}</code></pre>\n </MDXLayout>;\n}\n;\nMDXContent.isMDXComponent = true;"],"mappings":";;;;;;AAEA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAAmC,IAAAE,SAAA,mBAFnC;AAAA,SAAAH,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,gBAAAA,CAAA;AAAA,SAAAE,SAAA,WAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,CAAA,aAAAN,CAAA,MAAAA,CAAA,GAAAO,SAAA,CAAAC,MAAA,EAAAR,CAAA,UAAAS,CAAA,GAAAF,SAAA,CAAAP,CAAA,YAAAU,CAAA,IAAAD,CAAA,OAAAE,cAAA,CAAAC,IAAA,CAAAH,CAAA,EAAAC,CAAA,MAAAJ,CAAA,CAAAI,CAAA,IAAAD,CAAA,CAAAC,CAAA,aAAAJ,CAAA,KAAAJ,QAAA,CAAAW,KAAA,OAAAN,SAAA;AAAA,SAAAO,yBAAAd,CAAA,EAAAS,CAAA,gBAAAT,CAAA,iBAAAe,CAAA,EAAAL,CAAA,EAAAM,CAAA,GAAAC,6BAAA,CAAAjB,CAAA,EAAAS,CAAA,OAAAN,MAAA,CAAAe,qBAAA,QAAAZ,CAAA,GAAAH,MAAA,CAAAe,qBAAA,CAAAlB,CAAA,QAAAU,CAAA,MAAAA,CAAA,GAAAJ,CAAA,CAAAE,MAAA,EAAAE,CAAA,IAAAK,CAAA,GAAAT,CAAA,CAAAI,CAAA,UAAAD,CAAA,CAAAU,OAAA,CAAAJ,CAAA,QAAAK,oBAAA,CAAAR,IAAA,CAAAZ,CAAA,EAAAe,CAA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A;IAAME,UAAU,EAAC,KAAK;IACvB,WAAW,EAAE;EAAgB,gDAE7B,CAAM,CAAC,EACX,IAAA/B,OAAA,CAAA6B,GAAA,+FAA0F,CAAC,EAC3F,IAAA7B,OAAA,CAAA6B,GAAA,eAAK,IAAA7B,OAAA,CAAA6B,GAAA;IAAME,UAAU,EAAC,KAAK;IACvB,WAAW,EAAE;EAAgB,4EAI7B,CAAM,CAAC,EACX,IAAA/B,OAAA,CAAA6B,GAAA,0CAAqC,CAAC,EACtC,IAAA7B,OAAA,CAAA6B,GAAA,eAAK,IAAA7B,OAAA,CAAA6B,GAAA;IAAME,UAAU,EAAC,KAAK;IACvB,WAAW,EAAE;EAAgB,0EAI7B,CAAM,CACC,CAAC;AAChB;AACA;AACAN,UAAU,CAACO,cAAc,GAAG,IAAI","ignoreList":[]}
@@ -0,0 +1,7 @@
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.pkg_aspect-docs_pkg@96af1a186d7e33351b25fd4a290b75653da81de6/dist/pkg.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.pkg_aspect-docs_pkg@96af1a186d7e33351b25fd4a290b75653da81de6/dist/pkg.docs.mdx';
3
+
4
+ export const compositions = [compositions_0];
5
+ export const overview = [overview_0];
6
+
7
+ export const compositions_metadata = {"compositions":[{"displayName":"Pkg docs","identifier":"PkgDocs"}]};
package/index.ts ADDED
@@ -0,0 +1 @@
1
+ export { default as Pkg } from './pkg.mdx';
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@teambit/pkg.aspect-docs.pkg",
3
+ "version": "0.0.0-96af1a186d7e33351b25fd4a290b75653da81de6",
4
+ "homepage": "https://bit.cloud/teambit/pkg/aspect-docs/pkg",
5
+ "main": "dist/index.js",
6
+ "componentId": {
7
+ "scope": "teambit.pkg",
8
+ "name": "aspect-docs/pkg",
9
+ "version": "96af1a186d7e33351b25fd4a290b75653da81de6"
10
+ },
11
+ "dependencies": {
12
+ "core-js": "^3.0.0",
13
+ "@mdx-js/react": "1.6.22",
14
+ "@teambit/mdx.ui.mdx-scope-context": "1.0.0"
15
+ },
16
+ "devDependencies": {
17
+ "@types/react": "^17.0.8",
18
+ "@types/mocha": "9.1.0",
19
+ "@types/node": "12.20.4",
20
+ "@types/react-dom": "^17.0.5",
21
+ "@types/jest": "^26.0.0",
22
+ "@babel/runtime": "7.20.0",
23
+ "@types/testing-library__jest-dom": "5.9.5",
24
+ "@teambit/documenter.theme.theme-compositions": "4.1.5",
25
+ "@teambit/mdx.ui.mdx-layout": "1.0.11"
26
+ },
27
+ "peerDependencies": {
28
+ "react": "^16.8.0 || ^17.0.0",
29
+ "react-dom": "^16.8.0 || ^17.0.0"
30
+ },
31
+ "license": "Apache-2.0",
32
+ "optionalDependencies": {},
33
+ "peerDependenciesMeta": {},
34
+ "private": false,
35
+ "engines": {
36
+ "node": ">=12.22.0"
37
+ },
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "https://github.com/teambit/bit"
41
+ },
42
+ "keywords": [
43
+ "bit",
44
+ "components",
45
+ "collaboration",
46
+ "web",
47
+ "react",
48
+ "react-components",
49
+ "angular",
50
+ "angular-components"
51
+ ]
52
+ }
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions';
3
+ import { MDXLayout } from '@teambit/mdx.ui.mdx-layout';
4
+ import { Pkg } from './index';
5
+
6
+ export const PkgDocs = () => (
7
+ <ThemeCompositions>
8
+ <MDXLayout>
9
+ <Pkg />
10
+ </MDXLayout>
11
+ </ThemeCompositions>
12
+ );
package/pkg.docs.mdx ADDED
@@ -0,0 +1,34 @@
1
+ ---
2
+ description: 'Docs for Pkg aspect'
3
+ labels: ['docs', 'aspect', 'extensions']
4
+ ---
5
+
6
+ import { Pkg } from './index';
7
+
8
+ ## Static Content Page in Pkg
9
+
10
+ Docs for Pkg aspect
11
+
12
+ ### Component usage
13
+
14
+ Use your component in any Pkg file:
15
+
16
+ ```js
17
+ import { Pkg } from '@teambit/aspect-docs.pkg';
18
+
19
+ <Pkg />;
20
+ ```
21
+
22
+ ### Render with theme and Pkg providers
23
+
24
+ ```js
25
+ import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions';
26
+ import { PkgLayout } from '@teambit/ui.Pkg-layout';
27
+ import { Pkg } from '@teambit/aspect-docs.pkg';
28
+
29
+ <ThemeCompositions>
30
+ <PkgLayout>
31
+ <Pkg />
32
+ </PkgLayout>
33
+ </ThemeCompositions>;
34
+ ```
package/pkg.mdx ADDED
@@ -0,0 +1,184 @@
1
+ Bit components can be thought of as a super-set of standard packaged node modules.
2
+ Each component contains a consumable package in addition to its documentation, history and other information that enables it to be independently developed and maintained.
3
+
4
+ The PKG aspect handles the configuration, publishing and packing of component packages.
5
+ It adds its own build task to the build pipeline, to create component packages and include them in as part of the component artifacts.
6
+ This automation includes generating the package name and other properties according to the component's details.
7
+
8
+ #### Features
9
+
10
+ - **Efficient `package.json` configuration:** Use the PKG's workspace config API to add or override `package.json` properties to a group of components, all at once.
11
+ Use PKG's 'placeholders' to integrate component-specific data into the component's package configurations.
12
+ - **An API for programmable `package.json` configuration:** Use PKG's API to provide your extensions with "packaging capabilities". Modify the `package.json` to suit your extension's needs, whether it is an environment or any other type of extension.
13
+ - **Automated packing and publishing:** - PKG is registered to your build pipeline. That means every 'build' will also test 'packing' and every tagging of a new release version will also include 'publishing'. Your components and packages versions are alway in-sync.
14
+ - **"On-demand" packing and publishing:** - PKG offers the `pack` and `preview` CLI commands for a manual and on-demand usage.
15
+
16
+ ### Quickstart & configuration
17
+
18
+ > This aspect is only configurable using the 'variants' workspace API.
19
+
20
+ #### Package properties
21
+
22
+ Use the `packageJson` property to add or override the default `package.json` for your component packages.
23
+
24
+ > Warning! Packages with a modified `name` property will not be published to Bit.dev's registry.
25
+
26
+ ```js
27
+ {
28
+ "ui/*": {
29
+ "teambit.pkg/pkg": {
30
+ "packageJson": {
31
+ "name": "@{scope}/{name}",
32
+ "private": false,
33
+ "main": "dist/{main}.js",
34
+ "custom-prop": "value"
35
+ }
36
+ }
37
+ }
38
+ }
39
+ ```
40
+
41
+ #### Publish
42
+
43
+ > If `publishConfig` or `name` are not set, packages will be published to Bit.dev's registry.
44
+
45
+ ##### npm arguments
46
+
47
+ You can specify additional arguments to the `npm publish` command by adding an array of args to `packageManagerPublishArgs`.
48
+
49
+ For example:
50
+
51
+ ```js
52
+ "ui/*": {
53
+ "teambit.pkg/pkg": {
54
+ "packageManagerPublishArgs": ["--access public"]
55
+ }
56
+ }
57
+ ```
58
+
59
+ #### npmjs Registry
60
+
61
+ - Use the `name` property to set the publishing process to your [npm scope](https://docs.npmjs.com/cli/v6/using-npm/scope).
62
+ - Use the `private` _(boolean)_ property to set packages to be published with either private or public access.
63
+
64
+ ```js
65
+ {
66
+ "ui/*": {
67
+ "teambit.pkg/pkg": {
68
+ "packageJson": {
69
+ "name": "@{scope}/{name}",
70
+ "private": false,
71
+ }
72
+ }
73
+ }
74
+ }
75
+ ```
76
+
77
+ - By default, when specifying `name` or `publishConfig`, it'll publish to NPM. In some rare cases, this is not desired, to cancel it, add the config `"avoidPublishToNPM": true`
78
+
79
+ #### Private registry
80
+
81
+ Use the `scope` and `registry` properties to configure the publishing process to your own private registry (and scope).
82
+
83
+ ```js
84
+ "ui/*": {
85
+ "teambit.pkg/pkg": {
86
+ "packageJson": {
87
+ "publishConfig": {
88
+ "scope": "@custom",
89
+ "registry": "http://localhost:4873"
90
+ }
91
+ }
92
+ }
93
+ }
94
+ ```
95
+
96
+ > Packages with a modified `publishConfig` property will not be published to Bit.dev's registry.
97
+
98
+ #### Placeholders
99
+
100
+ Placeholders are an easy way to inject component-specific information into the 'pkg' configurations.
101
+
102
+ - `{name}` - The name of the component.
103
+ - `{scope}` - The name of the component scope.
104
+ - `{main}` - the name of the main file (leaving out the extension) - for example `index.js` will be `index`.
105
+
106
+ For example:
107
+
108
+ ```js
109
+ "packageJson": {
110
+ "main": "dist/{main}.js"
111
+ }
112
+ ```
113
+
114
+ #### .npmignore
115
+
116
+ Add records to the .npmignore file before a package is published or pack.
117
+ For example, if you don't want the source files to be part of the package, you can add them to the .npmignore.
118
+
119
+ The API to add records to this file is exposed in the environment: `getNpmIgnore()`.
120
+
121
+ For example, the following was added to the Aspect env.
122
+
123
+ ```js
124
+ getNpmIgnore() {
125
+ // ignores only .ts files in the root directory, so d.ts files inside dists are unaffected.
126
+ return ['/*.ts']
127
+ }
128
+ ```
129
+
130
+ ### CLI Reference
131
+
132
+ #### Pack
133
+
134
+ Creates a TAR file (to be published to a node package registry):
135
+
136
+ ```shell
137
+ bit pack <component-id>
138
+ ```
139
+
140
+ Overrides the existing TAR file (in the same location):
141
+
142
+ ```shell
143
+ bit pack <component-id> --override
144
+
145
+ bit pack <component-id> -o
146
+ ```
147
+
148
+ Returns the output in a JSON format:
149
+
150
+ ```shell
151
+ bit pack <component-id> --json
152
+
153
+ bit pack <component-id> -j
154
+ ```
155
+
156
+ #### Publish
157
+
158
+ Publishes an exported component:
159
+
160
+ ```shell
161
+ bit publish <componentId>
162
+ ```
163
+
164
+ Publishes a staged component that has not yet been exported:
165
+
166
+ ```shell
167
+ bit publish <component-id> --allow-staged
168
+ ```
169
+
170
+ Checks if the publishing process will be done successfully (without publishing):
171
+
172
+ ```shell
173
+ bit publish <component-id> --dry-run
174
+
175
+ bit publish <component-id> -d
176
+ ```
177
+
178
+ Returns the output as JSON:
179
+
180
+ ```shell
181
+ bit publish <component-id> --json
182
+
183
+ bit publish <component-id> --j
184
+ ```
@@ -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
+ }
@@ -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
+ }