Skip to content

Commit 4db0368

Browse files
committed
Add instructions
1 parent cb2e5b4 commit 4db0368

File tree

1 file changed

+66
-10
lines changed

1 file changed

+66
-10
lines changed

README.md

Lines changed: 66 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,83 @@
11
# AngularcliMeteor
22

3-
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.6.0.
3+
## Meteor server
44

5-
## Development server
5+
Run `meteor` from the `api` directory to start the Meteor server.
6+
7+
## Bundling Meteor client
8+
9+
`meteor-client-bundler` is a module bundler which will take a bunch of Atmosphere package and put them into a single module, so we can load Meteor's client scripts regardless of what framework we're using to run our server.
610

7-
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
11+
Run `./node_modules/.bin/meteor-client bundle -s api`.
812

9-
## Code scaffolding
13+
## Development server
1014

11-
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
15+
Then run `npm run start` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
1216

1317
## Build
1418

15-
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
19+
Run `npm run build` to build the project. The build artifacts will be stored in the `dist/` directory. Use `npm run build-prod` for a production build with AOT.
1620

1721
## Running unit tests
1822

19-
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
23+
Run `npm run test` to execute the unit tests via [Karma](https://karma-runner.github.io).
2024

2125
## Running end-to-end tests
2226

23-
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
27+
Run `npm run e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
28+
29+
## The process I've done to recreate this
30+
31+
```
32+
ng new angularcli-meteor --style scss
33+
cd angularcli-meteor
34+
ng eject
35+
```
36+
We need to eject `webpack.config.js` to be able to patch it to support Meteor.
37+
38+
```
39+
cat patches/webpack.config.js.patch | patch -p1
40+
cat patches/tsconfig.json.patch | patch -p1
41+
cat patches/tsconfig.app.json.patch | patch -p1
42+
cat patches/tsconfig.spec.json.patch | patch -p1
43+
cat patches/tsconfig.e2e.json.patch | patch -p1
44+
```
45+
46+
```
47+
npm install --save-dev typescript-extends
48+
npm install --save moment
49+
npm install --save angular2-moment
50+
```
51+
52+
```
53+
meteor create api --release 1.6-rc.13
54+
npm install --save babel-runtime
55+
npm install --save meteor-node-stubs
56+
npm install --save meteor-rxjs
57+
npm install --save-dev meteor-client-bundler
58+
npm install --save-dev @types/meteor
59+
npm install --save-dev tmp
60+
rm -rf api/node_modules
61+
rm -rf api/client
62+
mv api/server/main.js api/server/main.ts
63+
rm api/package.json api/package-lock.json
64+
ln -s ../package.json api/package.json
65+
ln -s ../package-lock.json api/package-lock.json
66+
ln -s ../node_modules api/
67+
cd api; meteor add barbatus:typescript; cd ..
68+
```
69+
70+
Now we need to create `api/tsconfig.json`.
71+
72+
To get the AOT config we will need to eject `webpack.config.js` once again, this time with the `--prod` flag.
73+
To be able to do so we will first have to remove all the "run" scripts from package.json.
2474

25-
## Further help
75+
```
76+
mv webpack.config.js webpack.config.js.dev
77+
ng eject --prod
78+
cat patches/webpack.config.js.prod.patch | patch -p1
79+
mv webpack.config.js webpack.config.js.prod
80+
ln -s webpack.config.js.dev webpack.config.js
81+
```
2682

27-
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
83+
Finally let's add `start-prod` and `build-prod` to the "run" scripts from package.json.

0 commit comments

Comments
 (0)