├── .bitmap
├── .circleci
└── config.yml
├── .editorconfig
├── .eslintignore
├── .eslintrc.js
├── .flowconfig
├── .github
├── ISSUE_TEMPLATE.md
├── ISSUE_TEMPLATE
│ ├── 1-bug-report.md
│ ├── 2-support-request.md
│ ├── 3-feature_request.md
│ └── 4-docs-issue.md
└── PULL_REQUEST_TEMPLATE.md
├── .gitignore
├── .prettierignore
├── .prettierrc
├── .snyk
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── Jenkinsfile
├── LICENSE
├── README.md
├── appveyor.yml
├── babel-register.js
├── babel.config.js
├── bin
├── bit-updates.js
├── bit.js
├── eb.js
└── ebit-auth.js
├── bit.json
├── custom-types
├── jest
│ └── index.d.ts
├── mocha
│ └── index.d.ts
└── testing-library__jest-dom
│ └── index.d.ts
├── docs
└── bootstrap.md
├── e2e
├── .eslintrc
├── api
│ ├── add-many.e2e.1.ts
│ ├── list.e2e.1.ts
│ └── show.e2e.1.ts
├── bit-hub
│ ├── export-eject-to-bit-hub.ts
│ └── import-from-bit-hub.ts
├── bitsrc-tester.ts
├── commands
│ ├── _scope.e2e.1.ts
│ ├── add.e2e.1.ts
│ ├── build.e2e.1.ts
│ ├── checkout.e2e.1.ts
│ ├── ci-update.e2e.1.ts
│ ├── config.e2e.1.ts
│ ├── dependency-status.e2e.1.ts
│ ├── deprecate.e2e.1.ts
│ ├── diff.e2e.1.ts
│ ├── eject.e2e.1.ts
│ ├── export.e2e.1.ts
│ ├── extentsion.e2e.1.ts
│ ├── import-all.e2e.1.ts
│ ├── import.e2e.1.ts
│ ├── init.e2e.1.ts
│ ├── install.e2e.1.ts
│ ├── isolate.e2e.1.ts
│ ├── link.e2e.1.ts
│ ├── list.e2e.1.ts
│ ├── log.e2e.1.ts
│ ├── merge.e2e.1.ts
│ ├── move.e2e.1.ts
│ ├── remote.e2e.1.ts
│ ├── remove.e2e.1.ts
│ ├── show.e2e.2.ts
│ ├── status.e2e.2.ts
│ ├── tag.e2e.1.ts
│ ├── test.e2e.2.ts
│ ├── untag.e2e.2.ts
│ ├── untrack.e2e.2.ts
│ └── watch.e2e.2.ts
├── doctor
│ ├── doctor-git-exec.e2e.3.ts
│ └── doctor-infra.e2e.3.ts
├── fixtures
│ ├── big-text-file-fixture.txt
│ ├── compilers
│ │ ├── add-scope-name
│ │ │ └── compiler.js
│ │ ├── babel
│ │ │ └── compiler.js
│ │ ├── bundle
│ │ │ └── compiler.js
│ │ ├── capsule-save-links
│ │ │ └── compiler.js
│ │ ├── capsule
│ │ │ └── compiler.js
│ │ ├── dist-main
│ │ │ └── compiler.js
│ │ ├── dummy
│ │ │ └── compiler.js
│ │ ├── new-babel
│ │ │ ├── .babelrc
│ │ │ └── compiler.js
│ │ ├── pkg-json
│ │ │ └── compiler.js
│ │ ├── webpack-relative
│ │ │ ├── base
│ │ │ │ └── base.config.js
│ │ │ ├── compiler.js
│ │ │ └── dev.config.js
│ │ └── webpack
│ │ │ ├── base.config.js
│ │ │ ├── compiler.js
│ │ │ └── dev.config.js
│ ├── components
│ │ ├── add-many
│ │ │ ├── add_many_test_files
│ │ │ │ ├── LICENSE
│ │ │ │ ├── a.js
│ │ │ │ ├── a.spec.js
│ │ │ │ ├── b.js
│ │ │ │ ├── c.js
│ │ │ │ ├── d.js
│ │ │ │ ├── d.spec.js
│ │ │ │ ├── e.js
│ │ │ │ ├── f.js
│ │ │ │ └── inner_folder
│ │ │ │ │ └── .gitkeep
│ │ │ ├── g.js
│ │ │ ├── h.js
│ │ │ ├── h.spec.js
│ │ │ ├── i.js
│ │ │ └── i.spec.js
│ │ ├── app
│ │ │ ├── app.tsx
│ │ │ └── index.ts
│ │ ├── dependency-status
│ │ │ └── dependency-status-test-files
│ │ │ │ ├── a.js
│ │ │ │ ├── b.js
│ │ │ │ └── c.js
│ │ ├── help
│ │ │ ├── help.tsx
│ │ │ └── index.ts
│ │ ├── hero-button
│ │ │ ├── HeroButton.js
│ │ │ ├── HeroButton.spec.js
│ │ │ ├── index.js
│ │ │ └── style.scss
│ │ ├── hero-withrelativepaths
│ │ │ ├── Hero.js
│ │ │ ├── index.js
│ │ │ └── style.scss
│ │ ├── hero
│ │ │ ├── Hero.js
│ │ │ ├── Hero.spec.js
│ │ │ ├── index.js
│ │ │ └── style.scss
│ │ ├── import-relative-path
│ │ │ └── import-by-2-files
│ │ │ │ ├── a1.js
│ │ │ │ ├── a2.js
│ │ │ │ ├── a3.js
│ │ │ │ └── b.js
│ │ ├── is-string
│ │ │ ├── index.js
│ │ │ ├── is-string.js
│ │ │ └── is-string.spec.js
│ │ ├── logo
│ │ │ ├── index.ts
│ │ │ ├── logo.e2e.spec.tsx
│ │ │ ├── logo.simulation.ts
│ │ │ ├── logo.spec.tsx
│ │ │ └── logo.tsx
│ │ ├── pad-left
│ │ │ ├── index.js
│ │ │ ├── pad-left.js
│ │ │ └── pad-left.spec.js
│ │ ├── styles
│ │ │ └── global.css
│ │ └── vue
│ │ │ ├── StylusExample.vue
│ │ │ ├── UiAutocomplete.vue
│ │ │ ├── UiAutocompleteSuggestion.vue
│ │ │ ├── UiIcon.vue
│ │ │ ├── directives
│ │ │ └── autofocus.js
│ │ │ ├── styles
│ │ │ ├── imports.scss
│ │ │ ├── md-colors.scss
│ │ │ ├── mixins.scss
│ │ │ ├── util.scss
│ │ │ └── variables.scss
│ │ │ └── stylus
│ │ │ ├── main.styl
│ │ │ └── second.styl
│ ├── extensions
│ │ ├── dummy-extension
│ │ │ ├── dummy-extension.manifest.js
│ │ │ └── index.js
│ │ ├── extension-add-config
│ │ │ └── simple-config
│ │ │ │ ├── index.js
│ │ │ │ └── simple-config.manifest.js
│ │ ├── extension-add-dependencies
│ │ │ ├── extension-add-dependencies.manifest.js
│ │ │ └── index.js
│ │ ├── extension-provider-error
│ │ │ ├── extension-provider-error.manifest.js
│ │ │ └── index.js
│ │ ├── non-requireable-extension
│ │ │ ├── index.js
│ │ │ └── non-requireable-extension.manifest.js
│ │ └── react-create-template
│ │ │ ├── index.js
│ │ │ └── react-create-template.manifest.js
│ ├── png_fixture.png
│ ├── scopes
│ │ ├── global-remote.tgz
│ │ └── repository-hooks-fixture.js
│ └── testers
│ │ ├── capsule
│ │ └── tester.js
│ │ ├── mocha
│ │ └── tester.js
│ │ └── new-mocha
│ │ └── tester.js
├── flows
│ ├── big-file.e2e.2.ts
│ ├── bitmap-deleted.e2e-2.ts
│ ├── copy-workspace-with-env.e2e.2.ts
│ ├── cyclic-dependencies.e2e.2.ts
│ ├── delete-files.e2e.2.ts
│ ├── dependencies-as-packages.e2e.2.ts
│ ├── dependencies-from-relative-path.e2e.3.ts
│ ├── dependencies-versions-resolution.e2e.2.ts
│ ├── dist-main-is-different.e2e.2.ts
│ ├── dist-outside-components.e2e.2.ts
│ ├── es6-link-files.e2e.3.ts
│ ├── es6.e2e.3.ts
│ ├── id-with-wildcard.e2e.2.ts
│ ├── import-package-json.e2e.3.ts
│ ├── imported-depends-on-authored.e2e.3.ts
│ ├── long-dependencies-chain.e2e.3.ts
│ ├── no-scope.e2e.2.ts
│ ├── out-of-sync-componets.e2e.3.ts
│ ├── pad-left-and-is-string.e2e.3.ts
│ ├── permissions-errors.e2e.3.ts
│ ├── relative-paths.e2e.3.ts
│ ├── remote-commands-outside-workspace.e2e.2.ts
│ ├── require-internal-files.e2e.2.ts
│ ├── set-default-owner-and-scope.e2e.4.ts
│ └── sort-components-output.e2e.3.ts
├── functionalities
│ ├── auto-tagging.e2e.2.ts
│ ├── binary-files.e2e.2.ts
│ ├── capsule.e2e.2.ts
│ ├── component-config.e2e.2.ts
│ ├── components-index.e2e.2.ts
│ ├── custom-module-resolutions.e2e.2.ts
│ ├── default-scope.e2e.2.ts
│ ├── dev-dependencies.e2e.2.ts
│ ├── dynamic-namespaces.e2e.3.ts
│ ├── envs.e2e.3.ts
│ ├── link-generation.e2e.2.ts
│ ├── merge.e2e.3.ts
│ ├── peer-dependencies.e2e.3.ts
│ ├── reduce-path.e2e.3.ts
│ ├── repository-hooks.e2e.ts
│ ├── symlink-object-without-component.e2e.3.ts
│ ├── track-directories.e2e.3.ts
│ └── workspace-config.e2e.3.ts
├── harmony
│ ├── compile.e2e.4.ts
│ ├── create.e2e.4.ts
│ ├── dependency-resolver.e2e.ts
│ ├── extensions-config.e2e.3.ts
│ ├── flows.e2e.4.ts
│ ├── load-extensions.e2e.4.ts
│ └── pkg.e2e.ts
├── interactive
│ ├── README.md
│ └── init.interactive.e2e.3.ts
├── npm-ci-registry.ts
├── performance
│ └── many-components.performance.ts
├── platforms
│ ├── angular.e2e.3.ts
│ └── vue.e2e.3.ts
├── typescript
│ ├── typescript-link-files.e2e.3.ts
│ └── typescript.e2e.3.ts
└── watch-runner.ts
├── fixtures
├── bitmap-fixtures
│ └── only-imported
│ │ └── .bitmap
├── build-tree
│ ├── a.js
│ ├── b.js
│ ├── not-link-file
│ │ ├── file-a.js
│ │ ├── file-b.js
│ │ └── file-c.js
│ ├── tree-shaking-cycle
│ │ ├── foo.js
│ │ ├── index.js
│ │ ├── is-string.js
│ │ └── self-cycle.js
│ ├── unparsed.css
│ └── unparsed.js
├── component-model.json
├── consumer-components
│ ├── custom-resolved-modules
│ │ ├── bar-foo.json
│ │ ├── utils-is-string.json
│ │ └── utils-is-type.json
│ ├── es6
│ │ ├── bar-foo.json
│ │ ├── utils-is-string.json
│ │ └── utils-is-type.json
│ ├── plain-javascript
│ │ ├── bar-foo.json
│ │ ├── utils-is-string.json
│ │ └── utils-is-type.json
│ ├── sass
│ │ ├── bar-foo.json
│ │ ├── utils-is-string.json
│ │ └── utils-is-type.json
│ └── with-compiler
│ │ └── with-compiler.json
├── dependencies-fixture.json
├── dependency-tree
│ ├── amd
│ │ ├── a.js
│ │ ├── b.js
│ │ └── c.js
│ ├── commonjs
│ │ ├── a.js
│ │ ├── b.js
│ │ └── c.js
│ ├── onlyRealDeps
│ │ └── a.js
│ └── webpack
│ │ ├── aliased.js
│ │ └── unaliased.js
├── filing-cabinet
│ ├── ast.js
│ ├── foo.jsx
│ ├── foo.scss
│ ├── foo2.scss
│ ├── mockedJSFiles.js
│ ├── node_modules
│ │ └── bootstrap
│ │ │ └── index.scss
│ ├── root1
│ │ └── mod1.js
│ ├── root2
│ │ └── mod2.js
│ └── webpack.config.js
├── invalid-tester.js
├── jsdoc
│ ├── descriptionTag.js
│ ├── endWithTwoStars.js
│ ├── flowTypeFile.js
│ ├── functionDeclaration.js
│ ├── methodDeclaration.js
│ ├── misc.js
│ ├── properties.js
│ ├── react
│ │ ├── elevation.tsx
│ │ └── react-docs.js
│ ├── variableDeclaration.js
│ ├── variousParamTypes.js
│ └── vue
│ │ └── checkbox.vue
├── missing-deps.js
├── path-map.json
├── precinct
│ ├── Gruntfile.js
│ ├── amd.js
│ ├── cjsExportLazy.js
│ ├── cjsMixedImport.js
│ ├── commonjs.js
│ ├── coreModules.js
│ ├── es6.js
│ ├── es6MixedExportLazy.js
│ ├── es6MixedImport.js
│ ├── es6NoImport.js
│ ├── es6WithError.js
│ ├── es7.js
│ ├── exampleAST.js
│ ├── jsx.js
│ ├── none.js
│ ├── styles.css
│ ├── styles.less
│ ├── styles.sass
│ ├── styles.scss
│ ├── styles.styl
│ ├── typescript.ts
│ ├── typescriptWithError.ts
│ └── unparseable.js
├── unsupported-file.pdf
├── version-model-extended.json
└── version-model-object.json
├── package-lock.json
├── package.json
├── resources
├── bit.template.json
├── repos
│ ├── bitsrc.repo
│ └── deb-repo.sh
└── win-chocolatey
│ ├── bit.nuspec
│ └── tools
│ └── chocolateyinstall.ps1.in
├── scripts
├── bootstrap-env-ubuntu.sh
├── build-chocolatey.ps1
├── build-deb.sh
├── build-dist.ps1
├── build-tar.sh
├── build-types.bash
├── build-windows-installer.bat
├── compare-versions.sh
├── copyArtifacts.ps1
├── deploy-windows.ps1
├── doc-generator.js
├── establish-dev-link.js
├── install.js
├── linux
│ ├── build-linux.sh
│ ├── centos
│ │ ├── Dockerfile
│ │ ├── README.md
│ │ ├── bit.repo
│ │ └── build-linux-rpm.sh
│ ├── debian
│ │ ├── Dockerfile
│ │ ├── README.md
│ │ └── build-linux-deb.sh
│ ├── postInstall.sh
│ └── postRemove.sh
├── macos
│ └── brew
│ │ └── bit.rb
├── node-installer.ps1
├── node-installer.sh
├── scripts-constants.js
├── set-installation-method.js
├── slack-deploy-notification.js
└── windows
│ ├── Bit.wxs
│ ├── BitSetup.wixproj
│ ├── bit-banner.bmp
│ ├── bit-dialog.bmp
│ ├── bit.cmd
│ ├── bit.ico
│ └── license.rtf
├── src
├── analytics
│ ├── analytics-sender.ts
│ └── analytics.ts
├── api.ts
├── api
│ ├── consumer
│ │ ├── index.ts
│ │ └── lib
│ │ │ ├── add.ts
│ │ │ ├── build.ts
│ │ │ ├── checkout.ts
│ │ │ ├── dependency_status.ts
│ │ │ ├── deprecation.ts
│ │ │ ├── diff.ts
│ │ │ ├── doctor.ts
│ │ │ ├── eject-conf.ts
│ │ │ ├── eject.ts
│ │ │ ├── exceptions
│ │ │ ├── config-key-not-found.ts
│ │ │ ├── diagnosis-not-found.ts
│ │ │ ├── id-exported-already.ts
│ │ │ ├── invalid-version.ts
│ │ │ ├── missing-diagnosis-name.ts
│ │ │ ├── no-id-match-wildcard.ts
│ │ │ ├── nothing-to-compare-to.ts
│ │ │ └── objects-without-consumer.ts
│ │ │ ├── export.ts
│ │ │ ├── feature-toggle.spec.ts
│ │ │ ├── feature-toggle.ts
│ │ │ ├── get-component-logs.ts
│ │ │ ├── get-consumer-component.ts
│ │ │ ├── get-scope-component.ts
│ │ │ ├── global-config.ts
│ │ │ ├── import.ts
│ │ │ ├── init.ts
│ │ │ ├── inject-conf.ts
│ │ │ ├── install.ts
│ │ │ ├── isolate.ts
│ │ │ ├── link.ts
│ │ │ ├── list-scope.spec.ts
│ │ │ ├── list-scope.ts
│ │ │ ├── login.ts
│ │ │ ├── merge.ts
│ │ │ ├── migrate.ts
│ │ │ ├── move.ts
│ │ │ ├── paint-graph.ts
│ │ │ ├── remote.ts
│ │ │ ├── remove.ts
│ │ │ ├── show.ts
│ │ │ ├── status.ts
│ │ │ ├── tag.ts
│ │ │ ├── test.ts
│ │ │ ├── untag.ts
│ │ │ └── untrack.ts
│ └── scope
│ │ ├── index.ts
│ │ └── lib
│ │ ├── build-in-scope.ts
│ │ ├── cat-component.ts
│ │ ├── cat-object.ts
│ │ ├── cat-scope.ts
│ │ ├── ci-update-action.ts
│ │ ├── delete.ts
│ │ ├── deprecation.ts
│ │ ├── describe-scope.ts
│ │ ├── fetch.ts
│ │ ├── graph.ts
│ │ ├── latest-versions.ts
│ │ ├── log.ts
│ │ ├── modify-ci-props.ts
│ │ ├── put.ts
│ │ ├── refresh-scope.ts
│ │ ├── resolver.ts
│ │ ├── scope-config.ts
│ │ ├── scope-init.ts
│ │ ├── scope-list.ts
│ │ ├── scope-show.ts
│ │ └── test-in-scope.ts
├── app.ts
├── bit-id
│ ├── README.md
│ ├── bit-id-and-value-array.ts
│ ├── bit-id.spec.ts
│ ├── bit-id.ts
│ ├── bit-ids.spec.ts
│ ├── bit-ids.ts
│ ├── exceptions
│ │ ├── index.ts
│ │ ├── invalid-bit-id.ts
│ │ ├── invalid-id-chunk.ts
│ │ ├── invalid-name.ts
│ │ └── invalid-scope-name.ts
│ └── index.ts
├── cli
│ ├── chalk-box.ts
│ ├── cli-utils.ts
│ ├── command-registry-builder.ts
│ ├── command-registry.ts
│ ├── command-runner.ts
│ ├── command.ts
│ ├── commands
│ │ ├── exceptions
│ │ │ ├── add-tests-without-id.ts
│ │ │ └── remote-undefined.ts
│ │ ├── private-cmds
│ │ │ ├── _delete-cmd.ts
│ │ │ ├── _deprecate-cmd.ts
│ │ │ ├── _fetch-cmd.ts
│ │ │ ├── _graph-cmd.ts
│ │ │ ├── _latest-cmd.ts
│ │ │ ├── _list-cmd.ts
│ │ │ ├── _log-cmd.ts
│ │ │ ├── _put-cmd.ts
│ │ │ ├── _scope-cmd.ts
│ │ │ ├── _search-cmd.ts
│ │ │ ├── _show-cmd.ts
│ │ │ ├── _undeprecate-cmd.ts
│ │ │ ├── cat-component-cmd.ts
│ │ │ ├── cat-object-cmd.ts
│ │ │ ├── cat-scope-cmd.ts
│ │ │ ├── ci-update-cmd.ts
│ │ │ ├── dependency-status-cmd.ts
│ │ │ ├── migrate-cmd.ts
│ │ │ ├── refresh-scope-cmd.ts
│ │ │ ├── resolver-cmd.ts
│ │ │ └── scope-config-cmd.ts
│ │ └── public-cmds
│ │ │ ├── add-cmd.ts
│ │ │ ├── build-cmd.ts
│ │ │ ├── checkout-cmd.ts
│ │ │ ├── clear-cache-cmd.ts
│ │ │ ├── config-cmd.ts
│ │ │ ├── deprecate-cmd.ts
│ │ │ ├── diff-cmd.ts
│ │ │ ├── doctor-cmd.ts
│ │ │ ├── eject-cmd.ts
│ │ │ ├── eject-conf-cmd.ts
│ │ │ ├── export-cmd.ts
│ │ │ ├── graph-cmd.ts
│ │ │ ├── import-cmd.ts
│ │ │ ├── init-cmd.ts
│ │ │ ├── inject-conf-cmd.ts
│ │ │ ├── install-cmd.ts
│ │ │ ├── isolate-cmd.ts
│ │ │ ├── link-cmd.ts
│ │ │ ├── list-cmd.ts
│ │ │ ├── log-cmd.ts
│ │ │ ├── login-cmd.ts
│ │ │ ├── logout-cmd.ts
│ │ │ ├── merge-cmd.ts
│ │ │ ├── move-cmd.ts
│ │ │ ├── remote-cmd.ts
│ │ │ ├── remove-cmd.ts
│ │ │ ├── scope-config-cmd.ts
│ │ │ ├── search-cmd.ts
│ │ │ ├── show-cmd.ts
│ │ │ ├── status-cmd.ts
│ │ │ ├── tag-cmd.ts
│ │ │ ├── test-cmd.ts
│ │ │ ├── undeprecate-cmd.ts
│ │ │ ├── untag-cmd.ts
│ │ │ └── untrack-cmd.ts
│ ├── default-error-handler.ts
│ ├── global-flags.ts
│ ├── index.ts
│ ├── legacy-command.ts
│ ├── loader
│ │ ├── index.ts
│ │ ├── loader-messages.ts
│ │ └── loader.ts
│ └── templates
│ │ ├── all-help.ts
│ │ ├── bare-list-template.ts
│ │ ├── codemod-template.ts
│ │ ├── component-issues-template.ts
│ │ ├── component-template.ts
│ │ ├── diagnosis-list-template.ts
│ │ ├── docs-template.ts
│ │ ├── doctor-results-template.ts
│ │ ├── eject-template.ts
│ │ ├── help.ts
│ │ ├── link-template.ts
│ │ ├── list-template.ts
│ │ ├── newer-version-template.ts
│ │ ├── raw-list-template.ts
│ │ └── remove-template.ts
├── component-resolver
│ ├── component-resolver.ts
│ └── index.ts
├── constants.ts
├── consumer
│ ├── bit-map
│ │ ├── bit-map.spec.ts
│ │ ├── bit-map.ts
│ │ ├── component-map.ts
│ │ ├── exceptions
│ │ │ ├── index.ts
│ │ │ ├── invalid-bit-map.ts
│ │ │ ├── missing-bit-map-component.ts
│ │ │ ├── missing-main-file.ts
│ │ │ └── outside-root-dir.ts
│ │ └── index.ts
│ ├── component-ops
│ │ ├── add-components
│ │ │ ├── add-components.ts
│ │ │ ├── determine-main-file.ts
│ │ │ ├── exceptions
│ │ │ │ ├── adding-individual-files.ts
│ │ │ │ ├── duplicate-ids.ts
│ │ │ │ ├── empty-directory.ts
│ │ │ │ ├── excluded-main-file.ts
│ │ │ │ ├── incorrect-id-imported-component.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── main-file-is-dir.ts
│ │ │ │ ├── missing-id-imported-component.ts
│ │ │ │ ├── missing-main-file-multiple-components.ts
│ │ │ │ ├── no-files.ts
│ │ │ │ ├── path-outside-consumer.ts
│ │ │ │ ├── paths-not-exist.ts
│ │ │ │ ├── test-is-directory.ts
│ │ │ │ └── version-should-be-removed.ts
│ │ │ └── index.ts
│ │ ├── build-component.ts
│ │ ├── codemod-components.ts
│ │ ├── component-status-loader.ts
│ │ ├── component-writer.ts
│ │ ├── components-diff.ts
│ │ ├── components-object-diff.ts
│ │ ├── delete-component-files.ts
│ │ ├── dependency-status.ts
│ │ ├── eject-components.ts
│ │ ├── eject-conf.ts
│ │ ├── exceptions
│ │ │ ├── components-pending-import.ts
│ │ │ └── eject-no-dir.ts
│ │ ├── import-components.ts
│ │ ├── inject-conf.ts
│ │ ├── install-components.ts
│ │ ├── load-flattened-dependencies.ts
│ │ ├── manipulate-dir.ts
│ │ ├── many-components-writer.ts
│ │ ├── move-components.ts
│ │ └── remove-components.ts
│ ├── component
│ │ ├── component-loader.ts
│ │ ├── components-list.spec.ts
│ │ ├── components-list.ts
│ │ ├── consumer-component.spec.ts
│ │ ├── consumer-component.ts
│ │ ├── dependencies
│ │ │ ├── dependencies.spec.ts
│ │ │ ├── dependencies.ts
│ │ │ ├── dependency-resolver
│ │ │ │ ├── dependencies-resolver.ts
│ │ │ │ ├── dependencies-versions-resolver.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── overrides-dependencies.ts
│ │ │ ├── dependency.ts
│ │ │ ├── files-dependency-builder
│ │ │ │ ├── build-tree.spec.ts
│ │ │ │ ├── build-tree.ts
│ │ │ │ ├── dependency-tree
│ │ │ │ │ ├── Config.ts
│ │ │ │ │ ├── index.spec.ts
│ │ │ │ │ └── index.ts
│ │ │ │ ├── detectives
│ │ │ │ │ ├── detective-css-and-preprocessors
│ │ │ │ │ │ └── index.ts
│ │ │ │ │ ├── detective-css
│ │ │ │ │ │ ├── index.spec.ts
│ │ │ │ │ │ └── index.ts
│ │ │ │ │ ├── detective-es6
│ │ │ │ │ │ ├── index.spec.ts
│ │ │ │ │ │ └── index.ts
│ │ │ │ │ ├── detective-less
│ │ │ │ │ │ ├── index.spec.ts
│ │ │ │ │ │ └── index.ts
│ │ │ │ │ ├── detective-sass
│ │ │ │ │ │ ├── index.spec.ts
│ │ │ │ │ │ └── index.ts
│ │ │ │ │ ├── detective-scss
│ │ │ │ │ │ ├── index.spec.ts
│ │ │ │ │ │ └── index.ts
│ │ │ │ │ ├── detective-stylable
│ │ │ │ │ │ └── index.ts
│ │ │ │ │ ├── detective-typescript
│ │ │ │ │ │ ├── index.spec.ts
│ │ │ │ │ │ └── index.ts
│ │ │ │ │ ├── detective-vue
│ │ │ │ │ │ └── index.ts
│ │ │ │ │ └── parser-helper.ts
│ │ │ │ ├── filing-cabinet
│ │ │ │ │ ├── index.spec.ts
│ │ │ │ │ └── index.ts
│ │ │ │ ├── generate-tree-madge.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── lookups
│ │ │ │ │ └── vue-lookup
│ │ │ │ │ │ └── index.ts
│ │ │ │ ├── path-map.spec.ts
│ │ │ │ ├── path-map.ts
│ │ │ │ ├── precinct
│ │ │ │ │ ├── index.spec.ts
│ │ │ │ │ └── index.ts
│ │ │ │ └── types
│ │ │ │ │ ├── dependency-tree-type.ts
│ │ │ │ │ └── index.ts
│ │ │ └── index.ts
│ │ ├── exceptions
│ │ │ ├── bit-already-exist-externaly.ts
│ │ │ ├── component-not-found-in-path.ts
│ │ │ ├── eject-bound-to-workspace.ts
│ │ │ ├── external-build-errors.ts
│ │ │ ├── external-test-errors.ts
│ │ │ ├── failed-load-for-tag.ts
│ │ │ ├── file-source-not-found.ts
│ │ │ ├── incorrect-root-dir.ts
│ │ │ ├── inject-non-ejected.ts
│ │ │ ├── invalid-bit.ts
│ │ │ ├── invalid-compiler-interface.ts
│ │ │ ├── main-file-removed.ts
│ │ │ ├── missing-files-from-component.ts
│ │ │ └── plugin-not-found.ts
│ │ ├── index.ts
│ │ ├── package-json-file.ts
│ │ ├── package-json-utils.ts
│ │ ├── package-json-vinyl.ts
│ │ ├── package-json.ts
│ │ ├── sources
│ │ │ ├── abstract-vinyl.ts
│ │ │ ├── artifact.ts
│ │ │ ├── data-to-persist.spec.ts
│ │ │ ├── data-to-persist.ts
│ │ │ ├── dist.ts
│ │ │ ├── dists.spec.ts
│ │ │ ├── dists.ts
│ │ │ ├── index.ts
│ │ │ ├── json-file.ts
│ │ │ ├── license.ts
│ │ │ ├── remove-path.ts
│ │ │ ├── source-file.ts
│ │ │ └── vinyl-types.ts
│ │ └── templates
│ │ │ └── postinstall.default-template.ts
│ ├── config
│ │ ├── abstract-config.ts
│ │ ├── component-config.ts
│ │ ├── component-overrides.spec.ts
│ │ ├── component-overrides.ts
│ │ ├── consumer-overrides.spec.ts
│ │ ├── consumer-overrides.ts
│ │ ├── exceptions
│ │ │ ├── bit-config-not-found.ts
│ │ │ ├── index.ts
│ │ │ ├── invalid-bit-json.ts
│ │ │ ├── invalid-config-prop-path.ts
│ │ │ ├── invalid-package-json.ts
│ │ │ └── invalid-package-manager.ts
│ │ ├── extension-config-list.ts
│ │ ├── extension-data.ts
│ │ ├── index.ts
│ │ ├── legacy-workspace-config-interface.ts
│ │ └── workspace-config.ts
│ ├── consumer-loader.ts
│ ├── consumer-locator.ts
│ ├── consumer.spec.ts
│ ├── consumer.ts
│ ├── dir-structure
│ │ └── dir-structure.ts
│ ├── exceptions
│ │ ├── component-out-of-sync.ts
│ │ ├── component-specs-failed.ts
│ │ ├── consumer-already-exists.ts
│ │ ├── consumer-not-found.ts
│ │ ├── index.ts
│ │ ├── login-failed.ts
│ │ ├── missing-dependencies.ts
│ │ ├── newer-version-found.ts
│ │ └── nothing-to-import.ts
│ ├── index.ts
│ ├── login
│ │ ├── exceptions
│ │ │ ├── index.ts
│ │ │ ├── path-to-npmrc-not-exist.ts
│ │ │ └── write-to-npmrc-error.ts
│ │ └── login.ts
│ ├── migrations
│ │ ├── bit-map
│ │ │ ├── index.ts
│ │ │ └── to-semver-migration.ts
│ │ ├── consumer-migrator-manifest.ts
│ │ └── consumer-migrator.ts
│ ├── specs-results
│ │ ├── index.ts
│ │ └── specs-results.ts
│ └── versions-ops
│ │ ├── checkout-version.ts
│ │ └── merge-version
│ │ ├── index.ts
│ │ ├── merge-version.spec.ts
│ │ ├── merge-version.ts
│ │ ├── three-way-merge.ts
│ │ └── two-way-merge.ts
├── doctor
│ ├── core-diagnoses
│ │ ├── broken-symlink-files.ts
│ │ ├── orphan-symlink-objects.ts
│ │ ├── validate-bit-version.ts
│ │ ├── validate-git-exec.ts
│ │ ├── validate-npm-exec.ts
│ │ ├── validate-workspace-bit-json-syntax.ts
│ │ └── validate-yarn-exec.ts
│ ├── diagnosis.ts
│ ├── doctor-registrar-builder.ts
│ └── doctor-registrar.ts
├── e2e-helper
│ ├── e2e-bit-json-helper.ts
│ ├── e2e-bit-jsonc-helper.ts
│ ├── e2e-bitmap-helper.ts
│ ├── e2e-command-helper.ts
│ ├── e2e-config-helper.ts
│ ├── e2e-env-helper.ts
│ ├── e2e-extensions-helper.ts
│ ├── e2e-fixtures-helper.ts
│ ├── e2e-fs-helper.ts
│ ├── e2e-general-helper.ts
│ ├── e2e-git-helper.ts
│ ├── e2e-helper.ts
│ ├── e2e-npm-helper.ts
│ ├── e2e-package-json-helper.ts
│ ├── e2e-scope-helper.ts
│ ├── e2e-scope-json-helper.ts
│ └── e2e-scopes.ts
├── environment
│ ├── capsule-factory.ts
│ ├── environment.spec.ts
│ ├── environment.ts
│ ├── index.ts
│ └── isolator.ts
├── error
│ ├── abstract-error.ts
│ ├── clone-error-object.ts
│ ├── custom-error.ts
│ ├── external-error.ts
│ ├── external-errors.ts
│ ├── general-error.ts
│ ├── hash-error-object.ts
│ ├── show-doctor-error.ts
│ └── validation-error.ts
├── extensions
│ ├── bit
│ │ ├── bit.manifest.ts
│ │ ├── bit.provider.ts
│ │ ├── index.ts
│ │ └── manifests.ts
│ ├── builder
│ │ ├── build-pipe.ts
│ │ ├── builder.extension.ts
│ │ ├── builder.service.ts
│ │ ├── index.ts
│ │ ├── run.cmd.tsx
│ │ ├── task-process.ts
│ │ └── types.ts
│ ├── cli
│ │ ├── cli.extension.ts
│ │ ├── commands
│ │ │ └── help.cmd.tsx
│ │ ├── exceptions
│ │ │ ├── already-exists.tsx
│ │ │ ├── command-not-found.tsx
│ │ │ ├── index.ts
│ │ │ └── paper-error.tsx
│ │ ├── index.ts
│ │ ├── legacy-command-adapter.ts
│ │ ├── readme.md
│ │ └── registry.ts
│ ├── compiler
│ │ ├── README.md
│ │ ├── compile.ts
│ │ ├── compiler.cmd.tsx
│ │ ├── compiler.extension.ts
│ │ ├── compiler.task.ts
│ │ ├── index.ts
│ │ └── types.ts
│ ├── component-resolver
│ │ ├── component-resolver.manifest.ts
│ │ ├── component-resolver.provider.ts
│ │ ├── component-resolver.ts
│ │ ├── index.ts
│ │ └── readme.md
│ ├── component
│ │ ├── component-factory.extension.ts
│ │ ├── component-fs.ts
│ │ ├── component.ts
│ │ ├── config.ts
│ │ ├── dependencies
│ │ │ ├── dependencies.ts
│ │ │ └── index.ts
│ │ ├── exceptions
│ │ │ ├── index.ts
│ │ │ └── nothing-to-snap.ts
│ │ ├── history-graph.ts
│ │ ├── id.ts
│ │ ├── index.ts
│ │ ├── snap.ts
│ │ ├── state.ts
│ │ ├── store.ts
│ │ ├── tag-map.ts
│ │ ├── tag.ts
│ │ └── types.ts
│ ├── compositions
│ │ ├── compoisiton.ts
│ │ ├── composition-store.preview.ts
│ │ ├── compositions.extension.ts
│ │ └── index.ts
│ ├── config
│ │ ├── config.manifest.ts
│ │ ├── config.provider.ts
│ │ ├── config.ts
│ │ ├── exceptions
│ │ │ └── invalid-config-file.tsx
│ │ ├── index.ts
│ │ ├── readme.md
│ │ ├── types.ts
│ │ ├── workspace-config.ts
│ │ └── workspace-template.jsonc
│ ├── core
│ │ ├── core.manifest.ts
│ │ ├── core.provider.ts
│ │ ├── core.ts
│ │ └── index.ts
│ ├── create
│ │ ├── README.md
│ │ ├── create.cmd.tsx
│ │ ├── create.manifest.ts
│ │ ├── create.provider.ts
│ │ ├── create.ts
│ │ ├── index.ts
│ │ └── types.ts
│ ├── dependency-resolver
│ │ ├── dependency-resolver.extension.ts
│ │ ├── index.ts
│ │ ├── package-manager.ts
│ │ ├── readme.md
│ │ └── types.ts
│ ├── docs
│ │ ├── docs-store.tsx
│ │ ├── docs.extension.ts
│ │ ├── docs.ui.tsx
│ │ └── index.ts
│ ├── environments
│ │ ├── components
│ │ │ ├── env-console
│ │ │ │ ├── env-console.tsx
│ │ │ │ └── index.ts
│ │ │ └── index.ts
│ │ ├── context
│ │ │ ├── context.ts
│ │ │ └── index.ts
│ │ ├── environment.ts
│ │ ├── environments.extension.ts
│ │ ├── index.ts
│ │ ├── runtime
│ │ │ ├── env-runtime.ts
│ │ │ ├── index.ts
│ │ │ └── runtime.ts
│ │ └── services
│ │ │ ├── concrete-service.ts
│ │ │ ├── index.ts
│ │ │ └── service.ts
│ ├── extension-env
│ │ ├── ext-env.ts
│ │ ├── extension-env.extension.ts
│ │ └── index.ts
│ ├── flows
│ │ ├── README.md
│ │ ├── cache.ts
│ │ ├── flow
│ │ │ ├── flow.spec.ts
│ │ │ ├── flow.ts
│ │ │ └── index.ts
│ │ ├── flows.manifest.ts
│ │ ├── flows.ts
│ │ ├── index.ts
│ │ ├── network
│ │ │ ├── index.ts
│ │ │ ├── network.spec.ts
│ │ │ ├── network.ts
│ │ │ ├── options.ts
│ │ │ └── sub-graph.ts
│ │ ├── task
│ │ │ ├── container-script.js
│ │ │ ├── execution-stream.ts
│ │ │ ├── index.ts
│ │ │ ├── task.spec.ts
│ │ │ └── task.ts
│ │ └── util
│ │ │ ├── create-capsule.ts
│ │ │ ├── create-fake-network.ts
│ │ │ ├── flatten-nested-map.ts
│ │ │ └── sort-graph-by-levels.ts
│ ├── git
│ │ └── index.ts
│ ├── graph
│ │ ├── component-graph
│ │ │ ├── component-graph.ts
│ │ │ └── index.ts
│ │ ├── dependency.ts
│ │ ├── duplicate-dependency.ts
│ │ ├── graph-builder.ts
│ │ ├── graph.manifest.ts
│ │ ├── graph.provider.ts
│ │ ├── index.ts
│ │ └── readme.md
│ ├── graphql
│ │ ├── graphql-provider
│ │ │ ├── graphql-provider.tsx
│ │ │ └── index.ts
│ │ ├── graphql.extension.ts
│ │ ├── graphql.ui.tsx
│ │ └── index.ts
│ ├── insights
│ │ ├── all-insights
│ │ │ ├── duplicate-dependencies.tsx
│ │ │ └── find-cycles.tsx
│ │ ├── core-insights-getter.ts
│ │ ├── exceptions
│ │ │ ├── insight-already-exists.tsx
│ │ │ ├── insight-not-found.tsx
│ │ │ └── no-data-for-insight.tsx
│ │ ├── index.ts
│ │ ├── insight-manager.ts
│ │ ├── insight.provider.ts
│ │ ├── insight.ts
│ │ ├── insights.cmd.tsx
│ │ └── insights.manifest.ts
│ ├── isolator
│ │ ├── capsule-create.cmd.tsx
│ │ ├── capsule-list.cmd.tsx
│ │ ├── capsule-list.ts
│ │ ├── capsule
│ │ │ ├── capsule.ts
│ │ │ ├── container-exec.ts
│ │ │ ├── container.ts
│ │ │ └── index.ts
│ │ ├── index.ts
│ │ ├── isolator.extension.ts
│ │ ├── readme.md
│ │ ├── symlink-dependencies-to-capsules.ts
│ │ └── write-components-to-capsules.ts
│ ├── jest
│ │ ├── index.ts
│ │ ├── jest.config.ts
│ │ ├── jest.extension.ts
│ │ └── jest.tester.ts
│ ├── logger
│ │ ├── README.md
│ │ ├── index.ts
│ │ ├── logger.manifest.ts
│ │ ├── logger.provider.ts
│ │ └── logger.ts
│ ├── pkg
│ │ ├── exceptions
│ │ │ └── scope-not-found.tsx
│ │ ├── index.ts
│ │ ├── pack.cmd.tsx
│ │ ├── pack.ts
│ │ ├── pkg.extension.ts
│ │ └── readme.md
│ ├── react
│ │ ├── assets
│ │ │ └── index.html
│ │ ├── browser
│ │ │ ├── browser.ts
│ │ │ └── index.ts
│ │ ├── docs.tpl.ts
│ │ ├── html.js
│ │ ├── index.ts
│ │ ├── jest
│ │ │ ├── css-transform.js
│ │ │ ├── file-transform.js
│ │ │ ├── jest.config.js
│ │ │ ├── setupTests.js
│ │ │ └── transformer.js
│ │ ├── package-lock.json
│ │ ├── preview
│ │ │ ├── index.tsx
│ │ │ └── preview.tsx
│ │ ├── react.env.ts
│ │ ├── react.extension.ts
│ │ ├── typescript
│ │ │ └── tsconfig.json
│ │ └── webpack.config.js
│ ├── reporter
│ │ ├── README.md
│ │ ├── get-column-count.ts
│ │ ├── index.ts
│ │ ├── logger.ts
│ │ ├── reporter.manifest.ts
│ │ ├── reporter.provider.ts
│ │ ├── reporter.ts
│ │ └── status-line.ts
│ ├── scope
│ │ ├── index.ts
│ │ └── scope.extension.ts
│ ├── tester
│ │ ├── index.ts
│ │ ├── test.cmd.tsx
│ │ ├── tester.extension.ts
│ │ ├── tester.service.ts
│ │ ├── tester.task.ts
│ │ ├── tester.ts
│ │ └── utils
│ │ │ ├── detect-spec-files.ts
│ │ │ └── index.ts
│ ├── types
│ │ ├── component-host.ts
│ │ ├── index.ts
│ │ └── log-publisher.ts
│ ├── typescript
│ │ ├── index.ts
│ │ ├── tsconfig.default.json
│ │ ├── typescript.compiler.ts
│ │ └── typescript.extension.ts
│ ├── ui
│ │ ├── index.ts
│ │ ├── start.cmd.tsx
│ │ ├── ui.cli.rt.tsx
│ │ ├── ui.extension.ts
│ │ ├── ui.runtime.ts
│ │ ├── ui.ui.tsx
│ │ └── webpack
│ │ │ ├── html.js
│ │ │ └── webpack.config.js
│ ├── utils
│ │ ├── load-extensions
│ │ │ ├── constants.ts
│ │ │ ├── index.ts
│ │ │ ├── load-extensions-by-manifests.ts
│ │ │ └── load-resolved-extensions.ts
│ │ └── resolved-component
│ │ │ ├── index.ts
│ │ │ └── resolved-component.ts
│ ├── variants
│ │ ├── constants.ts
│ │ ├── index.ts
│ │ ├── readme.md
│ │ ├── variants.manifest.ts
│ │ ├── variants.provider.ts
│ │ └── variants.ts
│ ├── watch
│ │ ├── index.ts
│ │ ├── watch.cmd.tsx
│ │ ├── watch.extension.ts
│ │ ├── watch.provider.ts
│ │ └── watch.ts
│ ├── webpack
│ │ ├── index.ts
│ │ └── webpack.extension.ts
│ └── workspace
│ │ ├── constants.ts
│ │ ├── index.ts
│ │ ├── install.cmd.tsx
│ │ ├── list.cmd.tsx
│ │ ├── types.ts
│ │ ├── ui
│ │ ├── index.ts
│ │ ├── side-bar
│ │ │ ├── index.ts
│ │ │ └── side-bar.tsx
│ │ ├── top-bar
│ │ │ ├── index.ts
│ │ │ └── top-bar.tsx
│ │ └── workspace.tsx
│ │ ├── utils.ts
│ │ ├── workspace.graphql.ts
│ │ ├── workspace.manifest.ts
│ │ ├── workspace.provider.ts
│ │ ├── workspace.ts
│ │ └── workspace.ui.tsx
├── fixtures
│ └── fixtures.ts
├── git-hooks
│ ├── exceptions
│ │ ├── git-hook-already-exists.ts
│ │ └── index.ts
│ ├── fixtures
│ │ └── bit-import-git-hook.ts
│ ├── git-hook.ts
│ └── git-hooks-manager.ts
├── global-config
│ ├── config.ts
│ ├── global-remotes.ts
│ └── index.ts
├── hooks
│ ├── exceptions
│ │ ├── hook-already-exists.ts
│ │ ├── hook-not-exists.ts
│ │ └── index.ts
│ ├── hooks-manager.ts
│ ├── index.ts
│ └── utils
│ │ └── enrich-context-from-global.ts
├── index.ts
├── interactive
│ ├── commands
│ │ ├── index.ts
│ │ └── init-interactive.ts
│ ├── index.ts
│ └── utils
│ │ ├── run-interactive-cmd.ts
│ │ └── should-show-interactive.ts
├── jsdoc
│ ├── example-tag-parser.ts
│ ├── extract-data-regex.ts
│ ├── formater.ts
│ ├── index.ts
│ ├── jsdoc
│ │ ├── index.ts
│ │ ├── jsdoc-parser.spec.ts
│ │ └── jsdoc-parser.ts
│ ├── parser.ts
│ ├── react
│ │ ├── index.ts
│ │ ├── react-parser.spec.ts
│ │ └── react-parser.ts
│ ├── types.ts
│ └── vue
│ │ ├── index.ts
│ │ ├── vue-parser.spec.ts
│ │ └── vue-parser.ts
├── legacy-extensions
│ ├── base-extension.ts
│ ├── compiler-api.ts
│ ├── compiler-extension.ts
│ ├── core-extensions
│ │ └── ext-docs-parser.ts
│ ├── env-extension-types.ts
│ ├── env-extension.ts
│ ├── env-factory.ts
│ ├── exceptions
│ │ ├── extension-file-not-found.ts
│ │ ├── extension-get-dynamic-config-error.ts
│ │ ├── extension-get-dynamic-packages-error.ts
│ │ ├── extension-init-error.ts
│ │ ├── extension-load-error.ts
│ │ ├── extension-name-not-valid.ts
│ │ └── extension-schema-error.ts
│ ├── extension-command.ts
│ ├── extension-isolate-result.ts
│ ├── extension.ts
│ ├── extensions-loader.ts
│ └── tester-extension.ts
├── links
│ ├── dependency-file-link-generator.spec.ts
│ ├── dependency-file-link-generator.ts
│ ├── index.ts
│ ├── link-content.spec.ts
│ ├── link-content.ts
│ ├── link-file.ts
│ ├── link-generator.ts
│ ├── linker.ts
│ ├── node-modules-linker.ts
│ └── symlink.ts
├── logger
│ ├── logger.spec.ts
│ └── logger.ts
├── migration
│ ├── migration-helper.spec.ts
│ └── migration-helper.ts
├── npm-client
│ ├── index.ts
│ ├── install-packages.ts
│ ├── npm-client.spec.ts
│ └── npm-client.ts
├── plugins
│ ├── file-types-plugins.ts
│ └── wix
│ │ └── stylable.ts
├── prompts
│ ├── exceptions
│ │ ├── index.ts
│ │ └── prompt-canceled.ts
│ ├── index.ts
│ ├── prompt.ts
│ └── schemas
│ │ ├── analytics-reporting.ts
│ │ ├── error-reporting.ts
│ │ ├── fork-components.ts
│ │ ├── passphrase.ts
│ │ ├── remote-remove.ts
│ │ ├── resolve-conflict.ts
│ │ └── user-password.ts
├── registry
│ ├── exceptions
│ │ ├── index.ts
│ │ ├── path-to-npmrc-not-exist.ts
│ │ └── write-to-npmrc-error.ts
│ ├── index.ts
│ └── registry.ts
├── remotes
│ ├── exceptions
│ │ ├── index.ts
│ │ ├── invalid-remote.ts
│ │ ├── primary-not-found.ts
│ │ ├── primary-overloaded.ts
│ │ └── remote-not-found.ts
│ ├── get-remote-by-name.ts
│ ├── index.ts
│ ├── remote-resolver
│ │ └── remote-resolver.ts
│ ├── remote.ts
│ └── remotes.ts
├── scope
│ ├── ci-ops
│ │ ├── ci-ops.ts
│ │ ├── ci-worker.ts
│ │ ├── index.ts
│ │ └── run-and-update-ci.ts
│ ├── component-dependencies.ts
│ ├── component-objects.ts
│ ├── component-ops
│ │ ├── auto-tag.spec.ts
│ │ ├── auto-tag.ts
│ │ ├── components-deprecation.ts
│ │ ├── export-scope-components.ts
│ │ ├── get-flattened-dependencies.ts
│ │ ├── remove-model-components.ts
│ │ ├── scope-components-importer.ts
│ │ ├── tag-model-component.ts
│ │ └── untag-component.ts
│ ├── component-version.ts
│ ├── exceptions
│ │ ├── bit-not-in-scope.ts
│ │ ├── component-not-found.ts
│ │ ├── corrupted-component.ts
│ │ ├── cyclic-dependencie.ts
│ │ ├── dependency-not-found.ts
│ │ ├── hash-mismatch.ts
│ │ ├── hash-not-found.ts
│ │ ├── index.ts
│ │ ├── invalid-index-json.ts
│ │ ├── merge-conflict-on-remote.ts
│ │ ├── merge-conflict.ts
│ │ ├── outdated-index-json.ts
│ │ ├── resolution-exception.ts
│ │ ├── scope-already-exists.ts
│ │ ├── scope-json-not-found.ts
│ │ ├── scope-not-found.ts
│ │ ├── source-not-found.ts
│ │ ├── version-already-exists.ts
│ │ ├── version-invalid.ts
│ │ └── version-not-found.ts
│ ├── extensions
│ │ └── install-extensions.ts
│ ├── flatten-dependencies.ts
│ ├── graph
│ │ ├── components-graph.ts
│ │ ├── graph.ts
│ │ ├── scope-graph.ts
│ │ └── vizgraph.ts
│ ├── index.ts
│ ├── migrations
│ │ ├── component-version
│ │ │ ├── add-binding-prefix.ts
│ │ │ ├── change-import-specifiers-to-array.ts
│ │ │ ├── ensure-main-file.ts
│ │ │ ├── index.ts
│ │ │ ├── remove-latest-from-compiler.ts
│ │ │ ├── specs-results-to-array.ts
│ │ │ ├── to-files.ts
│ │ │ ├── to-semver-migration.ts
│ │ │ └── update-binding-prefix-to-new-default.ts
│ │ ├── component
│ │ │ ├── index.ts
│ │ │ ├── to-semver-migration.ts
│ │ │ └── update-binding-prefix-to-new-default.ts
│ │ ├── scope-migrator-manifest.ts
│ │ └── scope-migrator.ts
│ ├── models
│ │ ├── index.ts
│ │ ├── model-component.ts
│ │ ├── scopeMeta.ts
│ │ ├── source.ts
│ │ ├── symlink.ts
│ │ ├── version.spec.ts
│ │ └── version.ts
│ ├── network
│ │ ├── check-version-compatibility.spec.ts
│ │ ├── check-version-compatibility.ts
│ │ ├── exceptions
│ │ │ ├── authentication-failed.ts
│ │ │ ├── export-another-owner-private.ts
│ │ │ ├── fs-scope-not-loaded.ts
│ │ │ ├── index.ts
│ │ │ ├── network-error.ts
│ │ │ ├── old-client-version.ts
│ │ │ ├── permission-denied.ts
│ │ │ ├── protocol-not-supported.ts
│ │ │ ├── remote-resolver-error.ts
│ │ │ ├── remote-scope-not-found.ts
│ │ │ ├── ssh-connection-error.ts
│ │ │ ├── ssh-invalid-response.ts
│ │ │ └── unexpected-network-error.ts
│ │ ├── fs
│ │ │ ├── fs.ts
│ │ │ └── index.ts
│ │ ├── index.ts
│ │ ├── network-lib.ts
│ │ ├── network.ts
│ │ └── ssh
│ │ │ ├── index.ts
│ │ │ ├── key-getter.ts
│ │ │ └── ssh.ts
│ ├── object-registrar.ts
│ ├── objects
│ │ ├── components-index.spec.ts
│ │ ├── components-index.ts
│ │ ├── index.ts
│ │ ├── object.ts
│ │ ├── raw-object.ts
│ │ ├── ref.ts
│ │ ├── repository-hooks.ts
│ │ └── repository.ts
│ ├── removed-components.spec.ts
│ ├── removed-components.ts
│ ├── removed-local-objects.ts
│ ├── repositories
│ │ ├── hooks.ts
│ │ ├── index.ts
│ │ ├── sources.spec.ts
│ │ ├── sources.ts
│ │ └── tmp.ts
│ ├── repository.ts
│ ├── scope-json.ts
│ ├── scope-loader.ts
│ ├── scope-remotes.ts
│ ├── scope.ts
│ ├── types.ts
│ ├── version-dependencies.ts
│ └── version-validator.ts
├── search
│ ├── index.ts
│ ├── indexer.spec.ts
│ ├── indexer.ts
│ ├── query-builder.spec.ts
│ ├── query-builder.ts
│ ├── search-adapter.ts
│ ├── searcher.ts
│ ├── serverless-index.spec.ts
│ ├── serverless-index.ts
│ └── stopwords.ts
├── specs-runner
│ ├── index.ts
│ ├── specs-runner.ts
│ ├── worker.spec.ts
│ └── worker.ts
├── utils
│ ├── abortable-promise
│ │ ├── abortable-promise.spec.ts
│ │ ├── abortable-promise.ts
│ │ ├── exceptions
│ │ │ ├── index.ts
│ │ │ └── missing-abort-fn.ts
│ │ └── index.ts
│ ├── array
│ │ ├── filter-async.ts
│ │ ├── first.ts
│ │ ├── flatten.ts
│ │ ├── shared-start.ts
│ │ └── split-by.ts
│ ├── bit
│ │ ├── component-id-to-package-name.ts
│ │ ├── component-node-modules-path.ts
│ │ ├── compose-component-path.ts
│ │ ├── is-bit-id-match-by-wildcards.ts
│ │ ├── npm-registry-name.ts
│ │ ├── package-name-to-component-id.spec.ts
│ │ └── package-name-to-component-id.ts
│ ├── buffer
│ │ ├── replace-buffer-non-recursive.spec.ts
│ │ ├── replace-buffer-non-recursive.ts
│ │ └── to-read-stream.ts
│ ├── build-command-message.ts
│ ├── child_process.ts
│ ├── diff-files.ts
│ ├── encryption
│ │ └── sha1.ts
│ ├── eol.ts
│ ├── filter-object.ts
│ ├── fs-output-file.ts
│ ├── fs-output-json-sync.ts
│ ├── fs-remove-file.ts
│ ├── fs-rmdir.ts
│ ├── fs-write-file.ts
│ ├── fs
│ │ ├── create-symlink-or-copy.ts
│ │ ├── current-dir-name.ts
│ │ ├── dir-path-parser.ts
│ │ ├── file-info.ts
│ │ ├── fs-no-ext.ts
│ │ ├── get-ext.ts
│ │ ├── is-dir-empty.ts
│ │ ├── move-sync.ts
│ │ ├── propogate-until.ts
│ │ ├── read-dir-ignore-ds-store.ts
│ │ ├── remove-containing-dir-if-empty.ts
│ │ ├── remove-empty-dir.ts
│ │ ├── remove-files-and-empty-dirs-recursively.ts
│ │ ├── search-files-ignore-ext.spec.ts
│ │ └── search-files-ignore-ext.ts
│ ├── getMissingTestFiles.ts
│ ├── git
│ │ ├── exceptions
│ │ │ └── git-not-found.ts
│ │ └── git-executable.ts
│ ├── glob.ts
│ ├── ignore
│ │ └── ignore.ts
│ ├── immutable-unshift.ts
│ ├── index.ts
│ ├── is-bit-url.ts
│ ├── is-dir-empty-sync.ts
│ ├── is-dir.ts
│ ├── is-file-auto-generated.ts
│ ├── is-relative-import.ts
│ ├── is-valid-id-chunk.spec.ts
│ ├── is-valid-id-chunk.ts
│ ├── is-valid-path.ts
│ ├── is-valid-scope-name.ts
│ ├── map-object.ts
│ ├── map
│ │ └── to-object.ts
│ ├── merge-files.ts
│ ├── number
│ │ ├── is-number.ts
│ │ └── is-numeric.ts
│ ├── object-clean.ts
│ ├── object-to-stringified-tuple-array.ts
│ ├── object
│ │ ├── empty.ts
│ │ ├── filter.ts
│ │ ├── foreach.ts
│ │ ├── has-own-property.ts
│ │ └── sort.ts
│ ├── os-resolve-group-id.ts
│ ├── os-resolve-home-path.ts
│ ├── pack-command.ts
│ ├── path-is-inside.ts
│ ├── path.ts
│ ├── prepend-bang.ts
│ ├── pretty-json-chalk
│ │ ├── index.ts
│ │ ├── prettyjson.ts
│ │ └── utils.ts
│ ├── promise-to-result-object.ts
│ ├── queue.ts
│ ├── remove-from-require-cache.ts
│ ├── resolveLatestVersion.spec.ts
│ ├── resolveLatestVersion.ts
│ ├── ssh
│ │ ├── client-support-compressed-command.ts
│ │ ├── identity-file.ts
│ │ └── parse-url.ts
│ ├── string
│ │ ├── camel-case.ts
│ │ ├── clean-bang.ts
│ │ ├── clean-char.ts
│ │ ├── from-base64.ts
│ │ ├── generate-random.ts
│ │ ├── get-stringify-args.ts
│ │ ├── has-wildcard.spec.ts
│ │ ├── has-wildcard.ts
│ │ ├── is-string.ts
│ │ ├── remove-chalk-characters.ts
│ │ ├── replace-package-name.spec.ts
│ │ ├── replace-package-name.ts
│ │ ├── strip-trailing-char.ts
│ │ ├── to-base64-array-buffer.ts
│ │ └── to-base64.ts
│ ├── to-boolean.ts
│ ├── unpack-command.ts
│ ├── validate-type.ts
│ ├── zlib-deflate.ts
│ └── zlib-inflate.ts
└── version
│ ├── exceptions
│ ├── index.ts
│ ├── invalid-version-change.ts
│ └── invalid-version.ts
│ ├── index.ts
│ ├── version-parser.spec.ts
│ ├── version-parser.ts
│ ├── version.spec.ts
│ └── version.ts
├── todo.md
├── tsconfig.extensions.json
├── tsconfig.json
├── tsconfig.types-clean.json
└── tsconfig.types.json
/.editorconfig:
--------------------------------------------------------------------------------
1 | # editorconfig.org
2 |
3 | root = true
4 |
5 | [*]
6 | charset = utf-8
7 | end_of_line = lf
8 | indent_size = 2
9 | indent_style = space
10 | insert_final_newline = true
11 | trim_trailing_whitespace = true
12 |
--------------------------------------------------------------------------------
/.flowconfig:
--------------------------------------------------------------------------------
1 | [ignore]
2 | .*node_modules/bit-scope-client
3 | .*node_modules/bit-javascript
4 | .*node_modules/bit-js
5 |
6 | [include]
7 |
8 | [libs]
9 |
10 | [options]
11 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ## Expected Behavior
2 |
3 |
4 | ## Actual Behavior
5 |
6 |
7 | ## Steps to Reproduce the Problem
8 |
9 | 1.
10 | 1.
11 | 1.
12 |
13 | ## Specifications
14 |
15 | - Bit version:
16 | - Node version:
17 | - npm / yarn version:
18 | - Platform:
19 | - Bit compiler (include version):
20 | - Bit tester (include version):
21 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/4-docs-issue.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Docs Issue Report
3 | about: Report an issue with docs.bit.dev
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 |
15 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ## Proposed Changes
2 |
3 | -
4 | -
5 | -
6 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | fixtures/precinct/unparseable.js
2 | fixtures/precinct/typescriptWithError.ts
3 | fixtures/precinct/styles.css
4 | fixtures/precinct/es6WithError.js
5 | fixtures/build-tree/unparsed.js
6 | fixtures/build-tree/unparsed.css
7 |
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "printWidth": 120,
3 | "parser": "typescript",
4 | "singleQuote": true,
5 | "tabWidth": 2,
6 | "useTabs": false,
7 | "bracketSpacing": true
8 | }
--------------------------------------------------------------------------------
/.snyk:
--------------------------------------------------------------------------------
1 | # Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
2 | version: v1.13.5
3 | ignore: {}
4 | # patches apply the minimum changes required to fix a vulnerability
5 | patch:
6 | SNYK-JS-HTTPSPROXYAGENT-469131:
7 | - make-fetch-happen > https-proxy-agent:
8 | patched: '2019-10-04T08:36:13.676Z'
9 |
--------------------------------------------------------------------------------
/babel-register.js:
--------------------------------------------------------------------------------
1 | require('@babel/register')({ extensions: ['.js', '.jsx', '.ts', '.tsx'] });
2 |
--------------------------------------------------------------------------------
/bit.json:
--------------------------------------------------------------------------------
1 | {
2 | "env": {},
3 | "componentsDefaultDirectory": "components/{namespace}/{name}",
4 | "packageManager": "npm"
5 | }
--------------------------------------------------------------------------------
/custom-types/jest/index.d.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/custom-types/jest/index.d.ts
--------------------------------------------------------------------------------
/custom-types/testing-library__jest-dom/index.d.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/custom-types/testing-library__jest-dom/index.d.ts
--------------------------------------------------------------------------------
/e2e/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "rules": {
3 | "no-unused-expressions": [0],
4 | "default-case":"off"
5 | },
6 | "env": {
7 | "mocha": true
8 | },
9 | "globals": {
10 | "describe": true,
11 | "it": true
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/e2e/fixtures/compilers/bundle/compiler.js:
--------------------------------------------------------------------------------
1 | /**
2 | * generate one file: bundle.js
3 | */
4 | const path = require('path');
5 |
6 | function compile(files, distPath) {
7 | const distFile = files[0].clone();
8 | distFile.base = distPath;
9 | distFile.path = path.join(distPath, 'bundle.js');
10 | return [distFile];
11 | }
12 |
13 | module.exports = {
14 | compile
15 | };
16 |
--------------------------------------------------------------------------------
/e2e/fixtures/compilers/dummy/compiler.js:
--------------------------------------------------------------------------------
1 | /**
2 | * dummy compiler. do nothing. return the same source files as dists
3 | */
4 | const path = require('path');
5 |
6 | function compile(files, distPath) {
7 | return files
8 | .map((file) => {
9 | const distFile = file.clone();
10 | distFile.base = distPath;
11 | distFile.path = path.join(distPath, file.relative);
12 | return distFile;
13 | });
14 | }
15 |
16 | module.exports = {
17 | compile
18 | };
19 |
--------------------------------------------------------------------------------
/e2e/fixtures/compilers/new-babel/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["env"],
3 | "sourceMaps": true,
4 | "ast": false,
5 | "minified": true,
6 | "plugins": [
7 | "transform-object-rest-spread"
8 | ]
9 | }
--------------------------------------------------------------------------------
/e2e/fixtures/compilers/webpack-relative/base/base.config.js:
--------------------------------------------------------------------------------
1 | const webpack = require('webpack');
2 |
3 | module.exports = {
4 | entry: {
5 | app: './src/app',
6 | },
7 |
8 | module: {
9 | rules: [
10 | {
11 | test: /\.js$/,
12 | exclude: /node_modules/,
13 | loader: 'babel-loader',
14 | },
15 | ],
16 | },
17 |
18 | plugins: [
19 | new webpack.EnvironmentPlugin([
20 | 'NODE_ENV',
21 | ]),
22 | ],
23 | };
24 |
--------------------------------------------------------------------------------
/e2e/fixtures/compilers/webpack-relative/compiler.js:
--------------------------------------------------------------------------------
1 | const compiler = {
2 | init: ({ rawConfig, dynamicConfig, api }) => {
3 | return {write: true}
4 | },
5 | getDynamicConfig: ({ rawConfig }) => {
6 | },
7 | getDynamicPackageDependencies: ({ rawConfig, dynamicConfig, configFiles, context }) => {
8 | },
9 | action: ({
10 | files,
11 | rawConfig,
12 | dynamicConfig,
13 | configFiles,
14 | api,
15 | context
16 | }) => {
17 | }
18 | }
19 |
20 | module.exports = compiler;
--------------------------------------------------------------------------------
/e2e/fixtures/compilers/webpack-relative/dev.config.js:
--------------------------------------------------------------------------------
1 | const merge = require('webpack-merge');
2 | const baseConfig = require('./base/base.config.js');
3 |
4 | module.exports = merge(baseConfig, {
5 | devtool: 'eval-source-map',
6 |
7 | devServer: {
8 | inline: true,
9 | contentBase: 'src',
10 | port: '3001',
11 | },
12 |
13 | module: {
14 | rules: [
15 | {
16 | test: /\.css$/,
17 | use: [
18 | 'style-loader',
19 | 'css-loader?importLoaders=1',
20 | ],
21 | },
22 | ],
23 | },
24 | });
--------------------------------------------------------------------------------
/e2e/fixtures/compilers/webpack/base.config.js:
--------------------------------------------------------------------------------
1 | const webpack = require('webpack');
2 |
3 | module.exports = {
4 | entry: {
5 | app: './src/app',
6 | },
7 |
8 | module: {
9 | rules: [
10 | {
11 | test: /\.js$/,
12 | exclude: /node_modules/,
13 | loader: 'babel-loader',
14 | },
15 | ],
16 | },
17 |
18 | plugins: [
19 | new webpack.EnvironmentPlugin([
20 | 'NODE_ENV',
21 | ]),
22 | ],
23 | };
24 |
--------------------------------------------------------------------------------
/e2e/fixtures/compilers/webpack/compiler.js:
--------------------------------------------------------------------------------
1 | const compiler = {
2 | init: ({ rawConfig, dynamicConfig, api }) => {
3 |
4 | },
5 | getDynamicConfig: ({ rawConfig }) => {
6 | },
7 | getDynamicPackageDependencies: ({ rawConfig, dynamicConfig, configFiles, context }) => {
8 | },
9 | action: ({
10 | files,
11 | rawConfig,
12 | dynamicConfig,
13 | configFiles,
14 | api,
15 | context
16 | }) => {
17 | }
18 | }
19 |
20 | module.exports = compiler;
--------------------------------------------------------------------------------
/e2e/fixtures/compilers/webpack/dev.config.js:
--------------------------------------------------------------------------------
1 | const merge = require('webpack-merge');
2 | const baseConfig = require('./base.config.js');
3 |
4 | module.exports = merge(baseConfig, {
5 | devtool: 'eval-source-map',
6 |
7 | devServer: {
8 | inline: true,
9 | contentBase: 'src',
10 | port: '3001',
11 | },
12 |
13 | module: {
14 | rules: [
15 | {
16 | test: /\.css$/,
17 | use: [
18 | 'style-loader',
19 | 'css-loader?importLoaders=1',
20 | ],
21 | },
22 | ],
23 | },
24 | });
--------------------------------------------------------------------------------
/e2e/fixtures/components/add-many/add_many_test_files/LICENSE:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/e2e/fixtures/components/add-many/add_many_test_files/LICENSE
--------------------------------------------------------------------------------
/e2e/fixtures/components/add-many/add_many_test_files/a.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/e2e/fixtures/components/add-many/add_many_test_files/a.js
--------------------------------------------------------------------------------
/e2e/fixtures/components/add-many/add_many_test_files/a.spec.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/e2e/fixtures/components/add-many/add_many_test_files/a.spec.js
--------------------------------------------------------------------------------
/e2e/fixtures/components/add-many/add_many_test_files/b.js:
--------------------------------------------------------------------------------
1 | require('./a.js');
2 | require('./c.js');
--------------------------------------------------------------------------------
/e2e/fixtures/components/add-many/add_many_test_files/c.js:
--------------------------------------------------------------------------------
1 | console.log('hello');
--------------------------------------------------------------------------------
/e2e/fixtures/components/add-many/add_many_test_files/d.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/e2e/fixtures/components/add-many/add_many_test_files/d.js
--------------------------------------------------------------------------------
/e2e/fixtures/components/add-many/add_many_test_files/d.spec.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/e2e/fixtures/components/add-many/add_many_test_files/d.spec.js
--------------------------------------------------------------------------------
/e2e/fixtures/components/add-many/add_many_test_files/e.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/e2e/fixtures/components/add-many/add_many_test_files/e.js
--------------------------------------------------------------------------------
/e2e/fixtures/components/add-many/add_many_test_files/f.js:
--------------------------------------------------------------------------------
1 | require('./e.js');
--------------------------------------------------------------------------------
/e2e/fixtures/components/add-many/add_many_test_files/inner_folder/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/e2e/fixtures/components/add-many/add_many_test_files/inner_folder/.gitkeep
--------------------------------------------------------------------------------
/e2e/fixtures/components/add-many/g.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/e2e/fixtures/components/add-many/g.js
--------------------------------------------------------------------------------
/e2e/fixtures/components/add-many/h.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/e2e/fixtures/components/add-many/h.js
--------------------------------------------------------------------------------
/e2e/fixtures/components/add-many/h.spec.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/e2e/fixtures/components/add-many/h.spec.js
--------------------------------------------------------------------------------
/e2e/fixtures/components/add-many/i.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/e2e/fixtures/components/add-many/i.js
--------------------------------------------------------------------------------
/e2e/fixtures/components/add-many/i.spec.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/e2e/fixtures/components/add-many/i.spec.js
--------------------------------------------------------------------------------
/e2e/fixtures/components/app/app.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Logo } from '@bit/logo';
3 |
4 | export function App() {
5 | return (
6 |
7 | My logo:
8 |
9 | );
10 | }
11 |
--------------------------------------------------------------------------------
/e2e/fixtures/components/app/index.ts:
--------------------------------------------------------------------------------
1 | export * from './app';
2 |
--------------------------------------------------------------------------------
/e2e/fixtures/components/dependency-status/dependency-status-test-files/a.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/e2e/fixtures/components/dependency-status/dependency-status-test-files/a.js
--------------------------------------------------------------------------------
/e2e/fixtures/components/dependency-status/dependency-status-test-files/b.js:
--------------------------------------------------------------------------------
1 | require('./a.js');
2 | require('./c.js');
--------------------------------------------------------------------------------
/e2e/fixtures/components/dependency-status/dependency-status-test-files/c.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/e2e/fixtures/components/dependency-status/dependency-status-test-files/c.js
--------------------------------------------------------------------------------
/e2e/fixtures/components/help/help.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | export function Help() {
3 | return need any help
;
4 | }
5 |
--------------------------------------------------------------------------------
/e2e/fixtures/components/help/index.ts:
--------------------------------------------------------------------------------
1 | export * from './help';
2 |
--------------------------------------------------------------------------------
/e2e/fixtures/components/hero-button/HeroButton.spec.js:
--------------------------------------------------------------------------------
1 | import HeroButton from './HeroButton';
2 |
3 | mockDom('');
4 |
5 | describe('#HeroButton', () => {
6 | function mountComponent(props = {}) {
7 | return mount();
8 | }
9 |
10 | it('Should render', () => {
11 | expect(HeroButton).to.be.ok;
12 | });
13 | it('Should contain text REACT SF', () => {
14 | const wrapper = mountComponent();
15 | expect(wrapper.text()).to.equal('REACT SF');
16 | });
17 | });
18 |
--------------------------------------------------------------------------------
/e2e/fixtures/components/hero-button/index.js:
--------------------------------------------------------------------------------
1 | export { default } from './HeroButton';
2 |
--------------------------------------------------------------------------------
/e2e/fixtures/components/hero-withrelativepaths/index.js:
--------------------------------------------------------------------------------
1 | export { default } from './Hero';
2 |
--------------------------------------------------------------------------------
/e2e/fixtures/components/hero/index.js:
--------------------------------------------------------------------------------
1 | export { default } from './Hero';
2 |
--------------------------------------------------------------------------------
/e2e/fixtures/components/import-relative-path/import-by-2-files/a1.js:
--------------------------------------------------------------------------------
1 | import {b1, b3} from './b';
--------------------------------------------------------------------------------
/e2e/fixtures/components/import-relative-path/import-by-2-files/a2.js:
--------------------------------------------------------------------------------
1 | import {b2, b3} from './b';
2 |
--------------------------------------------------------------------------------
/e2e/fixtures/components/import-relative-path/import-by-2-files/a3.js:
--------------------------------------------------------------------------------
1 | require('./b');
--------------------------------------------------------------------------------
/e2e/fixtures/components/import-relative-path/import-by-2-files/b.js:
--------------------------------------------------------------------------------
1 | const b1 = 1;
2 | const b2 = 2;
3 | const b3 = 3;
4 | export {b1, b2, b3}
--------------------------------------------------------------------------------
/e2e/fixtures/components/is-string/index.js:
--------------------------------------------------------------------------------
1 | export { default } from './is-string';
2 |
--------------------------------------------------------------------------------
/e2e/fixtures/components/is-string/is-string.js:
--------------------------------------------------------------------------------
1 | /**
2 | * detemines whether `str` is a string.
3 | * @name isString
4 | * @param {*} val
5 | * @returns {boolean}
6 | * @example
7 | * isString(3) // => false
8 | * isString('') // => true
9 | */
10 | export default function isString(val) {
11 | return typeof val === 'string';
12 | }
13 |
--------------------------------------------------------------------------------
/e2e/fixtures/components/logo/index.ts:
--------------------------------------------------------------------------------
1 | export * from './logo';
2 |
--------------------------------------------------------------------------------
/e2e/fixtures/components/logo/logo.e2e.spec.tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/e2e/fixtures/components/logo/logo.e2e.spec.tsx
--------------------------------------------------------------------------------
/e2e/fixtures/components/logo/logo.simulation.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/e2e/fixtures/components/logo/logo.simulation.ts
--------------------------------------------------------------------------------
/e2e/fixtures/components/logo/logo.spec.tsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/e2e/fixtures/components/logo/logo.spec.tsx
--------------------------------------------------------------------------------
/e2e/fixtures/components/logo/logo.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export function Logo() {
4 | return HELLO WORLD!!!
;
5 | }
6 |
--------------------------------------------------------------------------------
/e2e/fixtures/components/pad-left/index.js:
--------------------------------------------------------------------------------
1 | export { default } from './pad-left';
2 |
--------------------------------------------------------------------------------
/e2e/fixtures/components/pad-left/pad-left.spec.js:
--------------------------------------------------------------------------------
1 | import { expect } from 'chai';
2 | import leftPad from './pad-left';
3 |
4 | describe('#leftPad()', () => {
5 | it('should pad string `foo` to a total char size of 5', () => {
6 | expect(leftPad('foo', 5)).to.equal(' foo');
7 | });
8 |
9 | it('should not pad string `foobar` any char as 6 is the original str length', () => {
10 | expect(leftPad('foobar', 6)).to.equal('foobar');
11 | });
12 |
13 | it('should pad string `1` with one 0', () => {
14 | expect(leftPad('17', 5, '0')).to.equal('00017');
15 | });
16 | });
17 |
--------------------------------------------------------------------------------
/e2e/fixtures/components/vue/StylusExample.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
7 |
8 |
11 |
--------------------------------------------------------------------------------
/e2e/fixtures/components/vue/directives/autofocus.js:
--------------------------------------------------------------------------------
1 | export default {
2 | inserted(el, { value }) {
3 | if (value) {
4 | el.focus();
5 | }
6 | }
7 | };
8 |
--------------------------------------------------------------------------------
/e2e/fixtures/components/vue/styles/imports.scss:
--------------------------------------------------------------------------------
1 | @import 'util';
2 | @import 'variables';
3 | @import 'mixins';
4 |
--------------------------------------------------------------------------------
/e2e/fixtures/components/vue/styles/mixins.scss:
--------------------------------------------------------------------------------
1 | @mixin text-truncation {
2 | white-space: nowrap;
3 | overflow: hidden;
4 | text-overflow: ellipsis;
5 | }
6 |
--------------------------------------------------------------------------------
/e2e/fixtures/components/vue/stylus/main.styl:
--------------------------------------------------------------------------------
1 |
2 | /** Stylus Styles */
3 | @import './second'
4 |
--------------------------------------------------------------------------------
/e2e/fixtures/extensions/dummy-extension/dummy-extension.manifest.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'dummy-extension',
3 | dependencies: [],
4 | provider: async () => {
5 | console.log('dummy extension runs');
6 | }
7 | };
8 |
--------------------------------------------------------------------------------
/e2e/fixtures/extensions/dummy-extension/index.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./dummy-extension.manifest');
2 |
--------------------------------------------------------------------------------
/e2e/fixtures/extensions/extension-add-config/simple-config/index.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./simple-config.manifest');
2 |
--------------------------------------------------------------------------------
/e2e/fixtures/extensions/extension-add-config/simple-config/simple-config.manifest.js:
--------------------------------------------------------------------------------
1 | const { getDeclarationCoreExtension } = require('bit-bin');
2 | console.log('im here');
3 | const PkgExtension = getDeclarationCoreExtension('@teambit/pkg');
4 |
5 | module.exports = {
6 | name: 'simple config',
7 | dependencies: [PkgExtension],
8 | provider: async ([pkg]) => {
9 | console.log('simple config runs');
10 | pkg.registerPackageJsonNewProps({ 'my-custom-key': 'my-custom-val' });
11 | }
12 | };
13 |
--------------------------------------------------------------------------------
/e2e/fixtures/extensions/extension-add-dependencies/index.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./extension-add-dependencies.manifest');
2 |
--------------------------------------------------------------------------------
/e2e/fixtures/extensions/extension-provider-error/extension-provider-error.manifest.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: 'extension-provider-error',
3 | dependencies: [],
4 | provider: async () => {
5 | throw new Error('error in provider');
6 | }
7 | };
8 |
--------------------------------------------------------------------------------
/e2e/fixtures/extensions/extension-provider-error/index.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./extension-provider-error.manifest');
2 |
--------------------------------------------------------------------------------
/e2e/fixtures/extensions/non-requireable-extension/index.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./non-requireable-extension.manifest');
2 |
--------------------------------------------------------------------------------
/e2e/fixtures/extensions/non-requireable-extension/non-requireable-extension.manifest.js:
--------------------------------------------------------------------------------
1 | throw new Error('error by purpose');
2 |
3 | module.exports = {
4 | name: 'non-requireable-extension',
5 | dependencies: [],
6 | provider: async () => {
7 | console.log('dummy extension runs');
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/e2e/fixtures/extensions/react-create-template/index.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./react-create-template.manifest');
2 |
--------------------------------------------------------------------------------
/e2e/fixtures/png_fixture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/e2e/fixtures/png_fixture.png
--------------------------------------------------------------------------------
/e2e/fixtures/scopes/global-remote.tgz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/e2e/fixtures/scopes/global-remote.tgz
--------------------------------------------------------------------------------
/fixtures/bitmap-fixtures/only-imported/.bitmap:
--------------------------------------------------------------------------------
1 | /* THIS IS A BIT-AUTO-GENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. */
2 |
3 | {
4 | "tests-es6/bar/foo-es6@0.0.1": {
5 | "files": [
6 | {
7 | "name": "foo-es6.js",
8 | "relativePath": "bar/foo-es6.js",
9 | "test": false
10 | }
11 | ],
12 | "mainFile": "bar/foo-es6.js",
13 | "rootDir": "components/bar/foo-es6",
14 | "origin": "IMPORTED"
15 | },
16 | "version": "13.0.4-dev.14"
17 | }
--------------------------------------------------------------------------------
/fixtures/build-tree/a.js:
--------------------------------------------------------------------------------
1 | const b = require('./b');
2 |
--------------------------------------------------------------------------------
/fixtures/build-tree/b.js:
--------------------------------------------------------------------------------
1 | const unparsed = require('./unparsed');
2 |
--------------------------------------------------------------------------------
/fixtures/build-tree/not-link-file/file-a.js:
--------------------------------------------------------------------------------
1 | import { varX } from './file-b';
2 |
--------------------------------------------------------------------------------
/fixtures/build-tree/not-link-file/file-b.js:
--------------------------------------------------------------------------------
1 | import { varX } from './file-c';
2 |
3 | // export { varX }; // uncomment to make the following test fail "fileA imports varX from fileB, fileB imports varX from fileC but not export it"
4 |
--------------------------------------------------------------------------------
/fixtures/build-tree/not-link-file/file-c.js:
--------------------------------------------------------------------------------
1 | const varX = 4;
2 | export { varX };
3 |
--------------------------------------------------------------------------------
/fixtures/build-tree/tree-shaking-cycle/foo.js:
--------------------------------------------------------------------------------
1 | import { isString } from '.';
2 |
--------------------------------------------------------------------------------
/fixtures/build-tree/tree-shaking-cycle/index.js:
--------------------------------------------------------------------------------
1 | export { default as isString } from './is-string';
2 |
--------------------------------------------------------------------------------
/fixtures/build-tree/tree-shaking-cycle/is-string.js:
--------------------------------------------------------------------------------
1 | import { isString } from '.'; // cycle with ./index.js
2 | export default isString;
3 |
--------------------------------------------------------------------------------
/fixtures/build-tree/tree-shaking-cycle/self-cycle.js:
--------------------------------------------------------------------------------
1 | import { selfCycle } from './self-cycle';
2 | export { selfCycle };
3 |
--------------------------------------------------------------------------------
/fixtures/build-tree/unparsed.css:
--------------------------------------------------------------------------------
1 | this should trigger parsing error
--------------------------------------------------------------------------------
/fixtures/build-tree/unparsed.js:
--------------------------------------------------------------------------------
1 | this should trigger parsing error
--------------------------------------------------------------------------------
/fixtures/component-model.json:
--------------------------------------------------------------------------------
1 | {
2 | "validateBeforePersist": true,
3 | "scope": "remote",
4 | "name": "bar/foo",
5 | "versions": { "0.0.1": { "hash": "d410b67990f465795d337604be144fd826f847b2" } },
6 | "lang": "javascript",
7 | "deprecated": false,
8 | "bindingPrefix": "@bit",
9 | "state": {}
10 | }
--------------------------------------------------------------------------------
/fixtures/dependency-tree/amd/a.js:
--------------------------------------------------------------------------------
1 | define(['./b', './c'], function(b, c) {
2 | 'use strict';
3 |
4 | return 'cool';
5 | });
6 |
--------------------------------------------------------------------------------
/fixtures/dependency-tree/amd/b.js:
--------------------------------------------------------------------------------
1 | define(['./c'], function(c) {
2 | 'use strict';
3 |
4 | return c;
5 | });
6 |
--------------------------------------------------------------------------------
/fixtures/dependency-tree/amd/c.js:
--------------------------------------------------------------------------------
1 | define({});
2 |
--------------------------------------------------------------------------------
/fixtures/dependency-tree/commonjs/a.js:
--------------------------------------------------------------------------------
1 | var b = require('./b');
2 | var c = require('./c');
3 |
--------------------------------------------------------------------------------
/fixtures/dependency-tree/commonjs/b.js:
--------------------------------------------------------------------------------
1 | var path = require('path');
2 |
3 | module.exports = {};
4 |
--------------------------------------------------------------------------------
/fixtures/dependency-tree/commonjs/c.js:
--------------------------------------------------------------------------------
1 | var fs = require('fs');
2 |
3 | module.exports = {};
4 |
--------------------------------------------------------------------------------
/fixtures/dependency-tree/onlyRealDeps/a.js:
--------------------------------------------------------------------------------
1 | var path = require('path');
2 | var debug = require('debug');
3 | var notReal = require('not-real');
4 |
--------------------------------------------------------------------------------
/fixtures/dependency-tree/webpack/aliased.js:
--------------------------------------------------------------------------------
1 | var foo = require('F');
2 |
--------------------------------------------------------------------------------
/fixtures/dependency-tree/webpack/unaliased.js:
--------------------------------------------------------------------------------
1 | var cabinet = require('filing-cabinet');
2 |
--------------------------------------------------------------------------------
/fixtures/filing-cabinet/foo.jsx:
--------------------------------------------------------------------------------
1 | export default () => {
2 | return ;
3 | }
4 |
--------------------------------------------------------------------------------
/fixtures/filing-cabinet/foo.scss:
--------------------------------------------------------------------------------
1 | @import "~bootstrap/index";
--------------------------------------------------------------------------------
/fixtures/filing-cabinet/foo2.scss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/fixtures/filing-cabinet/foo2.scss
--------------------------------------------------------------------------------
/fixtures/filing-cabinet/node_modules/bootstrap/index.scss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/fixtures/filing-cabinet/node_modules/bootstrap/index.scss
--------------------------------------------------------------------------------
/fixtures/filing-cabinet/root1/mod1.js:
--------------------------------------------------------------------------------
1 | module.exports = {};
2 |
--------------------------------------------------------------------------------
/fixtures/filing-cabinet/root2/mod2.js:
--------------------------------------------------------------------------------
1 | module.exports = {};
2 |
--------------------------------------------------------------------------------
/fixtures/filing-cabinet/webpack.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | entry: './index.js',
3 | resolve: {
4 | alias: {
5 | R: './node_modules/resolve'
6 | }
7 | }
8 | };
9 |
--------------------------------------------------------------------------------
/fixtures/invalid-tester.js:
--------------------------------------------------------------------------------
1 | function compile(src) {
2 | //eslint-disable-line
3 | }
4 |
5 | module.exports = {
6 | compile
7 | };
8 |
--------------------------------------------------------------------------------
/fixtures/jsdoc/endWithTwoStars.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Basic accordion component
3 | * @render react
4 | * @example
5 | *
6 | *
7 | *
8 | * */
9 | export default class Accordion extends React.Component {}
10 |
--------------------------------------------------------------------------------
/fixtures/jsdoc/flowTypeFile.js:
--------------------------------------------------------------------------------
1 | /**
2 | * returns the first element of an array reference.
3 | * @name first
4 | * @param {[]} array
5 | * @returns {*|null} first element of given array
6 | * @example
7 | * ```js
8 | * first([1, 2, 3]) // => 1
9 | * first(['a', 'b', 'c']) // => 'a'
10 | * ```
11 | */
12 | module.exports = function first(array: any[]): any | null | undefined {
13 | if (array && array[0]) return array[0];
14 | return null;
15 | };
16 |
--------------------------------------------------------------------------------
/fixtures/jsdoc/functionDeclaration.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Adds two numbers.
3 | *
4 | * @name add
5 | * @static
6 | * @public
7 | * @param {number} a The first number in an addition.
8 | * @param {number} b The second number in an addition.
9 | * @returns {number} Returns the total.
10 | * @example
11 | * //-
12 | * // Adds two numbers
13 | * //-
14 | * add(2, 3);
15 | * //=>
16 | * // 5
17 | * //=>
18 | */
19 | function add(a, b) {
20 | return a + b;
21 | }
22 |
--------------------------------------------------------------------------------
/fixtures/jsdoc/misc.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @name publicFunc
3 | * @public
4 | */
5 | function publicFunc() {}
6 |
7 | /**
8 | * @name privateFunc
9 | * @private
10 | */
11 | function privateFunc() {}
12 |
--------------------------------------------------------------------------------
/fixtures/jsdoc/variableDeclaration.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Adds two numbers.
3 | *
4 | * @name add
5 | * @category Math
6 | * @param {number} a The first number in an addition.
7 | * @param {number} b The second number in an addition.
8 | * @returns {number} Returns the total.
9 | * @example
10 | *
11 | * _.add(6, 4);
12 | * // => 10
13 | */
14 | const add = function (a, b) {
15 | return a + b;
16 | };
17 |
18 | module.exports = {
19 | add
20 | };
21 |
--------------------------------------------------------------------------------
/fixtures/missing-deps.js:
--------------------------------------------------------------------------------
1 | const a = require('non-exist-package'); // missing package
2 | const b = require('../non-exist-dep'); // missing dependency
3 |
--------------------------------------------------------------------------------
/fixtures/precinct/Gruntfile.js:
--------------------------------------------------------------------------------
1 | module.exports = function(grunt) {
2 | grunt.initConfig({
3 | jshint: {
4 | files: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'],
5 | options: {
6 | globals: {
7 | jQuery: true
8 | }
9 | }
10 | },
11 | watch: {
12 | files: ['<%= jshint.files %>'],
13 | tasks: ['jshint']
14 | }
15 | });
16 |
17 | grunt.loadNpmTasks('grunt-contrib-jshint');
18 | grunt.loadNpmTasks('grunt-contrib-watch');
19 |
20 | grunt.registerTask('default', ['jshint']);
21 | };
22 |
--------------------------------------------------------------------------------
/fixtures/precinct/amd.js:
--------------------------------------------------------------------------------
1 | define(['./a', './b'], function(a, b) {});
2 |
--------------------------------------------------------------------------------
/fixtures/precinct/cjsExportLazy.js:
--------------------------------------------------------------------------------
1 | module.exports = function({
2 | // Just requiring any files that exist
3 | amd = require('./amd'),
4 | es6 = require('./es6').foo,
5 | es7 = require('./es7')
6 | }) {};
7 |
--------------------------------------------------------------------------------
/fixtures/precinct/cjsMixedImport.js:
--------------------------------------------------------------------------------
1 | var bar = require('./bar');
2 | import foo from './foo';
3 |
--------------------------------------------------------------------------------
/fixtures/precinct/commonjs.js:
--------------------------------------------------------------------------------
1 | var a = require('./a'),
2 | b = require('./b');
3 |
--------------------------------------------------------------------------------
/fixtures/precinct/coreModules.js:
--------------------------------------------------------------------------------
1 | var assert = require('assert');
2 | var path = require('path');
3 | var fs = require('fs');
4 |
--------------------------------------------------------------------------------
/fixtures/precinct/es6.js:
--------------------------------------------------------------------------------
1 | import { square, diag } from 'lib';
2 | console.log(square(11)); // 121
3 | console.log(diag(4, 3)); // 5
4 |
--------------------------------------------------------------------------------
/fixtures/precinct/es6MixedExportLazy.js:
--------------------------------------------------------------------------------
1 | export default function({
2 | // Just requiring any files that exist
3 | amd = require('./amd'),
4 | es6 = require('./es6'),
5 | es7 = require('./es7')
6 | }) {}
7 |
--------------------------------------------------------------------------------
/fixtures/precinct/es6MixedImport.js:
--------------------------------------------------------------------------------
1 | import foo from './foo';
2 | var bar = require('./bar');
3 |
--------------------------------------------------------------------------------
/fixtures/precinct/es6NoImport.js:
--------------------------------------------------------------------------------
1 | export const sqrt = Math.sqrt;
2 | export function square(x) {
3 | return x * x;
4 | }
5 | export function diag(x, y) {
6 | return sqrt(square(x) + square(y));
7 | }
8 |
--------------------------------------------------------------------------------
/fixtures/precinct/es6WithError.js:
--------------------------------------------------------------------------------
1 | import { square, diag } from 'lib' // error, semicolon
2 | console.log(square(11)); // 121
3 | console.log(diag(4, 3); // 5, error, missing paren
--------------------------------------------------------------------------------
/fixtures/precinct/es7.js:
--------------------------------------------------------------------------------
1 | import { square, diag } from 'lib';
2 | async function foo() {}
3 |
--------------------------------------------------------------------------------
/fixtures/precinct/jsx.js:
--------------------------------------------------------------------------------
1 | import { square, diag } from 'lib';
2 | const tmpl = ;
3 |
--------------------------------------------------------------------------------
/fixtures/precinct/none.js:
--------------------------------------------------------------------------------
1 | var a = new window.Foo();
2 |
--------------------------------------------------------------------------------
/fixtures/precinct/styles.css:
--------------------------------------------------------------------------------
1 | @import "foo.css";
2 | @import url("baz.css");
3 | @value a from 'bla.css';
4 | @value a, b as x from url(another.css);
5 |
--------------------------------------------------------------------------------
/fixtures/precinct/styles.less:
--------------------------------------------------------------------------------
1 | @import "_foo";
2 | @import "_bar.css";
3 | @import "baz.less";
4 |
--------------------------------------------------------------------------------
/fixtures/precinct/styles.sass:
--------------------------------------------------------------------------------
1 | @import _foo
2 |
--------------------------------------------------------------------------------
/fixtures/precinct/styles.scss:
--------------------------------------------------------------------------------
1 | @import "_foo";
2 | @import "baz.scss";
3 |
--------------------------------------------------------------------------------
/fixtures/precinct/styles.styl:
--------------------------------------------------------------------------------
1 | @import "mystyles"
2 | @import "styles2.styl"
3 | @require "styles3.styl";
4 | @require "styles4";
--------------------------------------------------------------------------------
/fixtures/precinct/typescript.ts:
--------------------------------------------------------------------------------
1 | import * as fs from 'fs';
2 | import { square, diag } from 'lib';
3 | import foo from './bar';
4 | import './my-module.js'; // Import a module for side-effects only
5 | import zip = require('./ZipCodeValidator'); // needed when importing a module using `export =` syntax
6 |
7 | console.log(square(11)); // 121
8 | console.log(diag(4, 3)); // 5
9 |
--------------------------------------------------------------------------------
/fixtures/precinct/typescriptWithError.ts:
--------------------------------------------------------------------------------
1 | import { square, diag } from 'lib';
2 |
3 | console.log(diag(4, 3); // error, missing bracket
4 |
--------------------------------------------------------------------------------
/fixtures/precinct/unparseable.js:
--------------------------------------------------------------------------------
1 | {
2 | "very invalid": "javascript",
3 | "this", "is actually json",
4 | "But" not even valid json.
5 | }
--------------------------------------------------------------------------------
/fixtures/unsupported-file.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/fixtures/unsupported-file.pdf
--------------------------------------------------------------------------------
/resources/bit.template.json:
--------------------------------------------------------------------------------
1 | {
2 | "remotes": {
3 | "wix": "ssh://bit@bit.wix.com:user"
4 | },
5 |
6 | "dependencies": {
7 | "ranm8/fs/createDirectory": "*1",
8 | "@wix/user/getUser": "3",
9 | "ranm8/isString": "latest",
10 | "wix/foreach": "*2"
11 | }
12 | }
--------------------------------------------------------------------------------
/resources/repos/bitsrc.repo:
--------------------------------------------------------------------------------
1 | [Bitsrc]
2 | name=Bitsrc
3 | baseurl=https://bitsrc.jfrog.io/bitsrc/bit-yum/stable
4 | enabled=1
5 | gpgcheck=0
6 | gpgkey=https://bitsrc.jfrog.io/bitsrc/bit-yum/stable/repodata/repomd.xml.key
7 | repo_gpgcheck=1
8 |
--------------------------------------------------------------------------------
/resources/repos/deb-repo.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | #add gpg key
4 | curl https://bitsrc.jfrog.io/bitsrc/api/gpg/key/public | sudo apt-key add -
5 |
6 | #add source
7 | sudo sh -c "echo 'deb http://bitsrc.jfrog.io/bitsrc/bit-deb all stable' >> /etc/apt/sources.list"
8 |
9 |
--------------------------------------------------------------------------------
/scripts/bootstrap-env-ubuntu.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | apt-get install ruby-dev -y
3 | apt-get install -y rubygems
4 | #apt-get install rubygems-integration -y
5 | #apt-get install -y git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev
6 | apt-get update -qq
7 | apt-get install -y rpm lintian
8 | gem install fpm
9 | apt-get install fakeroot -y
10 | npm install -g bit-bin
11 |
--------------------------------------------------------------------------------
/scripts/build-dist.ps1:
--------------------------------------------------------------------------------
1 | npm pack
2 | if (Test-Path distribution/windows) {
3 | rm distribution/windows -Recurse
4 | }
5 | $VERSION= $(node -p -e "require('./package.json').version")
6 | mkdir distribution
7 | mkdir distribution/windows
8 | mv bit-bin-$VERSION.tgz distribution/windows/
9 |
10 | cd distribution/windows
11 |
12 | tar -xzf bit-bin-$VERSION.tgz --strip 1
13 | rm bit-bin-$VERSION.tgz
14 | npm install --no-optional
15 | npm run build
16 | npm prune --production
17 | mv scripts/windows/bit.cmd bin/
18 |
--------------------------------------------------------------------------------
/scripts/build-types.bash:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 | rm -rf types
4 | node_modules/.bin/tsc --project tsconfig.types.json
5 | cp -r types/src/* dist
6 | rm -rf types
7 |
--------------------------------------------------------------------------------
/scripts/build-windows-installer.bat:
--------------------------------------------------------------------------------
1 | "%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" ./scripts/windows/BitSetup.wixproj /p:Configuration=Release
2 |
--------------------------------------------------------------------------------
/scripts/compare-versions.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | echo "compare $1 to $2"
4 | if [ $1 == $2 ]; then
5 | echo "Versions match"
6 | exit 0;
7 | else
8 | echo "Versions not match"
9 | exit 1;
10 | fi
--------------------------------------------------------------------------------
/scripts/copyArtifacts.ps1:
--------------------------------------------------------------------------------
1 | mkdir artifacts
2 | $VERSION= $(node -p -e "require('./package.json').version")
3 | mv distribution\winMsibin\Release\Bit.msi artifacts\bit-${VERSION}-unsigned.msi
4 |
--------------------------------------------------------------------------------
/scripts/linux/centos/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM centos
2 | RUN curl -sL https://rpm.nodesource.com/setup_10.x | bash -
3 | RUN yum install -y git gcc-c++ make rpm dpkg-deb fakeroot rpmbuild ruby-devel gcc rpm-build rubygems nodejs
4 | RUN yum install -y nano
5 | RUN gem install --no-ri --no-rdoc fpm
6 | COPY ./bit.repo /etc/yum.repos.d/bit.repo
7 | RUN npm i -g pkg@4.4.6
8 | CMD ["/bin/bash"]
9 |
--------------------------------------------------------------------------------
/scripts/linux/centos/bit.repo:
--------------------------------------------------------------------------------
1 | [bit]
2 | name=bit repo
3 | baseurl=https://@bitsrc.jfrog.io/bitsrc/bit-yum/development
4 | enabled=1
5 | gpgcheck=0
--------------------------------------------------------------------------------
/scripts/linux/debian/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM debian
2 | RUN apt-get update && apt-get install -y curl software-properties-common
3 | RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
4 | RUN apt-get -y install nano git nodejs ruby ruby-dev rubygems build-essential
5 | RUN gem install --no-ri --no-rdoc fpm
6 | RUN npm i -g pkg@4.4.6
7 | RUN sh -c "echo 'deb [trusted=true] https://bitsrc.jfrog.io/bitsrc/bit-deb all development' >> /etc/apt/sources.list"
8 | CMD ["/bin/bash"]
9 |
--------------------------------------------------------------------------------
/scripts/linux/postInstall.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ln -sf /usr/share/bit/bin/bit /usr/local/bin/bit
4 | ln -sf /usr/share/bit/bin/bit.js /usr/local/bin/bit.js
5 | ln -sf /usr/share/bit/bin/node /usr/local/bin/bitNode
6 |
--------------------------------------------------------------------------------
/scripts/linux/postRemove.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 |
4 | rm /usr/local/bin/bit
5 | rm /usr/local/bin/bit.js
6 | rm /usr/local/bin/bitNode
7 |
--------------------------------------------------------------------------------
/scripts/node-installer.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | set -ex
3 |
4 | OS=$1
5 |
6 | if [ "$OS" == "linux" ]; then
7 | url="https://nodejs.org/dist/v6.10.0/node-v6.10.0-linux-x64.tar.xz"
8 | elif [ "$OS" == "mac" ]; then
9 | url="https://nodejs.org/dist/v6.10.0/node-v6.10.0-darwin-x64.tar.gz"
10 | fi
11 |
12 |
13 | rm -rf ./nodeBin
14 | mkdir -p ./nodeBin
15 | pushd .
16 | cd nodeBin
17 | wget $url
18 | tar --strip-components=1 -xf node*
19 | popd
20 | pwd
21 | cp nodeBin/bin/node ./bin
22 | chmod +x ./bin/node
23 | rm -rf ./nodeBin
24 |
--------------------------------------------------------------------------------
/scripts/set-installation-method.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 | /**
3 | * Sets the installationMethod field in package.json. Useful for setting it in
4 | * shell scripts.
5 | */
6 |
7 | const fs = require('fs');
8 |
9 | const packageManifestFilename = process.argv[2];
10 | const packageManifest = require(packageManifestFilename);
11 | packageManifest.installationMethod = process.argv[3];
12 | fs.writeFileSync(packageManifestFilename, JSON.stringify(packageManifest, null, 2) + "\n");
--------------------------------------------------------------------------------
/scripts/windows/bit-banner.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/scripts/windows/bit-banner.bmp
--------------------------------------------------------------------------------
/scripts/windows/bit-dialog.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/scripts/windows/bit-dialog.bmp
--------------------------------------------------------------------------------
/scripts/windows/bit.cmd:
--------------------------------------------------------------------------------
1 | @echo off
2 | "%~dp0\node.exe" "%~dp0\bit.js" %*
3 |
--------------------------------------------------------------------------------
/scripts/windows/bit.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/scripts/windows/bit.ico
--------------------------------------------------------------------------------
/src/api/consumer/lib/dependency_status.ts:
--------------------------------------------------------------------------------
1 | import { DependencyStatusResult, DependencyStatusProps } from '../../../consumer/component-ops/dependency-status';
2 | import getDependencyStatus from '../../../consumer/component-ops/dependency-status';
3 | import { loadConsumer, Consumer } from '../../../consumer';
4 |
5 | export default (async function dependencyStatus(
6 | dependencyStatusProps: DependencyStatusProps
7 | ): Promise {
8 | const consumer: Consumer = await loadConsumer();
9 | return getDependencyStatus(consumer, dependencyStatusProps);
10 | });
11 |
--------------------------------------------------------------------------------
/src/api/consumer/lib/eject-conf.ts:
--------------------------------------------------------------------------------
1 | import { loadConsumer, Consumer } from '../../../consumer';
2 | import GeneralError from '../../../error/general-error';
3 | import { EjectConfResult } from '../../../consumer/component-ops/eject-conf';
4 |
5 | export default (async function ejectConf(id: string): Promise {
6 | if (!id) {
7 | throw new GeneralError('please specify component id');
8 | }
9 | const consumer: Consumer = await loadConsumer();
10 | const ejectResults = await consumer.ejectConf(consumer.getParsedId(id));
11 | await consumer.onDestroy();
12 | return ejectResults;
13 | });
14 |
--------------------------------------------------------------------------------
/src/api/consumer/lib/exceptions/config-key-not-found.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../../error/abstract-error';
2 |
3 | export default class ConfigKeyNotFound extends AbstractError {
4 | key: string;
5 |
6 | constructor(key: string) {
7 | super();
8 | this.key = key;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/api/consumer/lib/exceptions/diagnosis-not-found.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../../error/abstract-error';
2 |
3 | export default class DiagnosisNotFound extends AbstractError {
4 | diagnosisName: string;
5 |
6 | constructor(diagnosisName: string) {
7 | super();
8 | this.diagnosisName = diagnosisName;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/api/consumer/lib/exceptions/id-exported-already.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../../error/abstract-error';
2 |
3 | export default class IdExportedAlready extends AbstractError {
4 | id: string;
5 | remote: string;
6 |
7 | constructor(id: string, remote: string) {
8 | super();
9 | this.id = id;
10 | this.remote = remote;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/api/consumer/lib/exceptions/invalid-version.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../../error/abstract-error';
2 |
3 | export default class InvalidVersion extends AbstractError {
4 | version: string;
5 |
6 | constructor(version: string) {
7 | super();
8 | this.version = version;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/api/consumer/lib/exceptions/missing-diagnosis-name.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../../error/abstract-error';
2 |
3 | export default class MissingDiagnosisName extends AbstractError {}
4 |
--------------------------------------------------------------------------------
/src/api/consumer/lib/exceptions/no-id-match-wildcard.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../../error/abstract-error';
2 |
3 | export default class NoIdMatchWildcard extends AbstractError {
4 | idsWithWildcards: string[];
5 |
6 | constructor(idsWithWildcards: string[]) {
7 | super();
8 | this.idsWithWildcards = idsWithWildcards;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/api/consumer/lib/exceptions/nothing-to-compare-to.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../../error/abstract-error';
2 |
3 | export default class NothingToCompareTo extends AbstractError {
4 | id: string;
5 |
6 | constructor(id: string) {
7 | super();
8 | this.id = id;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/api/consumer/lib/exceptions/objects-without-consumer.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../../error/abstract-error';
2 |
3 | export default class ObjectsWithoutConsumer extends AbstractError {
4 | scopePath: string;
5 | showDoctorMessage: boolean;
6 |
7 | constructor(scopePath: string) {
8 | super();
9 | this.scopePath = scopePath;
10 | this.showDoctorMessage = true;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/api/consumer/lib/login.ts:
--------------------------------------------------------------------------------
1 | import loginToBitSrc from '../../../consumer/login/login';
2 |
3 | export default (async function loginAction(
4 | port: string,
5 | suppressBrowserLaunch: boolean,
6 | npmrcPath: string,
7 | skipRegistryConfig: boolean,
8 | machineName: string | null | undefined
9 | ): Promise<{ isAlreadyLoggedIn?: boolean; username?: string; npmrcPath?: string }> {
10 | return loginToBitSrc(port, suppressBrowserLaunch, npmrcPath, skipRegistryConfig, machineName);
11 | });
12 |
--------------------------------------------------------------------------------
/src/api/scope/lib/cat-object.ts:
--------------------------------------------------------------------------------
1 | import { loadScope } from '../../../scope';
2 |
3 | export default function catObject(hash: string, pretty: boolean, stringify: boolean) {
4 | // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
5 | return loadScope().then(scope => {
6 | return scope.getRawObject(hash).then(object => {
7 | if (!object) return 'object not found';
8 | if (stringify) return JSON.stringify(object.content.toString());
9 | return object.getString(pretty);
10 | });
11 | });
12 | }
13 |
--------------------------------------------------------------------------------
/src/api/scope/lib/cat-scope.ts:
--------------------------------------------------------------------------------
1 | import { loadScope, Scope } from '../../../scope';
2 | import ModelComponent from '../../../scope/models/model-component';
3 | import BitObject from '../../../scope/objects/object';
4 | import Symlink from '../../../scope/models/symlink';
5 |
6 | export default (async function catScope(path: string, full: boolean): Promise {
7 | const scope: Scope = await loadScope(path);
8 | const bitObjects = await scope.objects.list();
9 | return full ? bitObjects : bitObjects.filter(obj => obj instanceof ModelComponent || obj instanceof Symlink);
10 | });
11 |
--------------------------------------------------------------------------------
/src/api/scope/lib/ci-update-action.ts:
--------------------------------------------------------------------------------
1 | import runAndUpdateCi from '../../../scope/ci-ops/run-and-update-ci';
2 |
3 | export default function CiUpdateAction(
4 | id: string,
5 | path: string,
6 | verbose: boolean,
7 | directory?: string,
8 | keep = false,
9 | noCache = false
10 | ) {
11 | return runAndUpdateCi({ id, scopePath: path, verbose, directory, keep, noCache });
12 | }
13 |
--------------------------------------------------------------------------------
/src/api/scope/lib/describe-scope.ts:
--------------------------------------------------------------------------------
1 | import { loadScope } from '../../../scope';
2 |
3 | export default function describeScope(path: string) {
4 | return loadScope(path).then(scope => {
5 | return scope.describe();
6 | });
7 | }
8 |
--------------------------------------------------------------------------------
/src/api/scope/lib/latest-versions.ts:
--------------------------------------------------------------------------------
1 | import { loadScope, Scope } from '../../../scope';
2 | import { BitId } from '../../../bit-id';
3 |
4 | export default (async function latestVersions(path: string, componentIdsStr: string[]): Promise {
5 | const scope: Scope = await loadScope(path);
6 | const bitIds: BitId[] = await Promise.all(componentIdsStr.map(id => scope.getParsedId(id)));
7 | const componentsIds = await scope.latestVersions(bitIds);
8 | return componentsIds.map(componentId => componentId.toString());
9 | });
10 |
--------------------------------------------------------------------------------
/src/api/scope/lib/log.ts:
--------------------------------------------------------------------------------
1 | import { Scope, loadScope } from '../../../scope';
2 | import { BitId } from '../../../bit-id';
3 |
4 | export default async function log(path: string, id: string): Promise {
5 | const scope: Scope = await loadScope(path);
6 | const bitId = BitId.parse(id, true);
7 | const componentLogs = await scope.loadComponentLogs(bitId);
8 | return JSON.stringify(componentLogs);
9 | }
10 |
--------------------------------------------------------------------------------
/src/api/scope/lib/refresh-scope.ts:
--------------------------------------------------------------------------------
1 | import { loadScope } from '../../../scope';
2 |
3 | export default function refreshScope(path: string): Promise {
4 | return loadScope(path).then(scope => {
5 | return scope.objects.list().then(objects => Promise.all(objects.map(o => scope.objects._writeOne(o))));
6 | });
7 | }
8 |
--------------------------------------------------------------------------------
/src/api/scope/lib/scope-init.ts:
--------------------------------------------------------------------------------
1 | import { Scope } from '../../../scope';
2 |
3 | export default function init(path: string = process.cwd(), name: string, groupName: string): Promise {
4 | return Scope.ensure(path, name, groupName).then(scope => scope.ensureDir());
5 | }
6 |
--------------------------------------------------------------------------------
/src/api/scope/lib/scope-list.ts:
--------------------------------------------------------------------------------
1 | import { loadScope } from '../../../scope';
2 | import ComponentsList from '../../../consumer/component/components-list';
3 | import { ListScopeResult } from '../../../consumer/component/components-list';
4 |
5 | export default function list(
6 | path: string,
7 | namespacesUsingWildcards?: string,
8 | loadScopeFromCache = true
9 | ): Promise {
10 | return loadScope(path, loadScopeFromCache).then(scope =>
11 | ComponentsList.listLocalScope(scope, namespacesUsingWildcards)
12 | );
13 | }
14 |
--------------------------------------------------------------------------------
/src/bit-id/exceptions/index.ts:
--------------------------------------------------------------------------------
1 | import InvalidBitId from './invalid-bit-id';
2 | import InvalidIdChunk from './invalid-id-chunk';
3 | import InvalidName from './invalid-name';
4 | import InvalidScopeName from './invalid-scope-name';
5 |
6 | export { InvalidBitId, InvalidIdChunk, InvalidName, InvalidScopeName };
7 |
--------------------------------------------------------------------------------
/src/bit-id/exceptions/invalid-bit-id.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class InvalidBitId extends AbstractError {}
4 |
--------------------------------------------------------------------------------
/src/bit-id/exceptions/invalid-id-chunk.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class InvalidIdChunk extends AbstractError {
4 | id: string;
5 |
6 | constructor(id: string) {
7 | super();
8 | this.id = id;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/bit-id/exceptions/invalid-name.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class InvalidName extends AbstractError {
4 | componentName: string;
5 |
6 | constructor(componentName: string) {
7 | super();
8 | this.componentName = componentName;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/bit-id/exceptions/invalid-scope-name.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class InvalidScopeName extends AbstractError {
4 | scopeName: string;
5 |
6 | constructor(scopeName: string) {
7 | super();
8 | this.scopeName = scopeName;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/bit-id/index.ts:
--------------------------------------------------------------------------------
1 | import BitId from './bit-id';
2 | import BitIds from './bit-ids';
3 |
4 | export { BitId, BitIds };
5 |
--------------------------------------------------------------------------------
/src/cli/cli-utils.ts:
--------------------------------------------------------------------------------
1 | import { toBase64, fromBase64, isString } from '../utils';
2 |
3 | export const pack = (x: Array | string): string => {
4 | // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
5 | // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
6 | return isString(x) ? toBase64(x) : toBase64(x.join('+++'));
7 | };
8 |
9 | export const unpack = (str: string): Array => fromBase64(str).split('+++');
10 |
--------------------------------------------------------------------------------
/src/cli/commands/exceptions/add-tests-without-id.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class AddTestsWithoutId extends AbstractError {}
4 |
--------------------------------------------------------------------------------
/src/cli/commands/exceptions/remote-undefined.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class RemoteUndefined extends AbstractError {}
4 |
--------------------------------------------------------------------------------
/src/cli/global-flags.ts:
--------------------------------------------------------------------------------
1 | interface GlobalFlags {
2 | _token?: string;
3 | }
4 |
5 | class GlobalFlags implements GlobalFlags {
6 | get token(): string | undefined {
7 | return this._token;
8 | }
9 |
10 | set token(token: string | undefined) {
11 | this._token = token;
12 | }
13 | }
14 |
15 | const globalFlags = new GlobalFlags();
16 |
17 | export default globalFlags;
18 |
--------------------------------------------------------------------------------
/src/cli/index.ts:
--------------------------------------------------------------------------------
1 | export { default as buildRegistry } from './command-registry-builder';
2 | export { default as CommandRegistry } from './command-registry';
3 |
--------------------------------------------------------------------------------
/src/cli/loader/index.ts:
--------------------------------------------------------------------------------
1 | import loader from './loader';
2 |
3 | export default loader;
4 |
--------------------------------------------------------------------------------
/src/cli/templates/bare-list-template.ts:
--------------------------------------------------------------------------------
1 | import { VERSION_DELIMITER } from '../../constants';
2 | import { ListScopeResult } from '../../consumer/component/components-list';
3 |
4 | export default (rawScopeResults: ListScopeResult[]) => {
5 | function paintRawComponent(listScopeResult: ListScopeResult) {
6 | // $FlowFixMe scope and version properties are always set for scope components
7 | return `${listScopeResult.id.scope}/${listScopeResult.id.name}${VERSION_DELIMITER}${listScopeResult.id.version}`;
8 | }
9 |
10 | return rawScopeResults.map(paintRawComponent).join('\n');
11 | };
12 |
--------------------------------------------------------------------------------
/src/cli/templates/raw-list-template.ts:
--------------------------------------------------------------------------------
1 | import { VERSION_DELIMITER } from '../../constants';
2 | import { ListScopeResult } from '../../consumer/component/components-list';
3 |
4 | export default (rawScopeResults: ListScopeResult[]) => {
5 | function paintBareComponent(listScopeResult: ListScopeResult) {
6 | // $FlowFixMe scope and version properties are always set for scope components
7 | return `${listScopeResult.id.scope}/${listScopeResult.id.name}${VERSION_DELIMITER}${listScopeResult.id.version}`;
8 | }
9 |
10 | return rawScopeResults.map(paintBareComponent).join('\n');
11 | };
12 |
--------------------------------------------------------------------------------
/src/component-resolver/index.ts:
--------------------------------------------------------------------------------
1 | import componentResolver from './component-resolver';
2 |
3 | export default componentResolver;
4 |
--------------------------------------------------------------------------------
/src/consumer/bit-map/exceptions/index.ts:
--------------------------------------------------------------------------------
1 | import InvalidBitMap from './invalid-bit-map';
2 | import MissingBitMapComponent from './missing-bit-map-component';
3 | import MissingMainFile from './missing-main-file';
4 |
5 | export { InvalidBitMap, MissingBitMapComponent, MissingMainFile };
6 |
--------------------------------------------------------------------------------
/src/consumer/bit-map/exceptions/invalid-bit-map.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class InvalidBitMap extends AbstractError {
4 | path: string;
5 | errorMessage: string;
6 | showDoctorMessage: boolean;
7 |
8 | constructor(path: string, errorMessage: string) {
9 | super();
10 | this.path = path;
11 | this.errorMessage = errorMessage;
12 | this.showDoctorMessage = true;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/consumer/bit-map/exceptions/missing-bit-map-component.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class MissingBitMapComponent extends AbstractError {
4 | id: string;
5 |
6 | constructor(id: string) {
7 | super();
8 | this.id = id;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/consumer/bit-map/exceptions/missing-main-file.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class MissingMainFile extends AbstractError {
4 | componentId: string;
5 | mainFile: string;
6 | files: string[];
7 |
8 | constructor(componentId: string, mainFile: string, files: string[]) {
9 | super();
10 | this.componentId = componentId;
11 | this.mainFile = mainFile;
12 | this.files = files;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/consumer/bit-map/exceptions/outside-root-dir.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class OutsideRootDir extends AbstractError {
4 | filePath: string;
5 | rootDir: string;
6 |
7 | constructor(filePath: string, rootDir: string) {
8 | super();
9 | this.filePath = filePath;
10 | this.rootDir = rootDir;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/consumer/bit-map/index.ts:
--------------------------------------------------------------------------------
1 | import BitMap from './bit-map';
2 |
3 | export default BitMap;
4 |
--------------------------------------------------------------------------------
/src/consumer/component-ops/add-components/exceptions/adding-individual-files.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../../error/abstract-error';
2 |
3 | export class AddingIndividualFiles extends AbstractError {
4 | file: string;
5 | constructor(file: string) {
6 | super();
7 | this.file = file;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/consumer/component-ops/add-components/exceptions/empty-directory.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../../error/abstract-error';
2 |
3 | export default class EmptyDirectory extends AbstractError {}
4 |
--------------------------------------------------------------------------------
/src/consumer/component-ops/add-components/exceptions/excluded-main-file.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../../error/abstract-error';
2 |
3 | export default class ExcludedMainFile extends AbstractError {
4 | mainFile: string;
5 | constructor(mainFile: string) {
6 | super();
7 | this.mainFile = mainFile;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/consumer/component-ops/add-components/exceptions/incorrect-id-imported-component.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../../error/abstract-error';
2 |
3 | export default class IncorrectIdForImportedComponent extends AbstractError {
4 | importedId: string;
5 | newId: string;
6 | filePath: string;
7 |
8 | constructor(importedId: string, newId: string, filePath: string) {
9 | super();
10 | this.importedId = importedId;
11 | this.newId = newId;
12 | this.filePath = filePath;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/consumer/component-ops/add-components/exceptions/main-file-is-dir.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../../error/abstract-error';
2 |
3 | export default class MainFileIsDir extends AbstractError {
4 | mainFile: string;
5 | constructor(mainFile: string) {
6 | super();
7 | this.mainFile = mainFile;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/consumer/component-ops/add-components/exceptions/missing-id-imported-component.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../../error/abstract-error';
2 |
3 | export default class MissingComponentIdForImportedComponent extends AbstractError {
4 | id: string;
5 |
6 | constructor(id: string) {
7 | super();
8 | this.id = id;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/consumer/component-ops/add-components/exceptions/missing-main-file-multiple-components.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../../error/abstract-error';
2 |
3 | export default class MissingMainFileMultipleComponents extends AbstractError {
4 | componentIds: string[];
5 |
6 | constructor(componentIds: string[]) {
7 | super();
8 | this.componentIds = componentIds;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/consumer/component-ops/add-components/exceptions/no-files.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../../error/abstract-error';
2 |
3 | export default class NoFiles extends AbstractError {
4 | ignoredFiles: string[];
5 |
6 | constructor(ignoredFiles: string[]) {
7 | super();
8 | this.ignoredFiles = ignoredFiles;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/consumer/component-ops/add-components/exceptions/path-outside-consumer.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../../error/abstract-error';
2 |
3 | export default class PathOutsideConsumer extends AbstractError {
4 | path: string;
5 | constructor(path: string) {
6 | super();
7 | this.path = path;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/consumer/component-ops/add-components/exceptions/paths-not-exist.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../../error/abstract-error';
2 |
3 | export default class PathsNotExist extends AbstractError {
4 | paths: string[];
5 | showDoctorMessage: boolean;
6 |
7 | constructor(paths: string[]) {
8 | super();
9 | this.paths = paths;
10 | this.showDoctorMessage = true;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/consumer/component-ops/add-components/exceptions/test-is-directory.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../../error/abstract-error';
2 |
3 | export default class TestIsDirectory extends AbstractError {
4 | path: string;
5 | constructor(path: string) {
6 | super();
7 | this.path = path;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/consumer/component-ops/add-components/exceptions/version-should-be-removed.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../../error/abstract-error';
2 |
3 | export default class VersionShouldBeRemoved extends AbstractError {
4 | id: string;
5 | constructor(id: string) {
6 | super();
7 | this.id = id;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/consumer/component-ops/add-components/index.ts:
--------------------------------------------------------------------------------
1 | import AddComponents from './add-components';
2 |
3 | export default AddComponents;
4 |
--------------------------------------------------------------------------------
/src/consumer/component-ops/exceptions/components-pending-import.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class ComponentsPendingImport extends AbstractError {}
4 |
--------------------------------------------------------------------------------
/src/consumer/component-ops/exceptions/eject-no-dir.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class EjectNoDir extends AbstractError {
4 | compId: string;
5 |
6 | constructor(compId: string) {
7 | super();
8 | this.compId = compId;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/consumer/component/dependencies/dependency-resolver/index.ts:
--------------------------------------------------------------------------------
1 | export { default as DependencyResolver } from './dependencies-resolver';
2 | export { default as updateDependenciesVersions } from './dependencies-versions-resolver';
3 |
--------------------------------------------------------------------------------
/src/consumer/component/dependencies/files-dependency-builder/index.ts:
--------------------------------------------------------------------------------
1 | import { getDependencyTree, resolveNodePackage, resolveModulePath } from './build-tree';
2 | // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
3 | import getDependenciesFromSource from './precinct';
4 |
5 | export { resolveNodePackage, resolveModulePath, getDependencyTree, getDependenciesFromSource };
6 |
--------------------------------------------------------------------------------
/src/consumer/component/dependencies/files-dependency-builder/types/index.ts:
--------------------------------------------------------------------------------
1 | /* THIS IS A BIT-AUTO-GENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. */
2 |
3 | module.exports = require('./dependency-tree-type');
4 |
--------------------------------------------------------------------------------
/src/consumer/component/dependencies/index.ts:
--------------------------------------------------------------------------------
1 | import Dependency from './dependency';
2 | import Dependencies from './dependencies';
3 |
4 | export { Dependency, Dependencies };
5 |
--------------------------------------------------------------------------------
/src/consumer/component/exceptions/bit-already-exist-externaly.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class BitAlreadyExistExternalyError extends AbstractError {
4 | bitName: string;
5 |
6 | constructor(bitName: string) {
7 | super();
8 | this.bitName = bitName;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/consumer/component/exceptions/component-not-found-in-path.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class ComponentNotFoundInPath extends AbstractError {
4 | path: string;
5 | code: number;
6 |
7 | constructor(path: string) {
8 | super();
9 | this.code = 127;
10 | this.path = path;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/consumer/component/exceptions/eject-bound-to-workspace.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class EjectBoundToWorkspace extends AbstractError {}
4 |
--------------------------------------------------------------------------------
/src/consumer/component/exceptions/external-build-errors.ts:
--------------------------------------------------------------------------------
1 | import ExternalErrors from '../../../error/external-errors';
2 |
3 | export default class ExternalBuildErrors extends ExternalErrors {
4 | id: string;
5 |
6 | constructor(id: string, errors: Error[]) {
7 | super(errors);
8 | this.id = id;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/consumer/component/exceptions/external-test-errors.ts:
--------------------------------------------------------------------------------
1 | import ExternalErrors from '../../../error/external-errors';
2 |
3 | export default class ExternalTestErrors extends ExternalErrors {
4 | id: string;
5 | constructor(id: string, errors: Error[]) {
6 | super(errors);
7 | this.id = id;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/consumer/component/exceptions/file-source-not-found.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class FileSourceNotFound extends AbstractError {
4 | path: string;
5 |
6 | constructor(path: string) {
7 | super();
8 | this.path = path;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/consumer/component/exceptions/incorrect-root-dir.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class IncorrectRootDir extends AbstractError {
4 | id: string;
5 | importStatement: string;
6 | constructor(id: string, importStatement: string) {
7 | super();
8 | this.id = id;
9 | this.importStatement = importStatement;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/consumer/component/exceptions/inject-non-ejected.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class InjectNonEjected extends AbstractError {}
4 |
--------------------------------------------------------------------------------
/src/consumer/component/exceptions/invalid-bit.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class InvalidBit extends AbstractError {}
4 |
--------------------------------------------------------------------------------
/src/consumer/component/exceptions/invalid-compiler-interface.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class InvalidCompilerInterface extends AbstractError {
4 | compilerName: string;
5 | constructor(compilerName: string) {
6 | super();
7 | this.compilerName = compilerName;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/consumer/component/exceptions/main-file-removed.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class MainFileRemoved extends AbstractError {
4 | mainFile: string;
5 | id: string;
6 | constructor(mainFile: string, id: string) {
7 | super();
8 | this.mainFile = mainFile;
9 | this.id = id;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/consumer/component/exceptions/missing-files-from-component.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class MissingFilesFromComponent extends AbstractError {
4 | id: string;
5 |
6 | constructor(id: string) {
7 | super();
8 | this.id = id;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/consumer/component/exceptions/plugin-not-found.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class PluginNotFoundException extends AbstractError {
4 | plugin: string;
5 |
6 | constructor(plugin: string) {
7 | super();
8 | this.plugin = plugin;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/consumer/component/index.ts:
--------------------------------------------------------------------------------
1 | import ConsumerComponent from './consumer-component';
2 |
3 | export default ConsumerComponent;
4 |
--------------------------------------------------------------------------------
/src/consumer/component/sources/artifact.ts:
--------------------------------------------------------------------------------
1 | import { AbstractVinyl } from '.';
2 |
3 | export class Artifact extends AbstractVinyl {}
4 |
--------------------------------------------------------------------------------
/src/consumer/component/sources/index.ts:
--------------------------------------------------------------------------------
1 | import AbstractVinyl from './abstract-vinyl';
2 | import Dist from './dist';
3 | import License from './license';
4 | import SourceFile from './source-file';
5 |
6 | export { AbstractVinyl, Dist, License, SourceFile };
7 |
--------------------------------------------------------------------------------
/src/consumer/config/exceptions/bit-config-not-found.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class BitConfigNotFound extends AbstractError {}
4 |
--------------------------------------------------------------------------------
/src/consumer/config/exceptions/index.ts:
--------------------------------------------------------------------------------
1 | import BitConfigNotFound from './bit-config-not-found';
2 | import InvalidBitJson from './invalid-bit-json';
3 | import InvalidPackageJson from './invalid-package-json';
4 | import InvalidConfigPropPath from './invalid-config-prop-path';
5 |
6 | export { BitConfigNotFound, InvalidBitJson, InvalidPackageJson, InvalidConfigPropPath };
7 |
--------------------------------------------------------------------------------
/src/consumer/config/exceptions/invalid-bit-json.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class InvalidBitJson extends AbstractError {
4 | path: string;
5 | showDoctorMessage: boolean;
6 |
7 | constructor(path: string) {
8 | super();
9 | this.path = path;
10 | this.showDoctorMessage = true;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/consumer/config/exceptions/invalid-config-prop-path.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class InvalidConfigPropPath extends AbstractError {
4 | fieldName: string;
5 | fieldValue: string;
6 | showDoctorMessage: boolean;
7 |
8 | constructor(fieldName: string, fieldValue: string) {
9 | super();
10 | this.fieldName = fieldName;
11 | this.fieldValue = fieldValue;
12 | this.showDoctorMessage = true;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/consumer/config/exceptions/invalid-package-json.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class InvalidPackageJson extends AbstractError {
4 | path: string;
5 | showDoctorMessage: boolean;
6 |
7 | constructor(path: string) {
8 | super();
9 | this.path = path;
10 | this.showDoctorMessage = true;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/consumer/config/exceptions/invalid-package-manager.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class InvalidPackageManager extends AbstractError {
4 | packageManager: string;
5 | showDoctorMessage: boolean;
6 |
7 | constructor(packageManager: string) {
8 | super();
9 | this.packageManager = packageManager;
10 | this.showDoctorMessage = false;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/consumer/config/index.ts:
--------------------------------------------------------------------------------
1 | import ComponentConfig from './component-config';
2 |
3 | export {
4 | default as LegacyWorkspaceConfig,
5 | WorkspaceConfigProps as LegacyWorkspaceConfigProps,
6 | WorkspaceConfigEnsureFunction,
7 | WorkspaceConfigLoadFunction
8 | } from './workspace-config';
9 | export { ILegacyWorkspaceConfig } from './legacy-workspace-config-interface';
10 | export { ExtensionConfigList, ExtensionConfigEntry, IExtensionConfigList } from './extension-config-list';
11 | export default ComponentConfig;
12 |
--------------------------------------------------------------------------------
/src/consumer/exceptions/component-out-of-sync.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class ComponentOutOfSync extends AbstractError {
4 | id: string;
5 | showDoctorMessage: boolean;
6 |
7 | constructor(id: string) {
8 | super();
9 | this.id = id;
10 | this.showDoctorMessage = true;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/consumer/exceptions/component-specs-failed.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 | import SpecsResults from '../specs-results';
3 |
4 | export default class ComponentSpecsFailed extends AbstractError {
5 | id?: string;
6 | specsResults?: SpecsResults;
7 |
8 | constructor(id?: string, specsResults?: SpecsResults) {
9 | super();
10 | this.id = id;
11 | this.specsResults = specsResults;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/consumer/exceptions/consumer-already-exists.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class ConsumerAlreadyExists extends AbstractError {}
4 |
--------------------------------------------------------------------------------
/src/consumer/exceptions/consumer-not-found.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class ConsumerNotFound extends AbstractError {}
4 |
--------------------------------------------------------------------------------
/src/consumer/exceptions/login-failed.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class LoginFailed extends AbstractError {
4 | showDoctorMessage: boolean;
5 |
6 | constructor() {
7 | super();
8 | this.showDoctorMessage = true;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/consumer/exceptions/missing-dependencies.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class MissingDependencies extends AbstractError {
4 | components: Record;
5 | constructor(components: Record) {
6 | super();
7 | this.components = components;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/consumer/exceptions/newer-version-found.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export type NewerVersion = {
4 | componentId: string;
5 | currentVersion: string;
6 | latestVersion: string;
7 | };
8 | export default class NewerVersionFound extends AbstractError {
9 | newerVersions: NewerVersion[];
10 |
11 | constructor(newerVersions: NewerVersion[]) {
12 | super();
13 | this.name = 'NewerVersionFound';
14 | this.newerVersions = newerVersions;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/consumer/exceptions/nothing-to-import.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class NothingToImport extends AbstractError {}
4 |
--------------------------------------------------------------------------------
/src/consumer/index.ts:
--------------------------------------------------------------------------------
1 | import Consumer from './consumer';
2 | import { loadConsumer, loadConsumerIfExist } from './consumer-loader';
3 | import { getConsumerInfo } from './consumer-locator';
4 |
5 | export { Consumer, loadConsumer, loadConsumerIfExist, getConsumerInfo };
6 |
--------------------------------------------------------------------------------
/src/consumer/login/exceptions/index.ts:
--------------------------------------------------------------------------------
1 | import PathToNpmrcNotExist from './path-to-npmrc-not-exist';
2 | import WriteToNpmrcError from './write-to-npmrc-error';
3 |
4 | export { PathToNpmrcNotExist, WriteToNpmrcError };
5 |
--------------------------------------------------------------------------------
/src/consumer/login/exceptions/path-to-npmrc-not-exist.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class PathToNpmrcNotExist extends AbstractError {
4 | path: string;
5 | showDoctorMessage: boolean;
6 |
7 | constructor(path: string) {
8 | super();
9 | this.path = path;
10 | this.showDoctorMessage = true;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/consumer/login/exceptions/write-to-npmrc-error.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class WriteToNpmrcError extends AbstractError {
4 | path: string;
5 | showDoctorMessage: boolean;
6 |
7 | constructor(path: string) {
8 | super();
9 | this.path = path;
10 | this.showDoctorMessage = true;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/consumer/migrations/bit-map/index.ts:
--------------------------------------------------------------------------------
1 | import changeVersionToSemVerDeclartaion from './to-semver-migration';
2 |
3 | export { changeVersionToSemVerDeclartaion };
4 |
--------------------------------------------------------------------------------
/src/consumer/migrations/consumer-migrator-manifest.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * A file to define the list of migration needs to be run for each version
3 | */
4 | import * as bitMapMigrations from './bit-map';
5 |
6 | export default {
7 | '0.11.1': {
8 | bitmap: [bitMapMigrations.changeVersionToSemVerDeclartaion]
9 | }
10 | };
11 |
--------------------------------------------------------------------------------
/src/consumer/specs-results/index.ts:
--------------------------------------------------------------------------------
1 | import specsResults from './specs-results';
2 |
3 | export default specsResults;
4 |
--------------------------------------------------------------------------------
/src/consumer/versions-ops/merge-version/index.ts:
--------------------------------------------------------------------------------
1 | export { default as threeWayMerge } from './three-way-merge';
2 | export { mergeVersion, FileStatus, getMergeStrategyInteractive, getMergeStrategy, MergeOptions } from './merge-version';
3 | export { MergeStrategy, ApplyVersionResults, ApplyVersionResult, FailedComponents } from './merge-version';
4 |
--------------------------------------------------------------------------------
/src/consumer/versions-ops/merge-version/merge-version.spec.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/src/consumer/versions-ops/merge-version/merge-version.spec.ts
--------------------------------------------------------------------------------
/src/environment/index.ts:
--------------------------------------------------------------------------------
1 | import Environment from './environment';
2 |
3 | export default Environment;
4 |
--------------------------------------------------------------------------------
/src/error/abstract-error.ts:
--------------------------------------------------------------------------------
1 | export default class AbstractError extends Error {
2 | isUserError: boolean; // user errors are not reported to Sentry
3 | constructor() {
4 | super();
5 | this.name = this.constructor.name;
6 | this.isUserError = true;
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/error/clone-error-object.ts:
--------------------------------------------------------------------------------
1 | import R from 'ramda';
2 |
3 | export const systemFields = ['stack', 'code', 'errno', 'syscall'];
4 |
5 | // partially forked from 'utils-copy-error' package
6 | export default function cloneErrorObject(error: Error): Error {
7 | // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
8 | const err = new error.constructor(error.message);
9 |
10 | systemFields.forEach(field => {
11 | if (error[field]) err[field] = error[field];
12 | });
13 | Object.keys(error).forEach(key => {
14 | err[key] = R.clone(error[key]);
15 | });
16 | return err;
17 | }
18 |
--------------------------------------------------------------------------------
/src/error/custom-error.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from './abstract-error';
2 |
3 | /**
4 | * useful to throw an error from the remote server and print it as is on the client, without any extra data.
5 | * this way, in the future, in case we need to throw an error from the server, we don't need to
6 | * update the client to get the error the way we want it.
7 | */
8 | export default class CustomError extends AbstractError {
9 | code: number;
10 | message: string;
11 |
12 | constructor(message: string) {
13 | super();
14 | this.code = 132;
15 | this.message = message;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/error/external-error.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from './abstract-error';
2 |
3 | export default class ExternalError extends AbstractError {
4 | originalError: Error;
5 | constructor(originalError: Error) {
6 | super();
7 | this.originalError = originalError;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/error/external-errors.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from './abstract-error';
2 |
3 | /**
4 | * A class to represent multiple external errors
5 | */
6 | export default class ExternalErrors extends AbstractError {
7 | originalErrors: Error[];
8 | constructor(originalErrors: Error[]) {
9 | super();
10 | this.originalErrors = originalErrors;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/error/general-error.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from './abstract-error';
2 |
3 | export default class GeneralError extends AbstractError {
4 | msg: string;
5 |
6 | constructor(msg: string) {
7 | super();
8 | this.msg = msg;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/error/show-doctor-error.ts:
--------------------------------------------------------------------------------
1 | import GeneralError from './general-error';
2 |
3 | export default class ShowDoctorError extends GeneralError {
4 | showDoctorMessage: boolean;
5 |
6 | constructor(msg: string) {
7 | super(msg);
8 | this.showDoctorMessage = true;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/error/validation-error.ts:
--------------------------------------------------------------------------------
1 | export default class ValidationError extends Error {
2 | showDoctorMessage: boolean;
3 |
4 | constructor(msg: string) {
5 | super(msg);
6 | this.showDoctorMessage = true;
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/extensions/bit/bit.manifest.ts:
--------------------------------------------------------------------------------
1 | import { ExtensionManifest } from '@teambit/harmony';
2 | import { manifestsMap } from './manifests';
3 | import { provideBit } from './bit.provider';
4 |
5 | const manifests = Object.values(manifestsMap);
6 |
7 | export default {
8 | name: 'bit',
9 | dependencies: manifests,
10 | provider: provideBit
11 | } as ExtensionManifest;
12 |
--------------------------------------------------------------------------------
/src/extensions/bit/bit.provider.ts:
--------------------------------------------------------------------------------
1 | import { manifestsMap } from './manifests';
2 |
3 | export type BitDeps = [];
4 |
5 | export type BitConfig = {};
6 |
7 | export async function provideBit() {
8 | return {
9 | manifestsMap
10 | };
11 | }
12 |
--------------------------------------------------------------------------------
/src/extensions/bit/index.ts:
--------------------------------------------------------------------------------
1 | export { manifestsMap } from './manifests';
2 | export { default as BitExt } from './bit.manifest';
3 |
--------------------------------------------------------------------------------
/src/extensions/builder/index.ts:
--------------------------------------------------------------------------------
1 | export { BuilderExtension } from './builder.extension';
2 | export { BuildPipe } from './build-pipe';
3 | export { BuildTask, BuildContext, BuildResults } from './types';
4 |
--------------------------------------------------------------------------------
/src/extensions/cli/exceptions/already-exists.tsx:
--------------------------------------------------------------------------------
1 | import { PaperError } from './paper-error';
2 |
3 | export class AlreadyExistsError extends PaperError {
4 | constructor(type: string, name: string) {
5 | super(`${type} ${name} already exists.`);
6 | }
7 | report() {
8 | return this.message;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/extensions/cli/exceptions/index.ts:
--------------------------------------------------------------------------------
1 | export { AlreadyExistsError } from './already-exists';
2 | export { PaperError } from './paper-error';
3 |
--------------------------------------------------------------------------------
/src/extensions/cli/exceptions/paper-error.tsx:
--------------------------------------------------------------------------------
1 | export abstract class PaperError extends Error {
2 | isUserError: boolean; // user errors are not reported to Sentry
3 | abstract report(): string;
4 |
5 | static handleError(err: PaperError): string {
6 | return err.report();
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/extensions/cli/index.ts:
--------------------------------------------------------------------------------
1 | export { CLIExtension } from './cli.extension';
2 | export { Command, CLIArgs, Flags, GenericObject } from '../../cli/command';
3 | export { CommandOptions } from '../../cli/legacy-command';
4 | export { getID } from './registry';
5 | export * from './exceptions';
6 |
--------------------------------------------------------------------------------
/src/extensions/cli/readme.md:
--------------------------------------------------------------------------------
1 | # Paper
2 | Paper is an extension for building modern terminal commands using React components.
3 | It uses [Ink](https://github.com/vadimdemedes/ink) and [commander](https://github.com/tj/commander.js/) behind the scences to deliver a unified experience for building amazing component-based CLI apps.
4 |
5 | ## Features
6 | - Allow to register new commands
7 | - Use commander commands.
8 | - Render to stdout with Ink.
9 | - move to new command definition format (see example at `run.cmd.tx`)
10 |
--------------------------------------------------------------------------------
/src/extensions/compiler/compiler.task.ts:
--------------------------------------------------------------------------------
1 | import { BuildContext } from '../builder';
2 | import { BuildTask, BuildResults } from '../builder';
3 | import { Compiler } from './types';
4 |
5 | /**
6 | * compiler build task. Allows to compile components during component build.
7 | */
8 | export class CompilerTask implements BuildTask {
9 | constructor(readonly extensionId: string) {}
10 |
11 | async execute(context: BuildContext): Promise {
12 | const compilerInstance: Compiler = context.env.getCompiler();
13 | return compilerInstance.compileOnCapsules(context);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/extensions/compiler/index.ts:
--------------------------------------------------------------------------------
1 | export { Compile } from './compile';
2 | export { Compiler } from './types';
3 | export { default as CompileExt } from './compiler.extension';
4 |
--------------------------------------------------------------------------------
/src/extensions/compiler/types.ts:
--------------------------------------------------------------------------------
1 | import { ConcreteService } from '../environments/services/concrete-service';
2 | import { BuildResults, BuildContext } from '../builder';
3 |
4 | export interface Compiler extends ConcreteService {
5 | compileFile: (
6 | fileContent: string,
7 | options: { componentDir: string; filePath: string }
8 | ) => Array<{ outputText: string; outputPath: string }> | null;
9 | compileOnCapsules(context: BuildContext): Promise;
10 | }
11 |
--------------------------------------------------------------------------------
/src/extensions/component-resolver/component-resolver.manifest.ts:
--------------------------------------------------------------------------------
1 | import { ExtensionManifest } from '@teambit/harmony';
2 | import componentResolverProvider from './component-resolver.provider';
3 | import { WorkspaceExt } from '../../extensions/workspace';
4 | import { ScopeExtension } from '../scope';
5 |
6 | export const ComponentResolverExt: ExtensionManifest = {
7 | name: 'ComponentResolver',
8 | dependencies: [WorkspaceExt, ScopeExtension],
9 | provider: componentResolverProvider
10 | };
11 |
--------------------------------------------------------------------------------
/src/extensions/component-resolver/component-resolver.provider.ts:
--------------------------------------------------------------------------------
1 | import { Workspace } from '../workspace';
2 | import { ScopeExtension } from '../scope';
3 | import ComponentResolver from './component-resolver';
4 |
5 | export type ComponentResolverDeps = [Workspace, ScopeExtension];
6 |
7 | export default async function provideComponentResolver([workspace, scope]: ComponentResolverDeps) {
8 | const componentResolver = new ComponentResolver(scope, workspace);
9 | return componentResolver;
10 | }
11 |
--------------------------------------------------------------------------------
/src/extensions/component-resolver/index.ts:
--------------------------------------------------------------------------------
1 | export { default as ComponentResolver } from './component-resolver';
2 | export { ComponentResolverExt } from './component-resolver.manifest';
3 |
--------------------------------------------------------------------------------
/src/extensions/component-resolver/readme.md:
--------------------------------------------------------------------------------
1 | # component-resolver-ext
2 | This is an extension that knows to use the correct components-host to resolve a component from id to an instance.
3 | Currently it uses workspace and scope hosts.
4 |
--------------------------------------------------------------------------------
/src/extensions/component/dependencies/index.ts:
--------------------------------------------------------------------------------
1 | export { Dependencies } from './dependencies';
2 |
--------------------------------------------------------------------------------
/src/extensions/component/exceptions/index.ts:
--------------------------------------------------------------------------------
1 | // eslint-disable-next-line import/prefer-default-export
2 | export { default as NothingToSnap } from './nothing-to-snap';
3 |
--------------------------------------------------------------------------------
/src/extensions/component/exceptions/nothing-to-snap.ts:
--------------------------------------------------------------------------------
1 | export default class NothingToSnap extends Error {}
2 |
--------------------------------------------------------------------------------
/src/extensions/component/history-graph.ts:
--------------------------------------------------------------------------------
1 | export default class HistoryGraph {}
2 |
--------------------------------------------------------------------------------
/src/extensions/component/index.ts:
--------------------------------------------------------------------------------
1 | export { default as Component } from './component';
2 | export { default as ComponentFactoryExt } from './component-factory.extension';
3 | export { default as ComponentID } from './id';
4 | export { default as ComponentFactory } from './component-factory.extension';
5 | export { default as ComponentFS } from './component-fs';
6 | export { default as ComponentConfig } from './config';
7 |
--------------------------------------------------------------------------------
/src/extensions/component/store.ts:
--------------------------------------------------------------------------------
1 | import { ExtensionDataList } from '../../consumer/config/extension-data';
2 |
3 | export class Store extends ExtensionDataList {}
4 |
--------------------------------------------------------------------------------
/src/extensions/component/tag-map.ts:
--------------------------------------------------------------------------------
1 | import { SemVer } from 'semver';
2 | // eslint-disable-next-line import/no-cycle
3 | import Snap from './snap'; // todo: change to "import type" once babel supports it
4 |
5 | export default class TagMap extends Map {}
6 |
--------------------------------------------------------------------------------
/src/extensions/component/tag.ts:
--------------------------------------------------------------------------------
1 | import { SemVer } from 'semver';
2 | import Snap from './snap';
3 |
4 | /**
5 | * `Tag` provides a sematic reference to a specific state `Snap` in the working tree.
6 | */
7 | export default class Tag {
8 | constructor(
9 | /**
10 | * hash of the component `Snap`.
11 | */
12 | readonly snap: Snap,
13 |
14 | /**
15 | * sematic version of the snap.
16 | */
17 | readonly version: SemVer
18 | ) {}
19 | }
20 |
--------------------------------------------------------------------------------
/src/extensions/compositions/composition-store.preview.ts:
--------------------------------------------------------------------------------
1 | // import { Composition } from './compoisiton';
2 |
3 | export class CompositionStore {
4 | // constructor(compositions: Composition[]) {}
5 |
6 | get() {}
7 |
8 | static provider() {}
9 |
10 | static runtime = 'preview';
11 | }
12 |
--------------------------------------------------------------------------------
/src/extensions/compositions/compositions.extension.ts:
--------------------------------------------------------------------------------
1 | // import { Component } from '../component';
2 |
3 | export class Compositions {
4 | static id = '@teambit/compositions';
5 | static dependencies = [];
6 |
7 | // parse(component: Component) {
8 | // const files = component.filesystem.toObject();
9 | // Object.keys(files);
10 | // }
11 |
12 | static async provider() {
13 | return new Compositions();
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/extensions/compositions/index.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/src/extensions/compositions/index.ts
--------------------------------------------------------------------------------
/src/extensions/config/config.manifest.ts:
--------------------------------------------------------------------------------
1 | import configProvider from './config.provider';
2 |
3 | export default {
4 | name: 'config',
5 | dependencies: [],
6 | config: {},
7 | provider: configProvider
8 | };
9 |
--------------------------------------------------------------------------------
/src/extensions/config/index.ts:
--------------------------------------------------------------------------------
1 | export { Config } from './config';
2 | export { default as ConfigExt } from './config.manifest';
3 |
--------------------------------------------------------------------------------
/src/extensions/config/readme.md:
--------------------------------------------------------------------------------
1 | WIP
2 | this was cherry picked from another branch, so it doesn't contain all the logic.
3 | please do not touch:)
4 |
--------------------------------------------------------------------------------
/src/extensions/core/core.manifest.ts:
--------------------------------------------------------------------------------
1 | import { ExtensionManifest } from '@teambit/harmony';
2 | import { WorkspaceExt } from '../workspace';
3 | import { ScopeExtension } from '../scope';
4 | import provideCore from './core.provider';
5 | import { LoggerExt } from '../logger';
6 | import { ConfigExt } from '../config';
7 |
8 | export default {
9 | name: 'core',
10 | dependencies: [ConfigExt, LoggerExt, WorkspaceExt, ScopeExtension],
11 | provider: provideCore
12 | } as ExtensionManifest;
13 |
--------------------------------------------------------------------------------
/src/extensions/core/index.ts:
--------------------------------------------------------------------------------
1 | export { default as Core } from './core';
2 | export { default as CoreExt } from './core.manifest';
3 |
--------------------------------------------------------------------------------
/src/extensions/create/create.manifest.ts:
--------------------------------------------------------------------------------
1 | import { ExtensionManifest } from '@teambit/harmony';
2 | import { WorkspaceExt } from '../workspace';
3 | import { provideCreate } from './create.provider';
4 | import { CLIExtension } from '../cli';
5 |
6 | export default {
7 | name: '@teambit/create',
8 | dependencies: [CLIExtension, WorkspaceExt],
9 | provider: provideCreate
10 | } as ExtensionManifest;
11 |
--------------------------------------------------------------------------------
/src/extensions/create/index.ts:
--------------------------------------------------------------------------------
1 | export { Create } from './create';
2 | export { default as CreateExt } from './create.manifest';
3 |
--------------------------------------------------------------------------------
/src/extensions/create/types.ts:
--------------------------------------------------------------------------------
1 | export interface CreateExtConfig {
2 | template: string;
3 | }
4 |
--------------------------------------------------------------------------------
/src/extensions/dependency-resolver/index.ts:
--------------------------------------------------------------------------------
1 | export { DependencyResolverExtension } from './dependency-resolver.extension';
2 | export {
3 | DependenciesDefinition,
4 | SemverVersion,
5 | SemverVersionRule,
6 | DependencyResolverWorkspaceConfig,
7 | DependencyResolverVariantConfig,
8 | RawComponentState,
9 | DependencyType
10 | } from './types';
11 |
--------------------------------------------------------------------------------
/src/extensions/docs/docs-store.tsx:
--------------------------------------------------------------------------------
1 | // import React from 'react';
2 | // import ReactDOM from '../ui/node_modules/react-dom';
3 |
4 | // // let docs = [];
5 |
6 | // export function addDocs(docs: any[]) {
7 | // const Doc = docs[0];
8 | // ReactDOM.render(, document.getElementById('root'));
9 | // }
10 |
--------------------------------------------------------------------------------
/src/extensions/docs/docs.extension.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/src/extensions/docs/docs.extension.ts
--------------------------------------------------------------------------------
/src/extensions/docs/docs.ui.tsx:
--------------------------------------------------------------------------------
1 | import { WorkspaceUI } from '../workspace/workspace.ui';
2 |
3 | export class DocsUI {
4 | static dependencies = [WorkspaceUI];
5 |
6 | static async provider([workspace]: [WorkspaceUI]) {
7 | workspace.registerMenuItem({
8 | label: 'Overview',
9 | onClick: () => {}
10 | });
11 | return new DocsUI();
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/extensions/docs/index.ts:
--------------------------------------------------------------------------------
1 | // export { addDocs } from './docs-store';
2 |
--------------------------------------------------------------------------------
/src/extensions/environments/components/env-console/index.ts:
--------------------------------------------------------------------------------
1 | export { EnvConsole } from './env-console';
2 |
--------------------------------------------------------------------------------
/src/extensions/environments/components/index.ts:
--------------------------------------------------------------------------------
1 | export { EnvConsole } from './env-console';
2 |
--------------------------------------------------------------------------------
/src/extensions/environments/context/index.ts:
--------------------------------------------------------------------------------
1 | export { ExecutionContext } from './context';
2 |
--------------------------------------------------------------------------------
/src/extensions/environments/environment.ts:
--------------------------------------------------------------------------------
1 | export interface Environment {
2 | [key: string]: any; // :TODO need to define an abstract type for service handlers (now using any)
3 | /**
4 | * Add properties to the components' package.json
5 | *
6 | * @memberof Environment
7 | */
8 | getPackageJsonProps?: () => Record;
9 | // TODO: define this return type (dependency policy) - it's not defined since we have an
10 | // TODO: issue because it's defined in deps-resolver which use envs
11 | dependencies?: () => any;
12 | }
13 |
--------------------------------------------------------------------------------
/src/extensions/environments/index.ts:
--------------------------------------------------------------------------------
1 | export { Environments } from './environments.extension';
2 | export { Environment } from './environment';
3 | export { ExecutionContext } from './context';
4 | export { EnvService } from './services';
5 |
--------------------------------------------------------------------------------
/src/extensions/environments/runtime/env-runtime.ts:
--------------------------------------------------------------------------------
1 | import { Environment } from '../environment';
2 | import { Component } from '../../component';
3 |
4 | export class EnvRuntime {
5 | constructor(
6 | /**
7 | * ID of the wrapping extension.
8 | */
9 | readonly id: string,
10 |
11 | /**
12 | * environment
13 | */
14 | readonly env: Environment,
15 |
16 | /**
17 | * components to be loaded in the environment
18 | */
19 | readonly components: Component[]
20 | ) {}
21 | }
22 |
--------------------------------------------------------------------------------
/src/extensions/environments/runtime/index.ts:
--------------------------------------------------------------------------------
1 | export { Runtime } from './runtime';
2 | export { EnvRuntime } from './env-runtime';
3 |
--------------------------------------------------------------------------------
/src/extensions/environments/services/index.ts:
--------------------------------------------------------------------------------
1 | export { Service as EnvService } from './service';
2 |
--------------------------------------------------------------------------------
/src/extensions/environments/services/service.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '../../component';
2 |
3 | export type EnvContext = {
4 | components: Component[];
5 | };
6 |
7 | export interface Service {
8 | /**
9 | * executes a service on a subset of components.
10 | */
11 | run(context: EnvContext): any;
12 | }
13 |
--------------------------------------------------------------------------------
/src/extensions/extension-env/ext-env.ts:
--------------------------------------------------------------------------------
1 | // import { Environment } from '../envs';
2 | // import { TypeScript } from '../typescript';
3 |
4 | // export class ExtEnv implements Environment {
5 | // dev() {
6 | // //
7 | // }
8 | // }
9 |
--------------------------------------------------------------------------------
/src/extensions/extension-env/extension-env.extension.ts:
--------------------------------------------------------------------------------
1 | // import { Environments } from '../envs';
2 | // import { ExtEnv } from './ext-env';
3 |
4 | export class ExtensionEnv {
5 | // static dependencies = [Environments];
6 | // static provider([envs]: [Environments]) {
7 | // envs.register(new ExtEnv());
8 | // }
9 | }
10 |
--------------------------------------------------------------------------------
/src/extensions/extension-env/index.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/src/extensions/extension-env/index.ts
--------------------------------------------------------------------------------
/src/extensions/flows/flow/index.ts:
--------------------------------------------------------------------------------
1 | export { Flow } from './flow';
2 |
--------------------------------------------------------------------------------
/src/extensions/flows/flows.manifest.ts:
--------------------------------------------------------------------------------
1 | import { ExtensionManifest } from '@teambit/harmony';
2 | import { Flows } from './flows';
3 | import { WorkspaceExt, Workspace } from '../workspace';
4 |
5 | type ScriptDeps = [Workspace];
6 |
7 | export default {
8 | name: 'flows',
9 | dependencies: [WorkspaceExt],
10 | async provider([workspace]: ScriptDeps) {
11 | const flows = new Flows(workspace);
12 | // const runCMD = new RunCmd(flows, reporter, logger);
13 | // cli.register(runCMD);
14 | return flows;
15 | }
16 | } as ExtensionManifest;
17 |
--------------------------------------------------------------------------------
/src/extensions/flows/index.ts:
--------------------------------------------------------------------------------
1 | export { default as FlowsExt } from './flows.manifest';
2 | export { Flows, IdsAndFlows } from './flows';
3 | export { TASK_SEPARATOR, SCRIPT_FILENAME } from './task/task';
4 | export { flattenNestedMap, flattenReplaySubject } from './util/flatten-nested-map';
5 | export { createFakeCapsule } from './util/create-capsule';
6 | export { createGetGraphFn, createTestNetworkStream } from './util/create-fake-network';
7 |
--------------------------------------------------------------------------------
/src/extensions/flows/network/index.ts:
--------------------------------------------------------------------------------
1 | export { Network, GetFlow } from './network';
2 |
--------------------------------------------------------------------------------
/src/extensions/flows/network/options.ts:
--------------------------------------------------------------------------------
1 | export type ExecutionOptions = {
2 | concurrency: number;
3 | traverse: 'only' | 'dependencies' | 'dependents' | 'both';
4 | caching: boolean;
5 | };
6 |
--------------------------------------------------------------------------------
/src/extensions/flows/task/index.ts:
--------------------------------------------------------------------------------
1 | export { executeTask } from './task';
2 |
--------------------------------------------------------------------------------
/src/extensions/git/index.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/src/extensions/git/index.ts
--------------------------------------------------------------------------------
/src/extensions/graph/component-graph/index.ts:
--------------------------------------------------------------------------------
1 | // eslint-disable-next-line import/no-cycle
2 | export { ComponentGraph } from './component-graph';
3 |
--------------------------------------------------------------------------------
/src/extensions/graph/dependency.ts:
--------------------------------------------------------------------------------
1 | type DependencyType = 'dev' | 'peer' | 'runtime';
2 |
3 | export class Dependency {
4 | readonly type: DependencyType;
5 | constructor(type: DependencyType) {
6 | this.type = type;
7 | }
8 | stringify(): string {
9 | return this.type;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/extensions/graph/graph.manifest.ts:
--------------------------------------------------------------------------------
1 | import { ExtensionManifest } from '@teambit/harmony';
2 | import { provide } from './graph.provider';
3 | import { WorkspaceExt } from '../workspace';
4 | import { ScopeExtension } from '../scope';
5 | import { ComponentFactoryExt } from '../component';
6 |
7 | export default {
8 | name: 'graph',
9 | dependencies: [WorkspaceExt, ScopeExtension, ComponentFactoryExt],
10 | provider: provide
11 | } as ExtensionManifest;
12 |
--------------------------------------------------------------------------------
/src/extensions/graph/graph.provider.ts:
--------------------------------------------------------------------------------
1 | import { Workspace } from '../workspace';
2 | import { ScopeExtension } from '../scope';
3 | import { ComponentFactory } from '../component';
4 | import { GraphBuilder } from './graph-builder';
5 |
6 | export type GraphDeps = [Workspace, ScopeExtension, ComponentFactory];
7 |
8 | export async function provide([workspace, scope, componentFactory]: GraphDeps) {
9 | return new GraphBuilder(componentFactory, workspace, scope);
10 | }
11 |
--------------------------------------------------------------------------------
/src/extensions/graph/index.ts:
--------------------------------------------------------------------------------
1 | export { ComponentGraph } from './component-graph';
2 | export { GraphBuilder } from './graph-builder';
3 | export { default as ComponentGraphExt } from './graph.manifest';
4 | export { Dependency } from './dependency';
5 | export { DuplicateDependency, VersionSubgraph } from './duplicate-dependency';
6 |
--------------------------------------------------------------------------------
/src/extensions/graph/readme.md:
--------------------------------------------------------------------------------
1 | # component-graph-builder
2 | This is an extension that knows to build a graph of components from a component or a list of components.
3 | It uses the component-resolver extension in order to resolve the component dependencies during the graph building.
4 |
--------------------------------------------------------------------------------
/src/extensions/graphql/graphql-provider/graphql-provider.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ApolloClient from 'apollo-boost';
3 | import { ApolloProvider } from '@apollo/react-hooks';
4 |
5 | export type GraphQLProviderProps = {
6 | client: ApolloClient;
7 | root: JSX.Element;
8 | };
9 |
10 | export function GraphQLProvider({ client, root }: GraphQLProviderProps) {
11 | return {root};
12 | }
13 |
--------------------------------------------------------------------------------
/src/extensions/graphql/graphql-provider/index.ts:
--------------------------------------------------------------------------------
1 | export { GraphQLProvider } from './graphql-provider';
2 |
--------------------------------------------------------------------------------
/src/extensions/graphql/index.ts:
--------------------------------------------------------------------------------
1 | export { GraphQLExtension } from './graphql.extension';
2 |
--------------------------------------------------------------------------------
/src/extensions/insights/core-insights-getter.ts:
--------------------------------------------------------------------------------
1 | import { GraphBuilder } from '../graph';
2 | import FindCycles from './all-insights/find-cycles';
3 | import DuplicateDependencies from './all-insights/duplicate-dependencies';
4 |
5 | export default function getCoreInsights(graphBuilder: GraphBuilder) {
6 | const coreInsights = [new FindCycles(graphBuilder), new DuplicateDependencies(graphBuilder)];
7 | return coreInsights;
8 | }
9 |
--------------------------------------------------------------------------------
/src/extensions/insights/exceptions/insight-already-exists.tsx:
--------------------------------------------------------------------------------
1 | import { PaperError } from '../../cli';
2 |
3 | export default class InsightAlreadyExists extends PaperError {
4 | constructor(readonly insightName: string) {
5 | super(generateMessage(insightName));
6 | }
7 | report() {
8 | return this.message;
9 | }
10 | }
11 | function generateMessage(insightName: string) {
12 | return `Insight ${insightName} already exists`;
13 | }
14 |
--------------------------------------------------------------------------------
/src/extensions/insights/exceptions/insight-not-found.tsx:
--------------------------------------------------------------------------------
1 | import { PaperError } from '../../cli';
2 |
3 | export default class InsightNotFound extends PaperError {
4 | constructor(readonly insightName: string) {
5 | super(generateMessage(insightName));
6 | }
7 | report() {
8 | return this.message;
9 | }
10 | }
11 | function generateMessage(insightName: string) {
12 | return `Insight ${insightName} not found`;
13 | }
14 |
--------------------------------------------------------------------------------
/src/extensions/insights/exceptions/no-data-for-insight.tsx:
--------------------------------------------------------------------------------
1 | import { PaperError } from '../../cli';
2 |
3 | export default class NoDataForInsight extends PaperError {
4 | constructor(readonly insightName: string) {
5 | super(generateMessage(insightName));
6 | }
7 | report() {
8 | return this.message;
9 | }
10 | }
11 | function generateMessage(insightName: string) {
12 | return `No data for ${insightName}`;
13 | }
14 |
--------------------------------------------------------------------------------
/src/extensions/insights/index.ts:
--------------------------------------------------------------------------------
1 | export { default as InsightsExt } from './insights.manifest';
2 | export { InsightManager } from './insight-manager';
3 | export { Insight } from './insight';
4 |
--------------------------------------------------------------------------------
/src/extensions/insights/insights.manifest.ts:
--------------------------------------------------------------------------------
1 | import { ExtensionManifest } from '@teambit/harmony';
2 | import { provide } from './insight.provider';
3 | import { ComponentGraphExt } from '../graph';
4 | import { CLIExtension } from '../cli';
5 |
6 | export default {
7 | name: 'insights',
8 | dependencies: [ComponentGraphExt, CLIExtension],
9 | config: {
10 | silence: false
11 | },
12 | provider: provide
13 | } as ExtensionManifest;
14 |
--------------------------------------------------------------------------------
/src/extensions/isolator/capsule/index.ts:
--------------------------------------------------------------------------------
1 | export { default as Capsule } from './capsule';
2 | export { default as FsContainer } from './container';
3 | export { default as ContainerExec } from './container-exec';
4 |
--------------------------------------------------------------------------------
/src/extensions/isolator/index.ts:
--------------------------------------------------------------------------------
1 | export { IsolatorExtension, Network } from './isolator.extension';
2 | export { FsContainer, Capsule, ContainerExec } from './capsule';
3 |
--------------------------------------------------------------------------------
/src/extensions/jest/index.ts:
--------------------------------------------------------------------------------
1 | export { JestExtension } from './jest.extension';
2 | export { JestTester } from './jest.tester';
3 |
--------------------------------------------------------------------------------
/src/extensions/jest/jest.config.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/src/extensions/jest/jest.config.ts
--------------------------------------------------------------------------------
/src/extensions/jest/jest.extension.ts:
--------------------------------------------------------------------------------
1 | import { JestTester } from './jest.tester';
2 |
3 | export class JestExtension {
4 | static id = '@teambit/jest';
5 | static dependencies = [];
6 |
7 | createTester(jestConfig: any) {
8 | return new JestTester(jestConfig);
9 | }
10 |
11 | static provider() {
12 | return new JestExtension();
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/extensions/logger/index.ts:
--------------------------------------------------------------------------------
1 | export { default as Logger } from './logger';
2 | export { LogPublisher } from '../types';
3 | export { LogEntry } from './logger';
4 | export { LogLevel } from './logger';
5 | export { default as LoggerExt } from './logger.manifest';
6 |
--------------------------------------------------------------------------------
/src/extensions/logger/logger.manifest.ts:
--------------------------------------------------------------------------------
1 | import { provideLogger } from './logger.provider';
2 |
3 | export default {
4 | name: 'Logger',
5 | dependencies: [],
6 | config: {},
7 | provider: provideLogger
8 | };
9 |
--------------------------------------------------------------------------------
/src/extensions/logger/logger.provider.ts:
--------------------------------------------------------------------------------
1 | import Logger from './logger';
2 |
3 | export async function provideLogger() {
4 | return new Logger();
5 | }
6 |
--------------------------------------------------------------------------------
/src/extensions/pkg/exceptions/scope-not-found.tsx:
--------------------------------------------------------------------------------
1 | import { PaperError } from '../../cli';
2 |
3 | export class ScopeNotFound extends PaperError {
4 | constructor(readonly scopePath?: string) {
5 | super(generateMessage(scopePath));
6 | }
7 |
8 | report() {
9 | return this.message;
10 | }
11 | }
12 |
13 | function generateMessage(scopePath?: string) {
14 | if (scopePath) {
15 | return `scope not found at ${scopePath}`;
16 | }
17 | return 'scope not found';
18 | }
19 |
--------------------------------------------------------------------------------
/src/extensions/pkg/index.ts:
--------------------------------------------------------------------------------
1 | export { PkgExtension } from './pkg.extension';
2 |
--------------------------------------------------------------------------------
/src/extensions/react/assets/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | React with Webpack
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/src/extensions/react/browser/browser.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/src/extensions/react/browser/browser.ts
--------------------------------------------------------------------------------
/src/extensions/react/browser/index.ts:
--------------------------------------------------------------------------------
1 | // import { Harmony } from '@teambit/harmony';
2 | // import { Compositions } from '../../compositions';
3 |
4 | // Harmony.load([Compositions], {}, 'composer').run();
5 |
--------------------------------------------------------------------------------
/src/extensions/react/html.js:
--------------------------------------------------------------------------------
1 | module.exports = function html(title, components) {
2 | return ({ htmlWebpackPlugin }) => `
3 |
4 |
5 |
6 |
7 | ${title}
8 |
12 |
13 |
14 |
15 |
16 |
17 | `;
18 | };
19 |
--------------------------------------------------------------------------------
/src/extensions/react/index.ts:
--------------------------------------------------------------------------------
1 | export { React } from './react.extension';
2 |
--------------------------------------------------------------------------------
/src/extensions/react/jest/css-transform.js:
--------------------------------------------------------------------------------
1 | // This is a custom Jest transformer turning style imports into empty objects.
2 | // http://facebook.github.io/jest/docs/en/webpack.html
3 |
4 | module.exports = {
5 | process() {
6 | return 'module.exports = {};';
7 | },
8 | getCacheKey() {
9 | // The output is always the same.
10 | return 'cssTransform';
11 | }
12 | };
13 |
--------------------------------------------------------------------------------
/src/extensions/react/jest/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | require('@testing-library/jest-dom/extend-expect');
6 |
--------------------------------------------------------------------------------
/src/extensions/react/preview/index.tsx:
--------------------------------------------------------------------------------
1 | // import React from 'react';
2 | // import ReactDOM from 'react-dom';
3 | // import { Preview } from './preview';
4 |
5 | // ReactDOM.render(
6 | //
7 | //
8 | // ,
9 | // document.getElementById('root')
10 | // );
11 |
12 | // If you want your app to work offline and load faster, you can change
13 | // unregister() to register() below. Note this comes with some pitfalls.
14 | // Learn more about service workers: https://bit.ly/CRA-PWA
15 | // serviceWorker.unregister();
16 |
--------------------------------------------------------------------------------
/src/extensions/react/preview/preview.tsx:
--------------------------------------------------------------------------------
1 | import React, { Suspense } from 'react';
2 | // import { Component } from '../../composer/component';
3 |
4 | export function Preview() {
5 | // const docsPath = currentComponent().docs;
6 | // if (!docsPath) return no docs found for this component
;
7 | // const Docs = React.lazy(() => import(/* webpackIgnore: true */ docsPath));
8 | // import(`.//${}`)
9 |
10 | return (
11 |
12 |
}>{/* */}
13 |
14 | );
15 | }
16 |
--------------------------------------------------------------------------------
/src/extensions/reporter/get-column-count.ts:
--------------------------------------------------------------------------------
1 | export default function getColumnCount() {
2 | // the number on the right side is arbitrary and is mostly for non terminal environments
3 | return process.stdout.columns || 100;
4 | }
5 |
--------------------------------------------------------------------------------
/src/extensions/reporter/index.ts:
--------------------------------------------------------------------------------
1 | export { default as Reporter } from './reporter';
2 | export { default as Logger } from './logger';
3 | export { default as ReporterExt } from './reporter.manifest';
4 |
--------------------------------------------------------------------------------
/src/extensions/reporter/reporter.manifest.ts:
--------------------------------------------------------------------------------
1 | import { provideReporter } from './reporter.provider';
2 | import { LoggerExt } from '../logger';
3 |
4 | export default {
5 | name: 'Reporter',
6 | dependencies: [LoggerExt],
7 | config: {},
8 | provider: provideReporter
9 | };
10 |
--------------------------------------------------------------------------------
/src/extensions/reporter/reporter.provider.ts:
--------------------------------------------------------------------------------
1 | import Reporter from './reporter';
2 | import { Logger } from '../logger';
3 |
4 | export type ReporterDeps = [Logger];
5 |
6 | export async function provideReporter([logger]: ReporterDeps) {
7 | return new Reporter(logger);
8 | }
9 |
--------------------------------------------------------------------------------
/src/extensions/scope/index.ts:
--------------------------------------------------------------------------------
1 | export { ScopeExtension, OnTag } from './scope.extension';
2 |
--------------------------------------------------------------------------------
/src/extensions/tester/index.ts:
--------------------------------------------------------------------------------
1 | export { TesterExtension } from './tester.extension';
2 | export { Tester, TestResults, TesterContext } from './tester';
3 |
--------------------------------------------------------------------------------
/src/extensions/tester/utils/index.ts:
--------------------------------------------------------------------------------
1 | export { detectTestFiles } from './detect-spec-files';
2 |
--------------------------------------------------------------------------------
/src/extensions/types/index.ts:
--------------------------------------------------------------------------------
1 | export { default as ComponentHost } from './component-host';
2 | export { LogPublisher } from './log-publisher';
3 |
--------------------------------------------------------------------------------
/src/extensions/types/log-publisher.ts:
--------------------------------------------------------------------------------
1 | export type LogPublisher = {
2 | info: (...any) => void;
3 | warn: (...any) => void;
4 | error: (...any) => void;
5 | debug: (...any) => void;
6 | };
7 |
--------------------------------------------------------------------------------
/src/extensions/typescript/index.ts:
--------------------------------------------------------------------------------
1 | export { TypescriptExtension } from './typescript.extension';
2 | export { TypescriptCompiler } from './typescript.compiler';
3 |
--------------------------------------------------------------------------------
/src/extensions/typescript/typescript.extension.ts:
--------------------------------------------------------------------------------
1 | import { TypescriptCompiler } from './typescript.compiler';
2 |
3 | export class TypescriptExtension {
4 | static id = '@teambit/typescript';
5 | static dependencies = [];
6 | createCompiler(tsConfig: Record) {
7 | return new TypescriptCompiler(tsConfig);
8 | }
9 | static provider() {
10 | return new TypescriptExtension();
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/extensions/ui/index.ts:
--------------------------------------------------------------------------------
1 | export { UIExtension } from './ui.extension';
2 |
--------------------------------------------------------------------------------
/src/extensions/ui/ui.cli.rt.tsx:
--------------------------------------------------------------------------------
1 | // import { CLIExtension } from '../cli';
2 | // import { StartCmd } from './start.cmd';
3 | // import { Environments } from '../environments';
4 | // import { Workspace } from '../workspace';
5 | // import { GraphQLExtension } from '../graphql';
6 |
7 | // export default ([cli, envs, workspace, graphql]: [CLIExtension, Environments, Workspace, GraphQLExtension]) => {
8 | // // const ui = new UIExtension(envs, graphql);
9 | // cli.register(new StartCmd(ui, workspace));
10 | // // return ui;
11 | // }
12 |
--------------------------------------------------------------------------------
/src/extensions/ui/ui.runtime.ts:
--------------------------------------------------------------------------------
1 | import harmony from '@teambit/harmony';
2 | import { UIRuntimeExtension } from './ui.ui';
3 | import { DocsUI } from '../docs/docs.ui';
4 |
5 | /**
6 | * configure all core extensions
7 | * :TODO pass all other extensions from above.
8 | */
9 | harmony
10 | .run([UIRuntimeExtension, DocsUI])
11 | .then(() => {
12 | const uiExtension = harmony.get('UIRuntimeExtension');
13 | uiExtension.render();
14 | })
15 | .catch(err => {
16 | throw err;
17 | });
18 |
--------------------------------------------------------------------------------
/src/extensions/ui/webpack/html.js:
--------------------------------------------------------------------------------
1 | module.exports = function html(title) {
2 | return () => `
3 |
4 |
5 |
6 |
7 | ${title}
8 |
12 |
13 |
14 |
15 |
16 |
17 | `;
18 | };
19 |
--------------------------------------------------------------------------------
/src/extensions/utils/load-extensions/constants.ts:
--------------------------------------------------------------------------------
1 | // Warnings
2 | export const UNABLE_TO_LOAD_EXTENSION = (id: string) => `couldn't load extension ${id}, see full error in the log file`;
3 | export const UNABLE_TO_LOAD_EXTENSION_FROM_LIST = (ids: string[]) =>
4 | `couldn't load one of the following extensions ${ids.join(', ')}, see full error in the log file`;
5 |
--------------------------------------------------------------------------------
/src/extensions/utils/load-extensions/index.ts:
--------------------------------------------------------------------------------
1 | export { loadExtensionsByManifests } from './load-extensions-by-manifests';
2 | export { loadResolvedExtensions } from './load-resolved-extensions';
3 |
--------------------------------------------------------------------------------
/src/extensions/utils/resolved-component/index.ts:
--------------------------------------------------------------------------------
1 | export { ResolvedComponent } from './resolved-component';
2 |
--------------------------------------------------------------------------------
/src/extensions/utils/resolved-component/resolved-component.ts:
--------------------------------------------------------------------------------
1 | // TODO: This 2 (component and capsule should be probably an interfaces in the shared types implemented by the actual classes
2 | import { Component } from '../../component';
3 | import { Capsule } from '../../isolator';
4 |
5 | export class ResolvedComponent {
6 | constructor(readonly component: Component, readonly capsule: Capsule) {}
7 |
8 | require() {
9 | // eslint-disable-next-line global-require, import/no-dynamic-require
10 | return require(this.capsule.wrkDir);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/extensions/variants/constants.ts:
--------------------------------------------------------------------------------
1 | export const EXT_NAME = '@teambit/variants';
2 |
--------------------------------------------------------------------------------
/src/extensions/variants/index.ts:
--------------------------------------------------------------------------------
1 | export { Variants } from './variants';
2 | export { Variants as VariantsExt } from './variants.manifest';
3 |
--------------------------------------------------------------------------------
/src/extensions/variants/readme.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gogoyqj/ebit/00fd9d4d8bb4cd597eebac1ca539e20560484f0f/src/extensions/variants/readme.md
--------------------------------------------------------------------------------
/src/extensions/variants/variants.manifest.ts:
--------------------------------------------------------------------------------
1 | import { ExtensionManifest } from '@teambit/harmony';
2 | import { provideVariants } from './variants.provider';
3 | import { EXT_NAME } from './constants';
4 | import { ConfigExt } from '../config';
5 |
6 | export const Variants: ExtensionManifest = {
7 | name: EXT_NAME,
8 | dependencies: [ConfigExt],
9 | provider: provideVariants
10 | };
11 |
--------------------------------------------------------------------------------
/src/extensions/variants/variants.provider.ts:
--------------------------------------------------------------------------------
1 | import { Variants, Patterns } from './variants';
2 | import { Config } from '../config';
3 |
4 | export type VariantsDeps = [Config];
5 |
6 | export async function provideVariants([hostConfig]: VariantsDeps, config: Patterns) {
7 | const variants = new Variants(config, hostConfig);
8 | // TODO: fix when config become maybe
9 | if (hostConfig.type) {
10 | hostConfig.registerGetVariantsConfig(variants.legacy.bind(variants));
11 | hostConfig.registerGetVariantConfig(variants.legacyById.bind(variants));
12 | }
13 | return variants;
14 | }
15 |
--------------------------------------------------------------------------------
/src/extensions/watch/index.ts:
--------------------------------------------------------------------------------
1 | export { default as Watch } from './watch';
2 | export { default as WatchExt } from './watch.extension';
3 |
--------------------------------------------------------------------------------
/src/extensions/watch/watch.extension.ts:
--------------------------------------------------------------------------------
1 | import { WorkspaceExt } from '../workspace';
2 | import { CompileExt } from '../compiler';
3 | import { provideWatch } from './watch.provider';
4 | import { CLIExtension } from '../cli';
5 |
6 | export default {
7 | name: 'Watch',
8 | dependencies: [CLIExtension, CompileExt, WorkspaceExt],
9 | provider: provideWatch
10 | };
11 |
--------------------------------------------------------------------------------
/src/extensions/watch/watch.provider.ts:
--------------------------------------------------------------------------------
1 | import { Workspace } from '../workspace';
2 | // import { BitCli } from '../cli';
3 | import { WatchCommand } from './watch.cmd';
4 | import { Compile } from '../compiler';
5 | import Watch from './watch';
6 | import { CLIExtension } from '../cli';
7 |
8 | export type watchDeps = [CLIExtension, Compile, Workspace];
9 |
10 | export function provideWatch([cli, compile, workspace]: watchDeps) {
11 | const watch = new Watch(compile, workspace);
12 | cli.register(new WatchCommand(watch));
13 | return watch;
14 | }
15 |
--------------------------------------------------------------------------------
/src/extensions/webpack/index.ts:
--------------------------------------------------------------------------------
1 | export { WebpackExtension } from './webpack.extension';
2 |
--------------------------------------------------------------------------------
/src/extensions/webpack/webpack.extension.ts:
--------------------------------------------------------------------------------
1 | export class WebpackExtension {
2 | bundle() {}
3 |
4 | static async provide() {
5 | return new WebpackExtension();
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/extensions/workspace/constants.ts:
--------------------------------------------------------------------------------
1 | export const EXT_NAME = '@teambit/workspace';
2 |
--------------------------------------------------------------------------------
/src/extensions/workspace/index.ts:
--------------------------------------------------------------------------------
1 | // eslint-disable-next-line import/prefer-default-export
2 | export { default as Workspace } from './workspace';
3 | export { default as WorkspaceExt } from './workspace.manifest';
4 | // TODO: change to module path once track the utils folder
5 | export { ResolvedComponent } from '../utils/resolved-component/resolved-component';
6 |
--------------------------------------------------------------------------------
/src/extensions/workspace/ui/index.ts:
--------------------------------------------------------------------------------
1 | export { Workspace } from './workspace';
2 |
--------------------------------------------------------------------------------
/src/extensions/workspace/ui/side-bar/index.ts:
--------------------------------------------------------------------------------
1 | export { SideBar } from './side-bar';
2 |
--------------------------------------------------------------------------------
/src/extensions/workspace/ui/side-bar/side-bar.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export function SideBar({ components }: any) {
4 | return (
5 |
6 | {components.map(component => (
7 | - {component.id}
8 | ))}
9 |
10 | );
11 | }
12 |
--------------------------------------------------------------------------------
/src/extensions/workspace/ui/top-bar/index.ts:
--------------------------------------------------------------------------------
1 | export { TopBar } from './top-bar';
2 |
--------------------------------------------------------------------------------
/src/extensions/workspace/ui/top-bar/top-bar.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { TopBarSlotRegistry } from '../../workspace.ui';
3 |
4 | export type TopBarProps = {
5 | topBarSlot: TopBarSlotRegistry;
6 | };
7 |
8 | export function TopBar({ topBarSlot }: TopBarProps) {
9 | const menuItems = topBarSlot.values();
10 | return (
11 |
12 | {menuItems.map((menuItem, key) => (
13 | - {menuItem.label}
14 | ))}
15 |
16 | );
17 | }
18 |
--------------------------------------------------------------------------------
/src/git-hooks/exceptions/git-hook-already-exists.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class GitHookAlreadyExists extends AbstractError {
4 | hookName: string;
5 |
6 | constructor(hookName: string) {
7 | super();
8 | this.hookName = hookName;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/git-hooks/exceptions/index.ts:
--------------------------------------------------------------------------------
1 | import GitHookAlreadyExists from './git-hook-already-exists';
2 |
3 | export { GitHookAlreadyExists };
4 |
--------------------------------------------------------------------------------
/src/git-hooks/fixtures/bit-import-git-hook.ts:
--------------------------------------------------------------------------------
1 | const content = `#!/bin/sh
2 | bit import
3 | `;
4 |
5 | export default content;
6 |
--------------------------------------------------------------------------------
/src/global-config/index.ts:
--------------------------------------------------------------------------------
1 | import GlobalRemotes from './global-remotes';
2 | import GlobalConfig from './config';
3 |
4 | export { GlobalRemotes, GlobalConfig };
5 |
--------------------------------------------------------------------------------
/src/hooks/exceptions/hook-already-exists.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class HookAlreadyExists extends AbstractError {
4 | hookName: string;
5 |
6 | constructor(hookName: string) {
7 | super();
8 | this.hookName = hookName;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/hooks/exceptions/hook-not-exists.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class HookNotExists extends AbstractError {
4 | hookName: string;
5 |
6 | constructor(hookName: string) {
7 | super();
8 | this.hookName = hookName;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/hooks/exceptions/index.ts:
--------------------------------------------------------------------------------
1 | import HookAlreadyExists from './hook-already-exists';
2 | import HookNotExists from './hook-not-exists';
3 |
4 | export { HookAlreadyExists, HookNotExists };
5 |
--------------------------------------------------------------------------------
/src/hooks/index.ts:
--------------------------------------------------------------------------------
1 | import HooksManager, { HookAction } from './hooks-manager';
2 |
3 | export default HooksManager;
4 | export { HookAction };
5 |
--------------------------------------------------------------------------------
/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './api';
2 |
--------------------------------------------------------------------------------
/src/interactive/commands/index.ts:
--------------------------------------------------------------------------------
1 | export { default as initInteractive } from './init-interactive';
2 |
--------------------------------------------------------------------------------
/src/interactive/index.ts:
--------------------------------------------------------------------------------
1 | import initInteractive from './commands/init-interactive';
2 |
3 | export { initInteractive };
4 |
--------------------------------------------------------------------------------
/src/jsdoc/index.ts:
--------------------------------------------------------------------------------
1 | import parser from './parser';
2 | import formatter from './formater';
3 |
4 | export { parser, formatter };
5 |
--------------------------------------------------------------------------------
/src/jsdoc/jsdoc/index.ts:
--------------------------------------------------------------------------------
1 | import parse from './jsdoc-parser';
2 |
3 | export default parse;
4 |
--------------------------------------------------------------------------------
/src/jsdoc/react/index.ts:
--------------------------------------------------------------------------------
1 | import parse from './react-parser';
2 |
3 | export default parse;
4 |
--------------------------------------------------------------------------------
/src/jsdoc/vue/index.ts:
--------------------------------------------------------------------------------
1 | import parse from './vue-parser';
2 |
3 | export default parse;
4 |
--------------------------------------------------------------------------------
/src/legacy-extensions/exceptions/extension-file-not-found.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class ExtensionFileNotFound extends AbstractError {
4 | path: string;
5 |
6 | constructor(path: string) {
7 | super();
8 | this.path = path;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/legacy-extensions/exceptions/extension-get-dynamic-config-error.ts:
--------------------------------------------------------------------------------
1 | import ExternalError from '../../error/external-error';
2 |
3 | export default class ExtensionGetDynamicConfigError extends ExternalError {
4 | compName: string;
5 |
6 | constructor(originalError: Error, compName: string) {
7 | super(originalError);
8 | this.compName = compName;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/legacy-extensions/exceptions/extension-get-dynamic-packages-error.ts:
--------------------------------------------------------------------------------
1 | import ExternalError from '../../error/external-error';
2 |
3 | export default class ExtensionGetDynamicPackagesError extends ExternalError {
4 | compName: string;
5 |
6 | constructor(originalError: Error, compName: string) {
7 | super(originalError);
8 | this.compName = compName;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/legacy-extensions/exceptions/extension-init-error.ts:
--------------------------------------------------------------------------------
1 | import ExternalError from '../../error/external-error';
2 |
3 | export default class ExtensionInitError extends ExternalError {
4 | compName: string;
5 |
6 | constructor(originalError: Error, compName: string) {
7 | super(originalError);
8 | this.compName = compName;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/legacy-extensions/exceptions/extension-load-error.ts:
--------------------------------------------------------------------------------
1 | import ExternalError from '../../error/external-error';
2 |
3 | export default class ExtensionLoadError extends ExternalError {
4 | compName: string;
5 | printStack: boolean;
6 |
7 | constructor(originalError: Error, compName: string, printStack = true) {
8 | super(originalError);
9 | this.compName = compName;
10 | this.printStack = printStack;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/legacy-extensions/exceptions/extension-name-not-valid.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class ExtensionNameNotValid extends AbstractError {
4 | name: string;
5 |
6 | constructor(name: string) {
7 | super();
8 | this.name = name;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/legacy-extensions/exceptions/extension-schema-error.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class ExtensionSchemaError extends AbstractError {
4 | errors: string;
5 | extensionName: string;
6 |
7 | constructor(extensionName: string, errors: string) {
8 | super();
9 | this.extensionName = extensionName;
10 | this.errors = errors;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/links/index.ts:
--------------------------------------------------------------------------------
1 | import NodeModuleLinker from './node-modules-linker';
2 | import { linkAllToNodeModules, getLinksInDistToWrite, getAllComponentsLinks, reLinkDependents } from './linker';
3 | import LinkFile from './link-file';
4 |
5 | export {
6 | NodeModuleLinker,
7 | linkAllToNodeModules,
8 | getLinksInDistToWrite,
9 | getAllComponentsLinks,
10 | reLinkDependents,
11 | LinkFile
12 | };
13 |
--------------------------------------------------------------------------------
/src/npm-client/index.ts:
--------------------------------------------------------------------------------
1 | import npmClient from './npm-client';
2 |
3 | export default npmClient;
4 |
--------------------------------------------------------------------------------
/src/plugins/file-types-plugins.ts:
--------------------------------------------------------------------------------
1 | import * as stylable from './wix/stylable';
2 |
3 | export type FileTypePlugin = {
4 | pluginType: string;
5 | getExtension: Function;
6 | getTemplate: Function;
7 | detective: Function;
8 | };
9 |
10 | // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
11 | const fileTypesPlugins: FileTypePlugin[] = [stylable];
12 |
13 | export default fileTypesPlugins;
14 |
--------------------------------------------------------------------------------
/src/prompts/exceptions/index.ts:
--------------------------------------------------------------------------------
1 | export { default as PromptCanceled } from './prompt-canceled';
2 |
--------------------------------------------------------------------------------
/src/prompts/exceptions/prompt-canceled.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class PromptCanceled extends AbstractError {}
4 |
--------------------------------------------------------------------------------
/src/prompts/schemas/passphrase.ts:
--------------------------------------------------------------------------------
1 | import identityFile from '../../utils/ssh/identity-file';
2 |
3 | /**
4 | * // TODO: FIX if this function is used. identityFile() is now async.
5 | * schema for passphrase prompt on SSH.
6 | */
7 | export default {
8 | properties: {
9 | passphrase: {
10 | hidden: true,
11 | required: true,
12 | description: `enter passphrase for key '${identityFile()}'`
13 | }
14 | }
15 | };
16 |
--------------------------------------------------------------------------------
/src/prompts/schemas/user-password.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * schema for passphrase prompt on SSH.
3 | */
4 | export default {
5 | properties: {
6 | username: {
7 | required: true
8 | },
9 | password: {
10 | hidden: true,
11 | required: true
12 | }
13 | }
14 | };
15 |
--------------------------------------------------------------------------------
/src/registry/exceptions/index.ts:
--------------------------------------------------------------------------------
1 | // @flow
2 | import PathToNpmrcNotExist from './path-to-npmrc-not-exist';
3 | import WriteToNpmrcError from './write-to-npmrc-error';
4 |
5 | export { PathToNpmrcNotExist, WriteToNpmrcError };
6 |
--------------------------------------------------------------------------------
/src/registry/exceptions/path-to-npmrc-not-exist.ts:
--------------------------------------------------------------------------------
1 | /** @flow */
2 | export default class PathsNotExist extends Error {
3 | path: string;
4 | constructor(path: string) {
5 | super();
6 | this.path = path;
7 | // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
8 | this.code = 'PathNotExist';
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/registry/exceptions/write-to-npmrc-error.ts:
--------------------------------------------------------------------------------
1 | /** @flow */
2 | export default class WriteToNpmrcError extends Error {
3 | path: string;
4 | constructor(path: string) {
5 | super();
6 | this.path = path;
7 | // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
8 | this.code = 'WriteError';
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/registry/index.ts:
--------------------------------------------------------------------------------
1 | /** @flow */
2 | import npmLogin from './registry';
3 | // eslint-disable-next-line import/prefer-default-export
4 | export { npmLogin };
5 |
--------------------------------------------------------------------------------
/src/remotes/exceptions/index.ts:
--------------------------------------------------------------------------------
1 | import PrimaryNotFound from './primary-not-found';
2 | import PrimaryOverloaded from './primary-overloaded';
3 | import InvalidRemote from './invalid-remote';
4 | import RemoteNotFound from './remote-not-found';
5 |
6 | export { PrimaryNotFound, PrimaryOverloaded, InvalidRemote, RemoteNotFound };
7 |
--------------------------------------------------------------------------------
/src/remotes/exceptions/invalid-remote.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class InvalidRemote extends AbstractError {}
4 |
--------------------------------------------------------------------------------
/src/remotes/exceptions/primary-not-found.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class PrimaryNotFound extends AbstractError {}
4 |
--------------------------------------------------------------------------------
/src/remotes/exceptions/primary-overloaded.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class PrimaryOverloaded extends AbstractError {}
4 |
--------------------------------------------------------------------------------
/src/remotes/exceptions/remote-not-found.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class RemoteNotFound extends AbstractError {
4 | constructor(name) {
5 | super();
6 | this.name = name;
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/remotes/get-remote-by-name.ts:
--------------------------------------------------------------------------------
1 | import { Consumer } from '../consumer';
2 | import { Remotes } from '.';
3 | import { getScopeRemotes } from '../scope/scope-remotes';
4 |
5 | export default async function getRemoteByName(remoteName: string, consumer?: Consumer) {
6 | if (consumer) {
7 | const remotes: Remotes = await getScopeRemotes(consumer.scope);
8 | return remotes.resolve(remoteName, consumer.scope);
9 | }
10 | return Remotes.getScopeRemote(remoteName);
11 | }
12 |
--------------------------------------------------------------------------------
/src/remotes/index.ts:
--------------------------------------------------------------------------------
1 | import Remotes from './remotes';
2 | import Remote from './remote';
3 |
4 | export { Remote, Remotes };
5 |
--------------------------------------------------------------------------------
/src/scope/ci-ops/ci-worker.ts:
--------------------------------------------------------------------------------
1 | // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
2 | import runAndUpdateCI from './run-and-update-ci';
3 |
4 | const scopePath = process.env.__scope__;
5 | const id = process.env.__id__;
6 |
7 | if (!id) {
8 | throw new Error('id for ci-worker must be provided');
9 | }
10 |
11 | runAndUpdateCI({ id, scopePath })
12 | .then(() => null)
13 | .catch(er => process.stderr.write(er));
14 |
--------------------------------------------------------------------------------
/src/scope/ci-ops/index.ts:
--------------------------------------------------------------------------------
1 | import ciOps from './ci-ops';
2 |
3 | export default ciOps;
4 |
--------------------------------------------------------------------------------
/src/scope/component-ops/auto-tag.spec.ts:
--------------------------------------------------------------------------------
1 | import { expect } from 'chai';
2 | import { getAutoTagPending } from './auto-tag';
3 |
4 | describe('AutoTag', () => {
5 | describe('getAutoTagPending', () => {
6 | it('should return an empty array when there are no components in the scope', async () => {
7 | const scope = { getComponentsAndVersions: () => Promise.resolve([]) };
8 | // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
9 | const test = await getAutoTagPending(scope, [], []);
10 | expect(test).to.be.an('array').and.empty;
11 | });
12 | });
13 | });
14 |
--------------------------------------------------------------------------------
/src/scope/exceptions/bit-not-in-scope.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class BitNotInScope extends AbstractError {}
4 |
--------------------------------------------------------------------------------
/src/scope/exceptions/component-not-found.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class ComponentNotFound extends AbstractError {
4 | id: string;
5 | dependentId: string | null | undefined;
6 | code: number;
7 |
8 | constructor(id: string, dependentId?: string) {
9 | super();
10 | this.code = 127;
11 | this.id = id;
12 | this.dependentId = dependentId;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/scope/exceptions/corrupted-component.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class CorruptedComponent extends AbstractError {
4 | id: string;
5 | version: string;
6 | showDoctorMessage: boolean;
7 |
8 | constructor(id: string, version: string) {
9 | super();
10 | this.id = id;
11 | this.version = version;
12 | this.showDoctorMessage = true;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/scope/exceptions/cyclic-dependencie.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class CyclicDependencies extends AbstractError {
4 | msg: string;
5 | constructor(msg: string) {
6 | super();
7 | this.msg = msg;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/scope/exceptions/dependency-not-found.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class DependencyNotFound extends AbstractError {
4 | id: string;
5 | code: number;
6 | // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
7 | bitJsonPath: string;
8 |
9 | constructor(id: string) {
10 | super();
11 | this.code = 127;
12 | this.id = id;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/scope/exceptions/hash-mismatch.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class HashMismatch extends AbstractError {
4 | id: string;
5 | version: string;
6 | originalHash: string;
7 | currentHash: string;
8 | showDoctorMessage: boolean;
9 |
10 | constructor(id: string, version: string, originalHash: string, currentHash: string) {
11 | super();
12 | this.id = id;
13 | this.version = version;
14 | this.originalHash = originalHash;
15 | this.currentHash = currentHash;
16 | this.showDoctorMessage = true;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/scope/exceptions/hash-not-found.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class HashNotFound extends AbstractError {
4 | hash: string;
5 | showDoctorMessage: boolean;
6 |
7 | constructor(hash: string) {
8 | super();
9 | this.hash = hash;
10 | this.showDoctorMessage = true;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/scope/exceptions/invalid-index-json.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class InvalidIndexJson extends AbstractError {
4 | path: string;
5 | showDoctorMessage: boolean;
6 |
7 | constructor(path: string, message: string) {
8 | super();
9 | this.path = path;
10 | this.message = message;
11 | this.showDoctorMessage = true;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/scope/exceptions/merge-conflict-on-remote.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class MergeConflictOnRemote extends AbstractError {
4 | code: number;
5 | idsAndVersions: Array<{ id: string; versions: string[] }>;
6 |
7 | constructor(idsAndVersions: Array<{ id: string; versions: string[] }>) {
8 | super();
9 | this.code = 131;
10 | this.idsAndVersions = idsAndVersions;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/scope/exceptions/merge-conflict.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class MergeConflict extends AbstractError {
4 | id: string;
5 | versions: string[];
6 |
7 | constructor(id: string, versions: string[]) {
8 | super();
9 | this.id = id;
10 | this.versions = versions;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/scope/exceptions/outdated-index-json.ts:
--------------------------------------------------------------------------------
1 | export default class OutdatedIndexJson extends Error {
2 | componentId: string;
3 | indexJsonPath: string;
4 | showDoctorMessage: boolean;
5 |
6 | constructor(componentId: string, indexJsonPath: string) {
7 | super();
8 | this.componentId = componentId;
9 | this.indexJsonPath = indexJsonPath;
10 | this.showDoctorMessage = true;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/scope/exceptions/resolution-exception.ts:
--------------------------------------------------------------------------------
1 | import ExternalError from '../../error/external-error';
2 |
3 | export default class ResolutionException extends ExternalError {
4 | filePath: string;
5 | showDoctorMessage: boolean;
6 | constructor(originalError: Error, filePath: string) {
7 | super(originalError);
8 | this.filePath = filePath;
9 | this.showDoctorMessage = true;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/scope/exceptions/scope-already-exists.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class ScopeAlreadyExists extends AbstractError {}
4 |
--------------------------------------------------------------------------------
/src/scope/exceptions/scope-json-not-found.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class ScopeJsonNotFound extends AbstractError {
4 | path: string;
5 | showDoctorMessage: boolean;
6 |
7 | constructor(path: string) {
8 | super();
9 | this.path = path;
10 | this.showDoctorMessage = true;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/scope/exceptions/scope-not-found.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class ScopeNotFound extends AbstractError {
4 | scopePath: string;
5 | constructor(scopePath: string) {
6 | super();
7 | this.scopePath = scopePath;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/scope/exceptions/source-not-found.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class SourceNotFound extends AbstractError {}
4 |
--------------------------------------------------------------------------------
/src/scope/exceptions/version-already-exists.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class VersionAlreadyExists extends AbstractError {
4 | version: string;
5 | componentId: string;
6 | showDoctorMessage: boolean;
7 |
8 | constructor(version: string, componentId: string) {
9 | super();
10 | this.version = version;
11 | this.componentId = componentId;
12 | this.showDoctorMessage = true;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/scope/exceptions/version-invalid.ts:
--------------------------------------------------------------------------------
1 | import ValidationError from '../../error/validation-error';
2 |
3 | export default class VersionInvalid extends ValidationError {}
4 |
--------------------------------------------------------------------------------
/src/scope/exceptions/version-not-found.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class VersionNotFound extends AbstractError {
4 | version: string;
5 | constructor(version: string) {
6 | super();
7 | this.version = version;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/scope/index.ts:
--------------------------------------------------------------------------------
1 | import loadScope from './scope-loader';
2 | import Scope from './scope';
3 | import ComponentWithDependencies from './component-dependencies';
4 |
5 | export { loadScope, Scope, ComponentWithDependencies };
6 |
--------------------------------------------------------------------------------
/src/scope/migrations/component/index.ts:
--------------------------------------------------------------------------------
1 | import changeVersionToSemVerDeclartaion from './to-semver-migration';
2 | import updateBindingPrefixToNewDefault from './update-binding-prefix-to-new-default';
3 |
4 | export { changeVersionToSemVerDeclartaion, updateBindingPrefixToNewDefault };
5 |
--------------------------------------------------------------------------------
/src/scope/models/index.ts:
--------------------------------------------------------------------------------
1 | import ModelComponent from './model-component';
2 | import ScopeMeta from './scopeMeta';
3 | import Source from './source';
4 | import Version from './version';
5 | import Symlink from './symlink';
6 |
7 | export { ModelComponent, ScopeMeta, Source, Version, Symlink };
8 |
--------------------------------------------------------------------------------
/src/scope/network/exceptions/authentication-failed.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class AuthenticationFailed extends AbstractError {
4 | debugInfo: string;
5 | showDoctorMessage: boolean;
6 |
7 | constructor(debugInfo: string) {
8 | super();
9 | this.debugInfo = debugInfo;
10 | this.showDoctorMessage = true;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/scope/network/exceptions/export-another-owner-private.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class ExportAnotherOwnerPrivate extends AbstractError {
4 | message: string;
5 | sourceScope: string;
6 | destinationScope: string;
7 | constructor(message: string, sourceScope: string, destinationScope: string) {
8 | super();
9 | this.message = message;
10 | this.sourceScope = sourceScope;
11 | this.destinationScope = destinationScope;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/scope/network/exceptions/fs-scope-not-loaded.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class FsScopeNotLoaded extends AbstractError {}
4 |
--------------------------------------------------------------------------------
/src/scope/network/exceptions/network-error.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class NetworkError extends AbstractError {
4 | remoteErr: string;
5 | showDoctorMessage: boolean;
6 |
7 | constructor(remoteErr: string) {
8 | super();
9 | this.remoteErr = remoteErr;
10 | this.showDoctorMessage = true;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/scope/network/exceptions/old-client-version.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class OldClientVersion extends AbstractError {
4 | message: string;
5 | code: number;
6 |
7 | constructor(message: string) {
8 | super();
9 | this.code = 133;
10 | this.message = message;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/scope/network/exceptions/permission-denied.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class PermissionDenied extends AbstractError {
4 | scope: string;
5 |
6 | constructor(scope: string) {
7 | super();
8 | this.scope = scope;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/scope/network/exceptions/protocol-not-supported.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class ProtocolNotSupported extends AbstractError {}
4 |
--------------------------------------------------------------------------------
/src/scope/network/exceptions/remote-resolver-error.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class RemoteResolverError extends AbstractError {
4 | message: string;
5 | showDoctorMessage: boolean;
6 |
7 | constructor(message: string) {
8 | super();
9 | this.message = message;
10 | this.showDoctorMessage = true;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/scope/network/exceptions/remote-scope-not-found.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class RemoteScopeNotFound extends AbstractError {
4 | name: string;
5 | code: number;
6 |
7 | constructor(name: string) {
8 | super();
9 | this.code = 129;
10 | this.name = name;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/scope/network/exceptions/ssh-connection-error.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class SSHConnectionError extends AbstractError {}
4 |
--------------------------------------------------------------------------------
/src/scope/network/exceptions/ssh-invalid-response.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class SSHInvalidResponse extends AbstractError {
4 | response: string;
5 | showDoctorMessage: boolean;
6 |
7 | constructor(response: string) {
8 | super();
9 | this.response = response;
10 | this.showDoctorMessage = true;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/scope/network/exceptions/unexpected-network-error.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class UnexpectedNetworkError extends AbstractError {
4 | message: string;
5 | showDoctorMessage: boolean;
6 |
7 | constructor(message: string) {
8 | super();
9 | this.message = message;
10 | this.showDoctorMessage = true;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/scope/network/fs/index.ts:
--------------------------------------------------------------------------------
1 | import Fs from './fs';
2 |
3 | export default Fs;
4 |
--------------------------------------------------------------------------------
/src/scope/network/index.ts:
--------------------------------------------------------------------------------
1 | import SSH from './ssh';
2 | import connect from './network-lib';
3 |
4 | export { SSH, connect };
5 |
--------------------------------------------------------------------------------
/src/scope/network/ssh/index.ts:
--------------------------------------------------------------------------------
1 | import SSH from './ssh';
2 |
3 | export default SSH;
4 |
--------------------------------------------------------------------------------
/src/scope/object-registrar.ts:
--------------------------------------------------------------------------------
1 | import { Source, ModelComponent, Version, ScopeMeta, Symlink } from './models';
2 |
3 | export default function types() {
4 | return [Source, ModelComponent, Version, ScopeMeta, Symlink];
5 | }
6 |
7 | function typesToObject(typesArr: Function[]) {
8 | return typesArr.reduce((map, objectType) => {
9 | map[objectType.name] = objectType;
10 | return map;
11 | }, {});
12 | }
13 |
14 | const typesObj = typesToObject(types());
15 |
16 | export { typesObj, typesToObject };
17 |
--------------------------------------------------------------------------------
/src/scope/objects/index.ts:
--------------------------------------------------------------------------------
1 | import BitObject from './object';
2 | import BitRawObject from './raw-object';
3 | import Repository from './repository';
4 | import Ref from './ref';
5 |
6 | export { BitObject, BitRawObject, Ref, Repository };
7 |
--------------------------------------------------------------------------------
/src/scope/repositories/hooks.ts:
--------------------------------------------------------------------------------
1 | export default class Hooks {
2 | getPath() {}
3 | }
4 |
--------------------------------------------------------------------------------
/src/scope/repositories/index.ts:
--------------------------------------------------------------------------------
1 | import Tmp from './tmp';
2 | import SourceRepository from './sources';
3 |
4 | export { Tmp, SourceRepository };
5 |
--------------------------------------------------------------------------------
/src/scope/repository.ts:
--------------------------------------------------------------------------------
1 | import fs from 'fs-extra';
2 | import Scope from './scope';
3 |
4 | export default class Repository {
5 | scope: Scope;
6 | // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
7 | path: string;
8 |
9 | constructor(scope: Scope) {
10 | this.scope = scope;
11 | }
12 |
13 | getPath() {
14 | return this.scope.getPath();
15 | }
16 |
17 | ensureDir() {
18 | return fs.ensureDir(this.getPath());
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/scope/types.ts:
--------------------------------------------------------------------------------
1 | export interface PersistOptions {
2 | message?: string;
3 | version?: string;
4 | force?: boolean;
5 | }
6 |
7 | export interface ComponentToPersist {
8 | // TODO: change to real component instance
9 | component: any;
10 | persistOptions: PersistOptions;
11 | }
12 |
13 | export interface PersistComponentsGeneralOptions {
14 | verbose?: boolean;
15 | }
16 |
--------------------------------------------------------------------------------
/src/search/index.ts:
--------------------------------------------------------------------------------
1 | // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
2 | import indexer from './indexer';
3 | // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
4 | import searcher from './searcher';
5 | // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
6 | import searchAdapter from './search-adapter';
7 |
8 | export { indexer, searcher, searchAdapter };
9 |
--------------------------------------------------------------------------------
/src/specs-runner/index.ts:
--------------------------------------------------------------------------------
1 | import specsRunner from './specs-runner';
2 |
3 | export default specsRunner;
4 |
--------------------------------------------------------------------------------
/src/utils/abortable-promise/abortable-promise.ts:
--------------------------------------------------------------------------------
1 | import { MissingAbortFn } from './exceptions';
2 |
3 | export default class AbortablePromise extends Promise {
4 | constructor(
5 | promiseFn: (resolve: (data: any) => void, reject: (err: Error) => void) => void,
6 | private abortFn?: () => void
7 | ) {
8 | super(promiseFn);
9 | }
10 |
11 | abort() {
12 | if (this.abortFn) return this.abortFn();
13 | throw new MissingAbortFn();
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/utils/abortable-promise/exceptions/index.ts:
--------------------------------------------------------------------------------
1 | // eslint-disable-next-line import/prefer-default-export
2 | export { default as MissingAbortFn } from './missing-abort-fn';
3 |
--------------------------------------------------------------------------------
/src/utils/abortable-promise/exceptions/missing-abort-fn.ts:
--------------------------------------------------------------------------------
1 | export default class MissingAbortFn extends Error {}
2 |
--------------------------------------------------------------------------------
/src/utils/abortable-promise/index.ts:
--------------------------------------------------------------------------------
1 | export { default } from './abortable-promise';
2 |
--------------------------------------------------------------------------------
/src/utils/array/filter-async.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Array.filter is synchronous and therefore does not support Promises.
3 | * This one works with promises.
4 | * Taken from https://stackoverflow.com/questions/33355528/filtering-an-array-with-a-function-that-returns-a-promise
5 | */
6 | export default function filterAsync(array: any[], filter): any[] {
7 | // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
8 | return Promise.all(array.map(entry => filter(entry))).then(results => array.filter(() => results.shift()));
9 | }
10 |
--------------------------------------------------------------------------------
/src/utils/array/first.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * returns the first element of an array.
3 | * @name first
4 | * @param {[]} array
5 | * @returns {[]} the first element of given array
6 | * @example
7 | * ```js
8 | * first([1,2,3]) // => 1
9 | * first([]) // => null
10 | * ```
11 | */
12 | export default function first(array: any[]): any | null | undefined {
13 | if (array && array[0]) return array[0];
14 | return null;
15 | }
16 |
--------------------------------------------------------------------------------
/src/utils/array/flatten.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * flatten arrays to a single dimension.
3 | * @name flatten
4 | * @param {[[*]]} arrays
5 | * @returns [*] a flatten array
6 | * @example
7 | * ```js
8 | * flatten([[1], [2], [3]]) // => [1, 2, 3]
9 | * ```
10 | */
11 | export default function flatten(arrays: Array): Array {
12 | const concat = [].concat;
13 | return concat.apply([], arrays);
14 | }
15 |
--------------------------------------------------------------------------------
/src/utils/bit/npm-registry-name.ts:
--------------------------------------------------------------------------------
1 | import { CFG_REGISTRY_DOMAIN_PREFIX, DEFAULT_REGISTRY_DOMAIN_PREFIX } from '../../constants';
2 | import { getSync } from '../../api/consumer/lib/global-config';
3 |
4 | export default function npmRegistryName(): string {
5 | return getSync(CFG_REGISTRY_DOMAIN_PREFIX) || DEFAULT_REGISTRY_DOMAIN_PREFIX;
6 | }
7 |
--------------------------------------------------------------------------------
/src/utils/buffer/to-read-stream.ts:
--------------------------------------------------------------------------------
1 | import * as stream from 'stream';
2 |
3 | /**
4 | * cast a buffer to a read stream
5 | */
6 | export default function bufferToReadStream(buffer: Buffer) {
7 | const s = new stream.PassThrough();
8 | s.end(buffer);
9 | return s;
10 | }
11 |
--------------------------------------------------------------------------------
/src/utils/build-command-message.ts:
--------------------------------------------------------------------------------
1 | import { BIT_VERSION } from '../constants';
2 |
3 | module.exports = function buildCommandMessage(payload, context, compress = true) {
4 | return {
5 | payload,
6 | headers: {
7 | version: BIT_VERSION,
8 | compressed: compress,
9 | context
10 | }
11 | };
12 | };
13 |
--------------------------------------------------------------------------------
/src/utils/child_process.ts:
--------------------------------------------------------------------------------
1 | export function pipeOutput(childProcess) {
2 | const { stdout, stderr } = childProcess;
3 | if (stdout) {
4 | stdout.pipe(process.stdout);
5 | }
6 | if (stderr) {
7 | stderr.pipe(process.stderr);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/utils/encryption/sha1.ts:
--------------------------------------------------------------------------------
1 | import * as crypto from 'crypto';
2 |
3 | /**
4 | * encrypt `data` buffer or string into a sha1 hash
5 | * @example
6 | * ```js
7 | * sha1('foo bar') // => '3773dea65156909838fa6c22825cafe090ff8030'
8 | * ```
9 | */
10 | export default function sha1(data: string | Buffer, encoding: crypto.HexBase64Latin1Encoding = 'hex'): string {
11 | return crypto
12 | .createHash('sha1')
13 | .update(data)
14 | .digest(encoding);
15 | }
16 |
--------------------------------------------------------------------------------
/src/utils/filter-object.ts:
--------------------------------------------------------------------------------
1 | import forEach from './object/foreach';
2 |
3 | export default function filterObject(obj: Record, fn: (val: any, key: any) => boolean): any {
4 | const newObj = {};
5 | forEach(obj, (val, key) => {
6 | if (fn(val, key)) newObj[key] = val;
7 | });
8 | return newObj;
9 | }
10 |
--------------------------------------------------------------------------------
/src/utils/fs-output-json-sync.ts:
--------------------------------------------------------------------------------
1 | import fs from 'fs-extra';
2 |
3 | export default function outputJsonFile(file: string, data: Record): void {
4 | try {
5 | fs.ensureFileSync(file);
6 | return fs.outputJsonSync(file, data);
7 | } catch (e) {
8 | console.error(`failed to write output to file:${e}`); // eslint-disable-line no-console
9 | }
10 | // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
11 | return file;
12 | }
13 |
--------------------------------------------------------------------------------
/src/utils/fs-rmdir.ts:
--------------------------------------------------------------------------------
1 | import fs from 'fs-extra';
2 | import * as pathlib from 'path';
3 |
4 | export default function rmDir(path: string) {
5 | if (fs.existsSync(path)) {
6 | fs.readdirSync(path).forEach(file => {
7 | const curPath = pathlib.join(path, file);
8 | if (fs.lstatSync(curPath).isDirectory()) {
9 | rmDir(curPath);
10 | } else {
11 | fs.unlinkSync(curPath);
12 | }
13 | });
14 | fs.rmdirSync(path);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/utils/fs/current-dir-name.ts:
--------------------------------------------------------------------------------
1 | import * as path from 'path';
2 |
3 | /**
4 | * get the current working dir name.
5 | * @name currentDirName
6 | * @returns {string} current working dir name
7 | * @example
8 | * ```js
9 | * currentDirName() // => 'bit'
10 | * ```
11 | */
12 | export default function currentDirName(): string {
13 | const currentDir = process.cwd();
14 | return path.basename(currentDir);
15 | }
16 |
--------------------------------------------------------------------------------
/src/utils/fs/dir-path-parser.ts:
--------------------------------------------------------------------------------
1 | import * as path from 'path';
2 |
3 | /**
4 | * parse given dir path
5 | * @param {*} dirPath
6 | */
7 | export default function parseDirPath(dirPath: string) {
8 | return path.parse(dirPath).dir.split(path.delimiter);
9 | }
10 |
--------------------------------------------------------------------------------
/src/utils/fs/fs-no-ext.ts:
--------------------------------------------------------------------------------
1 | import getExt from './get-ext';
2 |
3 | export default function getWithoutExt(filename: string): string {
4 | const ext = getExt(filename);
5 | // There is no extension just return the file name
6 | if (ext === filename) {
7 | return filename;
8 | }
9 | return filename.substring(0, filename.length - ext.length - 1); // -1 to remove the '.'
10 | }
11 |
--------------------------------------------------------------------------------
/src/utils/fs/is-dir-empty.ts:
--------------------------------------------------------------------------------
1 | import readDirIgnoreDsStore from './read-dir-ignore-ds-store';
2 |
3 | export default (async function isDirEmpty(dirPath: string): Promise {
4 | const files = await readDirIgnoreDsStore(dirPath);
5 | return !files.length;
6 | });
7 |
--------------------------------------------------------------------------------
/src/utils/fs/read-dir-ignore-ds-store.ts:
--------------------------------------------------------------------------------
1 | import fs from 'fs-extra';
2 |
3 | export default (async function readDirIgnoreDsStore(dirPath: string): Promise {
4 | const files = await fs.readdir(dirPath);
5 | return files.filter(file => file !== '.DS_Store');
6 | });
7 |
8 | export function readDirSyncIgnoreDsStore(dirPath: string): string[] {
9 | const files = fs.readdirSync(dirPath);
10 | return files.filter(file => file !== '.DS_Store');
11 | }
12 |
--------------------------------------------------------------------------------
/src/utils/fs/remove-containing-dir-if-empty.ts:
--------------------------------------------------------------------------------
1 | import * as path from 'path';
2 | import removeEmptyDir from './remove-empty-dir';
3 |
4 | export default (async function removeContainingDirIfEmpty(componentDir: string): Promise {
5 | const containingDir = path.dirname(componentDir);
6 | return removeEmptyDir(containingDir);
7 | });
8 |
--------------------------------------------------------------------------------
/src/utils/fs/remove-empty-dir.ts:
--------------------------------------------------------------------------------
1 | import fs from 'fs-extra';
2 | import isDirEmpty from './is-dir-empty';
3 | import logger from '../../logger/logger';
4 |
5 | export default (async function removeEmptyDir(dirPath: string): Promise {
6 | const isExist = await fs.pathExists(dirPath);
7 | if (!isExist) {
8 | return false;
9 | }
10 | const isEmpty = await isDirEmpty(dirPath);
11 | if (isEmpty) {
12 | logger.info(`remove-empty-dir, deleting ${dirPath}`);
13 | await fs.remove(dirPath);
14 | return true;
15 | }
16 | return false;
17 | });
18 |
--------------------------------------------------------------------------------
/src/utils/git/exceptions/git-not-found.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../../error/abstract-error';
2 |
3 | export default class GitNotFound extends AbstractError {
4 | gitExecutablePath: string;
5 | err: Error;
6 | showDoctorMessage: boolean;
7 | constructor(gitExecutablePath: string, err: Error) {
8 | super();
9 | this.gitExecutablePath = gitExecutablePath;
10 | this.err = err;
11 | this.showDoctorMessage = true;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/utils/git/git-executable.ts:
--------------------------------------------------------------------------------
1 | import { getSync } from '../../api/consumer/lib/global-config';
2 | import { CFG_GIT_EXECUTABLE_PATH } from '../../constants';
3 |
4 | export default function getGitExecutablePath() {
5 | const executablePath = getSync(CFG_GIT_EXECUTABLE_PATH);
6 | return executablePath || 'git';
7 | }
8 |
--------------------------------------------------------------------------------
/src/utils/glob.ts:
--------------------------------------------------------------------------------
1 | const globlib = require('glob');
2 | const path = require('path');
3 |
4 | export default function glob(pattern: string, options?: {}): Promise {
5 | return new Promise((resolve, reject) => {
6 | globlib(pattern, options, (err, matches) => {
7 | if (err) return reject(err);
8 | return resolve(matches.map(match => path.normalize(match)));
9 | });
10 | });
11 | }
12 |
--------------------------------------------------------------------------------
/src/utils/immutable-unshift.ts:
--------------------------------------------------------------------------------
1 | export default function immutableUnshift(arr: Array, newEntry: any): Array {
2 | return [newEntry, ...arr];
3 | }
4 |
--------------------------------------------------------------------------------
/src/utils/is-bit-url.ts:
--------------------------------------------------------------------------------
1 | export default function isBitUrl(url: string) {
2 | const regex = new RegExp('((bit|ssh|http(s)?)|(bit@[w.]+))(:(//)?)([w.@:/-~]+)(.bit)(/)?');
3 | return regex.test(url);
4 | }
5 |
--------------------------------------------------------------------------------
/src/utils/is-dir-empty-sync.ts:
--------------------------------------------------------------------------------
1 | import { readDirSyncIgnoreDsStore } from './fs/read-dir-ignore-ds-store';
2 |
3 | export default function isDirEmptySync(dirPath: string): boolean {
4 | return !readDirSyncIgnoreDsStore(dirPath).length;
5 | }
6 |
--------------------------------------------------------------------------------
/src/utils/is-dir.ts:
--------------------------------------------------------------------------------
1 | import fs from 'fs-extra';
2 | import GeneralError from '../error/general-error';
3 |
4 | export default function isDir(userPath: string): boolean {
5 | let stat;
6 | try {
7 | stat = fs.lstatSync(userPath);
8 | } catch (err) {
9 | throw new GeneralError(`The path ${userPath} doesn't exist`);
10 | }
11 | return stat.isDirectory();
12 | }
13 |
--------------------------------------------------------------------------------
/src/utils/is-file-auto-generated.ts:
--------------------------------------------------------------------------------
1 | import firstline from 'firstline';
2 | import { AUTO_GENERATED_STAMP } from '../constants';
3 | import { PathOsBased } from './path';
4 |
5 | /**
6 | * check if file was auto generated by bit
7 | *
8 | * @param {PathOsBased} filePath - consumer path
9 | * @returns {boolean}
10 | */
11 | export default (async function isFileAutoGenerated(filePath: PathOsBased): Promise {
12 | const line = await firstline(filePath);
13 | return line.includes(AUTO_GENERATED_STAMP);
14 | });
15 |
--------------------------------------------------------------------------------
/src/utils/is-valid-id-chunk.ts:
--------------------------------------------------------------------------------
1 | import isString from './string/is-string';
2 |
3 | const validationRegExp = /^[$\-_!a-z0-9/]+$/;
4 | const validationRegExpDisallowSlash = /^[$\-_!a-z0-9]+$/;
5 |
6 | export default function isValidIdChunk(val: any, allowSlash = true): boolean {
7 | if (!isString(val)) return false;
8 | return allowSlash ? validationRegExp.test(val) : validationRegExpDisallowSlash.test(val);
9 | }
10 |
--------------------------------------------------------------------------------
/src/utils/is-valid-scope-name.ts:
--------------------------------------------------------------------------------
1 | import isString from './string/is-string';
2 |
3 | // the '.' can be in the middle, not at the beginning and not at the end and only once.
4 | const validationRegExp = /^[$\-_!a-z0-9]+[.]?[$\-_!a-z0-9]+$/;
5 |
6 | export default function isValidScopeName(val: any): boolean {
7 | if (!isString(val)) return false;
8 | return validationRegExp.test(val);
9 | }
10 |
--------------------------------------------------------------------------------
/src/utils/map/to-object.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Cast a `Map` to a plain object.
3 | * Keys are being casted by invoking `toString` on each key.
4 | * @name mapToObject
5 | * @param {Map} map to cast
6 | * @returns {*} plain object
7 | * @example
8 | * ```js
9 | * mapToObject(new Map([['key', 'val'], ['foo', 'bar']]));
10 | * // => { key: 'val', foo: 'bar' }
11 | * ```
12 | */
13 | export default function mapToObject(map: Map): { [key: string]: any } {
14 | const object = {};
15 | map.forEach((val, key) => {
16 | object[key.toString()] = val;
17 | });
18 | return object;
19 | }
20 |
--------------------------------------------------------------------------------
/src/utils/number/is-number.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * determiens whether `val` is a number.
3 | * @name isNumber
4 | * @param {*} val
5 | * @returns {boolean}
6 | * @example
7 | * ```js
8 | * isNumber('') // => false
9 | * ```
10 | */
11 | export default function isNumber(val: any) {
12 | return typeof val === 'number';
13 | }
14 |
--------------------------------------------------------------------------------
/src/utils/number/is-numeric.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * determines whether `val` is a numeric value
3 | * @name isNumeric
4 | * @param {*} val
5 | * @return {boolean}
6 | */
7 | export default function isNumeric(val: any) {
8 | return !Number.isNaN(parseFloat(val)) && Number.isFinite(val);
9 | }
10 |
--------------------------------------------------------------------------------
/src/utils/object-to-stringified-tuple-array.ts:
--------------------------------------------------------------------------------
1 | import forEach from './object/foreach';
2 |
3 | export default function objectToStringifiedTupleArray(obj: { [key: string]: any }): [string | number][] {
4 | const arr: any[] = [];
5 | forEach(obj, (val, key) => {
6 | arr.push([key, typeof val === 'object' ? JSON.stringify(val) : val]);
7 | });
8 | return arr;
9 | }
10 |
--------------------------------------------------------------------------------
/src/utils/object/foreach.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Invoke a function for every key within given object or array.
3 | * @name forEach
4 | * @param {object} obj object or array to iterate
5 | * @param {function} cb callback function to invoke
6 | * @example
7 | * ```js
8 | * forEach({ a: 1, b: 2, c: 3 }, (val, key) => console.log(key, val));
9 | * // => a 1 b 2 c 3
10 | * ```
11 | */
12 | export default function forEach(obj: Record, cb: (val: any, key: any) => void) {
13 | const keys = Object.keys(obj);
14 | keys.forEach(key => cb(obj[key], key));
15 | }
16 |
--------------------------------------------------------------------------------
/src/utils/object/has-own-property.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Determines whether the object has the specified property.
3 | * @name hasOwnProperty
4 | * @param {object} obj
5 | * @param {string|number} prop property to test
6 | * @returns {boolean}
7 | * @example
8 | * ```js
9 | * hasOwnProperty({foo: 'bar'}, 'foo') // => true
10 | * hasOwnProperty({foo: 'bar'}, 'bar') // => false
11 | * ```
12 | */
13 | export default function hasOwnProperty(obj: Record, prop: string | number) {
14 | return Object.prototype.hasOwnProperty.call(obj, prop);
15 | }
16 |
--------------------------------------------------------------------------------
/src/utils/object/sort.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Sort an object.
3 | */
4 | export default function sortObject(obj: Record) {
5 | return Object.keys(obj)
6 | .sort()
7 | .reduce(function(result, key) {
8 | result[key] = obj[key];
9 | return result;
10 | }, {});
11 | }
12 |
--------------------------------------------------------------------------------
/src/utils/os-resolve-home-path.ts:
--------------------------------------------------------------------------------
1 | const userHome = require('user-home');
2 |
3 | const HOME_SIGN = '~';
4 |
5 | export default function resolveHomePath(relPath: string) {
6 | if (relPath.startsWith(HOME_SIGN)) {
7 | return relPath.replace(HOME_SIGN, userHome);
8 | }
9 |
10 | return relPath;
11 | }
12 |
--------------------------------------------------------------------------------
/src/utils/prepend-bang.ts:
--------------------------------------------------------------------------------
1 | export default function prependBang(str: string): string {
2 | return `!${str}`;
3 | }
4 |
--------------------------------------------------------------------------------
/src/utils/pretty-json-chalk/index.ts:
--------------------------------------------------------------------------------
1 | import { render } from './prettyjson';
2 |
3 | export default render;
4 |
--------------------------------------------------------------------------------
/src/utils/promise-to-result-object.ts:
--------------------------------------------------------------------------------
1 | export type ResultObject = {
2 | success: boolean;
3 | val: T | null | undefined;
4 | error: Error;
5 | };
6 |
7 | export default function toResultObject() {
8 | return (promise: Promise): Promise> => {
9 | // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
10 | return promise.then(val => ({ success: true, val })).catch(error => ({ success: false, error, val: null }));
11 | };
12 | }
13 |
--------------------------------------------------------------------------------
/src/utils/remove-from-require-cache.ts:
--------------------------------------------------------------------------------
1 | // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
2 | import Module from 'module';
3 | import filterObject from './filter-object';
4 |
5 | // remove any cached module path for a module name (Module._pathCache)
6 | export default function removeFromRequireCache(currentRequestName: string) {
7 | // @ts-ignore
8 | Module._pathCache = filterObject(Module._pathCache, (val, key) => {
9 | const cachedRequestName = JSON.parse(key).request;
10 | return currentRequestName !== cachedRequestName;
11 | });
12 | }
13 |
--------------------------------------------------------------------------------
/src/utils/ssh/client-support-compressed-command.ts:
--------------------------------------------------------------------------------
1 | import semver from 'semver';
2 |
3 | export default function clientSupportCompressedCommand(clientVersion: string) {
4 | // The compress support released in version 14.6.0, older version doesn't support it
5 | return clientVersion && semver.gte(clientVersion, '14.6.0');
6 | }
7 |
--------------------------------------------------------------------------------
/src/utils/ssh/identity-file.ts:
--------------------------------------------------------------------------------
1 | import { get } from '../../api/consumer/lib/global-config';
2 | import { CFG_SSH_KEY_FILE_KEY, DEFAULT_SSH_KEY_FILE } from '../../constants';
3 |
4 | export default (async function getPathToIdentityFile() {
5 | const identityFile = await get(CFG_SSH_KEY_FILE_KEY);
6 | return identityFile || DEFAULT_SSH_KEY_FILE;
7 | });
8 |
--------------------------------------------------------------------------------
/src/utils/string/camel-case.ts:
--------------------------------------------------------------------------------
1 | export default function camelCase(str: string): string {
2 | return str.replace(/-([a-z])/g, g => g[1].toUpperCase());
3 | }
4 |
--------------------------------------------------------------------------------
/src/utils/string/clean-bang.ts:
--------------------------------------------------------------------------------
1 | import cleanChar from './clean-char';
2 |
3 | /**
4 | * remove first bang (!) from `str`
5 | * @name cleanBang
6 | * @param {string} str string to manipulate
7 | * @returns {string} string without first found bang
8 | * @example
9 | * ```js
10 | * cleanBang('!bang') // => 'bang'
11 | * ```
12 | */
13 | export default function cleanBang(str: string): string {
14 | return cleanChar(str, '!');
15 | }
16 |
--------------------------------------------------------------------------------
/src/utils/string/clean-char.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * clean the first occurrence of (`char`) from a string (`str`)
3 | * @name cleanChar
4 | * @param {string} str string to mainpulate.
5 | * @param {string} char char to clean.
6 | * @returns {string} cleaned string.
7 | * ```js
8 | * cleanChar('foo', 'f') // => 'oo'
9 | * ```
10 | */
11 | export default function cleanChar(str: string, char: string): string {
12 | return str.replace(char, '');
13 | }
14 |
--------------------------------------------------------------------------------
/src/utils/string/from-base64.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * decode a base64 string
3 | * @name fromBase64
4 | * @param {string} base64 base64 string to decode
5 | * @returns {string} decoded string
6 | * @example
7 | * ```js
8 | * fromBase64('aGVsbG8gd29ybGQ=') // => 'hello world'
9 | * ```
10 | */
11 | export default function fromBase64(base64: string): string {
12 | return Buffer.from(base64, 'base64').toString();
13 | }
14 |
--------------------------------------------------------------------------------
/src/utils/string/generate-random.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Generates random string of specific size
3 | * @param size
4 | */
5 | export default function generateRandomStr(size = 8): string {
6 | return Math.random()
7 | .toString(36)
8 | .slice(size * -1)
9 | .replace('.', ''); // it's rare but possible that the first char is '.', which is invalid for a scope-name
10 | }
11 |
--------------------------------------------------------------------------------
/src/utils/string/get-stringify-args.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Get pretty value (boolean) and return args to pass to the json.stringify method
3 | *
4 | * @export
5 | * @param {boolean} pretty - pretty print or not
6 | * @returns {Array} args to pass to the json.stringify
7 | * */
8 | export default function getStringifyArgs(pretty?: boolean): Array {
9 | const args = [null, ''];
10 | if (pretty) args[1] = ' ';
11 | return args;
12 | }
13 |
--------------------------------------------------------------------------------
/src/utils/string/has-wildcard.ts:
--------------------------------------------------------------------------------
1 | export default function hasWildcard(ids: string | null | undefined | string[]): boolean {
2 | if (!ids) return false;
3 | if (Array.isArray(ids)) {
4 | return ids.some(id => idHasWildcard(id));
5 | }
6 | return idHasWildcard(ids);
7 | }
8 |
9 | function idHasWildcard(id: string) {
10 | if (!id) return false;
11 | if (typeof id !== 'string') {
12 | throw new Error(`idHasWildcard expects id to be string, got ${typeof id}`);
13 | }
14 | return id.includes('*');
15 | }
16 |
--------------------------------------------------------------------------------
/src/utils/string/is-string.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * determines whether `val` is of type string.
3 | * @name isString
4 | * @param {*} val value to test.
5 | * @returns {boolean}
6 | * @example
7 | * ```js
8 | * isString('') // => true
9 | * isString(4) // => false
10 | * ```
11 | */
12 | export default function isString(val: any): val is string {
13 | return typeof val === 'string';
14 | }
15 |
--------------------------------------------------------------------------------
/src/utils/string/remove-chalk-characters.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * remove chalk characters from a string.
3 | * @name removeChalkCharacters
4 | * @param {*} str string to remove the chalk characters from
5 | * @returns {string}
6 | * @example
7 | * ```js
8 | * removeChalkCharacters('\u001b[37mbit.envs/bundlers/vue\u001b[39m') // => bit.envs/bundlers/vue
9 | * ```
10 | */
11 | export default function removeChalkCharacters(str?: string | null | undefined): string | null | undefined {
12 | if (!str) return str;
13 | // eslint-disable-next-line no-control-regex
14 | return str.replace(/\u001b\[.*?m/g, '');
15 | }
16 |
--------------------------------------------------------------------------------
/src/utils/string/strip-trailing-char.ts:
--------------------------------------------------------------------------------
1 | export default function stripTrailingChar(str: string, char: string): string {
2 | if (!str || !char) {
3 | return str;
4 | }
5 | if (str[str.length - 1] === char) {
6 | return str.slice(0, -1);
7 | }
8 | return str;
9 | }
10 |
--------------------------------------------------------------------------------
/src/utils/string/to-base64.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * encode a string or a buffer to base64
3 | * @name toBase64
4 | * @param {string|Buffer} val string or buffer to encode
5 | * @returns {string} base64 encoded string
6 | * @example
7 | * ```js
8 | * toBase64('foo bar') // => Zm9vIGJhcg==
9 | * toBase64(Buffer.from('foo bar')) // => Zm9vIGJhcg==
10 | * ```
11 | */
12 | export default function toBase64(val: string | Buffer) {
13 | if (val instanceof Buffer) return val.toString('base64');
14 | return Buffer.from(val).toString('base64');
15 | }
16 |
--------------------------------------------------------------------------------
/src/utils/to-boolean.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Convert a boolean from a string or boolean, return default value in case of null or undefined
3 | */
4 | export default (function toBoolean(value: boolean | null | undefined | string, defaultValue: boolean): boolean {
5 | if (value === null || value === undefined) {
6 | return defaultValue;
7 | }
8 | const valueAsString = String(value)
9 | .trim()
10 | .toLowerCase();
11 | if (valueAsString === 'true') {
12 | return true;
13 | }
14 | if (valueAsString === 'false') {
15 | return false;
16 | }
17 | return defaultValue;
18 | });
19 |
--------------------------------------------------------------------------------
/src/utils/zlib-deflate.ts:
--------------------------------------------------------------------------------
1 | // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
2 | import zlib from 'zlib';
3 |
4 | export default function deflate(buffer: Buffer): Promise {
5 | return new Promise((resolve, reject) => {
6 | zlib.deflate(buffer, (err, res) => {
7 | if (err) return reject(err);
8 | return resolve(res);
9 | });
10 | });
11 | }
12 |
--------------------------------------------------------------------------------
/src/utils/zlib-inflate.ts:
--------------------------------------------------------------------------------
1 | // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
2 | import zlib from 'zlib';
3 |
4 | export default function inflate(buffer: Buffer): Promise {
5 | return new Promise((resolve, reject) => {
6 | zlib.inflate(buffer, (err, res) => {
7 | if (err) return reject(err);
8 | return resolve(res);
9 | });
10 | });
11 | }
12 |
--------------------------------------------------------------------------------
/src/version/exceptions/index.ts:
--------------------------------------------------------------------------------
1 | import InvalidVersionChange from './invalid-version-change';
2 | import InvalidVersion from './invalid-version';
3 |
4 | export { InvalidVersionChange, InvalidVersion };
5 |
--------------------------------------------------------------------------------
/src/version/exceptions/invalid-version-change.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class InvalidVersionChange extends AbstractError {}
4 |
--------------------------------------------------------------------------------
/src/version/exceptions/invalid-version.ts:
--------------------------------------------------------------------------------
1 | import AbstractError from '../../error/abstract-error';
2 |
3 | export default class InvalidVersion extends AbstractError {
4 | version: string | null | undefined;
5 |
6 | constructor(version: string | null | undefined) {
7 | super();
8 | this.version = version;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/version/index.ts:
--------------------------------------------------------------------------------
1 | import Version from './version';
2 |
3 | export default Version;
4 |
--------------------------------------------------------------------------------
/tsconfig.types.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "types",
5 | "emitDeclarationOnly": true,
6 | "declaration": true
7 | },
8 | "include": [
9 | "src"
10 | ],
11 | "exclude": [
12 | "components",
13 | "node_modules",
14 | "e2e/fixtures"
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------