Skip to content

Commit

Permalink
refactor: use npm@5 instead of yarn to manage dependencies (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
eransakal authored Sep 26, 2017
1 parent 8a7459f commit 1814bb3
Show file tree
Hide file tree
Showing 6 changed files with 12,060 additions and 6,750 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
npm-debug.log
testem.log
/typings
yarn*.log

# e2e
/e2e/*.js
Expand Down
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
KMCng application uses the following technologies and conventions:
* [Angular CLI](https://cli.angular.io/) to manage the application (dev)ops.
* [TypeScript](http://www.typescriptlang.org/) language (superset of Javascript).
* [Yarn](https://yarnpkg.com/en/) as our dependency management.
* Stylesheets with [SASS](http://sass-lang.com/) (not required, it supports regular css too).
* Error reported with [TSLint](http://palantir.github.io/tslint/) and [Codelyzer](https://github.com/mgechev/codelyzer).
* Best practices in file and application organization for [Angular 2]({https://angular.io/).
Expand All @@ -19,7 +18,7 @@ KMCng application uses the following technologies and conventions:

- [x] Ensure you have [node.js installed](https://nodejs.org/en/download/current/), version 7.0.0 or above.
- [x] Ensure you have [git installed](https://git-for-windows.github.io/)
- [x] Ensure you have [yarn installed](https://yarnpkg.com/lang/en/docs/install/) (we use it for node package management)
- [x] Ensure you have npm installed, version 5.0.0 or above.

### Project build options
> KKC-ng solution is comprised of many packages; The KMC-ng application is developed along-side the [kaltura-ng](https://github.com/kaltura/kaltura-ng) packages and [mc-theme](https://github.com/kaltura/kaltura-ng-mc-theme) package. To simplify local development we created a tool that automagically bind them together as-if they where part of the same repository.
Expand All @@ -41,16 +40,16 @@ $ git clone https://github.com/kaltura/kmc-ng.git
$ cd kmc-ng

# install the dependencies
$ yarn
$ npm install

# checkout latest standalone code
$ yarn run checkout-standalone
$ npm run checkout-standalone

# sync dependencies to the new branch
$ yarn install --check-files
$ npm install

# run a local server
$ yarn start
$ npm start
```

> Note - if you need to [edit the application configuration](#config), change the environment.ts file only after running all of the commands above
Expand All @@ -64,7 +63,7 @@ Please read [docs/develop kmc-ng solution guide](./docs/develop-kmc-ng-solution.
### Run the application
Run the following command
```
$ yarn start
$ npm start
```
navigate to [http://localhost:4200](http://localhost:4200) in your browser.

Expand Down
14 changes: 7 additions & 7 deletions docs/develop-kmc-ng-solution.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ As described in the [readme.md / kmc-ng solution](../README.md#kmc-ng-solution)
## Kaltura-ng dev workspace tool
To be able to make changes across repositories we will use a tool (named **kaltura-ng-dev-workspace**) that will make the binding between them. The tool will do the following:
- download all relevant repositories from github
- run `yarn install` to setup all dependencies
- run `npm install` to setup all dependencies
- create symlink between projects (meaning changes in one repo will be relflected automatically in all the dependent projects).
- build everything in topological order (according to dependency graph).

Expand All @@ -15,17 +15,17 @@ To be able to make changes across repositories we will use a tool (named **kaltu

- [x] Ensure you have [node.js installed](https://nodejs.org/en/download/current/), version 7.0.0 or above.
- [x] Ensure you have [git installed](https://git-for-windows.github.io/)
- [x] Ensure you have [yarn installed](https://yarnpkg.com/lang/en/docs/install/) (we use it for node package management) version 0.24.6 and above.
- [x] Ensure you have npm installed, version 5.0.0 or above.

#### Setup your workspace
1. create a folder to hold your packages (your workspace **root folder**). Note that **it is not** the kmc-ng repository folder.
2. create `package.json` in your **root folder** by running the following command:
```
$ yarn init -y
$ npm init -y
```
3. add this tool to your folder in your root folder by running the following command:
```
$ yarn add @kaltura-ng/dev-workspace
$ npm install @kaltura-ng/dev-workspace
```

4. create file `kaltura-ws.json` in your root folder with the following format:
Expand Down Expand Up @@ -55,18 +55,18 @@ To be able to make changes across repositories we will use a tool (named **kaltu
5.1 run the following command (this is a workaround to an issue we have with our tool):
```
$ cd kaltura-ng
$ yarn install
$ npm install
```

6. run setup command to build & symlink your repositories (**Note** It might take a few minutes)
```bash
$ yarn run setup
$ npm run setup
```

7. once the setup complete open the `kmc-ng` repo and try to serve it:
```bash
$ cd kmc-ng
$ yarn start
$ npm start
```

You should be able to open kmc-ng application in your browser at `http://localhost:4200`.
Loading

0 comments on commit 1814bb3

Please sign in to comment.