{"id":13432864,"url":"https://github.com/AllenFang/lerna-tutorial-example","last_synced_at":"2025-03-17T10:32:46.640Z","repository":{"id":66230465,"uuid":"134671406","full_name":"AllenFang/lerna-tutorial-example","owner":"AllenFang","description":"A lerna practice project provided by Docker","archived":false,"fork":false,"pushed_at":"2018-05-24T08:31:29.000Z","size":83,"stargazers_count":33,"open_issues_count":1,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-27T13:03:03.804Z","etag":null,"topics":["docker","git","lerna","npm"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AllenFang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-05-24T06:31:17.000Z","updated_at":"2023-10-17T10:05:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"bb7f66c8-b507-433c-b3b8-2a3b4cf40931","html_url":"https://github.com/AllenFang/lerna-tutorial-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllenFang%2Flerna-tutorial-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllenFang%2Flerna-tutorial-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllenFang%2Flerna-tutorial-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllenFang%2Flerna-tutorial-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AllenFang","download_url":"https://codeload.github.com/AllenFang/lerna-tutorial-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244016863,"owners_count":20384223,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","git","lerna","npm"],"created_at":"2024-07-31T02:01:17.758Z","updated_at":"2025-03-17T10:32:46.297Z","avatar_url":"https://github.com/AllenFang.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# Lerna Tutorial Example\n\nThis repo give you an independent enviornment to play with [lerna](https://github.com/lerna/lerna). We leverage on Docker to provide you a gitserver and a lightweight npm server so that you can easy to understand and learn how lerna publish, release and so on. \n\nYou will have following components after setup:\n\n* NPM server(We use [verdaccio](https://github.com/verdaccio/verdaccio))\n  * `npmserver` is docker dontainer name\n* GIT server(Simple git server on SSH and already contain a bare repository)\n  * `gitserver` is docker dontainer name\n* Workspace(Git, Node.js and NPM installed), develop/testing/deploy/publish here!!\n  * `workspace` is docker dontainer name\n\n## Setup\n\n### Install and run\n```sh\n####### GENERATE SSH KEY IF YOU DON'T HAVE YET #######\n$ cd ~\n$ mkdir .ssh\n$ ssh-keygen -t rsa\n######################################################\n\n$ git clone https://github.com/AllenFang/lerna-tutorial-example.git\n$ cd lerna-tutorial-example\n$ cp ~/.ssh/id_rsa.pub ./docker/git-server/keys\n$ cp ~/.ssh/id_rsa ./docker/git-server/keys\n$ cd docker\n$ docker-compose up -d\n```\nAfter docker compose start, `gitserver` and `npmserver` will run in the background then you need to type following commands to launch to `workspace` container to do further setup: \n\n`docker-compose run workspace sh`\n\n### Setup NPM\n\n```sh\n$ npm set registry http://npmserver:4873\n$ npm adduser --registry http://npmserver:4873  # Keyin your username, password and email\n```\nThen open your browser and do login via http://localhost:4873. After login, you will see no any package published yet. So two steps you need to do as below:\n\n### Setup GIT\n\n```sh\n$ git config --global user.email \"you@example.com\"  # Keyin your email\n$ git config --global user.name \"Your Name\"  # Keyin your username\n```\n\n### Setup Dummy Project\n\n```sh\n$ git clone ssh://git@gitserver/git-server/repos/examples.git\n$ cd examples\n$ npm install\n```\n\n## Lerna Test\n\nAfter above commands, you already setup the git and npm config in the `workspace` container then it's time that we can publish modules via `lerna`:\n\n```sh\n$ ./node_modules/.bin/lerna publish\n```\n\nAfter above comment, lerna will ask you auto detect what packages had changes since last publish and ask you what version you want to upgrade by a prmopt.\nFollowing is the result screenshot:\n\n![lerna publish result](https://i.imgur.com/NDA5INz.png)\n\nWhen you go to http://localhost:4873, you will see following result:\n![npm publish result](https://i.imgur.com/GRWGYmD.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAllenFang%2Flerna-tutorial-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAllenFang%2Flerna-tutorial-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAllenFang%2Flerna-tutorial-example/lists"}