├── .github ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ └── CI.yml ├── .gitignore ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTION.md ├── Dockerfile ├── LICENSE ├── README.md ├── atmosphere-packages ├── angular-compilers │ ├── .versions │ ├── README.md │ ├── package.js │ └── plugin │ │ └── register.js ├── angular-html-compiler │ ├── .versions │ ├── index.js │ └── package.js ├── angular-scss-compiler │ ├── .versions │ ├── file-utils.js │ ├── index.js │ └── package.js ├── angular-typescript-compiler │ ├── .versions │ ├── file-utils.js │ ├── index.js │ ├── package.js │ └── rollup.js └── publish.sh ├── examples ├── AngularCLI │ ├── .editorconfig │ ├── .gitignore │ ├── README.md │ ├── angular.json │ ├── api │ │ ├── .gitignore │ │ ├── .meteor │ │ │ ├── .finished-upgraders │ │ │ ├── .gitignore │ │ │ ├── .id │ │ │ ├── packages │ │ │ ├── platforms │ │ │ ├── release │ │ │ └── versions │ │ ├── node_modules │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── server │ │ │ ├── collections.ts │ │ │ ├── main.ts │ │ │ ├── methods.ts │ │ │ ├── models.ts │ │ │ └── publications.ts │ │ ├── tests │ │ │ ├── declarations.d.ts │ │ │ └── main.ts │ │ ├── tsconfig.json │ │ └── yarn.lock │ ├── e2e │ │ ├── protractor.conf.js │ │ ├── src │ │ │ ├── app.e2e-spec.ts │ │ │ └── app.po.ts │ │ └── tsconfig.e2e.json │ ├── meteor-client.config.json │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── app.component.html │ │ │ ├── app.component.spec.ts │ │ │ ├── app.component.ts │ │ │ └── app.module.ts │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── browserslist │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── karma.conf.js │ │ ├── main.ts │ │ ├── polyfills.ts │ │ ├── styles.css │ │ ├── test.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.spec.json │ │ └── tslint.json │ ├── tsconfig.json │ ├── tslint.json │ └── yarn.lock ├── MeteorCLI │ ├── all-in-one │ │ ├── .gitignore │ │ ├── .meteor │ │ │ ├── .finished-upgraders │ │ │ ├── .gitignore │ │ │ ├── .id │ │ │ ├── packages │ │ │ ├── platforms │ │ │ ├── release │ │ │ └── versions │ │ ├── LICENSE │ │ ├── README.md │ │ ├── client │ │ │ └── main.ts │ │ ├── imports │ │ │ ├── app │ │ │ │ ├── app.component.ts │ │ │ │ ├── app.html │ │ │ │ ├── app.module.ts │ │ │ │ ├── page-not-found │ │ │ │ │ ├── page-not-found.component.ts │ │ │ │ │ └── page-not-found.html │ │ │ │ ├── server-app.module.ts │ │ │ │ ├── todo-add │ │ │ │ │ ├── todo-add.component.ts │ │ │ │ │ ├── todo-add.html │ │ │ │ │ └── todo-add.module.ts │ │ │ │ └── todo-list │ │ │ │ │ ├── todo-list.component.ts │ │ │ │ │ ├── todo-list.html │ │ │ │ │ └── todo-list.scss │ │ │ ├── collections │ │ │ │ └── todos.ts │ │ │ ├── methods │ │ │ │ └── todos.ts │ │ │ ├── models │ │ │ │ └── todo.ts │ │ │ ├── polyfills.ts │ │ │ └── publications │ │ │ │ └── todos.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── run_tests.sh │ │ ├── server │ │ │ └── main.ts │ │ └── tsconfig.json │ ├── bare │ │ ├── .gitignore │ │ ├── .meteor │ │ │ ├── .finished-upgraders │ │ │ ├── .gitignore │ │ │ ├── .id │ │ │ ├── packages │ │ │ ├── platforms │ │ │ ├── release │ │ │ └── versions │ │ ├── README.md │ │ ├── client │ │ │ ├── imports │ │ │ │ ├── app │ │ │ │ │ ├── app.component.spec.ts │ │ │ │ │ ├── app.component.ts │ │ │ │ │ ├── app.html │ │ │ │ │ ├── app.module.spec.ts │ │ │ │ │ ├── app.module.ts │ │ │ │ │ ├── page-not-found │ │ │ │ │ │ ├── page-not-found.component.ts │ │ │ │ │ │ └── page-not-found.html │ │ │ │ │ ├── todo-add │ │ │ │ │ │ ├── todo-add.component.ts │ │ │ │ │ │ └── todo-add.html │ │ │ │ │ └── todo-list │ │ │ │ │ │ ├── todo-list.component.spec.ts │ │ │ │ │ │ ├── todo-list.component.ts │ │ │ │ │ │ ├── todo-list.html │ │ │ │ │ │ └── todo-list.scss │ │ │ │ ├── polyfills.spec.ts │ │ │ │ └── polyfills.ts │ │ │ ├── main.html │ │ │ └── main.ts │ │ ├── imports │ │ │ ├── collections │ │ │ │ └── todos.ts │ │ │ └── models │ │ │ │ └── todo.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── renovate.json │ │ ├── run_tests.sh │ │ ├── server │ │ │ ├── imports │ │ │ │ ├── methods │ │ │ │ │ └── todos.ts │ │ │ │ └── publications │ │ │ │ │ └── todos.ts │ │ │ └── main.ts │ │ └── tsconfig.json │ ├── lazy-loading │ │ ├── .gitignore │ │ ├── .meteor │ │ │ ├── .finished-upgraders │ │ │ ├── .gitignore │ │ │ ├── .id │ │ │ ├── packages │ │ │ ├── platforms │ │ │ ├── release │ │ │ └── versions │ │ ├── client │ │ │ ├── imports │ │ │ │ ├── app │ │ │ │ │ ├── app.component.ts │ │ │ │ │ ├── app.html │ │ │ │ │ ├── app.module.ts │ │ │ │ │ ├── page-not-found │ │ │ │ │ │ ├── page-not-found.component.ts │ │ │ │ │ │ └── page-not-found.html │ │ │ │ │ ├── todo-add │ │ │ │ │ │ ├── todo-add.component.ts │ │ │ │ │ │ ├── todo-add.html │ │ │ │ │ │ └── todo-add.module.ts │ │ │ │ │ └── todo-list │ │ │ │ │ │ ├── todo-list.component.ts │ │ │ │ │ │ ├── todo-list.html │ │ │ │ │ │ └── todo-list.scss │ │ │ │ └── polyfills.ts │ │ │ ├── main.html │ │ │ └── main.ts │ │ ├── imports │ │ │ ├── collections │ │ │ │ └── todos.ts │ │ │ └── models │ │ │ │ └── todo.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── run_tests.sh │ │ ├── server │ │ │ ├── imports │ │ │ │ ├── methods │ │ │ │ │ └── todos.ts │ │ │ │ └── publications │ │ │ │ │ └── todos.ts │ │ │ └── main.ts │ │ └── tsconfig.json │ ├── run_tests.sh │ └── universal │ │ ├── .gitignore │ │ ├── .meteor │ │ ├── .finished-upgraders │ │ ├── .gitignore │ │ ├── .id │ │ ├── packages │ │ ├── platforms │ │ ├── release │ │ └── versions │ │ ├── LICENSE │ │ ├── README.md │ │ ├── client │ │ └── main.ts │ │ ├── imports │ │ ├── app │ │ │ ├── app.component.ts │ │ │ ├── app.html │ │ │ ├── app.module.ts │ │ │ ├── page-not-found │ │ │ │ ├── page-not-found.component.ts │ │ │ │ └── page-not-found.html │ │ │ ├── server-app.module.ts │ │ │ ├── todo-add │ │ │ │ ├── todo-add.component.ts │ │ │ │ └── todo-add.html │ │ │ └── todo-list │ │ │ │ ├── todo-list.component.ts │ │ │ │ ├── todo-list.html │ │ │ │ └── todo-list.scss │ │ ├── collections │ │ │ └── todos.ts │ │ ├── methods │ │ │ └── todos.ts │ │ ├── models │ │ │ └── todo.ts │ │ ├── polyfills.ts │ │ └── publications │ │ │ └── todos.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── run_tests.sh │ │ ├── server │ │ └── main.ts │ │ └── tsconfig.json ├── angularjs │ ├── .gitignore │ ├── .meteor │ │ ├── .finished-upgraders │ │ ├── .gitignore │ │ ├── .id │ │ ├── packages │ │ ├── platforms │ │ ├── release │ │ └── versions │ ├── client │ │ ├── app │ │ │ └── app.module.js │ │ ├── main.html │ │ ├── main.js │ │ ├── main.scss │ │ ├── todo-add │ │ │ ├── todo-add.component.js │ │ │ ├── todo-add.controller.js │ │ │ ├── todo-add.html │ │ │ └── todo-add.scss │ │ └── todo-list │ │ │ ├── todo-list.component.js │ │ │ ├── todo-list.controller.js │ │ │ ├── todo-list.html │ │ │ └── todo-list.scss │ ├── collections │ │ └── todos.js │ ├── package-lock.json │ ├── package.json │ ├── run_tests.sh │ └── server │ │ └── main.js └── apollo │ ├── .gitignore │ ├── .meteor │ ├── .finished-upgraders │ ├── .gitignore │ ├── .id │ ├── packages │ ├── platforms │ ├── release │ └── versions │ ├── client │ ├── imports │ │ ├── app.component.ts │ │ ├── app.html │ │ └── app.module.ts │ ├── main.html │ └── main.ts │ ├── imports │ └── declarations.d.ts │ ├── package.json │ ├── server │ └── main.ts │ ├── tsconfig.json │ └── yarn.lock ├── renovate.json └── run_tests.sh /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Angular Meteor 2 | 3 | We'd love for you to contribute to our source code and to make Angular Meteor even better than it is 4 | today! Here are the guidelines we'd like you to follow: 5 | 6 | - [Code of Conduct](#coc) 7 | - [Question or Problem?](#question) 8 | - [Issues and Bugs](#issue) 9 | - [Feature Requests](#feature) 10 | - [Submission Guidelines](#submit) 11 | - [Contribution Setup](#setup) 12 | - [Commit Message Guidelines](#commit) 13 | 14 | ## Code of Conduct 15 | I love the Angular community so let's just use thier [Code of Conduct](https://github.com/angular/code-of-conduct/blob/master/CODE_OF_CONDUCT.md). 16 | 17 | If you are subject to or witness unacceptable behavior, or have any other concerns, please email me at uri.goldshtein@gmail.com. 18 | 19 | ## Got a Question or Problem? 20 | 21 | If you have questions about how to use Angular Meteor, please direct these to [StackOverflow](http://stackoverflow.com/questions/tagged/angular-meteor) or the [Meteor forums](https://forums.meteor.com/). 22 | 23 | ## Found an Issue? 24 | If you find a bug in the source code or a mistake in the documentation, you can help us by 25 | submitting an issue to our [GitHub Repository](https://github.com/urigo/angular-meteor/). Even better you can submit a Pull Request 26 | with a fix. 27 | 28 | ## Want a Feature? 29 | 30 | ### Submitting an Issue 31 | [Guidelines](https://github.com/Urigo/angular-meteor/blob/master/.github/ISSUE_TEMPLATE.md) 32 | 33 | ### Roadmap 34 | 35 | We manage the project roadmap in Github issues and milestones. There is a [public Waffle board](https://waffle.io/Urigo/angular-meteor) 36 | dedicated to `angular-meteor`. You can add an issue about what you want to see in the library or in the tutorial. 37 | 38 | #### [Tutorial](http://angular-meteor.com/tutorial) 39 | 40 | Our goal with the tutorial is to add as many common use cases as possible. If you want to create and add your own 41 | chapter we would be happy to help you writing and adding it. 42 | 43 | Also if you want to record a video for a chapter we would love to help you. 44 | 45 | #### Guidelines for video 46 | 47 | * Make videos as short as possible - easier to update and nicer to watch - be short as a sub-step (2.5, 3.11, etc...) 48 | * Upload your video to Youtube and send us the link - add tags and miningful content descriptions on Youtube 49 | * Upload your video sources to our [open Github repo](https://github.com/Urigo/angular-meteor-videos) - That way they are editable in any way we want (translated, dubbed, improve audio, update inner parts, etc...) 50 | * Feel free to contact [me](https://github.com/urigo) for any questions 51 | 52 | #### Guidelines for screenshots and gifs to the tutorial 53 | 54 | * Just do it! we need many of those and it's really helping the tutorial. and you are doing it already anyway.... 55 | 56 | ## Submission Guidelines 57 | 58 | ### Submitting an Issue 59 | [Guidelines](https://github.com/Urigo/angular-meteor/blob/master/.github/ISSUE_TEMPLATE.md) 60 | 61 | ### Submitting a Pull Request 62 | [Guidelines](https://github.com/Urigo/angular-meteor/blob/master/.github/PULL_REQUEST_TEMPLATE.md) 63 | 64 | If you want to contribute and need help or don't know what should you do, you can [contact me directly](https://github.com/urigo) 65 | 66 | ## Contribution Setup 67 | 68 | ### Setup repository 69 | 70 | Fork angular-meteor and clone the angular-meteor library to another directory named `angular` 71 | ``` 72 | mkdir angular 73 | git clone https://github.com/[your_username]/angular-meteor.git angular 74 | ``` 75 | 76 | ## Git Commit Guidelines 77 | 78 | ### Commit message format 79 | 80 | This project follows the `angular` project git commit message format. 81 | Please refer to the [official documentation](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#-git-commit-guidelines). 82 | 83 | You can commit changes in interactive mode by running: 84 | 85 | ``` 86 | npm run commit 87 | ``` 88 | 89 | It is a step by step process. 90 | 91 | ## Run local angular-meteor in your project 92 | 93 | ### Meteor 1.3 94 | 95 | ```bash 96 | meteor create myProject 97 | ``` 98 | 99 | Install `angular-meteor` for your application. 100 | 101 | ```bash 102 | npm install angular-meteor --save 103 | ``` 104 | 105 | Create a globally-installed symbolic link to your forked repository. 106 | 107 | ```bash 108 | cd /path_to_your_repos/angular-meteor/ 109 | npm link 110 | ``` 111 | 112 | Now create a symlink from the local node_modules folder to the global symlink 113 | 114 | ```bash 115 | cd myProject 116 | npm link angular-meteor 117 | ``` 118 | 119 | You can compile `angular-meteor` by running: 120 | 121 | ```bash 122 | npm run build 123 | ``` 124 | 125 | If you don’t want to manually recompile after every change you can use watch mode. 126 | 127 | ```bash 128 | npm run watch 129 | ``` 130 | 131 | 132 | ### Meteor 1.2 133 | 134 | ```bash 135 | meteor create myProject 136 | ``` 137 | 138 | Create a `packages` directory under your project's root folder and link your forked repo 139 | 140 | ```bash 141 | cd myProject 142 | ln -s ~/path_to_your_repos/angular-meteor/packages/ 143 | ``` 144 | 145 | The `angular-meteor-data` package uses the main file of `angular-meteor` node module. 146 | 147 | To start using a local file you should run: 148 | 149 | ```bash 150 | npm run dev:start 151 | ``` 152 | 153 | To compile new file for `angular-meteor-data` package you can run: 154 | 155 | ```bash 156 | npm run build:dev 157 | ``` 158 | 159 | If you don’t want to manually recompile after every change you can use watch mode. 160 | 161 | ```bash 162 | npm run watch:dev 163 | ``` 164 | 165 | Both above commands run `npm run dev:start` automaticaly, so you don't have to trigger it by yourself. 166 | 167 | Now you can start using your own copy of the `angular-meteor` project from `myProject`. 168 | 169 | **You should remember one thing**. 170 | 171 | Since `angular-meteor-data` package uses main file of `angular-meteor` npm package and you've already changed it using above commands, you should somehow restore that state. It's easy, just use this command: 172 | 173 | ```bash 174 | npm run dev:stop 175 | ``` 176 | 177 | ## Running tests 178 | 179 | In the command line 180 | 181 | ``` 182 | npm run test:watch 183 | ``` 184 | 185 | Then go to `localhost:3000` in your browser 186 | 187 | ## Contributing to documentation and tutorials. 188 | 189 | Whether it's a typo, some clarification, or a whole new feature - here's how to get started: 190 | 191 | 1. Clone angular-meteor on your local machine 192 | 2. Clone the docs repository at `https://github.com/urigo/angular-meteor-docs` 193 | 3. Run the app for the documentation `meteor` 194 | 4. Start tweaking and updating! 195 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Remember, an issue is not the place to ask questions. You can use [Stack Overflow](http://stackoverflow.com/questions/tagged/angular-meteor) for that, or you may want to start a discussion on the [Meteor forum](https://forums.meteor.com/). 2 | 3 | Before you open an issue, please check if a similar issue already exists or has been closed before. 4 | 5 | ### When reporting a bug, please be sure to include the following: 6 | - [ ] A descriptive title 7 | - [ ] An *isolated* way to reproduce the behavior (example: GitHub repository with code isolated to the issue that anyone can clone to observe the problem) 8 | - [ ] What version of `angular-meteor` you're using, and the platform(s) you're running it on 9 | - [ ] What packages or other dependencies you're using 10 | - [ ] The behavior you expect to see, and the actual behavior 11 | 12 | See [here](https://github.com/meteor/meteor/blob/devel/CONTRIBUTING.md#reporting-a-bug-in-meteor) for more detail on what is expected of a bug report. 13 | 14 | ### When you open an issue for a feature request, please add as much detail as possible: 15 | - [ ] A descriptive title 16 | - [ ] A description of the problem you're trying to solve, including *why* you think this is a problem 17 | - [ ] An overview of the suggested solution 18 | - [ ] If the feature changes current behavior, reasons why your solution is better 19 | 20 | See [here](https://github.com/meteor/meteor/blob/devel/CONTRIBUTING.md#feature-requests) for more detail on what is expected of a feature request. 21 | 22 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Before you submit a pull request, please make sure you have to following: 2 | 3 | - [ ] Your code should contain tests relevant for the problem you are solving 4 | - [ ] All new and existing tests passed 5 | - [ ] Your commits messages format follows the `angular` project [git commit message format](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#-git-commit-guidelines) 6 | 7 | ### When updating the site 8 | - [ ] A description of the problem you're trying to solve 9 | - [ ] An overview of the suggested solution 10 | - [ ] If the feature changes current behavior, reasons why your solution is better. 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /.github/workflows/CI.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | branches: 9 | - master 10 | 11 | jobs: 12 | CI: 13 | strategy: 14 | matrix: 15 | example: ["angularjs", "MeteorCLI/all-in-one", "MeteorCLI/bare","MeteorCLI/lazy-loading", "MeteorCLI/universal"] 16 | name: CI for ${{ matrix.example }} 17 | runs-on: ubuntu-latest 18 | env: 19 | TRAVIS_BUILD_DIR: ${{ github.workspace }} 20 | steps: 21 | - name: Checkout Master 22 | uses: actions/checkout@v2 23 | with: 24 | fetch-depth: 0 25 | - name: Use Node 26 | uses: actions/setup-node@v2 27 | with: 28 | node-version: '15.x' 29 | - name: Cache Meteor 30 | id: cache-meteor 31 | uses: actions/cache@v2 32 | with: 33 | path: | 34 | ~/.meteor 35 | **/.meteor/local 36 | key: ${{ runner.os }}-meteor-${{ matrix.example }}-${{ hashFiles('**/release') }} 37 | restore-keys: | 38 | ${{ runner.os }}-meteor-${{ matrix.example }} 39 | ${{ runner.os }}-meteor- 40 | - name: Use Meteor 41 | if: steps.cache-meteor.outputs.cache-hit != 'true' 42 | run: curl https://install.meteor.com/ | sh 43 | - name: Setup Meteor 44 | run: export PATH="$PATH:~/.meteor" 45 | - name: Run Tests 46 | run: cd examples/${{ matrix.example }} && ./run_tests.sh 47 | env: 48 | NODE_OPTIONS: --max-old-space-size=2048 49 | METEOR_PACKAGE_DIRS: $GITHUB_WORKSPACE/atmosphere-packages -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | .node_modules 3 | .idea 4 | typings 5 | atmosphere-packages/examples 6 | .npm 7 | npm-debug.log 8 | dist 9 | .DS_Store 10 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ### Compatibility for Angular 4 and beyond 4 | 5 | This version fixed a compatibility issue for the old Reactive Component with Angular 4. 6 | 7 | It is still recommended to use the newer []Meteor-RxJS API](https://github.com/Urigo/meteor-rxjs) and all the tutorials have migrated to that. 8 | 9 | * Add compatibility for Angular 4 for the old Reactive Component API, [#1644](https://github.com/Urigo/angular-meteor/pull/1644) 10 | * Add Angular CLI Example, [#1651](https://github.com/Urigo/angular-meteor/pull/1651) 11 | 12 | This version was done completely by @darkbasic, thank you so much! 13 | 14 | 15 | # [0.7.0-beta.1](https://github.com/Urigo/angular2-meteor/compare/0.6.0...v0.7.0-beta.1) (2016-08-21) 16 | 17 | 18 | ### Bug Fixes 19 | 20 | * **MeteorComponent:** fix #337 ([63f95b6](https://github.com/Urigo/angular2-meteor/commit/63f95b6)), closes [#337](https://github.com/Urigo/angular2-meteor/issues/337) [#323](https://github.com/Urigo/angular2-meteor/issues/323) 21 | * #331 ([6fe0d45](https://github.com/Urigo/angular2-meteor/commit/6fe0d45)) 22 | * fix #331 ([5a976ac](https://github.com/Urigo/angular2-meteor/commit/5a976ac)), closes [#331](https://github.com/Urigo/angular2-meteor/issues/331) 23 | 24 | 25 | 26 | 27 | ## [0.6.2](https://github.com/Urigo/angular2-meteor/compare/0.6.0...v0.6.2) (2016-07-20) 28 | 29 | 30 | ### Bug Fixes 31 | 32 | * **MeteorComponent:** fix #337 ([63f95b6](https://github.com/Urigo/angular2-meteor/commit/63f95b6)), closes [#337](https://github.com/Urigo/angular2-meteor/issues/337) [#323](https://github.com/Urigo/angular2-meteor/issues/323) 33 | 34 | 35 | 36 | 37 | ## 0.6.0 (2016-07-09) 38 | 39 | ### Breaking Changes 40 | 41 | Importing URLs of the component templates in a way as `import url from './foo.html'` will be deprecated from `angular2-compilers@0.6.0` in favor of the inline templates. That means the expression above will become now `import template from './foo.html'`. 42 | 43 | For the migration, we've added a special JS-module to `angular2-compilers@0.5.8` that exports template content as well but with a special suffix added to the URL, i.e., `!raw` and the whole path is `./foo.html!raw`. URLs like `./foo.html!raw` are supported by `angular2-compilers@0.6.0` as well allowing you to transit easily. 44 | 45 | `angular2-compilers@0.6.0` is based on `urigo:static-html-compiler@0.1.4` ([a0d28d3](https://github.com/Urigo/angular2-meteor/commit/a0d28d3)). 46 | 47 | ### Features 48 | 49 | - Main Meteor methods are now patched to run ngZone after the callback executions [(2145847)](https://github.com/Urigo/angular2-meteor/commit/2145847). In other words, `autoBind` param of the `MeteorComponent` wrappers is set to true by default. Fixes this [issue](https://github.com/Urigo/angular2-meteor/issues/140) (thanks @staeke for the idea and discussion) 50 | - `MeteorComponent` is improved to support server side rendering. One can use `angular2-meteor` on the server along with [`angular2-meteor-universal`](https://github.com/barbatus/angular2-meteor-universal) 51 | - LESS and SASS compilers are added to `angular2-compilers@0.6.0`. Angular2 components can start importing styles in the ES6 style (as templates), if styles are located in the root `imports` folder 52 | 53 | ### Bug Fixes 54 | 55 | - MeteorComponent.autorun: #149 ([d049759](https://github.com/Urigo/angular2-meteor/commit/d049759)) 56 | - Issue with promises: #238 ([a611ed8](https://github.com/Urigo/angular2-meteor/commit/a611ed8)) 57 | 58 | ### Other 59 | 60 | - Angular2-Meteor for Meteor 1.2 based on SystemJS have been deprecated (old code can be found in the `legacy` branch) 61 | - Usage Gulp in the build have been deprecated in favor of NPM scripts 62 | - Tests have been moved to be based on Mocha and Chai (Meteor 1.3 style) 63 | 64 | ## 0.3.3 65 | 66 | ### Breaking Changes 67 | 68 | - This package is no longer supported from Atmosphere, and will be installed from NPM from Meteor 1.3 and up. 69 | - Removed `bootstrap` module (`angular2-meteor/bootstrap`) in favor of the original Angular 2.0 bootstrap's. 70 | - Removed `packages/*` - they will be moved into a separated NPM modules in the future. 71 | - Imports location will be defined as NPM imports: `import {SomePackage} from 'angular2-meteor/cursor_handlers';` 72 | - Removed the need for `SystemJS`, now uses Meteor's ES6 imports that depends on CommonJS. 73 | 74 | ### Updates 75 | 76 | - Build process now use Webpack instead of Meteor build tool. 77 | - Tests now executed inside a Meteor context which means that there is a meteor app that uses the actual code, because Angular2-Meteor now does not depends of Meteor packages system (Atmosphere) and uses NPM instead. 78 | 79 | 80 | ## v0.3.2 81 | 82 | ### Updates 83 | 84 | Angular 2 upgraded to the first beta version. 85 | 86 | ## v0.3.0 87 | 88 | ### Updates 89 | 90 | Angular 2 upgraded to the last version. 91 | 92 | ### Breaking Changes 93 | 94 | - In the latest releases of Angular 2 (alpha-50 and up) `angular2/angular2` namespace were devided into several new ones, mainly, `angular2/core` and `angular2/common` 95 | - The dash symbol were removed in the selectors of main directives, i.e., instead of `ng-if` you should use `ngIf` now 96 | 97 | For more information about the latest API, please, refer to the official [docs](https://angular.io/docs/ts/latest/api). 98 | 99 | In order to get new Angular 2 definition files, you'll need to remove `typings\angular2` folder and `typings\angular2.d.ts` file to let 100 | the package install updated version. 101 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, gender identity and expression, level of experience, 9 | nationality, personal appearance, race, religion, or sexual identity and 10 | orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at uri.goldshtein@gmail.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | -------------------------------------------------------------------------------- /CONTRIBUTION.md: -------------------------------------------------------------------------------- 1 | ## Style Guide 2 | 3 | For the coding style guide, we use AirBnB [rules](https://github.com/airbnb/javascript) with TypeScript specifics and max line width set to 100 symbols. Rules are partly enforced by the tslint.json file in the root (if you are not familiar with TSLint, read more [here](https://github.com/palantir/tslint)). Please, check that your code conforms with the rules before PR. 4 | 5 | ### Clone the source to your computer 6 | 7 | In order to work with this package locally when using Meteor project, follow these instructions: 8 | 9 | 1. Clone this repository to any folder. 10 | Note that if you clone into Meteor project directory - you need to put the cloned folder inside a hidden file, so Meteor won't try to 11 | build it! Just create a folder that starts with `.` under your project root, it should look like that: 12 | ```` 13 | MyProject 14 | .local-packages 15 | angular-meteor 16 | .meteor 17 | client 18 | server 19 | public 20 | ```` 21 | 22 | 2. Run your project with enviromental variable `METEOR_PACKAGES_DIR=your_packages_folder` directory under your root. 23 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # Angular and Meteor - The perfect stack https://www.angular-meteor.com/ 2 | # 3 | # Author: Georgy Berdyshev 4 | # 5 | 6 | FROM ubuntu:bionic 7 | 8 | RUN apt-get update && apt-get dist-upgrade -y && \ 9 | apt-get install -y software-properties-common && \ 10 | rm -rf /var/lib/apt/lists/* 11 | 12 | RUN apt-get update && apt-get install -y \ 13 | git \ 14 | apt-transport-https \ 15 | curl 16 | 17 | RUN curl -sSL https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \ 18 | && echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list 19 | 20 | RUN apt-get update && apt-get -y install google-chrome-stable --no-install-recommends 21 | 22 | RUN apt-get -y install phantomjs --no-install-recommends 23 | 24 | RUN useradd -ms /bin/bash docker 25 | 26 | USER docker 27 | 28 | WORKDIR /home/docker 29 | 30 | RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash 31 | 32 | ENV NVM_DIR=/home/docker/.nvm 33 | 34 | RUN . $NVM_DIR/nvm.sh && nvm install --lts && \ 35 | nvm use --lts && \ 36 | npm install -g npm@latest && \ 37 | npm --version 38 | 39 | RUN curl https://install.meteor.com | /bin/sh 40 | 41 | ENV PATH="/home/docker/.meteor:${PATH}" 42 | 43 | RUN meteor --version 44 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Uri Goldshtein 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | [![Discord Chat](https://img.shields.io/discord/625400653321076807)](https://discord.gg/xud7bH9) 3 | 4 | ### [Angular-Meteor Compilers](https://github.com/Urigo/angular-meteor/tree/master/atmosphere-packages/angular-compilers) 5 | 6 | ### [meteor-rxjs - The Angular Meteor Data solution](https://github.com/Urigo/meteor-rxjs) [![npm version](https://badge.fury.io/js/meteor-rxjs.svg)](https://badge.fury.io/js/meteor-rxjs) 7 | 8 | ### [AngularJS-Meteor](https://github.com/Urigo/angular-meteor/tree/angular1) [![npm version](https://badge.fury.io/js/angular-meteor.svg)](https://badge.fury.io/js/angular-meteor) 9 | 10 | #### The power of Meteor and the simplicity and eco-system of Angular 11 | 12 | [![ng-conf](https://img.youtube.com/vi/_mu6BWsnaPM/0.jpg)](https://www.youtube.com/watch?v=_mu6BWsnaPM) 13 | 14 | ## Documentation and Getting Started 15 | - [Official website](https://www.angular-meteor.com) 16 | - [Angular Meteor Stickers](https://www.stickermule.com/marketplace/9686-angular-meteor-sticker) 17 | - [Getting started tutorial](https://angular-meteor.com/tutorials/whatsapp2-tutorial) 18 | - [Angular Example application with Ionic CLI](https://github.com/Urigo/Ionic2CLI-Meteor-WhatsApp) (Final version of the tutorial) 19 | - [Angular Example application with Meteor CLI](https://github.com/Urigo/Ionic2-MeteorCLI-WhatsApp) (Final version of the tutorial) 20 | - [AngularJS Example application with Ionic CLI](https://github.com/Urigo/IonicCLI-Meteor-WhatsApp) (Final version of the tutorial) 21 | - [AngularJS Example application with Meteor CLI](https://github.com/Urigo/Ionic-MeteorCLI-WhatsApp) (Final version of the tutorial) 22 | - [More simplified examples](https://github.com/Urigo/angular-meteor/tree/master/examples) 23 | - Questions and help - [Stack Overflow `angular-meteor` tag](http://stackoverflow.com/questions/tagged/angular-meteor), [`angularjs-meteor` tag](http://stackoverflow.com/questions/tagged/angularjs-meteor) 24 | - [Join angular-meteor Office Hours](https://plus.google.com/events/cj8i93v7cabr9fab5jvv3r6bb80) 25 | - [Discussions - the Meteor Forum](https://forums.meteor.com/) 26 | - [Gitter](https://gitter.im/Urigo/angular-meteor) 27 | - [Report issues](https://github.com/Urigo/angular-meteor/issues) 28 | - [Change Log, updates and breaking changes](https://github.com/Urigo/angular-meteor/blob/master/CHANGELOG.md) 29 | - [Meteor Blog](https://info.meteor.com/blog) 30 | - [Official Meteor guide for best practices](http://guide.meteor.com/) 31 | - [Awesome Meteor](https://github.com/Urigo/awesome-meteor) - Curated, community driven list of Meteor resources 32 | - Starters - [Angular-Meteor Base](https://github.com/Urigo/angular-meteor-base), [angular1-meteor Yeoman generator](https://github.com/ndxbxrme/generator-angular-meteor) 33 | - Track Roadmap here: [angular-meteor milestones](https://github.com/Urigo/angular-meteor/milestones), [Meteor issues related to Angular](https://github.com/meteor/meteor/labels/Project%3AAngular) 34 | 35 | ## Usage 36 | 37 | Go to the [official docs about Meteor-RxJS](https://angular-meteor.com/meteor-rxjs) 38 | 39 | ## Tutorial 40 | 41 | If you are new to Angular and/or Meteor but want to learn them quickly, 42 | please check out our 14-steps Angular-Meteor [tutorial](https://angular-meteor.com/tutorials/whatsapp2-tutorial). 43 | 44 | ## Quick Start Using Angular-Meteor 45 | 46 | ```bash 47 | $ git clone https://github.com/Urigo/angular-meteor-base myApp 48 | $ cd myApp 49 | $ meteor npm install 50 | ``` 51 | 52 | Then run: 53 | 54 | ``` 55 | $ meteor 56 | ``` 57 | 58 | ## Contributing 59 | 60 | Please read the contributing instructions at [the contributing page](https://github.com/Urigo/angular-meteor/blob/master/.github/CONTRIBUTING.md). 61 | 62 | ### Acknowledgement 63 | 64 | This project started as [ngMeteor](https://github.com/loneleeandroo/ngMeteor), a pre-0.9 meteorite package. Since then a lot has changed but that was the main base. 65 | 66 | Also, a lot of features were inspired by @superchris's [angular-meteor fork of ngMeteor](https://github.com/superchris/angular-meteor). 67 | -------------------------------------------------------------------------------- /atmosphere-packages/angular-compilers/.versions: -------------------------------------------------------------------------------- 1 | angular-compilers@0.4.0 2 | angular-html-compiler@0.4.0 3 | angular-scss-compiler@0.4.0 4 | angular-typescript-compiler@0.4.0 5 | babel-compiler@7.6.0 6 | babel-runtime@1.5.0 7 | dynamic-import@0.6.0 8 | ecmascript@0.15.0 9 | ecmascript-runtime@0.7.0 10 | ecmascript-runtime-client@0.11.0 11 | ecmascript-runtime-server@0.10.0 12 | fetch@0.1.1 13 | inter-process-messaging@0.1.1 14 | meteor@1.9.3 15 | modern-browsers@0.1.5 16 | modules@0.16.0 17 | modules-runtime@0.12.0 18 | promise@0.11.2 19 | react-fast-refresh@0.1.0 20 | -------------------------------------------------------------------------------- /atmosphere-packages/angular-compilers/README.md: -------------------------------------------------------------------------------- 1 | ## All-in-One Angular Compiler for Meteor 2 | Package contains one combined Angular compiler for Meteor that provides: 3 | - Typescript compilation 4 | - Assets compilation (HTML, styles) 5 | - Angular's AoT compilation 6 | - Rollup's bundling with Tree Shaking 7 | 8 | ### Installing the compilers 9 | 10 | In order to use those compilers, you need first to remove the default HTML compiler in Meteor, by running: 11 | ``` 12 | $ meteor remove blaze-html-templates 13 | $ meteor remove less 14 | ``` 15 | 16 | And then add the compilers for Angular by running: 17 | ``` 18 | $ meteor add angular-compilers 19 | ``` 20 | 21 | Angular's compiler-cli and other libraries are peer dependencies of this package, so you need to add them to you project. 22 | ``` 23 | $ meteor npm install @angular/core @angular/common @angular/compiler @angular/compiler-cli typescript --save-dev 24 | ``` 25 | 26 | ## Compiler modes 27 | 28 | ### Default mode (development) 29 | By default, this compiler compiles ts-files into CommonJS modules and serves component assets (HTML, LESS, and SASS) dynamically, which then are passed to Meteor to load. 30 | In this case, the app is bootstrapped using regular dynamic bootstrapping: 31 | ```ts 32 | import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; 33 | import {AppModule} from './app.module'; 34 | 35 | platformBrowserDynamic().bootstrapModule(AppModule); 36 | ``` 37 | 38 | In this case, Angular uses just-in-time template compiler to parse component 39 | templates before the app is loaded. 40 | 41 | ## AoT mode (Enabled by default in production) 42 | If the app is launched with the `AOT` environment variable preset, i.e, `AOT=1 meteor`, 43 | the compiler's AoT mode comes into play. Compiler uses internally 44 | Angular's CLI metadata and Angular's template compilers in order to 45 | pre-compile component assets, first, into ES6 ts-modules, and then TypeScript compiler to 46 | compile those ts-modules to regular ES6 js-modules. As a result, 47 | each file with `@Component`, `@Directive`, or `@NgModule` annotations will 48 | correspond internally to an ES6 js-module with the special Angular module component or module factories 49 | (they usually have `.ngfactory` extension if processed with `ngc` directly). 50 | 51 | ## Tree-shaking mode (Disabled by default in production) 52 | If the app is launched with `ROLLUP` environment variable preset, i.e, `AOT=1 ROLLUP=1 meteor`; 53 | On the final step all generated factory and component ES6 js-modules 54 | are bundled together using Rollup bundler in the Tree Shaking mode. 55 | Tree Shaking is a special algorithm that traverses graph of the js-modules 56 | (mostly of NPMs but not only) to find modules that are imported but 57 | not used (or to be exact, exports of which are not used). 58 | Then, they are excluded from the bundle. 59 | For more info on that read [here](https://angular.io/docs/ts/latest/cookbook/aot-compiler.html#!#tree-shaking) and [here](https://github.com/rollup/rollup). 60 | 61 | As you can see above, this mode introduces a couple of optimizations that take additional time to process 62 | making it a good fit for the production (more reasons you can find below) rather 63 | then for the development where you add new changes often and demand quick response from the compiler. 64 | 65 | ### Templates (HTML) and Stylesheets (SCSS) 66 | If the asset files (templates and stylesheets) located in imports folder, they would be added to the application module lazily to be added in any components. Otherwise, they would be merged, and added to main boilerplate. 67 | 68 | # Use in components or global 69 | `/client/main.scss` and `/client/main.html` directly added to `/merged-stylesheets.css` 70 | `/client/imports/app.scss` and `/client/imports/app.html` would be used in `/client/imports/app.component.ts` via regular `Component` declaration 71 | ```ts 72 | @Component({ 73 | templateUrl: 'app.html', 74 | styleUrls: ['app.scss'] 75 | }) 76 | export class AppComponent {} 77 | ``` 78 | Be careful about `ViewEncapsulation` for UI frameworks like Angular Material and Ionic, if you are using `AppComponent` as global stylesheet source. 79 | In this case you should disable encapsulation by using `ViewEncapsulation.None` as noted in `Angular Material` [docs](https://material.angular.io/guide/theming#defining-a-custom-theme) 80 | ```ts 81 | import { ViewEncapsulation } from '@angular/core'; 82 | @Component({ 83 | templateUrl: 'app.html', 84 | styleUrls: ['app.scss'], 85 | encapsulation: ViewEncapsulation.None 86 | }) 87 | export class AppComponent {} 88 | ``` 89 | 90 | # Import from node_modules 91 | `Angular SCSS Compiler` is able to understand `NPM` modules. 92 | - For example in `Angular Material` 93 | ```scss 94 | @import '@angular/material/theming'; 95 | // Plus imports for other components in your app. 96 | 97 | // Include the common styles for Angular Material. We include this here so that you only 98 | // have to load a single css file for Angular Material in your app. 99 | // Be sure that you only ever include this mixin once! 100 | @include mat-core(); 101 | 102 | // Define the palettes for your theme using the Material Design palettes available in palette.scss 103 | // (imported above). For each palette, you can optionally specify a default, lighter, and darker 104 | // hue. 105 | $candy-app-primary: mat-palette($mat-indigo); 106 | $candy-app-accent: mat-palette($mat-pink, A200, A100, A400); 107 | 108 | // The warn palette is optional (defaults to red). 109 | $candy-app-warn: mat-palette($mat-red); 110 | 111 | // Create the theme object (a Sass map containing all of the palettes). 112 | $candy-app-theme: mat-light-theme($candy-app-primary, $candy-app-accent, $candy-app-warn); 113 | 114 | // Include theme styles for core and each component used in your app. 115 | // Alternatively, you can import and @include the theme mixins for each component 116 | // that you are using. 117 | @include angular-material-theme($candy-app-theme); 118 | ``` 119 | 120 | ### Lazy Loading 121 | Meteor is able to work like `SystemJS` which is used with Angular to load components, routes and assets dynamically thanks to (`dynamic-import`)[https://blog.meteor.com/dynamic-imports-in-meteor-1-5-c6130419c3cd] package. 122 | You can use (Lazy Loading)[https://angular.io/guide/ngmodule#lazy-loading-modules-with-the-router] with `angular-compilers`. 123 | Add a route like `angular.io` example: 124 | ```ts 125 | { 126 | path: '/lazyRoutePath', 127 | loadChildren: '/path/to/your-lazy-module#YourLazyModule' 128 | } 129 | ``` 130 | 131 | ### Bootstrapping 132 | After the compilation, main Angular module factory should be bootstrapped as follows: 133 | ```ts 134 | import {platformBrowser} from '@angular/platform-browser'; 135 | import {AppModuleNgFactory} from './app.module.ngfactory'; 136 | platformBrowser().bootstrapModuleFactory(AppModuleNgFactory); 137 | ``` 138 | But the compiler takes care of you on this stage as well: 139 | you'll need only to add dynamic bootstrapping (as above), 140 | everything else is taken care of for you. Compiler will find most top 141 | Angular module of your app to boostrap and add bootstrapping code for you. 142 | 143 | ### Advantages of AOT over the default 144 | Main advantages of the additional processing: 145 | - Components are loaded faster, hence app itself; 146 | - Angular template compiler is not needed on the client side, 147 | hence the final js-bundle is smaller; 148 | - Compiled code is considered more secure; 149 | - You have chance to verify that templates are free of bugs, 150 | which is not fully available with the dynamic compilation; 151 | - Tree Shaking reduces size of the final bundle. 152 | 153 | For more info on the pluses and other details, please, read [here](https://angular.io/docs/ts/latest/cookbook/aot-compiler.html). 154 | -------------------------------------------------------------------------------- /atmosphere-packages/angular-compilers/package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | name: 'angular-compilers', 3 | version: '0.4.0', 4 | summary: 'Rollup, AOT, SCSS, HTML and TypeScript compilers for Angular Meteor', 5 | git: 'https://github.com/Urigo/angular-meteor/tree/master/atmosphere-packages/angular-compilers', 6 | documentation: 'README.md' 7 | }); 8 | 9 | Package.registerBuildPlugin({ 10 | name: 'Angular Compilers', 11 | sources: [ 12 | 'plugin/register.js' 13 | ], 14 | use: [ 15 | // Uses an external packages to get the actual compilers 16 | 'ecmascript@0.10.5', 17 | 'angular-typescript-compiler@0.4.0', 18 | 'angular-html-compiler@0.4.0', 19 | 'angular-scss-compiler@0.4.0' 20 | ] 21 | }); 22 | 23 | Package.onUse(function (api) { 24 | api.versionsFrom('1.11'); 25 | 26 | // Required in order to register plugins 27 | api.use('isobuild:compiler-plugin@1.0.0'); 28 | }); 29 | -------------------------------------------------------------------------------- /atmosphere-packages/angular-compilers/plugin/register.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import { 4 | AngularTsCompiler 5 | } from 'meteor/angular-typescript-compiler'; 6 | 7 | import { 8 | AngularHtmlCompiler 9 | } from 'meteor/angular-html-compiler'; 10 | 11 | import { 12 | AngularScssCompiler 13 | } from 'meteor/angular-scss-compiler'; 14 | 15 | let templateExtension = 'html'; 16 | 17 | if(process.env.BLAZE){ 18 | templateExtension = 'ng.html'; 19 | } 20 | 21 | let aot = ((process.env.NODE_ENV == 'production') && (process.env.AOT != '0')) || process.env.AOT == '1'; 22 | let rollup = (process.env.ROLLUP == '1'); 23 | let compiler, compilerCli; 24 | try{ 25 | if(aot){ 26 | compiler = require('@angular/compiler'); 27 | compilerCli = require('@angular/compiler-cli'); 28 | } 29 | }catch(e){ 30 | console.log('@angular/compiler and @angular/compiler-cli must be installed for AOT compilation!'); 31 | console.log('AOT compilation disabled!'); 32 | console.log('Ignore this if you are using AngularJS 1.X'); 33 | aot = false; 34 | rollup = false; 35 | } 36 | 37 | 38 | Plugin.registerCompiler({ 39 | extensions: ['ts', 'tsx'], 40 | filenames: ['tsconfig.json'] 41 | }, () => new AngularTsCompiler({ 42 | aot, 43 | rollup, 44 | compiler, 45 | compilerCli 46 | })); 47 | Plugin.registerCompiler({ 48 | extensions: [templateExtension] 49 | }, () => new AngularHtmlCompiler({ 50 | aot 51 | })); 52 | Plugin.registerCompiler({ 53 | extensions: ['scss'] 54 | }, () => new AngularScssCompiler({ 55 | aot 56 | })); 57 | -------------------------------------------------------------------------------- /atmosphere-packages/angular-html-compiler/.versions: -------------------------------------------------------------------------------- 1 | angular-html-compiler@0.4.0 2 | babel-compiler@7.6.0 3 | babel-runtime@1.5.0 4 | dynamic-import@0.6.0 5 | ecmascript@0.15.0 6 | ecmascript-runtime@0.7.0 7 | ecmascript-runtime-client@0.11.0 8 | ecmascript-runtime-server@0.10.0 9 | fetch@0.1.1 10 | inter-process-messaging@0.1.1 11 | meteor@1.9.3 12 | modern-browsers@0.1.5 13 | modules@0.16.0 14 | modules-runtime@0.12.0 15 | promise@0.11.2 16 | react-fast-refresh@0.1.0 17 | -------------------------------------------------------------------------------- /atmosphere-packages/angular-html-compiler/index.js: -------------------------------------------------------------------------------- 1 | const $ = Npm.require('cheerio'); 2 | 3 | const WEB_ARCH_REGEX = /^web/; 4 | 5 | const CACHE = new Map(); 6 | 7 | export class AngularHtmlCompiler { 8 | constructor({aot}){ 9 | this.isAot = aot; 10 | } 11 | static getContent(filePath){ 12 | return CACHE.get(filePath); 13 | } 14 | processFilesForTarget(htmlFiles){ 15 | const arch = htmlFiles[0].getArch(); 16 | const forWeb = WEB_ARCH_REGEX.test(arch); 17 | const prefix = forWeb ? 'client' : 'server'; 18 | console.time(`[${prefix}]: HTML Files Compilation`); 19 | for(const htmlFile of htmlFiles){ 20 | if(!htmlFile.getPathInPackage().includes('node_modules')){ 21 | const data = htmlFile.getContentsAsString(); 22 | CACHE.set(htmlFile.getPathInPackage(), data); 23 | const $contents = $(data); 24 | const isMain = $contents.closest('head,body').length; 25 | if(isMain){ 26 | const $head = $contents.closest('head'); 27 | const $body = $contents.closest('body'); 28 | htmlFile.addHtml({ 29 | data: $head.html() || '', 30 | section: 'head', 31 | hash: htmlFile.getSourceHash() 32 | }); 33 | 34 | htmlFile.addHtml({ 35 | data: $body.html() || '', 36 | section: 'body', 37 | hash: htmlFile.getSourceHash() 38 | }); 39 | const attrs = $body[0] ? $body[0].attribs : undefined; 40 | if (attrs) { 41 | htmlFile.addJavaScript({ 42 | path: 'main.html.js', 43 | data: ` 44 | Meteor.startup(function() { 45 | var attrs = ${JSON.stringify(attrs)}; 46 | for (var prop in attrs) { 47 | document.body.setAttribute(prop, attrs[prop]); 48 | } 49 | }); 50 | `, 51 | }); 52 | } 53 | }else if(!this.isAot){ 54 | htmlFile.addAsset({ 55 | data, 56 | path: htmlFile.getPathInPackage(), 57 | hash: htmlFile.getSourceHash() 58 | }); 59 | } 60 | } 61 | } 62 | console.timeEnd(`[${prefix}]: HTML Files Compilation`); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /atmosphere-packages/angular-html-compiler/package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | name: 'angular-html-compiler', 3 | version: '0.4.0', 4 | summary: 'Angular Html Compiler Package', 5 | git: 'https://github.com/Urigo/angular-meteor/tree/master/atmosphere-packages/angular-html-compiler', 6 | documentation: null 7 | }); 8 | 9 | Npm.depends({ 10 | 'cheerio': '0.22.0' 11 | }); 12 | 13 | Package.onUse(function (api) { 14 | api.versionsFrom("1.11"); 15 | api.use([ 16 | 'ecmascript' 17 | ], 'server'); 18 | api.mainModule('index.js', 'server'); 19 | }); -------------------------------------------------------------------------------- /atmosphere-packages/angular-scss-compiler/.versions: -------------------------------------------------------------------------------- 1 | angular-scss-compiler@0.4.0 2 | babel-compiler@7.6.0 3 | babel-runtime@1.5.0 4 | dynamic-import@0.6.0 5 | ecmascript@0.15.0 6 | ecmascript-runtime@0.7.0 7 | ecmascript-runtime-client@0.11.0 8 | ecmascript-runtime-server@0.10.0 9 | fetch@0.1.1 10 | inter-process-messaging@0.1.1 11 | meteor@1.9.3 12 | modern-browsers@0.1.5 13 | modules@0.16.0 14 | modules-runtime@0.12.0 15 | promise@0.11.2 16 | react-fast-refresh@0.1.0 17 | -------------------------------------------------------------------------------- /atmosphere-packages/angular-scss-compiler/file-utils.js: -------------------------------------------------------------------------------- 1 | const path = Npm.require('path'); 2 | 3 | export const basePath = process.cwd().replace(/\\/g, '\/'); 4 | 5 | export function getMeteorPath(filePath) { 6 | if (filePath.startsWith(basePath)) { 7 | filePath = filePath.slice(basePath.length); 8 | } 9 | return getNoRooted(filePath); 10 | } 11 | 12 | const ROOTED = /^(\/|\\)/; 13 | 14 | export function isRooted(filePath) { 15 | return ROOTED.test(filePath); 16 | } 17 | 18 | export function getNoRooted(filePath) { 19 | if (isRooted(filePath)) { 20 | return filePath.slice(1); 21 | } 22 | return filePath; 23 | } 24 | 25 | export function getFullPath(filePath) { 26 | filePath = getMeteorPath(filePath); 27 | return path.join(basePath, filePath); 28 | } 29 | 30 | export function removeTsExtension(filePath) { 31 | if (filePath.endsWith('.ts')) { 32 | return filePath.slice(0, -3); 33 | } 34 | return filePath; 35 | } 36 | -------------------------------------------------------------------------------- /atmosphere-packages/angular-scss-compiler/index.js: -------------------------------------------------------------------------------- 1 | const sass = Npm.require('node-sass'); 2 | 3 | const path = Npm.require('path'); 4 | 5 | import { 6 | basePath, 7 | ROOTED, 8 | getMeteorPath, 9 | isRooted, 10 | getNoRooted 11 | } from './file-utils'; 12 | 13 | const WEB_ARCH_REGEX = /^web/; 14 | 15 | const CACHE = new Map(); 16 | 17 | export class AngularScssCompiler{ 18 | constructor({ 19 | aot 20 | }){ 21 | this.isAot = aot; 22 | } 23 | static getContent(filePath){ 24 | return CACHE.get(filePath); 25 | } 26 | static compileFile(filePath, data){ 27 | const fullPath = isRooted(filePath) ? filePath : path.join(basePath, filePath); 28 | return sass.renderSync({ 29 | file: fullPath, 30 | includePaths: [basePath + '/node_modules'], 31 | data 32 | }); 33 | } 34 | processFilesForTarget(scssFiles){ 35 | const arch = scssFiles[0].getArch(); 36 | const forWeb = WEB_ARCH_REGEX.test(arch); 37 | const prefix = forWeb ? 'client' : 'server'; 38 | console.time(`[${prefix}]: SCSS Files Compilation`); 39 | for(const scssFile of scssFiles){ 40 | try{ 41 | const fileName = scssFile.getBasename(); 42 | const filePath = scssFile.getPathInPackage(); 43 | if(!fileName.startsWith('_' ) && 44 | !filePath.includes('node_modules')){ 45 | const outputData = AngularScssCompiler.compileFile(filePath, scssFile.getContentsAsString()); 46 | CACHE.set(filePath, outputData.css.toString('utf-8')); 47 | const toBeAdded = { 48 | path: filePath, 49 | data: outputData.css.toString('utf-8'), 50 | sourceMap: outputData.map, 51 | hash: outputData.hash 52 | }; 53 | if(!filePath.includes('imports/')){ 54 | scssFile.addStylesheet(toBeAdded) 55 | }else if(!this.isAot){ 56 | scssFile.addAsset(toBeAdded); 57 | } 58 | } 59 | }catch(e){ 60 | scssFile.error(e); 61 | console.error(e); 62 | } 63 | } 64 | console.timeEnd(`[${prefix}]: SCSS Files Compilation`); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /atmosphere-packages/angular-scss-compiler/package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | name: 'angular-scss-compiler', 3 | version: '0.4.0', 4 | summary: 'Angular Scss Compiler Package', 5 | git: 'https://github.com/Urigo/angular-meteor/tree/master/atmosphere-packages/angular-scss-compiler', 6 | documentation: null 7 | }); 8 | 9 | Npm.depends({ 10 | 'node-sass': '5.0.0' 11 | }); 12 | 13 | Package.onUse(function (api) { 14 | api.versionsFrom("1.11"); 15 | api.use([ 16 | 'ecmascript' 17 | ], 'server'); 18 | api.mainModule('index.js', 'server'); 19 | }); 20 | -------------------------------------------------------------------------------- /atmosphere-packages/angular-typescript-compiler/.versions: -------------------------------------------------------------------------------- 1 | angular-html-compiler@0.4.0 2 | angular-scss-compiler@0.4.0 3 | angular-typescript-compiler@0.4.0 4 | babel-compiler@7.6.0 5 | babel-runtime@1.5.0 6 | dynamic-import@0.6.0 7 | ecmascript@0.15.0 8 | ecmascript-runtime@0.7.0 9 | ecmascript-runtime-client@0.11.0 10 | ecmascript-runtime-server@0.10.0 11 | fetch@0.1.1 12 | inter-process-messaging@0.1.1 13 | meteor@1.9.3 14 | modern-browsers@0.1.5 15 | modules@0.16.0 16 | modules-runtime@0.12.0 17 | promise@0.11.2 18 | react-fast-refresh@0.1.0 19 | -------------------------------------------------------------------------------- /atmosphere-packages/angular-typescript-compiler/file-utils.js: -------------------------------------------------------------------------------- 1 | const path = Npm.require('path'); 2 | 3 | export const basePath = process.cwd().replace(/\\/g, '\/'); 4 | 5 | export function getMeteorPath(filePath) { 6 | if (filePath.startsWith(basePath)) { 7 | filePath = filePath.slice(basePath.length); 8 | } 9 | return getNoRooted(filePath); 10 | } 11 | 12 | const ROOTED = /^(\/|\\)/; 13 | 14 | export function isRooted(filePath) { 15 | return ROOTED.test(filePath); 16 | } 17 | 18 | export function getNoRooted(filePath) { 19 | if (isRooted(filePath)) { 20 | return filePath.slice(1); 21 | } 22 | return filePath; 23 | } 24 | 25 | export function getFullPath(filePath) { 26 | filePath = getMeteorPath(filePath); 27 | return path.join(basePath, filePath); 28 | } 29 | 30 | export function removeTsExtension(filePath) { 31 | if (filePath.endsWith('.ts')) { 32 | return filePath.slice(0, -3); 33 | } 34 | return filePath; 35 | } 36 | -------------------------------------------------------------------------------- /atmosphere-packages/angular-typescript-compiler/package.js: -------------------------------------------------------------------------------- 1 | Package.describe({ 2 | name: 'angular-typescript-compiler', 3 | version: '0.4.0', 4 | summary: 'Angular TypeScript Compiler Package', 5 | git: 'https://github.com/Urigo/angular-meteor/tree/master/atmosphere-packages/angular-typescript-compiler', 6 | documentation: null 7 | }); 8 | 9 | Npm.depends({ 10 | "meteor-typescript": "0.9.0", 11 | rollup: "2.26.11", 12 | "rollup-plugin-node-resolve": "5.2.0", 13 | "rollup-plugin-hypothetical": "2.1.0", 14 | "rollup-plugin-commonjs": "10.1.0", 15 | }); 16 | 17 | Package.onUse(function (api) { 18 | api.versionsFrom("1.11"); 19 | api.use( 20 | [ 21 | "ecmascript", 22 | "babel-compiler@7.5.3", 23 | "angular-html-compiler@0.4.0", 24 | "angular-scss-compiler@0.4.0", 25 | ], 26 | "server" 27 | ); 28 | api.mainModule('index.js', 'server'); 29 | }); -------------------------------------------------------------------------------- /atmosphere-packages/angular-typescript-compiler/rollup.js: -------------------------------------------------------------------------------- 1 | const path = Npm.require('path'); 2 | const baseRollup = Npm.require('rollup').rollup; 3 | const Hypothetical = Npm.require('rollup-plugin-hypothetical'); 4 | const CommonJS = Npm.require('rollup-plugin-commonjs'); 5 | const NodeResolve = Npm.require('rollup-plugin-node-resolve'); 6 | 7 | import {getMeteorPath, isRooted, getNoRooted} from './file-utils'; 8 | 9 | const EXCLUDE_MODULES = ['node_modules/zone.js/**']; 10 | 11 | const AppResolve = (appNgModules, exclude, forWeb) => { 12 | const exlRegExp = new RegExp(`^(${exclude.join('|')})$`); 13 | const nodeResolve = NodeResolve({ 14 | jsnext: true, 15 | module: true, 16 | browser: forWeb, 17 | }); 18 | return { 19 | resolveId(importee, importer) { 20 | if (! importer) return null; 21 | 22 | let modId = importee; 23 | 24 | // Relative path. 25 | if (importee[0] === '.') { 26 | modId = path.resolve(importer, '..', importee); 27 | modId = getMeteorPath(modId); 28 | } 29 | 30 | // Rooted path. 31 | if (isRooted(importee)) { 32 | modId = getMeteorPath(importee); 33 | } 34 | 35 | if (appNgModules.has(modId)) { 36 | return Promise.resolve(modId); 37 | } 38 | 39 | const index = path.join(modId, 'index'); 40 | if (appNgModules.has(index)) { 41 | return Promise.resolve(index); 42 | } 43 | 44 | const parts = importee.split(/[\/\\]/); 45 | modId = parts.shift(); 46 | 47 | // Skip bundling packages to exclude. 48 | if (exlRegExp.test(modId)) { 49 | return null; 50 | } 51 | 52 | return nodeResolve.resolveId(importee, importer); 53 | }, 54 | load(modId) { 55 | if (appNgModules.has(modId)) { 56 | return Promise.resolve(appNgModules.get(modId)); 57 | } 58 | 59 | return null; 60 | } 61 | } 62 | }; 63 | 64 | export default function rollup( 65 | appNgModules, bootstrapModule, mainCodePath, exclude, namedExports, forWeb) { 66 | return baseRollup({ 67 | entry: mainCodePath, 68 | onwarn: (warn) => {}, 69 | plugins: [ 70 | Hypothetical({ 71 | files: { 72 | [mainCodePath]: bootstrapModule, 73 | }, 74 | allowRealFiles: true 75 | }), 76 | AppResolve(appNgModules, 77 | ['meteor'].concat(exclude || []), forWeb), 78 | CommonJS({ 79 | sourceMap: false, 80 | exclude: EXCLUDE_MODULES, 81 | namedExports: namedExports || {}, 82 | }) 83 | ] 84 | }) 85 | .then(bundle => { 86 | const result = bundle.generate({ 87 | format: 'umd', 88 | moduleName: 'app', 89 | }); 90 | return result.code; 91 | }) 92 | .catch(error => { 93 | console.log(error) 94 | return null; 95 | }) 96 | .await(); 97 | } -------------------------------------------------------------------------------- /atmosphere-packages/publish.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cd angular-html-compiler 4 | meteor publish 5 | cd ../angular-scss-compiler 6 | meteor publish 7 | cd ../angular-typescript-compiler 8 | meteor publish 9 | cd ../angular-compilers 10 | meteor publish 11 | -------------------------------------------------------------------------------- /examples/AngularCLI/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /examples/AngularCLI/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | yarn-error.log 34 | testem.log 35 | /typings 36 | 37 | # System Files 38 | .DS_Store 39 | Thumbs.db 40 | -------------------------------------------------------------------------------- /examples/AngularCLI/README.md: -------------------------------------------------------------------------------- 1 | # AngularcliMeteor 2 | 3 | ## Meteor server 4 | 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. 10 | 11 | Run `./node_modules/.bin/meteor-client bundle -s api`. 12 | 13 | ## Development server 14 | 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. 16 | 17 | ## Build 18 | 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. 20 | 21 | ## Running unit tests 22 | 23 | Run `npm run test` to execute the unit tests via [Karma](https://karma-runner.github.io). 24 | 25 | ## Running end-to-end tests 26 | 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 angular-cli-meteor --style scss 33 | cd angular-cli-meteor 34 | ``` 35 | 36 | ``` 37 | meteor create api 38 | yarn add babel-runtime 39 | yarn add meteor-node-stubs 40 | yarn add meteor-rxjs 41 | yarn add meteor-client-bundler --dev 42 | yarn add @types/meteor --dev 43 | rm -rf api/node_modules 44 | rm -rf api/client 45 | mv api/server/main.js api/server/main.ts 46 | rm api/package.json api/yarn.lock 47 | cd api; 48 | ln -s ../package.json 49 | ln -s ../yarn.lock 50 | ln -s ../tsconfig.json 51 | ln -s ../node_modules 52 | meteor add barbatus:typescript; 53 | cd ..; 54 | ``` 55 | 56 | Create `meteor-client.config.json`. 57 | Add `"generateNodeModules": true` to `meteor-client.config.json`. 58 | Add `node_modules/meteor-client.js` to `scripts` section in `angular.json`. 59 | Add `meteor` to `types` section in `src/tsconfig.app.json` 60 | -------------------------------------------------------------------------------- /examples/AngularCLI/angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "projects": { 6 | "AngularCLIMeteor": { 7 | "root": "", 8 | "sourceRoot": "src", 9 | "projectType": "application", 10 | "prefix": "app", 11 | "schematics": {}, 12 | "architect": { 13 | "build": { 14 | "builder": "@angular-devkit/build-angular:browser", 15 | "options": { 16 | "outputPath": "dist/AngularCLIMeteor", 17 | "index": "src/index.html", 18 | "main": "src/main.ts", 19 | "polyfills": "src/polyfills.ts", 20 | "tsConfig": "src/tsconfig.app.json", 21 | "assets": [ 22 | "src/favicon.ico", 23 | "src/assets" 24 | ], 25 | "styles": [ 26 | "src/styles.css" 27 | ], 28 | "scripts": [ 29 | "node_modules/meteor-client.js" 30 | ] 31 | }, 32 | "configurations": { 33 | "production": { 34 | "fileReplacements": [{ 35 | "replace": "src/environments/environment.ts", 36 | "with": "src/environments/environment.prod.ts" 37 | }], 38 | "optimization": true, 39 | "outputHashing": "all", 40 | "sourceMap": false, 41 | "extractCss": true, 42 | "namedChunks": false, 43 | "aot": true, 44 | "extractLicenses": true, 45 | "vendorChunk": false, 46 | "buildOptimizer": true 47 | } 48 | } 49 | }, 50 | "serve": { 51 | "builder": "@angular-devkit/build-angular:dev-server", 52 | "options": { 53 | "browserTarget": "AngularCLIMeteor:build" 54 | }, 55 | "configurations": { 56 | "production": { 57 | "browserTarget": "AngularCLIMeteor:build:production" 58 | } 59 | } 60 | }, 61 | "extract-i18n": { 62 | "builder": "@angular-devkit/build-angular:extract-i18n", 63 | "options": { 64 | "browserTarget": "AngularCLIMeteor:build" 65 | } 66 | }, 67 | "test": { 68 | "builder": "@angular-devkit/build-angular:karma", 69 | "options": { 70 | "main": "src/test.ts", 71 | "polyfills": "src/polyfills.ts", 72 | "tsConfig": "src/tsconfig.spec.json", 73 | "karmaConfig": "src/karma.conf.js", 74 | "styles": [ 75 | "src/styles.css" 76 | ], 77 | "scripts": [], 78 | "assets": [ 79 | "src/favicon.ico", 80 | "src/assets" 81 | ] 82 | } 83 | }, 84 | "lint": { 85 | "builder": "@angular-devkit/build-angular:tslint", 86 | "options": { 87 | "tsConfig": [ 88 | "src/tsconfig.app.json", 89 | "src/tsconfig.spec.json" 90 | ], 91 | "exclude": [ 92 | "**/node_modules/**" 93 | ] 94 | } 95 | } 96 | } 97 | }, 98 | "AngularCLIMeteor-e2e": { 99 | "root": "e2e/", 100 | "projectType": "application", 101 | "architect": { 102 | "e2e": { 103 | "builder": "@angular-devkit/build-angular:protractor", 104 | "options": { 105 | "protractorConfig": "e2e/protractor.conf.js", 106 | "devServerTarget": "AngularCLIMeteor:serve" 107 | }, 108 | "configurations": { 109 | "production": { 110 | "devServerTarget": "AngularCLIMeteor:serve:production" 111 | } 112 | } 113 | }, 114 | "lint": { 115 | "builder": "@angular-devkit/build-angular:tslint", 116 | "options": { 117 | "tsConfig": "e2e/tsconfig.e2e.json", 118 | "exclude": [ 119 | "**/node_modules/**" 120 | ] 121 | } 122 | } 123 | } 124 | } 125 | }, 126 | "defaultProject": "AngularCLIMeteor" 127 | } 128 | -------------------------------------------------------------------------------- /examples/AngularCLI/api/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /examples/AngularCLI/api/.meteor/.finished-upgraders: -------------------------------------------------------------------------------- 1 | # This file contains information which helps Meteor properly upgrade your 2 | # app when you run 'meteor update'. You should check it into version control 3 | # with your project. 4 | 5 | notices-for-0.9.0 6 | notices-for-0.9.1 7 | 0.9.4-platform-file 8 | notices-for-facebook-graph-api-2 9 | 1.2.0-standard-minifiers-package 10 | 1.2.0-meteor-platform-split 11 | 1.2.0-cordova-changes 12 | 1.2.0-breaking-changes 13 | 1.3.0-split-minifiers-package 14 | 1.4.0-remove-old-dev-bundle-link 15 | 1.4.1-add-shell-server-package 16 | 1.4.3-split-account-service-packages 17 | 1.5-add-dynamic-import-package 18 | 1.7-split-underscore-from-meteor-base 19 | -------------------------------------------------------------------------------- /examples/AngularCLI/api/.meteor/.gitignore: -------------------------------------------------------------------------------- 1 | local 2 | -------------------------------------------------------------------------------- /examples/AngularCLI/api/.meteor/.id: -------------------------------------------------------------------------------- 1 | # This file contains a token that is unique to your project. 2 | # Check it into your repository along with the rest of this directory. 3 | # It can be used for purposes such as: 4 | # - ensuring you don't accidentally deploy one app on top of another 5 | # - providing package authors with aggregated statistics 6 | 7 | vxujg1qiczqd.piy2nzjh7tga 8 | -------------------------------------------------------------------------------- /examples/AngularCLI/api/.meteor/packages: -------------------------------------------------------------------------------- 1 | # Meteor packages used by this project, one per line. 2 | # Check this file (and the other files in this directory) into your repository. 3 | # 4 | # 'meteor add' and 'meteor remove' will edit this file for you, 5 | # but you can also edit it by hand. 6 | 7 | meteor-base@1.4.0 # Packages every Meteor app needs to have 8 | mobile-experience@1.0.5 # Packages for a great mobile UX 9 | mongo@1.6.2 # The database Meteor supports right now 10 | reactive-var@1.0.11 # Reactive variable for tracker 11 | tracker@1.2.0 # Meteor's client-side reactive programming library 12 | 13 | standard-minifier-css@1.5.3 # CSS minifier run for production mode 14 | standard-minifier-js@2.4.1 # JS minifier run for production mode 15 | es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers 16 | ecmascript@0.12.4 # Enable ECMAScript2015+ syntax in app code 17 | shell-server@0.4.0 # Server-side component of the `meteor shell` command 18 | angular-compilers 19 | -------------------------------------------------------------------------------- /examples/AngularCLI/api/.meteor/platforms: -------------------------------------------------------------------------------- 1 | server 2 | browser 3 | -------------------------------------------------------------------------------- /examples/AngularCLI/api/.meteor/release: -------------------------------------------------------------------------------- 1 | METEOR@1.8.1 2 | -------------------------------------------------------------------------------- /examples/AngularCLI/api/.meteor/versions: -------------------------------------------------------------------------------- 1 | allow-deny@1.1.0 2 | angular-compilers@0.3.2 3 | angular-html-compiler@0.3.2 4 | angular-scss-compiler@0.3.2 5 | angular-typescript-compiler@0.3.2 6 | autoupdate@1.6.0 7 | babel-compiler@7.3.4 8 | babel-runtime@1.3.0 9 | base64@1.0.12 10 | binary-heap@1.0.11 11 | boilerplate-generator@1.6.0 12 | callback-hook@1.1.0 13 | check@1.3.1 14 | ddp@1.4.0 15 | ddp-client@2.3.3 16 | ddp-common@1.4.0 17 | ddp-server@2.3.0 18 | diff-sequence@1.1.1 19 | dynamic-import@0.5.1 20 | ecmascript@0.12.7 21 | ecmascript-runtime@0.7.0 22 | ecmascript-runtime-client@0.8.0 23 | ecmascript-runtime-server@0.7.1 24 | ejson@1.1.0 25 | es5-shim@4.8.0 26 | fetch@0.1.1 27 | geojson-utils@1.0.10 28 | hot-code-push@1.0.4 29 | id-map@1.1.0 30 | inter-process-messaging@0.1.0 31 | launch-screen@1.1.1 32 | livedata@1.0.18 33 | logging@1.1.20 34 | meteor@1.9.3 35 | meteor-base@1.4.0 36 | minifier-css@1.4.2 37 | minifier-js@2.4.1 38 | minimongo@1.4.5 39 | mobile-experience@1.0.5 40 | mobile-status-bar@1.0.14 41 | modern-browsers@0.1.4 42 | modules@0.13.0 43 | modules-runtime@0.10.3 44 | mongo@1.6.3 45 | mongo-decimal@0.1.1 46 | mongo-dev-server@1.1.0 47 | mongo-id@1.0.7 48 | npm-mongo@3.1.2 49 | ordered-dict@1.1.0 50 | promise@0.11.2 51 | random@1.1.0 52 | reactive-var@1.0.11 53 | reload@1.3.0 54 | retry@1.1.0 55 | routepolicy@1.1.0 56 | shell-server@0.4.0 57 | socket-stream-client@0.2.2 58 | standard-minifier-css@1.5.3 59 | standard-minifier-js@2.4.1 60 | tracker@1.2.0 61 | underscore@1.0.10 62 | webapp@1.7.4 63 | webapp-hashing@1.0.9 64 | -------------------------------------------------------------------------------- /examples/AngularCLI/api/node_modules: -------------------------------------------------------------------------------- 1 | ../node_modules -------------------------------------------------------------------------------- /examples/AngularCLI/api/package-lock.json: -------------------------------------------------------------------------------- 1 | ../package-lock.json -------------------------------------------------------------------------------- /examples/AngularCLI/api/package.json: -------------------------------------------------------------------------------- 1 | ../package.json -------------------------------------------------------------------------------- /examples/AngularCLI/api/server/collections.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | import { Todo } from './models'; 4 | import { MongoObservable } from 'meteor-rxjs'; 5 | 6 | export const Todos = new MongoObservable.Collection('todos'); 7 | -------------------------------------------------------------------------------- /examples/AngularCLI/api/server/main.ts: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | 3 | Meteor.startup(() => { 4 | // code to run on server at startup 5 | }); 6 | -------------------------------------------------------------------------------- /examples/AngularCLI/api/server/methods.ts: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { check } from 'meteor/check'; 3 | import { Todos } from './collections'; 4 | 5 | Meteor.methods({ 6 | addTodo(content: string) { 7 | check(content, String); 8 | return Todos.insert({ 9 | content 10 | }); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /examples/AngularCLI/api/server/models.ts: -------------------------------------------------------------------------------- 1 | export interface Todo { 2 | content: string; 3 | } 4 | -------------------------------------------------------------------------------- /examples/AngularCLI/api/server/publications.ts: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | import { Todos } from './collections'; 3 | 4 | Meteor.publish('todos', function () { 5 | return Todos.find(); 6 | }); 7 | -------------------------------------------------------------------------------- /examples/AngularCLI/api/tests/declarations.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*/package.json' { 2 | const name: string; 3 | } 4 | -------------------------------------------------------------------------------- /examples/AngularCLI/api/tests/main.ts: -------------------------------------------------------------------------------- 1 | import assert from 'assert'; 2 | 3 | describe('angular-cli-meteor', function () { 4 | it('package.json has correct name', async function () { 5 | const { name } = await import('../package.json'); 6 | assert.strictEqual(name, 'angular-cli-meteor'); 7 | }); 8 | 9 | it('server is not client', function () { 10 | assert.strictEqual(Meteor.isClient, false); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /examples/AngularCLI/api/tsconfig.json: -------------------------------------------------------------------------------- 1 | ../tsconfig.json -------------------------------------------------------------------------------- /examples/AngularCLI/api/yarn.lock: -------------------------------------------------------------------------------- 1 | ../yarn.lock -------------------------------------------------------------------------------- /examples/AngularCLI/e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './src/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: require('path').join(__dirname, './tsconfig.e2e.json') 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; -------------------------------------------------------------------------------- /examples/AngularCLI/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to AngularCLI!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /examples/AngularCLI/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /examples/AngularCLI/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /examples/AngularCLI/meteor-client.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtime": { 3 | "DDP_DEFAULT_CONNECTION_URL": "http://localhost:3000", 4 | "ROOT_URL": "http://localhost:3000" 5 | }, 6 | "generateNodeModules": true 7 | } 8 | -------------------------------------------------------------------------------- /examples/AngularCLI/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-cli-meteor", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "test": "ng test", 9 | "lint": "ng lint", 10 | "e2e": "ng e2e", 11 | "api": "cd api && meteor run", 12 | "client-bundle": "meteor-client bundle -s api", 13 | "postinstall": "npm run client-bundle" 14 | }, 15 | "private": true, 16 | "dependencies": { 17 | "@angular/animations": "^7.1.1", 18 | "@angular/common": "^7.1.1", 19 | "@angular/compiler": "^7.1.1", 20 | "@angular/core": "^7.1.1", 21 | "@angular/forms": "^7.1.1", 22 | "@angular/http": "^7.1.1", 23 | "@angular/platform-browser": "^7.1.1", 24 | "@angular/platform-browser-dynamic": "^7.1.1", 25 | "@angular/router": "^7.1.1", 26 | "@babel/runtime": "^7.13.7", 27 | "core-js": "^2.5.7", 28 | "meteor-client-bundler": "^0.6.0", 29 | "meteor-node-stubs": "^0.4.1", 30 | "meteor-rxjs": "^0.4.14", 31 | "rxjs": "^6.3.3", 32 | "zone.js": "^0.8.26" 33 | }, 34 | "devDependencies": { 35 | "@angular-devkit/build-angular": "~0.11.0", 36 | "@angular/cli": "~7.1.0", 37 | "@angular/compiler-cli": "^7.1.1", 38 | "@angular/language-service": "^7.1.1", 39 | "@types/jasmine": "~3.3.0", 40 | "@types/jasminewd2": "~2.0.6", 41 | "@types/meteor": "1.4.14", 42 | "@types/node": "~8.9.5", 43 | "codelyzer": "~4.5.0", 44 | "jasmine-core": "~3.3.0", 45 | "jasmine-spec-reporter": "~4.2.1", 46 | "karma": "~3.1.1", 47 | "karma-chrome-launcher": "~2.2.0", 48 | "karma-coverage-istanbul-reporter": "~2.0.4", 49 | "karma-jasmine": "~2.0.1", 50 | "karma-jasmine-html-reporter": "^1.4.0", 51 | "protractor": "~5.4.1", 52 | "ts-node": "~7.0.1", 53 | "tslint": "~5.11.0", 54 | "typescript": "~3.1.6" 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /examples/AngularCLI/src/app/app.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Urigo/angular-meteor/aa80a4d1130a8f41a40d1093f6d6ac7392570c71/examples/AngularCLI/src/app/app.component.css -------------------------------------------------------------------------------- /examples/AngularCLI/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |

4 | Welcome to {{ title }}! 5 |

6 | Angular Logo 7 |
8 |

Todo List

9 |
10 | Add Todo 11 |
12 |

13 | 14 |

15 |

16 | 17 |

18 |
19 |
20 | 25 | -------------------------------------------------------------------------------- /examples/AngularCLI/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | describe('AppComponent', () => { 4 | beforeEach(async(() => { 5 | TestBed.configureTestingModule({ 6 | declarations: [ 7 | AppComponent 8 | ], 9 | }).compileComponents(); 10 | })); 11 | it('should create the app', async(() => { 12 | const fixture = TestBed.createComponent(AppComponent); 13 | const app = fixture.debugElement.componentInstance; 14 | expect(app).toBeTruthy(); 15 | })); 16 | it(`should have as title 'app'`, async(() => { 17 | const fixture = TestBed.createComponent(AppComponent); 18 | const app = fixture.debugElement.componentInstance; 19 | expect(app.title).toEqual('app'); 20 | })); 21 | it('should render title in a h1 tag', async(() => { 22 | const fixture = TestBed.createComponent(AppComponent); 23 | fixture.detectChanges(); 24 | const compiled = fixture.debugElement.nativeElement; 25 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to AngularCLI!'); 26 | })); 27 | }); 28 | -------------------------------------------------------------------------------- /examples/AngularCLI/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { Todos } from 'api/server/collections'; 3 | import { Todo } from 'api/server/models'; 4 | import { Observable } from 'rxjs'; 5 | import { switchMap } from 'rxjs/operators'; 6 | import { MeteorObservable } from 'meteor-rxjs'; 7 | 8 | @Component({ 9 | selector: 'app-root', 10 | templateUrl: './app.component.html', 11 | styleUrls: ['./app.component.css'] 12 | }) 13 | export class AppComponent implements OnInit { 14 | title = 'AngularCLI Meteor Boilerplate'; 15 | todos: Observable; 16 | todoContent: string; 17 | ngOnInit() { 18 | this.todos = MeteorObservable.subscribe('todos') 19 | .pipe(switchMap(() => Todos.find())); 20 | } 21 | addTodo($event: MouseEvent) { 22 | $event.preventDefault(); 23 | MeteorObservable.call('addTodo', this.todoContent).subscribe( 24 | res => console.log(res), 25 | err => console.error(err) 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /examples/AngularCLI/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { FormsModule } from '@angular/forms'; 3 | import { NgModule } from '@angular/core'; 4 | 5 | import { AppComponent } from './app.component'; 6 | 7 | @NgModule({ 8 | declarations: [ 9 | AppComponent 10 | ], 11 | imports: [ 12 | BrowserModule, 13 | FormsModule 14 | ], 15 | providers: [], 16 | bootstrap: [AppComponent] 17 | }) 18 | export class AppModule { } 19 | -------------------------------------------------------------------------------- /examples/AngularCLI/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Urigo/angular-meteor/aa80a4d1130a8f41a40d1093f6d6ac7392570c71/examples/AngularCLI/src/assets/.gitkeep -------------------------------------------------------------------------------- /examples/AngularCLI/src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # For IE 9-11 support, please uncomment the last line of the file and adjust as needed 5 | > 0.5% 6 | last 2 versions 7 | Firefox ESR 8 | not dead 9 | # IE 9-11 -------------------------------------------------------------------------------- /examples/AngularCLI/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /examples/AngularCLI/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build ---prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * In development mode, to ignore zone related error stack frames such as 11 | * `zone.run`, `zoneDelegate.invokeTask` for easier debugging, you can 12 | * import the following file, but please comment it out in production mode 13 | * because it will have performance impact when throw error 14 | */ 15 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 16 | -------------------------------------------------------------------------------- /examples/AngularCLI/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Urigo/angular-meteor/aa80a4d1130a8f41a40d1093f6d6ac7392570c71/examples/AngularCLI/src/favicon.ico -------------------------------------------------------------------------------- /examples/AngularCLI/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AngularCLI 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /examples/AngularCLI/src/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, '../coverage'), 20 | reports: ['html', 'lcovonly'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false 30 | }); 31 | }; -------------------------------------------------------------------------------- /examples/AngularCLI/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.log(err)); 13 | -------------------------------------------------------------------------------- /examples/AngularCLI/src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/ 22 | // import 'core-js/es6/symbol'; 23 | // import 'core-js/es6/object'; 24 | // import 'core-js/es6/function'; 25 | // import 'core-js/es6/parse-int'; 26 | // import 'core-js/es6/parse-float'; 27 | // import 'core-js/es6/number'; 28 | // import 'core-js/es6/math'; 29 | // import 'core-js/es6/string'; 30 | // import 'core-js/es6/date'; 31 | // import 'core-js/es6/array'; 32 | // import 'core-js/es6/regexp'; 33 | // import 'core-js/es6/map'; 34 | // import 'core-js/es6/weak-map'; 35 | // import 'core-js/es6/set'; 36 | 37 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 38 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 39 | 40 | /** IE10 and IE11 requires the following for the Reflect API. */ 41 | // import 'core-js/es6/reflect'; 42 | 43 | 44 | /** Evergreen browsers require these. **/ 45 | // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. 46 | import 'core-js/proposals/reflect-metadata'; 47 | 48 | 49 | /** 50 | * Web Animations `@angular/platform-browser/animations` 51 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 52 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 53 | **/ 54 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 55 | 56 | /** 57 | * By default, zone.js will patch all possible macroTask and DomEvents 58 | * user can disable parts of macroTask/DomEvents patch by setting following flags 59 | */ 60 | 61 | // (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 62 | // (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 63 | // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 64 | 65 | /* 66 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 67 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 68 | */ 69 | // (window as any).__Zone_enable_cross_context_check = true; 70 | 71 | /*************************************************************************************************** 72 | * Zone JS is required by default for Angular itself. 73 | */ 74 | import 'zone.js/dist/zone'; // Included with Angular CLI. 75 | 76 | 77 | 78 | /*************************************************************************************************** 79 | * APPLICATION IMPORTS 80 | */ 81 | -------------------------------------------------------------------------------- /examples/AngularCLI/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /examples/AngularCLI/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /examples/AngularCLI/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "es2015", 6 | "types": [ 7 | "meteor" 8 | ] 9 | }, 10 | "exclude": [ 11 | "src/test.ts", 12 | "**/*.spec.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /examples/AngularCLI/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "module": "commonjs" 6 | }, 7 | "files": [ 8 | "test.ts", 9 | "polyfills.ts" 10 | ], 11 | "include": [ 12 | "**/*.spec.ts", 13 | "**/*.d.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /examples/AngularCLI/src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /examples/AngularCLI/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "esModuleInterop": true, 12 | "module": "commonjs", 13 | "target": "es5", 14 | "typeRoots": [ 15 | "node_modules/@types" 16 | ], 17 | "lib": [ 18 | "es2017", 19 | "dom" 20 | ] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /examples/AngularCLI/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "node_modules/codelyzer" 4 | ], 5 | "rules": { 6 | "arrow-return-shorthand": true, 7 | "callable-types": true, 8 | "class-name": true, 9 | "comment-format": [ 10 | true, 11 | "check-space" 12 | ], 13 | "curly": true, 14 | "deprecation": { 15 | "severity": "warn" 16 | }, 17 | "eofline": true, 18 | "forin": true, 19 | "import-blacklist": [ 20 | true, 21 | "rxjs/Rx" 22 | ], 23 | "import-spacing": true, 24 | "indent": [ 25 | true, 26 | "spaces" 27 | ], 28 | "interface-over-type-literal": true, 29 | "label-position": true, 30 | "max-line-length": [ 31 | true, 32 | 140 33 | ], 34 | "member-access": false, 35 | "member-ordering": [ 36 | true, 37 | { 38 | "order": [ 39 | "static-field", 40 | "instance-field", 41 | "static-method", 42 | "instance-method" 43 | ] 44 | } 45 | ], 46 | "no-arg": true, 47 | "no-bitwise": true, 48 | "no-console": [ 49 | true, 50 | "debug", 51 | "info", 52 | "time", 53 | "timeEnd", 54 | "trace" 55 | ], 56 | "no-construct": true, 57 | "no-debugger": true, 58 | "no-duplicate-super": true, 59 | "no-empty": false, 60 | "no-empty-interface": true, 61 | "no-eval": true, 62 | "no-inferrable-types": [ 63 | true, 64 | "ignore-params" 65 | ], 66 | "no-misused-new": true, 67 | "no-non-null-assertion": true, 68 | "no-shadowed-variable": true, 69 | "no-string-literal": false, 70 | "no-string-throw": true, 71 | "no-switch-case-fall-through": true, 72 | "no-trailing-whitespace": true, 73 | "no-unnecessary-initializer": true, 74 | "no-unused-expression": true, 75 | "no-use-before-declare": true, 76 | "no-var-keyword": true, 77 | "object-literal-sort-keys": false, 78 | "one-line": [ 79 | true, 80 | "check-open-brace", 81 | "check-catch", 82 | "check-else", 83 | "check-whitespace" 84 | ], 85 | "prefer-const": true, 86 | "quotemark": [ 87 | true, 88 | "single" 89 | ], 90 | "radix": true, 91 | "semicolon": [ 92 | true, 93 | "always" 94 | ], 95 | "triple-equals": [ 96 | true, 97 | "allow-null-check" 98 | ], 99 | "typedef-whitespace": [ 100 | true, 101 | { 102 | "call-signature": "nospace", 103 | "index-signature": "nospace", 104 | "parameter": "nospace", 105 | "property-declaration": "nospace", 106 | "variable-declaration": "nospace" 107 | } 108 | ], 109 | "unified-signatures": true, 110 | "variable-name": false, 111 | "whitespace": [ 112 | true, 113 | "check-branch", 114 | "check-decl", 115 | "check-operator", 116 | "check-separator", 117 | "check-type" 118 | ], 119 | "no-output-on-prefix": true, 120 | "use-input-property-decorator": true, 121 | "use-output-property-decorator": true, 122 | "use-host-property-decorator": true, 123 | "no-input-rename": true, 124 | "no-output-rename": true, 125 | "use-life-cycle-interface": true, 126 | "use-pipe-transform-interface": true, 127 | "component-class-suffix": true, 128 | "directive-class-suffix": true 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /examples/MeteorCLI/all-in-one/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ -------------------------------------------------------------------------------- /examples/MeteorCLI/all-in-one/.meteor/.finished-upgraders: -------------------------------------------------------------------------------- 1 | # This file contains information which helps Meteor properly upgrade your 2 | # app when you run 'meteor update'. You should check it into version control 3 | # with your project. 4 | 5 | notices-for-0.9.0 6 | notices-for-0.9.1 7 | 0.9.4-platform-file 8 | notices-for-facebook-graph-api-2 9 | 1.2.0-standard-minifiers-package 10 | 1.2.0-meteor-platform-split 11 | 1.2.0-cordova-changes 12 | 1.2.0-breaking-changes 13 | 1.3.0-split-minifiers-package 14 | 1.4.0-remove-old-dev-bundle-link 15 | 1.4.1-add-shell-server-package 16 | 1.4.3-split-account-service-packages 17 | 1.5-add-dynamic-import-package 18 | 1.7-split-underscore-from-meteor-base 19 | 1.8.3-split-jquery-from-blaze 20 | -------------------------------------------------------------------------------- /examples/MeteorCLI/all-in-one/.meteor/.gitignore: -------------------------------------------------------------------------------- 1 | local 2 | build* -------------------------------------------------------------------------------- /examples/MeteorCLI/all-in-one/.meteor/.id: -------------------------------------------------------------------------------- 1 | # This file contains a token that is unique to your project. 2 | # Check it into your repository along with the rest of this directory. 3 | # It can be used for purposes such as: 4 | # - ensuring you don't accidentally deploy one app on top of another 5 | # - providing package authors with aggregated statistics 6 | 7 | f5zbq31cin28nounsys 8 | -------------------------------------------------------------------------------- /examples/MeteorCLI/all-in-one/.meteor/packages: -------------------------------------------------------------------------------- 1 | # Meteor packages used by this project, one per line. 2 | # Check this file (and the other files in this directory) into your repository. 3 | # 4 | # 'meteor add' and 'meteor remove' will edit this file for you, 5 | # but you can also edit it by hand. 6 | 7 | meteor-base@1.4.0 # Packages every Meteor app needs to have 8 | mobile-experience@1.1.0 # Packages for a great mobile UX 9 | mongo@1.10.1 # The database Meteor supports right now 10 | reactive-var@1.0.11 # Reactive variable for tracker 11 | tracker@1.2.0 # Meteor's client-side reactive programming library 12 | 13 | es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers 14 | ecmascript@0.15.0 # Enable ECMAScript2015+ syntax in app code 15 | shell-server@0.5.0 # Server-side component of the `meteor shell` command 16 | 17 | server-render@0.3.1 18 | angular-compilers 19 | -------------------------------------------------------------------------------- /examples/MeteorCLI/all-in-one/.meteor/platforms: -------------------------------------------------------------------------------- 1 | server 2 | browser 3 | -------------------------------------------------------------------------------- /examples/MeteorCLI/all-in-one/.meteor/release: -------------------------------------------------------------------------------- 1 | METEOR@2.1 2 | -------------------------------------------------------------------------------- /examples/MeteorCLI/all-in-one/.meteor/versions: -------------------------------------------------------------------------------- 1 | allow-deny@1.1.0 2 | angular-compilers@0.4.0 3 | angular-html-compiler@0.4.0 4 | angular-scss-compiler@0.4.0 5 | angular-typescript-compiler@0.4.0 6 | autoupdate@1.7.0 7 | babel-compiler@7.6.0 8 | babel-runtime@1.5.0 9 | base64@1.0.12 10 | binary-heap@1.0.11 11 | boilerplate-generator@1.7.1 12 | callback-hook@1.3.0 13 | check@1.3.1 14 | ddp@1.4.0 15 | ddp-client@2.4.0 16 | ddp-common@1.4.0 17 | ddp-server@2.3.2 18 | diff-sequence@1.1.1 19 | dynamic-import@0.6.0 20 | ecmascript@0.15.0 21 | ecmascript-runtime@0.7.0 22 | ecmascript-runtime-client@0.11.0 23 | ecmascript-runtime-server@0.10.0 24 | ejson@1.1.1 25 | es5-shim@4.8.0 26 | fetch@0.1.1 27 | geojson-utils@1.0.10 28 | hot-code-push@1.0.4 29 | id-map@1.1.0 30 | inter-process-messaging@0.1.1 31 | launch-screen@1.2.0 32 | livedata@1.0.18 33 | logging@1.2.0 34 | meteor@1.9.3 35 | meteor-base@1.4.0 36 | minimongo@1.6.1 37 | mobile-experience@1.1.0 38 | mobile-status-bar@1.1.0 39 | modern-browsers@0.1.5 40 | modules@0.16.0 41 | modules-runtime@0.12.0 42 | mongo@1.10.1 43 | mongo-decimal@0.1.2 44 | mongo-dev-server@1.1.0 45 | mongo-id@1.0.7 46 | npm-mongo@3.8.1 47 | ordered-dict@1.1.0 48 | promise@0.11.2 49 | random@1.2.0 50 | react-fast-refresh@0.1.0 51 | reactive-var@1.0.11 52 | reload@1.3.1 53 | retry@1.1.0 54 | routepolicy@1.1.0 55 | server-render@0.3.1 56 | shell-server@0.5.0 57 | socket-stream-client@0.3.1 58 | tracker@1.2.0 59 | underscore@1.0.10 60 | webapp@1.10.0 61 | webapp-hashing@1.1.0 62 | -------------------------------------------------------------------------------- /examples/MeteorCLI/all-in-one/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Arda TANRIKULU 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /examples/MeteorCLI/all-in-one/README.md: -------------------------------------------------------------------------------- 1 | # Angular Meteor Universal w/ AOT 2 | This project shows the usage of *@angular/platform-server* and *@angular/compiler-cli* with *Meteor* 3 | 4 | - Dynamic import without AOT is in dynamic-import branch 5 | 6 | How AOT works? 7 | -- 8 | - On both server and client, it loads AOT-compiled factories by using angular-compiler 9 | 10 | How Universal works? 11 | -- 12 | - renderModule(JIT) and renderModuleFactory(AOT) with Meteor's server-render 13 | 14 | How-to 15 | -- 16 | - Add `server-render` package into your project 17 | - Move your Angular files into `imports/app` 18 | - Create `ServerAppModule` in `server-app.module.ts` w/ importing `ServerModule` from `@angular/platform-server` and `AppModule` from `app.module` in `imports/app` folder 19 | - Change `BrowserModule` in imports to `BrowserModule.withServerTransition({ appId: 'yourAppId' })` 20 | - Write server bootstrap code into `server/main.ts` like in this example 21 | - Run your project with command -> `AOT=1 meteor` 22 | - You have Angular Meteor Universal w/ AOT !!! 23 | - If you want to disable Universal in Development, you can do `Meteor.isProduction` check before `onPageLoad` 24 | - If you want to disable AOT compilation, you can run Meteor w/o `AOT=1` 25 | 26 | Known issues 27 | -- 28 | - Ionic w/ Universal doesn't work due to this issue - https://github.com/ionic-team/ionic/issues/10699 - You can use Angular Material instead! 29 | -------------------------------------------------------------------------------- /examples/MeteorCLI/all-in-one/client/main.ts: -------------------------------------------------------------------------------- 1 | import '../imports/polyfills'; 2 | 3 | import { Meteor } from 'meteor/meteor'; 4 | 5 | import { enableProdMode } from '@angular/core'; 6 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 7 | import { AppModule } from '../imports/app/app.module'; 8 | 9 | Meteor.startup(() => { 10 | 11 | if (Meteor.isProduction) { 12 | enableProdMode(); 13 | } 14 | 15 | platformBrowserDynamic().bootstrapModule(AppModule); 16 | 17 | }); 18 | -------------------------------------------------------------------------------- /examples/MeteorCLI/all-in-one/imports/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, OnDestroy } from '@angular/core'; 2 | import { Router, NavigationEnd, ActivatedRoute } from '@angular/router'; 3 | import { Title } from '@angular/platform-browser'; 4 | 5 | import { Subscription } from 'rxjs'; 6 | 7 | import { filter, map, mergeMap } from 'rxjs/operators'; 8 | 9 | @Component({ 10 | selector: 'app', 11 | templateUrl: 'app.html' 12 | }) 13 | export class AppComponent implements OnInit, OnDestroy { 14 | //Dynamic title change along with router 15 | private titleChangeSubscription: Subscription; 16 | constructor( 17 | private router: Router, 18 | private activatedRoute: ActivatedRoute, 19 | private titleService: Title 20 | ) { } 21 | ngOnInit() { 22 | this.titleChangeSubscription = 23 | this.router.events.pipe( 24 | filter((event) => event instanceof NavigationEnd), 25 | map(() => this.activatedRoute), 26 | map((route) => { 27 | while (route.firstChild) route = route.firstChild; 28 | return route; 29 | }), 30 | filter((route) => route.outlet === 'primary'), 31 | mergeMap((route) => route.data) 32 | ).subscribe((event) => this.titleService.setTitle(event['title'])); 33 | } 34 | ngOnDestroy() { 35 | this.titleChangeSubscription.unsubscribe(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /examples/MeteorCLI/all-in-one/imports/app/app.html: -------------------------------------------------------------------------------- 1 |

Todos

2 | 3 | -------------------------------------------------------------------------------- /examples/MeteorCLI/all-in-one/imports/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | 3 | import { BrowserModule } from '@angular/platform-browser'; 4 | 5 | import { FormsModule } from '@angular/forms'; 6 | 7 | import { RouterModule } from '@angular/router'; 8 | 9 | import { AppComponent } from './app.component'; 10 | 11 | import { TodoListComponent } from './todo-list/todo-list.component'; 12 | import { PageNotFoundComponent } from './page-not-found/page-not-found.component'; 13 | 14 | @NgModule({ 15 | imports: [ 16 | // Transition between server and client 17 | BrowserModule.withServerTransition({ 18 | appId: 'angular-meteor-universal' 19 | }), 20 | FormsModule, 21 | RouterModule.forRoot([ 22 | { 23 | path: 'todoList', 24 | component: TodoListComponent, 25 | data: { 26 | title: 'Todo List' 27 | } 28 | }, 29 | { 30 | path: 'todoAdd', 31 | loadChildren: './todo-add/todo-add.module#TodoAddModule', 32 | data: { 33 | title: 'Add Todo' 34 | } 35 | }, 36 | // Home Page 37 | { 38 | path: '', 39 | redirectTo: '/todoList', 40 | pathMatch: 'full' 41 | }, 42 | // 404 Page 43 | { 44 | path: '**', 45 | component: PageNotFoundComponent, 46 | data: { 47 | title: '404 Page Not Found' 48 | } 49 | } 50 | ]) 51 | ], 52 | declarations: [ 53 | AppComponent, 54 | TodoListComponent, 55 | PageNotFoundComponent 56 | ], 57 | bootstrap: [ 58 | AppComponent 59 | ] 60 | }) 61 | export class AppModule { } 62 | -------------------------------------------------------------------------------- /examples/MeteorCLI/all-in-one/imports/app/page-not-found/page-not-found.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'page-not-found', 5 | templateUrl: 'page-not-found.html' 6 | }) 7 | export class PageNotFoundComponent { } 8 | -------------------------------------------------------------------------------- /examples/MeteorCLI/all-in-one/imports/app/page-not-found/page-not-found.html: -------------------------------------------------------------------------------- 1 |

404 Page Not Found

2 | -------------------------------------------------------------------------------- /examples/MeteorCLI/all-in-one/imports/app/server-app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | 3 | import { ServerModule } from '@angular/platform-server'; 4 | 5 | import { AppModule } from './app.module'; 6 | import { AppComponent } from './app.component'; 7 | 8 | @NgModule({ 9 | imports: [ 10 | // Import ServerModule while running on server 11 | ServerModule, 12 | AppModule 13 | ], 14 | bootstrap: [ 15 | AppComponent 16 | ] 17 | }) 18 | export class ServerAppModule { } 19 | -------------------------------------------------------------------------------- /examples/MeteorCLI/all-in-one/imports/app/todo-add/todo-add.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | import { Meteor } from 'meteor/meteor'; 4 | 5 | @Component({ 6 | selector: 'todo-add', 7 | templateUrl: 'todo-add.html' 8 | }) 9 | export class TodoAddComponent { 10 | content: string; 11 | addTodo() { 12 | Meteor.call('addTodo', this.content); 13 | this.content = null; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /examples/MeteorCLI/all-in-one/imports/app/todo-add/todo-add.html: -------------------------------------------------------------------------------- 1 | List 2 |
3 | Add Todo 4 | 7 | 8 | 9 |
10 | -------------------------------------------------------------------------------- /examples/MeteorCLI/all-in-one/imports/app/todo-add/todo-add.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | 3 | import { FormsModule } from '@angular/forms'; 4 | 5 | import { RouterModule } from '@angular/router'; 6 | 7 | import { TodoAddComponent } from './todo-add.component'; 8 | 9 | @NgModule({ 10 | imports: [ 11 | FormsModule, 12 | RouterModule.forChild([ 13 | { path: '', component: TodoAddComponent } 14 | ]) 15 | ], 16 | declarations: [ 17 | TodoAddComponent 18 | ] 19 | }) 20 | export class TodoAddModule{} 21 | -------------------------------------------------------------------------------- /examples/MeteorCLI/all-in-one/imports/app/todo-list/todo-list.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, OnDestroy } from '@angular/core'; 2 | import { Observable, Subscription } from 'rxjs'; 3 | 4 | import { Meteor } from 'meteor/meteor'; 5 | import { MeteorObservable } from 'meteor-rxjs'; 6 | 7 | import { Todos } from '../../collections/todos'; 8 | import { Todo } from '../../models/todo'; 9 | 10 | @Component({ 11 | selector: 'todo-list', 12 | templateUrl: 'todo-list.html', 13 | styleUrls: ['todo-list.scss'] 14 | }) 15 | export class TodoListComponent implements OnInit, OnDestroy { 16 | todos: Observable; 17 | todoListSubscription: Subscription; 18 | ngOnInit() { 19 | this.todos = Todos.find(); 20 | // Subscribe and connect it to Angular's change detection system 21 | // while running on client 22 | if (Meteor.isClient) 23 | this.todoListSubscription = MeteorObservable.subscribe('todoList').subscribe(); 24 | } 25 | ngOnDestroy() { 26 | if (this.todoListSubscription) 27 | this.todoListSubscription.unsubscribe(); 28 | } 29 | removeTodo(_id: string) { 30 | Meteor.call('removeTodo', _id); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /examples/MeteorCLI/all-in-one/imports/app/todo-list/todo-list.html: -------------------------------------------------------------------------------- 1 | 2 |
    3 |
  • 4 | {{todo.content}} 5 | 6 |
  • 7 |
8 | -------------------------------------------------------------------------------- /examples/MeteorCLI/all-in-one/imports/app/todo-list/todo-list.scss: -------------------------------------------------------------------------------- 1 | .addBtn { 2 | background-color: green; 3 | color: white; 4 | } 5 | -------------------------------------------------------------------------------- /examples/MeteorCLI/all-in-one/imports/collections/todos.ts: -------------------------------------------------------------------------------- 1 | import { MongoObservable } from 'meteor-rxjs'; 2 | 3 | import { Todo } from '../models/todo'; 4 | 5 | export const Todos = new MongoObservable.Collection('todos'); 6 | -------------------------------------------------------------------------------- /examples/MeteorCLI/all-in-one/imports/methods/todos.ts: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | 3 | import { Todos } from '../../imports/collections/todos'; 4 | 5 | Meteor.methods({ 6 | addTodo(content: string) { 7 | Todos.insert({ 8 | content 9 | }); 10 | }, 11 | removeTodo(_id: string) { 12 | Todos.remove({ 13 | _id 14 | }) 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /examples/MeteorCLI/all-in-one/imports/models/todo.ts: -------------------------------------------------------------------------------- 1 | export interface Todo { 2 | _id?: string; 3 | content?: string; 4 | } 5 | -------------------------------------------------------------------------------- /examples/MeteorCLI/all-in-one/imports/polyfills.ts: -------------------------------------------------------------------------------- 1 | import 'core-js/proposals/reflect-metadata'; 2 | 3 | if(Meteor.isClient){ 4 | require('zone.js'); 5 | } 6 | 7 | -------------------------------------------------------------------------------- /examples/MeteorCLI/all-in-one/imports/publications/todos.ts: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | 3 | import { Todos } from '../../imports/collections/todos'; 4 | 5 | Meteor.publish('todoList', function() { 6 | return Todos.find({}); 7 | }); 8 | -------------------------------------------------------------------------------- /examples/MeteorCLI/all-in-one/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "start": "meteor run", 5 | "test": "TEST_BROWSER_DRIVER=puppeteer meteor test --driver-package=ardatan:mocha --raw-logs", 6 | "test:ci": "TEST_BROWSER_DRIVER=puppeteer meteor test --driver-package=ardatan:mocha --once --raw-logs" 7 | }, 8 | "dependencies": { 9 | "@angular/animations": "^7.1.0", 10 | "@angular/common": "^7.1.0", 11 | "@angular/compiler": "^7.1.0", 12 | "@angular/core": "^7.1.0", 13 | "@angular/forms": "^7.1.0", 14 | "@angular/http": "^7.1.0", 15 | "@angular/platform-browser": "^7.1.0", 16 | "@angular/platform-browser-dynamic": "^7.1.0", 17 | "@angular/platform-server": "^7.1.0", 18 | "@angular/router": "^7.1.0", 19 | "@babel/runtime": "^7.13.7", 20 | "core-js": "^3.9.0", 21 | "meteor-node-stubs": "^0.4.1", 22 | "meteor-rxjs": "^0.4.14", 23 | "rxjs": "^6.3.0", 24 | "zone.js": "^0.8.26" 25 | }, 26 | "devDependencies": { 27 | "@angular/compiler-cli": "^7.1.0", 28 | "@types/chai": "^4.1.7", 29 | "@types/meteor": "^1.4.23", 30 | "@types/mocha": "^5.2.5", 31 | "@types/sinon": "^5.0.7", 32 | "chai": "^4.2.0", 33 | "mocha": "^5.2.0", 34 | "puppeteer": "^1.10.0", 35 | "sinon": "^7.1.1", 36 | "typescript": "~3.1.1" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /examples/MeteorCLI/all-in-one/run_tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | echo "[MeteorCLI - all-in-one] Resetting project" 3 | meteor reset 4 | echo "[MeteorCLI - all-in-one] Installing npm dependencies" 5 | npm ci 6 | exit_code=$?; if [ ${exit_code} -gt 0 ]; then exit ${exit_code}; fi 7 | echo "[MeteorCLI - all-in-one] Installing meteor dependencies" 8 | meteor update --all-packages --allow-incompatible-update 9 | exit_code=$?; if [ ${exit_code} -gt 0 ]; then exit ${exit_code}; fi 10 | echo "[MeteorCLI - all-in-one] Testing JIT" 11 | npm run test:ci 12 | exit_code=$?; if [ ${exit_code} -gt 0 ]; then exit ${exit_code}; fi 13 | echo "[MeteorCLI - all-in-one] Testing AOT" 14 | AOT=1 meteor build ./.meteor/build-aot 15 | exit_code=$?; if [ ${exit_code} -gt 0 ]; then exit ${exit_code}; fi 16 | echo "[MeteorCLI - all-in-one] AOT w/ Rollup" 17 | AOT=1 ROLLUP=1 meteor build ./.meteor/build-aot-rollup 18 | exit_code=$?; if [ ${exit_code} -gt 0 ]; then exit ${exit_code}; fi 19 | -------------------------------------------------------------------------------- /examples/MeteorCLI/all-in-one/server/main.ts: -------------------------------------------------------------------------------- 1 | import '../imports/polyfills'; 2 | 3 | import '../imports/methods/todos'; 4 | import '../imports/publications/todos'; 5 | 6 | import { Meteor } from 'meteor/meteor'; 7 | import { WebApp, WebAppInternals } from 'meteor/webapp'; 8 | 9 | import { 10 | enableProdMode, 11 | PlatformRef, 12 | ApplicationModule, 13 | ApplicationRef 14 | } from '@angular/core'; 15 | 16 | import { ResourceLoader } from '@angular/compiler'; 17 | import { ɵgetDOM as getDOM } from '@angular/platform-browser'; 18 | import { platformDynamicServer, BEFORE_APP_SERIALIZED, INITIAL_CONFIG, PlatformState } from '@angular/platform-server'; 19 | 20 | import { first } from 'rxjs/operators'; 21 | 22 | import { ServerAppModule } from '../imports/app/server-app.module'; 23 | 24 | const HEAD_REGEX = /]*>((.|[\n\r])*)<\/head>/im 25 | const BODY_REGEX = /]*>((.|[\n\r])*)<\/body>/im; 26 | 27 | Meteor.startup(() => { 28 | 29 | // Enable Angular's production mode if Meteor is in production mode 30 | if (Meteor.isProduction) { 31 | enableProdMode(); 32 | } 33 | 34 | // When page requested 35 | WebAppInternals.registerBoilerplateDataCallback('angular', async (request, data) => { 36 | 37 | let document, 38 | platformRef: PlatformRef; 39 | // Handle Angular's error, but do not prevent client bootstrap 40 | try { 41 | 42 | 43 | document = ` 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | `; 53 | 54 | // Integrate Angular's router with Meteor 55 | const url = request.url; 56 | 57 | // Get rendered document 58 | platformRef = platformDynamicServer([ 59 | { 60 | provide: INITIAL_CONFIG, 61 | useValue: { 62 | // Initial document 63 | document, 64 | url 65 | } 66 | } 67 | ]); 68 | 69 | const appModuleRef = await platformRef.bootstrapModule(ServerAppModule, { 70 | ngZone: 'noop', 71 | providers: [ 72 | { 73 | provide: ResourceLoader, 74 | useValue: { 75 | get: Assets.getText 76 | }, 77 | deps: [] 78 | } 79 | ] 80 | }); 81 | 82 | const applicationRef: ApplicationRef = appModuleRef.injector.get(ApplicationRef); 83 | 84 | await applicationRef.isStable.pipe( 85 | first(isStable => isStable == true) 86 | ).toPromise(); 87 | 88 | applicationRef.tick(); 89 | 90 | // Run any BEFORE_APP_SERIALIZED callbacks just before rendering to string. 91 | const callbacks = appModuleRef.injector.get(BEFORE_APP_SERIALIZED, null); 92 | if (callbacks) { 93 | for (const callback of callbacks) { 94 | try { 95 | callback(); 96 | } catch (e) { 97 | // Ignore exceptions. 98 | console.warn('Ignoring BEFORE_APP_SERIALIZED Exception: ', e); 99 | } 100 | } 101 | } 102 | 103 | const platformState: PlatformState = appModuleRef.injector.get(PlatformState); 104 | 105 | document = platformState.renderToString(); 106 | 107 | } catch (e) { 108 | 109 | // Write errors to console 110 | console.error('Angular SSR Error: ' + e.stack || e); 111 | 112 | } finally { 113 | 114 | //Make sure platform is destroyed before rendering 115 | 116 | if (platformRef) { 117 | platformRef.destroy(); 118 | } 119 | const head = HEAD_REGEX.exec(document)[1]; 120 | data.dynamicHead = head; 121 | const body = BODY_REGEX.exec(document)[1]; 122 | data.dynamicBody = body; 123 | 124 | } 125 | }) 126 | 127 | 128 | }); 129 | -------------------------------------------------------------------------------- /examples/MeteorCLI/all-in-one/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowSyntheticDefaultImports": true, 4 | "baseUrl": ".", 5 | "declaration": false, 6 | "emitDecoratorMetadata": true, 7 | "importHelpers": true, 8 | "experimentalDecorators": true, 9 | "lib": [ 10 | "dom", 11 | "es2015" 12 | ], 13 | "module": "commonjs", 14 | "moduleResolution": "node", 15 | "sourceMap": true, 16 | "target": "es2015", 17 | "skipLibCheck": true, 18 | "stripInternal": true, 19 | "noImplicitAny": false, 20 | "types": [ 21 | "@types/meteor", 22 | "@types/node", 23 | "@types/mocha", 24 | "@types/chai", 25 | "@types/sinon" 26 | ] 27 | }, 28 | "include": [ 29 | "imports/**/*.ts", 30 | "client/**/*.ts", 31 | "server/**/*.ts" 32 | ], 33 | "exclude": [ 34 | "node_modules" 35 | ], 36 | "compileOnSave": false, 37 | "atom": { 38 | "rewriteTsconfig": false 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .DS_Store -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/.meteor/.finished-upgraders: -------------------------------------------------------------------------------- 1 | # This file contains information which helps Meteor properly upgrade your 2 | # app when you run 'meteor update'. You should check it into version control 3 | # with your project. 4 | 5 | notices-for-0.9.0 6 | notices-for-0.9.1 7 | 0.9.4-platform-file 8 | notices-for-facebook-graph-api-2 9 | 1.2.0-standard-minifiers-package 10 | 1.2.0-meteor-platform-split 11 | 1.2.0-cordova-changes 12 | 1.2.0-breaking-changes 13 | 1.3.0-split-minifiers-package 14 | 1.4.0-remove-old-dev-bundle-link 15 | 1.4.1-add-shell-server-package 16 | 1.4.3-split-account-service-packages 17 | 1.5-add-dynamic-import-package 18 | 1.7-split-underscore-from-meteor-base 19 | 1.8.3-split-jquery-from-blaze 20 | -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/.meteor/.gitignore: -------------------------------------------------------------------------------- 1 | local 2 | build* 3 | -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/.meteor/.id: -------------------------------------------------------------------------------- 1 | # This file contains a token that is unique to your project. 2 | # Check it into your repository along with the rest of this directory. 3 | # It can be used for purposes such as: 4 | # - ensuring you don't accidentally deploy one app on top of another 5 | # - providing package authors with aggregated statistics 6 | 7 | 1u9fl6o1biafva9x89vl 8 | -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/.meteor/packages: -------------------------------------------------------------------------------- 1 | # Meteor packages used by this project, one per line. 2 | # Check this file (and the other files in this directory) into your repository. 3 | # 4 | # 'meteor add' and 'meteor remove' will edit this file for you, 5 | # but you can also edit it by hand. 6 | 7 | meteor-base@1.4.0 # Packages every Meteor app needs to have 8 | mobile-experience@1.1.0 # Packages for a great mobile UX 9 | mongo@1.10.1 # The database Meteor supports right now 10 | reactive-var@1.0.11 # Reactive variable for tracker 11 | tracker@1.2.0 # Meteor's client-side reactive programming library 12 | 13 | es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers 14 | ecmascript@0.15.0 # Enable ECMAScript2015+ syntax in app code 15 | shell-server@0.5.0 # Server-side component of the `meteor shell` command 16 | 17 | angular-compilers@0.4.0 18 | standard-minifier-css@1.7.2 19 | standard-minifier-js@2.6.0 20 | -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/.meteor/platforms: -------------------------------------------------------------------------------- 1 | server 2 | browser 3 | -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/.meteor/release: -------------------------------------------------------------------------------- 1 | METEOR@2.1 2 | -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/.meteor/versions: -------------------------------------------------------------------------------- 1 | allow-deny@1.1.0 2 | autoupdate@1.7.0 3 | babel-compiler@7.6.0 4 | babel-runtime@1.5.0 5 | base64@1.0.12 6 | binary-heap@1.0.11 7 | boilerplate-generator@1.7.1 8 | callback-hook@1.3.0 9 | check@1.3.1 10 | ddp@1.4.0 11 | ddp-client@2.4.0 12 | ddp-common@1.4.0 13 | ddp-server@2.3.2 14 | diff-sequence@1.1.1 15 | angular-compilers@0.4.0 16 | angular-html-compiler@0.4.0 17 | angular-scss-compiler@0.4.0 18 | angular-typescript-compiler@0.4.0 19 | dynamic-import@0.6.0 20 | ecmascript@0.15.0 21 | ecmascript-runtime@0.7.0 22 | ecmascript-runtime-client@0.11.0 23 | ecmascript-runtime-server@0.10.0 24 | ejson@1.1.1 25 | es5-shim@4.8.0 26 | fetch@0.1.1 27 | geojson-utils@1.0.10 28 | hot-code-push@1.0.4 29 | id-map@1.1.0 30 | inter-process-messaging@0.1.1 31 | launch-screen@1.2.0 32 | livedata@1.0.18 33 | logging@1.2.0 34 | meteor@1.9.3 35 | meteor-base@1.4.0 36 | minifier-css@1.5.3 37 | minifier-js@2.6.0 38 | minimongo@1.6.1 39 | mobile-experience@1.1.0 40 | mobile-status-bar@1.1.0 41 | modern-browsers@0.1.5 42 | modules@0.16.0 43 | modules-runtime@0.12.0 44 | mongo@1.10.1 45 | mongo-decimal@0.1.2 46 | mongo-dev-server@1.1.0 47 | mongo-id@1.0.7 48 | npm-mongo@3.8.1 49 | ordered-dict@1.1.0 50 | promise@0.11.2 51 | random@1.2.0 52 | react-fast-refresh@0.1.0 53 | reactive-var@1.0.11 54 | reload@1.3.1 55 | retry@1.1.0 56 | routepolicy@1.1.0 57 | shell-server@0.5.0 58 | socket-stream-client@0.3.1 59 | standard-minifier-css@1.7.2 60 | standard-minifier-js@2.6.0 61 | tracker@1.2.0 62 | underscore@1.0.10 63 | webapp@1.10.0 64 | webapp-hashing@1.1.0 65 | -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/README.md: -------------------------------------------------------------------------------- 1 | # Angular2-Meteor Boilerplate 2 | 3 | [![bitHound Overall Score](https://www.bithound.io/github/Urigo/angular2-meteor-base/badges/score.svg)](https://www.bithound.io/github/Urigo/angular2-meteor-base) [![bitHound Dependencies](https://www.bithound.io/github/Urigo/angular2-meteor-base/badges/dependencies.svg)](https://www.bithound.io/github/Urigo/angular2-meteor-base/master/dependencies/npm) 4 | 5 | 6 | ## Usage 7 | 8 | Since Meteor v1.4 you can use one command to create a working Angular2 app based on this boilerplate: 9 | 10 | ``` 11 | meteor create --example angular2-boilerplate 12 | ``` 13 | 14 | ## NPM Scripts 15 | 16 | This boilerplate comes with predefined NPM scripts, defined in `package.json`: 17 | 18 | - `$ npm run start` - Run the Meteor application. 19 | - `$ npm run start:prod` - Run the Meteor application in production mode. 20 | - `$ npm run build` - Creates a Meteor build version under `./build/` directory. 21 | - `$ npm run clear` - Resets Meteor's cache and clears the MongoDB collections. 22 | - `$ npm run meteor:update` - Updates Meteor's version and it's dependencies. 23 | - `$ npm run test` - Executes Meteor in test mode with Mocha. 24 | - `$ npm run test:ci` - Executes Meteor in test mode with Mocha for CI (run once). 25 | 26 | ## Boilerplate Contents 27 | 28 | This boilerplate contains the basics that requires to quick start with Angular2-Meteor application. 29 | 30 | This package contains: 31 | 32 | - TypeScript support (with `@types`) and Angular 2 compilers for Meteor 33 | - Angular2-Meteor 34 | - Angular 2 (core, common, compiler, platform, router, forms) 35 | - SASS, LESS, CSS support (Also support styles encapsulation for Angular 2) 36 | - Testing framework with Mocha and Chai 37 | - [Meteor-RxJS](http://angular-meteor.com/meteor-rxjs/) support and usage 38 | 39 | This application also contains demo code: 40 | 41 | - Main Component (`/client/app.component`) 42 | - Demo Child Component (`/client/imports/demo/demo.component`) 43 | - Demo Service (`/client/imports/demo/demo-data.service`) 44 | - Demo Mongo Collection (`/both/demo.collection.ts`) with a TypeScript interface as model. 45 | 46 | The Main component loads the child component, which uses the demo service that gets it's data from the demo collection. 47 | 48 | ### Folder Structure 49 | 50 | The folder structure is a mix between [Angular 2 recommendation](https://johnpapa.net/angular-2-styles/) and [Meteor 1.3 recommendation](https://guide.meteor.com/structure.html). 51 | 52 | ### Client 53 | 54 | The `client` folder contains single TypeScript (`.ts`) file which is the main file (`/client/app.component.ts`), and bootstrap's the Angular 2 application. 55 | 56 | The main component uses HTML template and SASS file. 57 | 58 | The `index.html` file is the main HTML which loads the application by using the main component selector (``). 59 | 60 | All the other client files are under `client/imports` and organized by the context of the components (in our example, the context is `demo`). 61 | 62 | 63 | ### Server 64 | 65 | The `server` folder contain single TypeScript (`.ts`) file which is the main file (`/server/main.ts`), and creates the main server instance, and the starts it. 66 | 67 | All other server files should be located under `/server/imports`. 68 | 69 | ### Common 70 | 71 | Example for common files in our app, is the MongoDB collection we create - it located under `/both/demo-collection.ts` and it can be imported from both client and server code. 72 | 73 | ### Testing 74 | 75 | The testing environment in this boilerplate based on [Meteor recommendation](https://guide.meteor.com/testing.html), and uses Mocha as testing framework along with Chai for assertion. 76 | 77 | There is a main test file that initialize Angular 2 tests library, it located under `/client/init.test.ts`. 78 | 79 | All other test files are located near the component/service it tests, with the `.test.ts` extension. 80 | 81 | The `DemoComponent` contains example for Angular 2 tests for Component, and in the server side there is an example for testing Meteor collections and stub data. 82 | -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/client/imports/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import '../polyfills.spec.ts'; 2 | 3 | import { APP_BASE_HREF } from '@angular/common'; 4 | import { getTestBed, TestBed, async } from '@angular/core/testing'; 5 | import { RouterTestingModule } from '@angular/router/testing'; 6 | import { AppComponent } from './app.component'; 7 | import { By } from '@angular/platform-browser'; 8 | 9 | import { expect } from 'chai'; 10 | import { spy } from 'sinon'; 11 | 12 | describe(`AppComponent`, () => { 13 | 14 | beforeEach(async(() => { 15 | TestBed.configureTestingModule({ 16 | imports: [RouterTestingModule], 17 | declarations: [AppComponent], //declare test component 18 | providers: [ 19 | { 20 | provide: APP_BASE_HREF, 21 | useValue: '/' 22 | } 23 | ] 24 | }) 25 | .compileComponents(); //compile html and css 26 | })); 27 | 28 | afterEach(() => { 29 | getTestBed().resetTestingModule(); 30 | }); 31 | 32 | it('should display h1 element', () => { 33 | const fixture = TestBed.createComponent(AppComponent); 34 | 35 | fixture.detectChanges(); 36 | 37 | const h1 = fixture.debugElement.query(By.css('h1')); 38 | 39 | expect(h1.nativeElement.textContent).to.equal('Todos'); 40 | }); 41 | 42 | 43 | }); 44 | -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/client/imports/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app', 5 | templateUrl: 'app.html' 6 | }) 7 | export class AppComponent {} 8 | -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/client/imports/app/app.html: -------------------------------------------------------------------------------- 1 |

Todos

2 | 3 | -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/client/imports/app/app.module.spec.ts: -------------------------------------------------------------------------------- 1 | import '../polyfills.spec.ts'; 2 | 3 | import { TestBed } from '@angular/core/testing'; 4 | import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing'; 5 | 6 | TestBed.initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting()); -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/client/imports/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | 3 | import { BrowserModule } from '@angular/platform-browser'; 4 | 5 | import { FormsModule } from '@angular/forms'; 6 | 7 | import { RouterModule } from '@angular/router'; 8 | 9 | import { AppComponent } from './app.component'; 10 | import { TodoAddComponent } from './todo-add/todo-add.component'; 11 | import { TodoListComponent } from './todo-list/todo-list.component'; 12 | import { PageNotFoundComponent } from './page-not-found/page-not-found.component'; 13 | 14 | @NgModule({ 15 | imports: [ 16 | BrowserModule, 17 | FormsModule, 18 | RouterModule.forRoot([ 19 | { 20 | path: 'todoList', 21 | component: TodoListComponent 22 | }, 23 | { 24 | path: 'todoAdd', 25 | component: TodoAddComponent 26 | }, 27 | // Home Page 28 | { 29 | path: '', 30 | redirectTo: '/todoList', 31 | pathMatch: 'full' 32 | }, 33 | // 404 Page 34 | { 35 | path: '**', 36 | component: PageNotFoundComponent 37 | } 38 | ]) 39 | ], 40 | declarations: [ 41 | AppComponent, 42 | TodoAddComponent, 43 | TodoListComponent, 44 | PageNotFoundComponent 45 | ], 46 | bootstrap: [ 47 | AppComponent 48 | ] 49 | }) 50 | export class AppModule { } 51 | -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/client/imports/app/page-not-found/page-not-found.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'page-not-found', 5 | templateUrl: 'page-not-found.html' 6 | }) 7 | export class PageNotFoundComponent { } 8 | -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/client/imports/app/page-not-found/page-not-found.html: -------------------------------------------------------------------------------- 1 |

404 Page Not Found

2 | -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/client/imports/app/todo-add/todo-add.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | import { Meteor } from 'meteor/meteor'; 4 | 5 | @Component({ 6 | selector: 'todo-add', 7 | templateUrl: 'todo-add.html' 8 | }) 9 | export class TodoAddComponent { 10 | content: string; 11 | addTodo() { 12 | Meteor.call('addTodo', this.content); 13 | this.content = null; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/client/imports/app/todo-add/todo-add.html: -------------------------------------------------------------------------------- 1 | List 2 |
3 | Add Todo 4 | 7 | 8 | 9 |
10 | -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/client/imports/app/todo-list/todo-list.component.spec.ts: -------------------------------------------------------------------------------- 1 | import '../../polyfills.spec.ts'; 2 | 3 | import { getTestBed, TestBed, async } from '@angular/core/testing'; 4 | import { TodoListComponent } from './todo-list.component'; 5 | import { By } from '@angular/platform-browser'; 6 | 7 | import { expect } from 'chai'; 8 | import { spy } from 'sinon'; 9 | 10 | describe(`TodoListComponent`, () => { 11 | 12 | beforeEach(async(() => { 13 | TestBed.configureTestingModule({ 14 | declarations: [TodoListComponent], //declare test component 15 | }) 16 | .compileComponents(); //compile html and css 17 | })); 18 | 19 | afterEach(() => { 20 | getTestBed().resetTestingModule(); 21 | }); 22 | 23 | it('should display `a` element', () => { 24 | const fixture = TestBed.createComponent(TodoListComponent); 25 | 26 | fixture.detectChanges(); 27 | 28 | const a = fixture.debugElement.query(By.css('a')); 29 | 30 | expect(a.nativeElement.textContent).to.equal('Add'); 31 | }); 32 | 33 | it('should render styles correctly', () => { 34 | const fixture = TestBed.createComponent(TodoListComponent); 35 | 36 | fixture.detectChanges(); 37 | 38 | const addBtn = fixture.debugElement.query(By.css('.addBtn')); 39 | 40 | const { 41 | color 42 | } = getComputedStyle(addBtn.nativeElement); 43 | 44 | expect(color).to.equal('rgb(0, 255, 0)'); 45 | }) 46 | 47 | }); 48 | -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/client/imports/app/todo-list/todo-list.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, OnDestroy, NgZone } from '@angular/core'; 2 | 3 | import { Observable, Subscription } from 'rxjs'; 4 | 5 | import { Meteor } from 'meteor/meteor'; 6 | import { MeteorObservable, zoneOperator } from 'meteor-rxjs'; 7 | import { Todo } from '../../../../imports/models/todo'; 8 | import { Todos } from '../../../../imports/collections/todos'; 9 | 10 | @Component( { 11 | selector: 'todo-list', 12 | templateUrl: 'todo-list.html', 13 | styleUrls: ['todo-list.scss'] 14 | } ) 15 | export class TodoListComponent implements OnInit, OnDestroy { 16 | todos: Observable; 17 | todos2: Observable; 18 | todos3: Observable; 19 | todos4: Todo[]; 20 | todoListSubscription: Subscription; 21 | 22 | constructor( private ngZone: NgZone ) { 23 | } 24 | 25 | ngOnInit() { 26 | //this.todoListSubscription = MeteorObservable.subscribe( 'todoList' ).subscribe(); 27 | this.todoListSubscription = MeteorObservable.subscribe( 'todoList' ).subscribe( () => { 28 | this.todos = Todos.find(); 29 | } ); 30 | 31 | this.todos2 = Todos.find().pipe( zoneOperator() ) as Observable; 32 | 33 | Tracker.autorun( () => { 34 | this.ngZone.run( () => { 35 | this.todos3 = Todos.find(); 36 | } ); 37 | } ); 38 | 39 | Tracker.autorun( () => { 40 | this.ngZone.run( () => { 41 | this.todos4 = Todos.find().fetch(); 42 | } ); 43 | } ); 44 | 45 | } 46 | 47 | ngOnDestroy() { 48 | if ( this.todoListSubscription ) { 49 | this.todoListSubscription.unsubscribe(); 50 | } 51 | } 52 | 53 | removeTodo( _id: string ) { 54 | Meteor.call( 'removeTodo', _id ); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/client/imports/app/todo-list/todo-list.html: -------------------------------------------------------------------------------- 1 | Add 3 |
    4 |
  • 5 | {{todo.content}} 6 | 9 |
  • 10 |
  • 11 | {{todo2.content}} 12 |
  • 13 |
  • 14 | {{todo3.content}} 15 |
  • 16 |
  • 17 | {{todo4.content}} 18 |
  • 19 |
20 | -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/client/imports/app/todo-list/todo-list.scss: -------------------------------------------------------------------------------- 1 | .deleteBtn { 2 | color: red; 3 | } 4 | .addBtn { 5 | color: rgb(0, 255, 0); 6 | } -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/client/imports/polyfills.spec.ts: -------------------------------------------------------------------------------- 1 | import 'tslib'; 2 | import 'zone.js/dist/zone'; 3 | import 'zone.js/dist/long-stack-trace-zone'; 4 | import 'zone.js/dist/async-test'; 5 | import 'zone.js/dist/fake-async-test'; 6 | import 'zone.js/dist/sync-test'; 7 | import 'zone.js/dist/proxy'; 8 | import 'zone.js/dist/mocha-patch'; 9 | import 'core-js/proposals/reflect-metadata'; 10 | 11 | -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/client/imports/polyfills.ts: -------------------------------------------------------------------------------- 1 | import 'zone.js'; 2 | import 'core-js/proposals/reflect-metadata'; 3 | -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/client/main.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Todos 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/client/main.ts: -------------------------------------------------------------------------------- 1 | import './imports/polyfills'; 2 | import { Meteor } from 'meteor/meteor'; 3 | 4 | import { enableProdMode } from '@angular/core'; 5 | import { AppModule } from './imports/app/app.module'; 6 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 7 | 8 | Meteor.startup( () => { 9 | 10 | if ( Meteor.isProduction ) { 11 | enableProdMode(); 12 | } 13 | 14 | platformBrowserDynamic().bootstrapModule( AppModule ).then(); 15 | 16 | } ); 17 | -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/imports/collections/todos.ts: -------------------------------------------------------------------------------- 1 | import { MongoObservable } from 'meteor-rxjs'; 2 | 3 | import { Todo } from '../models/todo'; 4 | 5 | export const Todos = new MongoObservable.Collection('todos'); 6 | -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/imports/models/todo.ts: -------------------------------------------------------------------------------- 1 | export interface Todo { 2 | _id?: string; 3 | content?: string; 4 | } 5 | -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "start": "meteor run", 5 | "start:prod": "AOT=1 meteor --production", 6 | "build:prod": "AOT=1 meteor build .", 7 | "test": "TEST_BROWSER_DRIVER=puppeteer meteor test --driver-package=ardatan:mocha --raw-logs", 8 | "test:ci": "TEST_BROWSER_DRIVER=puppeteer meteor test --driver-package=ardatan:mocha --once --raw-logs" 9 | }, 10 | "dependencies": { 11 | "@angular/common": "11.2.2", 12 | "@angular/core": "11.2.2", 13 | "@angular/forms": "11.2.2", 14 | "@angular/platform-browser": "11.2.2", 15 | "@angular/platform-browser-dynamic": "11.2.2", 16 | "@angular/router": "11.2.2", 17 | "@babel/runtime": "7.13.7", 18 | "core-js": "^3.9.0", 19 | "meteor-node-stubs": "^1.0.1", 20 | "meteor-rxjs": "^0.4.14", 21 | "rxjs": "^6.6.3", 22 | "zone.js": "^0.11.4" 23 | }, 24 | "devDependencies": { 25 | "@angular/compiler": "11.2.2", 26 | "@angular/compiler-cli": "11.2.2", 27 | "@types/chai": "^4.2.15", 28 | "@types/meteor": "1.4.67", 29 | "@types/mocha": "^8.2.1", 30 | "@types/node": "^14.14.22", 31 | "@types/sinon": "^9.0.10", 32 | "chai": "^4.3.0", 33 | "mocha": "8.3.0", 34 | "puppeteer": "^7.1.0", 35 | "sinon": "^9.2.4", 36 | "typescript": "4.2.2" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["config:js-app"] 3 | } 4 | -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/run_tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | echo "[MeteorCLI - bare] Resetting project" 3 | meteor reset 4 | echo "[MeteorCLI - bare] Installing npm dependencies" 5 | npm ci 6 | exit_code=$?; if [ ${exit_code} -gt 0 ]; then exit ${exit_code}; fi 7 | echo "[MeteorCLI - bare] Installing meteor dependencies" 8 | meteor update --all-packages --allow-incompatible-update 9 | exit_code=$?; if [ ${exit_code} -gt 0 ]; then exit ${exit_code}; fi 10 | echo "[MeteorCLI - bare] Testing JIT" 11 | npm run test:ci 12 | exit_code=$?; if [ ${exit_code} -gt 0 ]; then exit ${exit_code}; fi 13 | echo "[MeteorCLI - bare] Testing AOT" 14 | AOT=1 meteor build ./.meteor/build-aot 15 | exit_code=$?; if [ ${exit_code} -gt 0 ]; then exit ${exit_code}; fi 16 | echo "[MeteorCLI - bare] AOT w/ Rollup" 17 | AOT=1 ROLLUP=1 meteor build ./.meteor/build-aot-rollup 18 | exit_code=$?; if [ ${exit_code} -gt 0 ]; then exit ${exit_code}; fi 19 | -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/server/imports/methods/todos.ts: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | 3 | import { Todos } from '../../../imports/collections/todos'; 4 | 5 | Meteor.methods({ 6 | addTodo(content: string) { 7 | Todos.insert({ 8 | content 9 | }); 10 | }, 11 | removeTodo(_id: string) { 12 | Todos.remove({ 13 | _id 14 | }) 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/server/imports/publications/todos.ts: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | 3 | import { Todos } from '../../../imports/collections/todos'; 4 | 5 | Meteor.publish('todoList', function() { 6 | return Todos.find({}); 7 | }); 8 | -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/server/main.ts: -------------------------------------------------------------------------------- 1 | import './imports/methods/todos'; 2 | import './imports/publications/todos'; 3 | -------------------------------------------------------------------------------- /examples/MeteorCLI/bare/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowSyntheticDefaultImports": true, 4 | "baseUrl": ".", 5 | "declaration": false, 6 | "emitDecoratorMetadata": true, 7 | "importHelpers": true, 8 | "experimentalDecorators": true, 9 | "lib": [ 10 | "dom", 11 | "ES2017" 12 | ], 13 | "module": "commonjs", 14 | "moduleResolution": "node", 15 | "sourceMap": true, 16 | "target": "ES2017", 17 | "skipLibCheck": true, 18 | "stripInternal": true, 19 | "noImplicitAny": false, 20 | "types": [ 21 | "@types/meteor", 22 | "@types/node", 23 | "@types/mocha", 24 | "@types/chai", 25 | "@types/sinon" 26 | ] 27 | }, 28 | "include": [ 29 | "imports/**/*.ts", 30 | "client/**/*.ts", 31 | "server/**/*.ts" 32 | ], 33 | "exclude": [ 34 | "node_modules" 35 | ], 36 | "compileOnSave": false, 37 | "atom": { 38 | "rewriteTsconfig": false 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /examples/MeteorCLI/lazy-loading/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /examples/MeteorCLI/lazy-loading/.meteor/.finished-upgraders: -------------------------------------------------------------------------------- 1 | # This file contains information which helps Meteor properly upgrade your 2 | # app when you run 'meteor update'. You should check it into version control 3 | # with your project. 4 | 5 | notices-for-0.9.0 6 | notices-for-0.9.1 7 | 0.9.4-platform-file 8 | notices-for-facebook-graph-api-2 9 | 1.2.0-standard-minifiers-package 10 | 1.2.0-meteor-platform-split 11 | 1.2.0-cordova-changes 12 | 1.2.0-breaking-changes 13 | 1.3.0-split-minifiers-package 14 | 1.4.0-remove-old-dev-bundle-link 15 | 1.4.1-add-shell-server-package 16 | 1.4.3-split-account-service-packages 17 | 1.5-add-dynamic-import-package 18 | 1.7-split-underscore-from-meteor-base 19 | 1.8.3-split-jquery-from-blaze 20 | -------------------------------------------------------------------------------- /examples/MeteorCLI/lazy-loading/.meteor/.gitignore: -------------------------------------------------------------------------------- 1 | local 2 | build* -------------------------------------------------------------------------------- /examples/MeteorCLI/lazy-loading/.meteor/.id: -------------------------------------------------------------------------------- 1 | # This file contains a token that is unique to your project. 2 | # Check it into your repository along with the rest of this directory. 3 | # It can be used for purposes such as: 4 | # - ensuring you don't accidentally deploy one app on top of another 5 | # - providing package authors with aggregated statistics 6 | 7 | 1v3cd20wh44ur13qwquo 8 | -------------------------------------------------------------------------------- /examples/MeteorCLI/lazy-loading/.meteor/packages: -------------------------------------------------------------------------------- 1 | # Meteor packages used by this project, one per line. 2 | # Check this file (and the other files in this directory) into your repository. 3 | # 4 | # 'meteor add' and 'meteor remove' will edit this file for you, 5 | # but you can also edit it by hand. 6 | 7 | meteor-base@1.4.0 # Packages every Meteor app needs to have 8 | mobile-experience@1.1.0 # Packages for a great mobile UX 9 | mongo@1.10.1 # The database Meteor supports right now 10 | reactive-var@1.0.11 # Reactive variable for tracker 11 | tracker@1.2.0 # Meteor's client-side reactive programming library 12 | 13 | ecmascript@0.15.0 # Enable ECMAScript2015+ syntax in app code 14 | shell-server@0.5.0 # Server-side component of the `meteor shell` command 15 | 16 | angular-compilers 17 | -------------------------------------------------------------------------------- /examples/MeteorCLI/lazy-loading/.meteor/platforms: -------------------------------------------------------------------------------- 1 | server 2 | browser 3 | -------------------------------------------------------------------------------- /examples/MeteorCLI/lazy-loading/.meteor/release: -------------------------------------------------------------------------------- 1 | METEOR@2.1 2 | -------------------------------------------------------------------------------- /examples/MeteorCLI/lazy-loading/.meteor/versions: -------------------------------------------------------------------------------- 1 | allow-deny@1.1.0 2 | angular-compilers@0.4.0 3 | angular-html-compiler@0.4.0 4 | angular-scss-compiler@0.4.0 5 | angular-typescript-compiler@0.4.0 6 | autoupdate@1.7.0 7 | babel-compiler@7.6.0 8 | babel-runtime@1.5.0 9 | base64@1.0.12 10 | binary-heap@1.0.11 11 | boilerplate-generator@1.7.1 12 | callback-hook@1.3.0 13 | check@1.3.1 14 | ddp@1.4.0 15 | ddp-client@2.4.0 16 | ddp-common@1.4.0 17 | ddp-server@2.3.2 18 | diff-sequence@1.1.1 19 | dynamic-import@0.6.0 20 | ecmascript@0.15.0 21 | ecmascript-runtime@0.7.0 22 | ecmascript-runtime-client@0.11.0 23 | ecmascript-runtime-server@0.10.0 24 | ejson@1.1.1 25 | es5-shim@4.8.0 26 | fetch@0.1.1 27 | geojson-utils@1.0.10 28 | hot-code-push@1.0.4 29 | id-map@1.1.0 30 | inter-process-messaging@0.1.1 31 | launch-screen@1.2.0 32 | livedata@1.0.18 33 | logging@1.2.0 34 | meteor@1.9.3 35 | meteor-base@1.4.0 36 | minimongo@1.6.1 37 | mobile-experience@1.1.0 38 | mobile-status-bar@1.1.0 39 | modern-browsers@0.1.5 40 | modules@0.16.0 41 | modules-runtime@0.12.0 42 | mongo@1.10.1 43 | mongo-decimal@0.1.2 44 | mongo-dev-server@1.1.0 45 | mongo-id@1.0.7 46 | npm-mongo@3.8.1 47 | ordered-dict@1.1.0 48 | promise@0.11.2 49 | random@1.2.0 50 | react-fast-refresh@0.1.0 51 | reactive-var@1.0.11 52 | reload@1.3.1 53 | retry@1.1.0 54 | routepolicy@1.1.0 55 | shell-server@0.5.0 56 | socket-stream-client@0.3.1 57 | tracker@1.2.0 58 | underscore@1.0.10 59 | webapp@1.10.0 60 | webapp-hashing@1.1.0 61 | -------------------------------------------------------------------------------- /examples/MeteorCLI/lazy-loading/client/imports/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, OnDestroy } from '@angular/core'; 2 | import { Router, NavigationEnd, ActivatedRoute } from '@angular/router'; 3 | import { Title } from '@angular/platform-browser'; 4 | 5 | import { Subscription } from 'rxjs'; 6 | 7 | import { filter, map, mergeMap } from 'rxjs/operators'; 8 | 9 | @Component({ 10 | selector: 'app', 11 | templateUrl: 'app.html' 12 | }) 13 | export class AppComponent implements OnInit, OnDestroy { 14 | //Dynamic title change along with router 15 | private titleChangeSubscription: Subscription; 16 | constructor( 17 | private router: Router, 18 | private activatedRoute: ActivatedRoute, 19 | private titleService: Title 20 | ) { } 21 | ngOnInit() { 22 | this.titleChangeSubscription = 23 | this.router.events.pipe( 24 | filter((event) => event instanceof NavigationEnd), 25 | map(() => this.activatedRoute), 26 | map((route) => { 27 | while (route.firstChild) route = route.firstChild; 28 | return route; 29 | }), 30 | filter((route) => route.outlet === 'primary'), 31 | mergeMap((route) => route.data) 32 | ).subscribe((event) => this.titleService.setTitle(event['title'])); 33 | } 34 | ngOnDestroy() { 35 | this.titleChangeSubscription.unsubscribe(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /examples/MeteorCLI/lazy-loading/client/imports/app/app.html: -------------------------------------------------------------------------------- 1 |

Todos

2 | 3 | -------------------------------------------------------------------------------- /examples/MeteorCLI/lazy-loading/client/imports/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | 3 | import { BrowserModule } from '@angular/platform-browser'; 4 | 5 | import { RouterModule } from '@angular/router'; 6 | 7 | import { AppComponent } from './app.component'; 8 | import { TodoListComponent } from './todo-list/todo-list.component'; 9 | import { PageNotFoundComponent } from './page-not-found/page-not-found.component'; 10 | 11 | @NgModule({ 12 | imports: [ 13 | BrowserModule, 14 | RouterModule.forRoot([ 15 | { 16 | path: 'todoList', 17 | component: TodoListComponent, 18 | data: { 19 | title: 'Todo List' 20 | } 21 | }, 22 | { 23 | path: 'todoAdd', 24 | loadChildren: './todo-add/todo-add.module#TodoAddModule', 25 | data: { 26 | title: 'Add Todo' 27 | } 28 | }, 29 | // Home Page 30 | { 31 | path: '', 32 | redirectTo: '/todoList', 33 | pathMatch: 'full' 34 | }, 35 | // 404 Page 36 | { 37 | path: '**', 38 | component: PageNotFoundComponent, 39 | data: { 40 | title: '404 Page Not Found' 41 | } 42 | } 43 | ]) 44 | ], 45 | declarations: [ 46 | AppComponent, 47 | TodoListComponent, 48 | PageNotFoundComponent 49 | ], 50 | bootstrap: [ 51 | AppComponent 52 | ] 53 | }) 54 | export class AppModule { } 55 | -------------------------------------------------------------------------------- /examples/MeteorCLI/lazy-loading/client/imports/app/page-not-found/page-not-found.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'page-not-found', 5 | templateUrl: 'page-not-found.html' 6 | }) 7 | export class PageNotFoundComponent { } 8 | -------------------------------------------------------------------------------- /examples/MeteorCLI/lazy-loading/client/imports/app/page-not-found/page-not-found.html: -------------------------------------------------------------------------------- 1 |

404 Page Not Found

2 | -------------------------------------------------------------------------------- /examples/MeteorCLI/lazy-loading/client/imports/app/todo-add/todo-add.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | import { Meteor } from 'meteor/meteor'; 4 | 5 | @Component({ 6 | selector: 'todo-add', 7 | templateUrl: 'todo-add.html' 8 | }) 9 | export class TodoAddComponent { 10 | content: string; 11 | addTodo() { 12 | Meteor.call('addTodo', this.content); 13 | this.content = null; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /examples/MeteorCLI/lazy-loading/client/imports/app/todo-add/todo-add.html: -------------------------------------------------------------------------------- 1 | List 2 |
3 | Add Todo 4 | 7 | 8 | 9 |
10 | -------------------------------------------------------------------------------- /examples/MeteorCLI/lazy-loading/client/imports/app/todo-add/todo-add.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | 3 | import { FormsModule } from '@angular/forms'; 4 | 5 | import { RouterModule } from '@angular/router'; 6 | 7 | import { TodoAddComponent } from './todo-add.component'; 8 | 9 | @NgModule({ 10 | imports: [ 11 | FormsModule, 12 | RouterModule.forChild([ 13 | { path: '', component: TodoAddComponent } 14 | ]) 15 | ], 16 | declarations: [ 17 | TodoAddComponent 18 | ] 19 | }) 20 | export class TodoAddModule{} 21 | -------------------------------------------------------------------------------- /examples/MeteorCLI/lazy-loading/client/imports/app/todo-list/todo-list.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, OnDestroy } from '@angular/core'; 2 | 3 | import { Observable, Subscription } from 'rxjs'; 4 | 5 | import { Meteor } from 'meteor/meteor'; 6 | import { MeteorObservable } from 'meteor-rxjs'; 7 | 8 | import { Todos } from '../../../../imports/collections/todos'; 9 | import { Todo } from '../../../../imports/models/todo'; 10 | 11 | @Component({ 12 | selector: 'todo-list', 13 | templateUrl: 'todo-list.html', 14 | styleUrls: ['todo-list.scss'] 15 | }) 16 | export class TodoListComponent implements OnInit, OnDestroy { 17 | todos: Observable; 18 | todoListSubscription: Subscription; 19 | ngOnInit() { 20 | this.todoListSubscription = MeteorObservable.subscribe('todoList').subscribe(() => { 21 | this.todos = Todos.find(); 22 | }); 23 | } 24 | ngOnDestroy() { 25 | if (this.todoListSubscription) { 26 | this.todoListSubscription.unsubscribe(); 27 | } 28 | } 29 | removeTodo(_id: string) { 30 | Meteor.call('removeTodo', _id); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /examples/MeteorCLI/lazy-loading/client/imports/app/todo-list/todo-list.html: -------------------------------------------------------------------------------- 1 | Add 2 |
    3 |
  • 4 | {{todo.content}} 5 | 6 |
  • 7 |
8 | -------------------------------------------------------------------------------- /examples/MeteorCLI/lazy-loading/client/imports/app/todo-list/todo-list.scss: -------------------------------------------------------------------------------- 1 | .deleteBtn { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /examples/MeteorCLI/lazy-loading/client/imports/polyfills.ts: -------------------------------------------------------------------------------- 1 | import 'zone.js'; 2 | import 'core-js/proposals/reflect-metadata'; 3 | 4 | -------------------------------------------------------------------------------- /examples/MeteorCLI/lazy-loading/client/main.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Todos 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/MeteorCLI/lazy-loading/client/main.ts: -------------------------------------------------------------------------------- 1 | import './imports/polyfills'; 2 | 3 | import { Meteor } from 'meteor/meteor'; 4 | 5 | import { enableProdMode } from '@angular/core'; 6 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 7 | import { AppModule } from './imports/app/app.module'; 8 | 9 | Meteor.startup(() => { 10 | 11 | if (Meteor.isProduction) { 12 | enableProdMode(); 13 | } 14 | 15 | platformBrowserDynamic().bootstrapModule(AppModule); 16 | 17 | }); 18 | -------------------------------------------------------------------------------- /examples/MeteorCLI/lazy-loading/imports/collections/todos.ts: -------------------------------------------------------------------------------- 1 | import { MongoObservable } from 'meteor-rxjs'; 2 | 3 | import { Todo } from '../models/todo'; 4 | 5 | export const Todos = new MongoObservable.Collection('todos'); 6 | -------------------------------------------------------------------------------- /examples/MeteorCLI/lazy-loading/imports/models/todo.ts: -------------------------------------------------------------------------------- 1 | export interface Todo { 2 | _id?: string; 3 | content?: string; 4 | } 5 | -------------------------------------------------------------------------------- /examples/MeteorCLI/lazy-loading/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "start": "meteor run", 5 | "test": "TEST_BROWSER_DRIVER=puppeteer meteor test --driver-package=ardatan:mocha --raw-logs", 6 | "test:ci": "TEST_BROWSER_DRIVER=puppeteer meteor test --driver-package=ardatan:mocha --once --raw-logs" 7 | }, 8 | "dependencies": { 9 | "@angular/common": "^7.1.0", 10 | "@angular/compiler": "^7.1.0", 11 | "@angular/core": "^7.1.0", 12 | "@angular/forms": "^7.1.0", 13 | "@angular/platform-browser": "^7.1.0", 14 | "@angular/platform-browser-dynamic": "^7.1.0", 15 | "@angular/router": "^7.1.0", 16 | "@babel/runtime": "^7.13.7", 17 | "core-js": "^3.9.0", 18 | "meteor-node-stubs": "^0.4.1", 19 | "meteor-rxjs": "^0.4.14", 20 | "rxjs": "^6.3.0", 21 | "zone.js": "^0.8.26" 22 | }, 23 | "devDependencies": { 24 | "@angular/compiler-cli": "^7.1.0", 25 | "@types/chai": "^4.1.7", 26 | "@types/meteor": "^1.4.23", 27 | "@types/mocha": "^5.2.5", 28 | "@types/sinon": "^5.0.7", 29 | "chai": "^4.2.0", 30 | "mocha": "^5.2.0", 31 | "puppeteer": "^1.10.0", 32 | "sinon": "^7.1.1", 33 | "typescript": "~3.1.1" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /examples/MeteorCLI/lazy-loading/run_tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | echo "[MeteorCLI - lazy-loading] Resetting project" 3 | meteor reset 4 | echo "[MeteorCLI - lazy-loading] Installing npm dependencies" 5 | npm ci 6 | exit_code=$?; if [ ${exit_code} -gt 0 ]; then exit ${exit_code}; fi 7 | echo "[MeteorCLI - lazy-loading] Installing meteor dependencies" 8 | meteor update --all-packages --allow-incompatible-update 9 | exit_code=$?; if [ ${exit_code} -gt 0 ]; then exit ${exit_code}; fi 10 | echo "[MeteorCLI - lazy-loading] Testing JIT" 11 | npm run test:ci 12 | exit_code=$?; if [ ${exit_code} -gt 0 ]; then exit ${exit_code}; fi 13 | echo "[MeteorCLI - lazy-loading] Testing AOT" 14 | AOT=1 meteor build ./.meteor/build-aot 15 | exit_code=$?; if [ ${exit_code} -gt 0 ]; then exit ${exit_code}; fi 16 | echo "[MeteorCLI - lazy-loading] AOT w/ Rollup" 17 | AOT=1 ROLLUP=1 meteor build ./.meteor/build-aot-rollup 18 | exit_code=$?; if [ ${exit_code} -gt 0 ]; then exit ${exit_code}; fi 19 | -------------------------------------------------------------------------------- /examples/MeteorCLI/lazy-loading/server/imports/methods/todos.ts: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | 3 | import { Todos } from '../../../imports/collections/todos'; 4 | 5 | Meteor.methods({ 6 | addTodo(content: string) { 7 | Todos.insert({ 8 | content 9 | }); 10 | }, 11 | removeTodo(_id: string) { 12 | Todos.remove({ 13 | _id 14 | }) 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /examples/MeteorCLI/lazy-loading/server/imports/publications/todos.ts: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | 3 | import { Todos } from '../../../imports/collections/todos'; 4 | 5 | Meteor.publish('todoList', function() { 6 | return Todos.find({}); 7 | }); 8 | -------------------------------------------------------------------------------- /examples/MeteorCLI/lazy-loading/server/main.ts: -------------------------------------------------------------------------------- 1 | import './imports/methods/todos'; 2 | import './imports/publications/todos' 3 | -------------------------------------------------------------------------------- /examples/MeteorCLI/lazy-loading/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowSyntheticDefaultImports": true, 4 | "baseUrl": ".", 5 | "declaration": false, 6 | "emitDecoratorMetadata": true, 7 | "importHelpers": true, 8 | "experimentalDecorators": true, 9 | "lib": [ 10 | "dom", 11 | "es2015" 12 | ], 13 | "module": "commonjs", 14 | "moduleResolution": "node", 15 | "sourceMap": true, 16 | "target": "es2015", 17 | "skipLibCheck": true, 18 | "stripInternal": true, 19 | "noImplicitAny": false, 20 | "types": [ 21 | "@types/meteor", 22 | "@types/node", 23 | "@types/mocha", 24 | "@types/chai", 25 | "@types/sinon" 26 | ] 27 | }, 28 | "include": [ 29 | "imports/**/*.ts", 30 | "client/**/*.ts", 31 | "server/**/*.ts" 32 | ], 33 | "exclude": [ 34 | "node_modules" 35 | ], 36 | "compileOnSave": false, 37 | "atom": { 38 | "rewriteTsconfig": false 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /examples/MeteorCLI/run_tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | export NODE_OPTIONS=--max-old-space-size=2048 3 | export METEOR_PACKAGE_DIRS=../../../atmosphere-packages 4 | cd ./bare 5 | sh run_tests.sh 6 | exit_code=$?; if [ ${exit_code} -gt 0 ]; then exit ${exit_code}; fi 7 | cd ../lazy-loading 8 | sh run_tests.sh 9 | exit_code=$?; if [ ${exit_code} -gt 0 ]; then exit ${exit_code}; fi 10 | cd ../universal 11 | sh run_tests.sh 12 | exit_code=$?; if [ ${exit_code} -gt 0 ]; then exit ${exit_code}; fi 13 | cd ../all-in-one 14 | sh run_tests.sh 15 | exit_code=$?; if [ ${exit_code} -gt 0 ]; then exit ${exit_code}; fi 16 | -------------------------------------------------------------------------------- /examples/MeteorCLI/universal/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /examples/MeteorCLI/universal/.meteor/.finished-upgraders: -------------------------------------------------------------------------------- 1 | # This file contains information which helps Meteor properly upgrade your 2 | # app when you run 'meteor update'. You should check it into version control 3 | # with your project. 4 | 5 | notices-for-0.9.0 6 | notices-for-0.9.1 7 | 0.9.4-platform-file 8 | notices-for-facebook-graph-api-2 9 | 1.2.0-standard-minifiers-package 10 | 1.2.0-meteor-platform-split 11 | 1.2.0-cordova-changes 12 | 1.2.0-breaking-changes 13 | 1.3.0-split-minifiers-package 14 | 1.4.0-remove-old-dev-bundle-link 15 | 1.4.1-add-shell-server-package 16 | 1.4.3-split-account-service-packages 17 | 1.5-add-dynamic-import-package 18 | 1.7-split-underscore-from-meteor-base 19 | 1.8.3-split-jquery-from-blaze 20 | -------------------------------------------------------------------------------- /examples/MeteorCLI/universal/.meteor/.gitignore: -------------------------------------------------------------------------------- 1 | local 2 | build* -------------------------------------------------------------------------------- /examples/MeteorCLI/universal/.meteor/.id: -------------------------------------------------------------------------------- 1 | # This file contains a token that is unique to your project. 2 | # Check it into your repository along with the rest of this directory. 3 | # It can be used for purposes such as: 4 | # - ensuring you don't accidentally deploy one app on top of another 5 | # - providing package authors with aggregated statistics 6 | 7 | 1u9fl6o1biafva9x89vl 8 | -------------------------------------------------------------------------------- /examples/MeteorCLI/universal/.meteor/packages: -------------------------------------------------------------------------------- 1 | # Meteor packages used by this project, one per line. 2 | # Check this file (and the other files in this directory) into your repository. 3 | # 4 | # 'meteor add' and 'meteor remove' will edit this file for you, 5 | # but you can also edit it by hand. 6 | 7 | meteor-base@1.4.0 # Packages every Meteor app needs to have 8 | mobile-experience@1.1.0 # Packages for a great mobile UX 9 | mongo@1.10.1 # The database Meteor supports right now 10 | reactive-var@1.0.11 # Reactive variable for tracker 11 | tracker@1.2.0 # Meteor's client-side reactive programming library 12 | 13 | es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers 14 | ecmascript@0.15.0 # Enable ECMAScript2015+ syntax in app code 15 | shell-server@0.5.0 # Server-side component of the `meteor shell` command 16 | angular-compilers 17 | server-render@0.3.1 18 | -------------------------------------------------------------------------------- /examples/MeteorCLI/universal/.meteor/platforms: -------------------------------------------------------------------------------- 1 | server 2 | browser 3 | -------------------------------------------------------------------------------- /examples/MeteorCLI/universal/.meteor/release: -------------------------------------------------------------------------------- 1 | METEOR@2.1 2 | -------------------------------------------------------------------------------- /examples/MeteorCLI/universal/.meteor/versions: -------------------------------------------------------------------------------- 1 | allow-deny@1.1.0 2 | angular-compilers@0.4.0 3 | angular-html-compiler@0.4.0 4 | angular-scss-compiler@0.4.0 5 | angular-typescript-compiler@0.4.0 6 | autoupdate@1.7.0 7 | babel-compiler@7.6.0 8 | babel-runtime@1.5.0 9 | base64@1.0.12 10 | binary-heap@1.0.11 11 | boilerplate-generator@1.7.1 12 | callback-hook@1.3.0 13 | check@1.3.1 14 | ddp@1.4.0 15 | ddp-client@2.4.0 16 | ddp-common@1.4.0 17 | ddp-server@2.3.2 18 | diff-sequence@1.1.1 19 | dynamic-import@0.6.0 20 | ecmascript@0.15.0 21 | ecmascript-runtime@0.7.0 22 | ecmascript-runtime-client@0.11.0 23 | ecmascript-runtime-server@0.10.0 24 | ejson@1.1.1 25 | es5-shim@4.8.0 26 | fetch@0.1.1 27 | geojson-utils@1.0.10 28 | hot-code-push@1.0.4 29 | id-map@1.1.0 30 | inter-process-messaging@0.1.1 31 | launch-screen@1.2.0 32 | livedata@1.0.18 33 | logging@1.2.0 34 | meteor@1.9.3 35 | meteor-base@1.4.0 36 | minimongo@1.6.1 37 | mobile-experience@1.1.0 38 | mobile-status-bar@1.1.0 39 | modern-browsers@0.1.5 40 | modules@0.16.0 41 | modules-runtime@0.12.0 42 | mongo@1.10.1 43 | mongo-decimal@0.1.2 44 | mongo-dev-server@1.1.0 45 | mongo-id@1.0.7 46 | npm-mongo@3.8.1 47 | ordered-dict@1.1.0 48 | promise@0.11.2 49 | random@1.2.0 50 | react-fast-refresh@0.1.0 51 | reactive-var@1.0.11 52 | reload@1.3.1 53 | retry@1.1.0 54 | routepolicy@1.1.0 55 | server-render@0.3.1 56 | shell-server@0.5.0 57 | socket-stream-client@0.3.1 58 | tracker@1.2.0 59 | underscore@1.0.10 60 | webapp@1.10.0 61 | webapp-hashing@1.1.0 62 | -------------------------------------------------------------------------------- /examples/MeteorCLI/universal/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Arda TANRIKULU 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /examples/MeteorCLI/universal/README.md: -------------------------------------------------------------------------------- 1 | # Angular Meteor Universal w/ AOT 2 | This project shows the usage of *@angular/platform-server* and *@angular/compiler-cli* with *Meteor* 3 | 4 | - Dynamic import without AOT is in dynamic-import branch 5 | 6 | How AOT works? 7 | -- 8 | - On both server and client, it loads AOT-compiled factories by using angular-compiler 9 | 10 | How Universal works? 11 | -- 12 | - renderModule(JIT) and renderModuleFactory(AOT) with Meteor's server-render 13 | 14 | How-to 15 | -- 16 | - Add `server-render` package into your project 17 | - Move your Angular files into `imports/app` 18 | - Create `ServerAppModule` in `server-app.module.ts` w/ importing `ServerModule` from `@angular/platform-server` and `AppModule` from `app.module` in `imports/app` folder 19 | - Change `BrowserModule` in imports to `BrowserModule.withServerTransition({ appId: 'yourAppId' })` 20 | - Write server bootstrap code into `server/main.ts` like in this example 21 | - Run your project with command -> `AOT=1 meteor` 22 | - You have Angular Meteor Universal w/ AOT !!! 23 | - If you want to disable Universal in Development, you can do `Meteor.isProduction` check before `onPageLoad` 24 | - If you want to disable AOT compilation, you can run Meteor w/o `AOT=1` 25 | 26 | Known issues 27 | -- 28 | - Ionic w/ Universal doesn't work due to this issue - https://github.com/ionic-team/ionic/issues/10699 - You can use Angular Material instead! 29 | -------------------------------------------------------------------------------- /examples/MeteorCLI/universal/client/main.ts: -------------------------------------------------------------------------------- 1 | import '../imports/polyfills'; 2 | 3 | import { Meteor } from 'meteor/meteor'; 4 | 5 | import { enableProdMode } from '@angular/core'; 6 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 7 | import { AppModule } from '../imports/app/app.module'; 8 | 9 | Meteor.startup(() => { 10 | 11 | if (Meteor.isProduction) { 12 | enableProdMode(); 13 | } 14 | 15 | platformBrowserDynamic().bootstrapModule(AppModule); 16 | 17 | }); 18 | -------------------------------------------------------------------------------- /examples/MeteorCLI/universal/imports/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, OnDestroy } from '@angular/core'; 2 | import { Router, NavigationEnd, ActivatedRoute } from '@angular/router'; 3 | import { Title } from '@angular/platform-browser'; 4 | 5 | import { Subscription } from 'rxjs'; 6 | 7 | import { filter, map, mergeMap } from 'rxjs/operators'; 8 | 9 | @Component({ 10 | selector: 'app', 11 | templateUrl: 'app.html' 12 | }) 13 | export class AppComponent implements OnInit, OnDestroy { 14 | //Dynamic title change along with router 15 | private titleChangeSubscription: Subscription; 16 | constructor( 17 | private router: Router, 18 | private activatedRoute: ActivatedRoute, 19 | private titleService: Title 20 | ) { } 21 | ngOnInit() { 22 | this.titleChangeSubscription = 23 | this.router.events.pipe( 24 | filter((event) => event instanceof NavigationEnd), 25 | map(() => this.activatedRoute), 26 | map((route) => { 27 | while (route.firstChild) route = route.firstChild; 28 | return route; 29 | }), 30 | filter((route) => route.outlet === 'primary'), 31 | mergeMap((route) => route.data) 32 | ).subscribe((event) => this.titleService.setTitle(event['title'])); 33 | } 34 | ngOnDestroy() { 35 | this.titleChangeSubscription.unsubscribe(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /examples/MeteorCLI/universal/imports/app/app.html: -------------------------------------------------------------------------------- 1 |

Todos

2 | 3 | -------------------------------------------------------------------------------- /examples/MeteorCLI/universal/imports/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | 3 | import { BrowserModule } from '@angular/platform-browser'; 4 | 5 | import { FormsModule } from '@angular/forms'; 6 | 7 | import { RouterModule } from '@angular/router'; 8 | 9 | import { AppComponent } from './app.component'; 10 | import { TodoAddComponent } from './todo-add/todo-add.component'; 11 | import { TodoListComponent } from './todo-list/todo-list.component'; 12 | import { PageNotFoundComponent } from './page-not-found/page-not-found.component'; 13 | 14 | @NgModule({ 15 | imports: [ 16 | // Transition between server and client 17 | BrowserModule.withServerTransition({ 18 | appId: 'angular-meteor-universal' 19 | }), 20 | FormsModule, 21 | RouterModule.forRoot([ 22 | { 23 | path: 'todoList', 24 | component: TodoListComponent, 25 | data: { 26 | title: 'Todo List' 27 | } 28 | }, 29 | { 30 | path: 'todoAdd', 31 | component: TodoAddComponent, 32 | data: { 33 | title: 'Add Todo' 34 | } 35 | }, 36 | // Home Page 37 | { 38 | path: '', 39 | redirectTo: '/todoList', 40 | pathMatch: 'full' 41 | }, 42 | // 404 Page 43 | { 44 | path: '**', 45 | component: PageNotFoundComponent, 46 | data: { 47 | title: '404 Page Not Found' 48 | } 49 | } 50 | ]) 51 | ], 52 | declarations: [ 53 | AppComponent, 54 | TodoAddComponent, 55 | TodoListComponent, 56 | PageNotFoundComponent 57 | ], 58 | bootstrap: [ 59 | AppComponent 60 | ] 61 | }) 62 | export class AppModule { } 63 | -------------------------------------------------------------------------------- /examples/MeteorCLI/universal/imports/app/page-not-found/page-not-found.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'page-not-found', 5 | templateUrl: 'page-not-found.html' 6 | }) 7 | export class PageNotFoundComponent { } 8 | -------------------------------------------------------------------------------- /examples/MeteorCLI/universal/imports/app/page-not-found/page-not-found.html: -------------------------------------------------------------------------------- 1 |

404 Page Not Found

2 | -------------------------------------------------------------------------------- /examples/MeteorCLI/universal/imports/app/server-app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | 3 | import { ServerModule } from '@angular/platform-server'; 4 | 5 | import { AppModule } from './app.module'; 6 | import { AppComponent } from './app.component'; 7 | 8 | @NgModule({ 9 | imports: [ 10 | // Import ServerModule while running on server 11 | ServerModule, 12 | AppModule 13 | ], 14 | bootstrap: [ 15 | AppComponent 16 | ] 17 | }) 18 | export class ServerAppModule { } 19 | -------------------------------------------------------------------------------- /examples/MeteorCLI/universal/imports/app/todo-add/todo-add.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | import { Meteor } from 'meteor/meteor'; 4 | 5 | @Component({ 6 | selector: 'todo-add', 7 | templateUrl: 'todo-add.html' 8 | }) 9 | export class TodoAddComponent { 10 | content: string; 11 | addTodo() { 12 | Meteor.call('addTodo', this.content); 13 | this.content = null; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /examples/MeteorCLI/universal/imports/app/todo-add/todo-add.html: -------------------------------------------------------------------------------- 1 | List 2 |
3 | Add Todo 4 | 7 | 8 | 9 |
10 | -------------------------------------------------------------------------------- /examples/MeteorCLI/universal/imports/app/todo-list/todo-list.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, OnDestroy } from '@angular/core'; 2 | 3 | import { Observable, Subscription } from 'rxjs'; 4 | 5 | import { Meteor } from 'meteor/meteor'; 6 | import { MeteorObservable } from 'meteor-rxjs'; 7 | 8 | import { Todos } from '../../../imports/collections/todos'; 9 | import { Todo } from '../../../imports/models/todo'; 10 | 11 | @Component({ 12 | selector: 'todo-list', 13 | templateUrl: 'todo-list.html', 14 | styleUrls: ['todo-list.scss'] 15 | }) 16 | export class TodoListComponent implements OnInit, OnDestroy { 17 | todos: Observable; 18 | todoListSubscription: Subscription; 19 | ngOnInit() { 20 | this.todos = Todos.find(); 21 | // Subscribe and connect it to Angular's change detection system 22 | // while running on client 23 | if (Meteor.isClient) 24 | this.todoListSubscription = MeteorObservable.subscribe('todoList').subscribe(); 25 | } 26 | ngOnDestroy() { 27 | if (this.todoListSubscription) 28 | this.todoListSubscription.unsubscribe(); 29 | } 30 | removeTodo(_id: string) { 31 | Meteor.call('removeTodo', _id); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /examples/MeteorCLI/universal/imports/app/todo-list/todo-list.html: -------------------------------------------------------------------------------- 1 | 2 |
    3 |
  • 4 | {{todo.content}} 5 | 6 |
  • 7 |
8 | -------------------------------------------------------------------------------- /examples/MeteorCLI/universal/imports/app/todo-list/todo-list.scss: -------------------------------------------------------------------------------- 1 | .addBtn { 2 | background-color: green; 3 | color: white; 4 | } 5 | -------------------------------------------------------------------------------- /examples/MeteorCLI/universal/imports/collections/todos.ts: -------------------------------------------------------------------------------- 1 | import { MongoObservable } from 'meteor-rxjs'; 2 | 3 | import { Todo } from '../models/todo'; 4 | 5 | export const Todos = new MongoObservable.Collection('todos'); 6 | -------------------------------------------------------------------------------- /examples/MeteorCLI/universal/imports/methods/todos.ts: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | 3 | import { Todos } from '../../imports/collections/todos'; 4 | 5 | Meteor.methods({ 6 | addTodo(content: string) { 7 | Todos.insert({ 8 | content 9 | }); 10 | }, 11 | removeTodo(_id: string) { 12 | Todos.remove({ 13 | _id 14 | }) 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /examples/MeteorCLI/universal/imports/models/todo.ts: -------------------------------------------------------------------------------- 1 | export interface Todo { 2 | _id?: string; 3 | content?: string; 4 | } 5 | -------------------------------------------------------------------------------- /examples/MeteorCLI/universal/imports/polyfills.ts: -------------------------------------------------------------------------------- 1 | import 'core-js/proposals/reflect-metadata'; 2 | 3 | if(Meteor.isClient){ 4 | require('zone.js'); 5 | } 6 | -------------------------------------------------------------------------------- /examples/MeteorCLI/universal/imports/publications/todos.ts: -------------------------------------------------------------------------------- 1 | import { Meteor } from 'meteor/meteor'; 2 | 3 | import { Todos } from '../../imports/collections/todos'; 4 | 5 | Meteor.publish('todoList', function() { 6 | return Todos.find({}); 7 | }); 8 | -------------------------------------------------------------------------------- /examples/MeteorCLI/universal/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "start": "meteor run", 5 | "test": "TEST_BROWSER_DRIVER=puppeteer meteor test --driver-package=ardatan:mocha --raw-logs", 6 | "test:ci": "TEST_BROWSER_DRIVER=puppeteer meteor test --driver-package=ardatan:mocha --once --raw-logs" 7 | }, 8 | "dependencies": { 9 | "@angular/animations": "^7.1.0", 10 | "@angular/common": "^7.1.0", 11 | "@angular/compiler": "^7.1.0", 12 | "@angular/core": "^7.1.0", 13 | "@angular/forms": "^7.1.0", 14 | "@angular/http": "^7.1.0", 15 | "@angular/platform-browser": "^7.1.0", 16 | "@angular/platform-browser-dynamic": "^7.1.0", 17 | "@angular/platform-server": "^7.1.0", 18 | "@angular/router": "^7.1.0", 19 | "@babel/runtime": "^7.13.7", 20 | "core-js": "^3.9.0", 21 | "meteor-node-stubs": "^0.4.1", 22 | "meteor-rxjs": "^0.4.14", 23 | "rxjs": "^6.3.0", 24 | "zone.js": "^0.8.26" 25 | }, 26 | "devDependencies": { 27 | "@angular/compiler-cli": "^7.1.0", 28 | "@types/chai": "^4.1.7", 29 | "@types/meteor": "^1.4.23", 30 | "@types/mocha": "^5.2.5", 31 | "@types/sinon": "^5.0.7", 32 | "chai": "^4.2.0", 33 | "mocha": "^5.2.0", 34 | "puppeteer": "^1.10.0", 35 | "sinon": "^7.1.1", 36 | "typescript": "~3.1.1" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /examples/MeteorCLI/universal/run_tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | echo "[MeteorCLI - universal] Resetting project" 3 | meteor reset 4 | echo "[MeteorCLI - universal] Installing npm dependencies" 5 | npm ci 6 | exit_code=$?; if [ ${exit_code} -gt 0 ]; then exit ${exit_code}; fi 7 | echo "[MeteorCLI - universal] Installing meteor dependencies" 8 | meteor update --all-packages --allow-incompatible-update 9 | exit_code=$?; if [ ${exit_code} -gt 0 ]; then exit ${exit_code}; fi 10 | echo "[MeteorCLI - universal] Testing JIT" 11 | npm run test:ci 12 | exit_code=$?; if [ ${exit_code} -gt 0 ]; then exit ${exit_code}; fi 13 | echo "[MeteorCLI - universal] Testing AOT" 14 | AOT=1 meteor build ./.meteor/build-aot 15 | exit_code=$?; if [ ${exit_code} -gt 0 ]; then exit ${exit_code}; fi 16 | echo "[MeteorCLI - universal] AOT w/ Rollup" 17 | AOT=1 ROLLUP=1 meteor build ./.meteor/build-aot-rollup 18 | exit_code=$?; if [ ${exit_code} -gt 0 ]; then exit ${exit_code}; fi 19 | -------------------------------------------------------------------------------- /examples/MeteorCLI/universal/server/main.ts: -------------------------------------------------------------------------------- 1 | import '../imports/polyfills'; 2 | 3 | import '../imports/methods/todos'; 4 | import '../imports/publications/todos'; 5 | 6 | import { Meteor } from 'meteor/meteor'; 7 | import { WebApp, WebAppInternals } from 'meteor/webapp'; 8 | 9 | import { 10 | enableProdMode, 11 | PlatformRef, 12 | ApplicationModule, 13 | ApplicationRef 14 | } from '@angular/core'; 15 | 16 | import { ResourceLoader } from '@angular/compiler'; 17 | import { ɵgetDOM as getDOM } from '@angular/platform-browser'; 18 | import { platformDynamicServer, BEFORE_APP_SERIALIZED ,INITIAL_CONFIG, PlatformState } from '@angular/platform-server'; 19 | 20 | import { first } from 'rxjs/operators'; 21 | 22 | import { ServerAppModule } from '../imports/app/server-app.module'; 23 | 24 | const HEAD_REGEX = /]*>((.|[\n\r])*)<\/head>/im 25 | const BODY_REGEX = /]*>((.|[\n\r])*)<\/body>/im; 26 | 27 | Meteor.startup(() => { 28 | 29 | // Enable Angular's production mode if Meteor is in production mode 30 | if (Meteor.isProduction) { 31 | enableProdMode(); 32 | } 33 | 34 | // When page requested 35 | WebAppInternals.registerBoilerplateDataCallback('angular', async (request, data) => { 36 | 37 | let document, 38 | platformRef : PlatformRef; 39 | // Handle Angular's error, but do not prevent client bootstrap 40 | try { 41 | 42 | 43 | document = ` 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | `; 53 | 54 | // Integrate Angular's router with Meteor 55 | const url = request.url; 56 | 57 | // Get rendered document 58 | platformRef = platformDynamicServer([ 59 | { 60 | provide: INITIAL_CONFIG, 61 | useValue: { 62 | // Initial document 63 | document, 64 | url 65 | } 66 | } 67 | ]); 68 | 69 | const appModuleRef = await platformRef.bootstrapModule(ServerAppModule, { 70 | ngZone: 'noop', 71 | providers: [ 72 | { 73 | provide: ResourceLoader, 74 | useValue: { 75 | get: Assets.getText 76 | }, 77 | deps: [] 78 | } 79 | ] 80 | }); 81 | 82 | const applicationRef : ApplicationRef = appModuleRef.injector.get(ApplicationRef); 83 | 84 | await applicationRef.isStable.pipe( 85 | first(isStable => isStable == true) 86 | ).toPromise(); 87 | 88 | applicationRef.tick(); 89 | 90 | // Run any BEFORE_APP_SERIALIZED callbacks just before rendering to string. 91 | const callbacks = appModuleRef.injector.get(BEFORE_APP_SERIALIZED, null); 92 | if (callbacks) { 93 | for (const callback of callbacks) { 94 | try { 95 | callback(); 96 | } catch (e) { 97 | // Ignore exceptions. 98 | console.warn('Ignoring BEFORE_APP_SERIALIZED Exception: ', e); 99 | } 100 | } 101 | } 102 | 103 | const platformState: PlatformState = appModuleRef.injector.get(PlatformState); 104 | 105 | document = platformState.renderToString(); 106 | 107 | } catch (e) { 108 | 109 | // Write errors to console 110 | console.error('Angular SSR Error: ' + e.stack || e); 111 | 112 | }finally{ 113 | 114 | //Make sure platform is destroyed before rendering 115 | 116 | if(platformRef){ 117 | platformRef.destroy(); 118 | } 119 | const head = HEAD_REGEX.exec(document)[1]; 120 | data.dynamicHead = head; 121 | const body = BODY_REGEX.exec(document)[1]; 122 | data.dynamicBody = body; 123 | 124 | } 125 | }) 126 | 127 | 128 | }); 129 | -------------------------------------------------------------------------------- /examples/MeteorCLI/universal/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowSyntheticDefaultImports": true, 4 | "baseUrl": ".", 5 | "declaration": false, 6 | "emitDecoratorMetadata": true, 7 | "importHelpers": true, 8 | "experimentalDecorators": true, 9 | "lib": [ 10 | "dom", 11 | "es2015" 12 | ], 13 | "module": "commonjs", 14 | "moduleResolution": "node", 15 | "sourceMap": true, 16 | "target": "es2015", 17 | "skipLibCheck": true, 18 | "stripInternal": true, 19 | "noImplicitAny": false, 20 | "types": [ 21 | "@types/meteor", 22 | "@types/node", 23 | "@types/mocha", 24 | "@types/chai", 25 | "@types/sinon" 26 | ] 27 | }, 28 | "include": [ 29 | "imports/**/*.ts", 30 | "client/**/*.ts", 31 | "server/**/*.ts" 32 | ], 33 | "exclude": [ 34 | "node_modules" 35 | ], 36 | "compileOnSave": false, 37 | "atom": { 38 | "rewriteTsconfig": false 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /examples/angularjs/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ -------------------------------------------------------------------------------- /examples/angularjs/.meteor/.finished-upgraders: -------------------------------------------------------------------------------- 1 | # This file contains information which helps Meteor properly upgrade your 2 | # app when you run 'meteor update'. You should check it into version control 3 | # with your project. 4 | 5 | notices-for-0.9.0 6 | notices-for-0.9.1 7 | 0.9.4-platform-file 8 | notices-for-facebook-graph-api-2 9 | 1.2.0-standard-minifiers-package 10 | 1.2.0-meteor-platform-split 11 | 1.2.0-cordova-changes 12 | 1.2.0-breaking-changes 13 | 1.3.0-split-minifiers-package 14 | 1.4.0-remove-old-dev-bundle-link 15 | 1.4.1-add-shell-server-package 16 | 1.4.3-split-account-service-packages 17 | 1.5-add-dynamic-import-package 18 | 1.7-split-underscore-from-meteor-base 19 | 1.8.3-split-jquery-from-blaze 20 | -------------------------------------------------------------------------------- /examples/angularjs/.meteor/.gitignore: -------------------------------------------------------------------------------- 1 | local 2 | build* -------------------------------------------------------------------------------- /examples/angularjs/.meteor/.id: -------------------------------------------------------------------------------- 1 | # This file contains a token that is unique to your project. 2 | # Check it into your repository along with the rest of this directory. 3 | # It can be used for purposes such as: 4 | # - ensuring you don't accidentally deploy one app on top of another 5 | # - providing package authors with aggregated statistics 6 | 7 | semtov71936.bossafasjjx 8 | -------------------------------------------------------------------------------- /examples/angularjs/.meteor/packages: -------------------------------------------------------------------------------- 1 | # Meteor packages used by this project, one per line. 2 | # Check this file (and the other files in this directory) into your repository. 3 | # 4 | # 'meteor add' and 'meteor remove' will edit this file for you, 5 | # but you can also edit it by hand. 6 | 7 | meteor-base@1.4.0 # Packages every Meteor app needs to have 8 | mobile-experience@1.1.0 # Packages for a great mobile UX 9 | mongo@1.10.1 # The database Meteor supports right now 10 | reactive-var@1.0.11 # Reactive variable for tracker 11 | tracker@1.2.0 # Meteor's client-side reactive programming library 12 | 13 | standard-minifier-css@1.7.2 # CSS minifier run for production mode 14 | standard-minifier-js@2.6.0 # JS minifier run for production mode 15 | es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers 16 | ecmascript@0.15.0 # Enable ECMAScript2015+ syntax in app code 17 | shell-server@0.5.0 # Server-side component of the `meteor shell` command 18 | 19 | angular-compilers # Compile templates, stylesheets for AngularJS 20 | 21 | autopublish@1.0.7 22 | insecure@1.0.7 23 | underscore@1.0.10 24 | -------------------------------------------------------------------------------- /examples/angularjs/.meteor/platforms: -------------------------------------------------------------------------------- 1 | server 2 | browser 3 | -------------------------------------------------------------------------------- /examples/angularjs/.meteor/release: -------------------------------------------------------------------------------- 1 | METEOR@2.1 2 | -------------------------------------------------------------------------------- /examples/angularjs/.meteor/versions: -------------------------------------------------------------------------------- 1 | allow-deny@1.1.0 2 | angular-compilers@0.4.0 3 | angular-html-compiler@0.4.0 4 | angular-scss-compiler@0.4.0 5 | angular-typescript-compiler@0.4.0 6 | autopublish@1.0.7 7 | autoupdate@1.7.0 8 | babel-compiler@7.6.0 9 | babel-runtime@1.5.0 10 | base64@1.0.12 11 | binary-heap@1.0.11 12 | boilerplate-generator@1.7.1 13 | callback-hook@1.3.0 14 | check@1.3.1 15 | ddp@1.4.0 16 | ddp-client@2.4.0 17 | ddp-common@1.4.0 18 | ddp-server@2.3.2 19 | diff-sequence@1.1.1 20 | dynamic-import@0.6.0 21 | ecmascript@0.15.0 22 | ecmascript-runtime@0.7.0 23 | ecmascript-runtime-client@0.11.0 24 | ecmascript-runtime-server@0.10.0 25 | ejson@1.1.1 26 | es5-shim@4.8.0 27 | fetch@0.1.1 28 | geojson-utils@1.0.10 29 | hot-code-push@1.0.4 30 | id-map@1.1.0 31 | insecure@1.0.7 32 | inter-process-messaging@0.1.1 33 | launch-screen@1.2.0 34 | livedata@1.0.18 35 | logging@1.2.0 36 | meteor@1.9.3 37 | meteor-base@1.4.0 38 | minifier-css@1.5.3 39 | minifier-js@2.6.0 40 | minimongo@1.6.1 41 | mobile-experience@1.1.0 42 | mobile-status-bar@1.1.0 43 | modern-browsers@0.1.5 44 | modules@0.16.0 45 | modules-runtime@0.12.0 46 | mongo@1.10.1 47 | mongo-decimal@0.1.2 48 | mongo-dev-server@1.1.0 49 | mongo-id@1.0.7 50 | npm-mongo@3.8.1 51 | ordered-dict@1.1.0 52 | promise@0.11.2 53 | random@1.2.0 54 | react-fast-refresh@0.1.0 55 | reactive-var@1.0.11 56 | reload@1.3.1 57 | retry@1.1.0 58 | routepolicy@1.1.0 59 | shell-server@0.5.0 60 | socket-stream-client@0.3.1 61 | standard-minifier-css@1.7.2 62 | standard-minifier-js@2.6.0 63 | tracker@1.2.0 64 | underscore@1.0.10 65 | webapp@1.10.0 66 | webapp-hashing@1.1.0 67 | -------------------------------------------------------------------------------- /examples/angularjs/client/app/app.module.js: -------------------------------------------------------------------------------- 1 | import 'angular'; 2 | 3 | angular.module('angularjs-meteor-example', []) -------------------------------------------------------------------------------- /examples/angularjs/client/main.html: -------------------------------------------------------------------------------- 1 | 2 |

AngularJS Meteor TodoList Example

3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/angularjs/client/main.js: -------------------------------------------------------------------------------- 1 | Meteor.startup(function(){ 2 | angular.bootstrap(document, ['angularjs-meteor-example']); 3 | }); -------------------------------------------------------------------------------- /examples/angularjs/client/main.scss: -------------------------------------------------------------------------------- 1 | //Global styles here 2 | body{ 3 | text-align: center; 4 | } -------------------------------------------------------------------------------- /examples/angularjs/client/todo-add/todo-add.component.js: -------------------------------------------------------------------------------- 1 | angular.module('angularjs-meteor-example').component('todoAdd', { 2 | controller: 'TodoAddController', 3 | templateUrl: '/client/todo-add/todo-add.html' 4 | }); -------------------------------------------------------------------------------- /examples/angularjs/client/todo-add/todo-add.controller.js: -------------------------------------------------------------------------------- 1 | angular.module('angularjs-meteor-example').controller('TodoAddController', function($scope){ 2 | $scope.addTodo = function(content){ 3 | Todos.insert({ 4 | content 5 | }); 6 | } 7 | $scope.removeTodo = function(todo){ 8 | Todos.remove(todo._id); 9 | } 10 | }); -------------------------------------------------------------------------------- /examples/angularjs/client/todo-add/todo-add.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | Add New Todo 4 | 5 |
6 | 9 | 10 | 11 |
12 |
13 | -------------------------------------------------------------------------------- /examples/angularjs/client/todo-add/todo-add.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Urigo/angular-meteor/aa80a4d1130a8f41a40d1093f6d6ac7392570c71/examples/angularjs/client/todo-add/todo-add.scss -------------------------------------------------------------------------------- /examples/angularjs/client/todo-list/todo-list.component.js: -------------------------------------------------------------------------------- 1 | angular.module('angularjs-meteor-example').component('todoList', { 2 | controller: 'TodoListController', 3 | templateUrl: '/client/todo-list/todo-list.html' 4 | }); -------------------------------------------------------------------------------- /examples/angularjs/client/todo-list/todo-list.controller.js: -------------------------------------------------------------------------------- 1 | angular.module('angularjs-meteor-example').controller('TodoListController', function($scope){ 2 | Tracker.autorun(function(){ 3 | //Put reactive data assignments here!!! 4 | $scope.todos = Todos.find().fetch(); 5 | $scope.$applyAsync(); 6 | }); 7 | $scope.removeTodo = function(todo){ 8 | Todos.remove(todo._id); 9 | } 10 | }); -------------------------------------------------------------------------------- /examples/angularjs/client/todo-list/todo-list.html: -------------------------------------------------------------------------------- 1 |
    2 |
  1. 3 | {{todo.content}} 4 | 7 |
  2. 8 |
-------------------------------------------------------------------------------- /examples/angularjs/client/todo-list/todo-list.scss: -------------------------------------------------------------------------------- 1 | todo-list { 2 | ol { 3 | li{ 4 | color: green; 5 | button{ 6 | background-color: red; 7 | color: white; 8 | } 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /examples/angularjs/collections/todos.js: -------------------------------------------------------------------------------- 1 | Todos = new Mongo.Collection('todos'); -------------------------------------------------------------------------------- /examples/angularjs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angularjs-meteor", 3 | "private": true, 4 | "scripts": { 5 | "start": "meteor run", 6 | "test": "TEST_BROWSER_DRIVER=puppeteer meteor test --driver-package=ardatan:mocha --raw-logs", 7 | "test:ci": "TEST_BROWSER_DRIVER=puppeteer meteor test --driver-package=ardatan:mocha --once --raw-logs" 8 | }, 9 | "dependencies": { 10 | "@babel/runtime": "^7.13.7", 11 | "angular": "^1.7.5", 12 | "meteor-node-stubs": "^0.4.1" 13 | }, 14 | "devDependencies": { 15 | "mocha": "^5.2.0", 16 | "puppeteer": "^1.10.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /examples/angularjs/run_tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | export NODE_OPTIONS=--max-old-space-size=2048 3 | export METEOR_PACKAGE_DIRS=../../atmosphere-packages 4 | echo "[MeteorCLI - angularjs] Resetting project" 5 | meteor reset 6 | echo "[MeteorCLI - angularjs] Installing npm dependencies" 7 | npm ci 8 | exit_code=$?; if [ ${exit_code} -gt 0 ]; then exit ${exit_code}; fi 9 | echo "[MeteorCLI - angularjs] Installing meteor dependencies" 10 | meteor update --all-packages --allow-incompatible-update 11 | exit_code=$?; if [ ${exit_code} -gt 0 ]; then exit ${exit_code}; fi 12 | echo "[MeteorCLI - angularjs] Testing Dev" 13 | npm run test:ci 14 | exit_code=$?; if [ ${exit_code} -gt 0 ]; then exit ${exit_code}; fi 15 | echo "[MeteorCLI - angularjs] Testing Production" 16 | meteor build ./.meteor/build 17 | exit_code=$?; if [ ${exit_code} -gt 0 ]; then exit ${exit_code}; fi -------------------------------------------------------------------------------- /examples/angularjs/server/main.js: -------------------------------------------------------------------------------- 1 | if(Todos.find().count() === 0){ 2 | Todos.insert({ 3 | content: 'Test' 4 | }) 5 | Todos.insert({ 6 | content: 'Test1' 7 | }) 8 | Todos.insert({ 9 | content: 'Test2' 10 | }) 11 | Todos.insert({ 12 | content: 'Test3' 13 | }) 14 | Todos.insert({ 15 | content: 'Test4' 16 | }) 17 | } -------------------------------------------------------------------------------- /examples/apollo/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ -------------------------------------------------------------------------------- /examples/apollo/.meteor/.finished-upgraders: -------------------------------------------------------------------------------- 1 | # This file contains information which helps Meteor properly upgrade your 2 | # app when you run 'meteor update'. You should check it into version control 3 | # with your project. 4 | 5 | notices-for-0.9.0 6 | notices-for-0.9.1 7 | 0.9.4-platform-file 8 | notices-for-facebook-graph-api-2 9 | 1.2.0-standard-minifiers-package 10 | 1.2.0-meteor-platform-split 11 | 1.2.0-cordova-changes 12 | 1.2.0-breaking-changes 13 | 1.3.0-split-minifiers-package 14 | 1.4.0-remove-old-dev-bundle-link 15 | 1.4.1-add-shell-server-package 16 | 1.4.3-split-account-service-packages 17 | 1.5-add-dynamic-import-package 18 | 1.7-split-underscore-from-meteor-base 19 | -------------------------------------------------------------------------------- /examples/apollo/.meteor/.gitignore: -------------------------------------------------------------------------------- 1 | local 2 | -------------------------------------------------------------------------------- /examples/apollo/.meteor/.id: -------------------------------------------------------------------------------- 1 | # This file contains a token that is unique to your project. 2 | # Check it into your repository along with the rest of this directory. 3 | # It can be used for purposes such as: 4 | # - ensuring you don't accidentally deploy one app on top of another 5 | # - providing package authors with aggregated statistics 6 | 7 | jessq14dc8.tt7z10662xke 8 | -------------------------------------------------------------------------------- /examples/apollo/.meteor/packages: -------------------------------------------------------------------------------- 1 | # Meteor packages used by this project, one per line. 2 | # Check this file (and the other files in this directory) into your repository. 3 | # 4 | # 'meteor add' and 'meteor remove' will edit this file for you, 5 | # but you can also edit it by hand. 6 | 7 | meteor-base@1.4.0 # Packages every Meteor app needs to have 8 | mobile-experience@1.0.5 # Packages for a great mobile UX 9 | mongo@1.6.0 # The database Meteor supports right now 10 | reactive-var@1.0.11 # Reactive variable for tracker 11 | tracker@1.2.0 # Meteor's client-side reactive programming library 12 | 13 | standard-minifier-css@1.5.2 # CSS minifier run for production mode 14 | standard-minifier-js@2.4.0 # JS minifier run for production mode 15 | es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers 16 | ecmascript@0.12.3 # Enable ECMAScript2015+ syntax in app code 17 | shell-server@0.4.0 # Server-side component of the `meteor shell` command 18 | angular-compilers 19 | -------------------------------------------------------------------------------- /examples/apollo/.meteor/platforms: -------------------------------------------------------------------------------- 1 | server 2 | browser 3 | -------------------------------------------------------------------------------- /examples/apollo/.meteor/release: -------------------------------------------------------------------------------- 1 | METEOR@1.8.0.1 2 | -------------------------------------------------------------------------------- /examples/apollo/.meteor/versions: -------------------------------------------------------------------------------- 1 | allow-deny@1.1.0 2 | angular-compilers@0.3.2 3 | angular-html-compiler@0.3.2 4 | angular-scss-compiler@0.3.2 5 | angular-typescript-compiler@0.3.2 6 | autoupdate@1.5.0 7 | babel-compiler@7.2.3 8 | babel-runtime@1.3.0 9 | base64@1.0.11 10 | binary-heap@1.0.11 11 | boilerplate-generator@1.6.0 12 | callback-hook@1.1.0 13 | check@1.3.1 14 | ddp@1.4.0 15 | ddp-client@2.3.3 16 | ddp-common@1.4.0 17 | ddp-server@2.2.0 18 | diff-sequence@1.1.1 19 | dynamic-import@0.5.0 20 | ecmascript@0.12.3 21 | ecmascript-runtime@0.7.0 22 | ecmascript-runtime-client@0.8.0 23 | ecmascript-runtime-server@0.7.1 24 | ejson@1.1.0 25 | es5-shim@4.8.0 26 | fetch@0.1.0 27 | geojson-utils@1.0.10 28 | hot-code-push@1.0.4 29 | id-map@1.1.0 30 | inter-process-messaging@0.1.0 31 | launch-screen@1.1.1 32 | livedata@1.0.18 33 | logging@1.1.20 34 | meteor@1.9.2 35 | meteor-base@1.4.0 36 | minifier-css@1.4.1 37 | minifier-js@2.4.0 38 | minimongo@1.4.5 39 | mobile-experience@1.0.5 40 | mobile-status-bar@1.0.14 41 | modern-browsers@0.1.3 42 | modules@0.13.0 43 | modules-runtime@0.10.3 44 | mongo@1.6.0 45 | mongo-decimal@0.1.0 46 | mongo-dev-server@1.1.0 47 | mongo-id@1.0.7 48 | npm-mongo@3.1.1 49 | ordered-dict@1.1.0 50 | promise@0.11.1 51 | random@1.1.0 52 | reactive-var@1.0.11 53 | reload@1.2.0 54 | retry@1.1.0 55 | routepolicy@1.1.0 56 | shell-server@0.4.0 57 | socket-stream-client@0.2.2 58 | standard-minifier-css@1.5.2 59 | standard-minifier-js@2.4.0 60 | tracker@1.2.0 61 | underscore@1.0.10 62 | webapp@1.7.1 63 | webapp-hashing@1.0.9 64 | -------------------------------------------------------------------------------- /examples/apollo/client/imports/app.component.ts: -------------------------------------------------------------------------------- 1 | import {Apollo} from 'apollo-angular'; 2 | import { Component } from '@angular/core'; 3 | import gql from 'graphql-tag'; 4 | import { Observable } from 'rxjs'; 5 | import { map } from 'rxjs/operators'; 6 | 7 | @Component({ 8 | selector: 'app', 9 | templateUrl: 'app.html' 10 | }) 11 | export class AppComponent { 12 | say$: Observable; 13 | constructor(apollo: Apollo) { 14 | this.say$ = apollo 15 | .query({ 16 | query: gql` 17 | { 18 | hello 19 | } 20 | `, 21 | }).pipe( 22 | map(result => result.data.hello) 23 | ) 24 | } 25 | } -------------------------------------------------------------------------------- /examples/apollo/client/imports/app.html: -------------------------------------------------------------------------------- 1 |

{{ say$ | async }}

-------------------------------------------------------------------------------- /examples/apollo/client/imports/app.module.ts: -------------------------------------------------------------------------------- 1 | import {NgModule} from '@angular/core'; 2 | import {HttpClientModule} from '@angular/common/http'; 3 | import {ApolloModule, Apollo} from 'apollo-angular'; 4 | import {HttpLinkModule, HttpLink} from 'apollo-angular-link-http'; 5 | import {InMemoryCache} from 'apollo-cache-inmemory'; 6 | import { BrowserModule } from '@angular/platform-browser'; 7 | import { AppComponent } from './app.component'; 8 | 9 | @NgModule({ 10 | imports: [ 11 | BrowserModule, 12 | HttpClientModule, // provides HttpClient for HttpLink 13 | ApolloModule, 14 | HttpLinkModule, 15 | ], 16 | declarations: [ 17 | AppComponent 18 | ], 19 | bootstrap: [ 20 | AppComponent 21 | ] 22 | }) 23 | export class AppModule { 24 | constructor(apollo: Apollo, httpLink: HttpLink) { 25 | apollo.create({ 26 | // By default, this client will send queries to the 27 | // `/graphql` endpoint on the same host 28 | link: httpLink.create({ uri: Meteor.absoluteUrl('/graphql') }), 29 | cache: new InMemoryCache(), 30 | }); 31 | } 32 | } -------------------------------------------------------------------------------- /examples/apollo/client/main.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /examples/apollo/client/main.ts: -------------------------------------------------------------------------------- 1 | import 'core-js/proposals/reflect-metadata'; 2 | import 'zone.js'; 3 | import { Meteor } from "meteor/meteor"; 4 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic' 5 | import { AppModule } from './imports/app.module'; 6 | 7 | Meteor.startup(() => { 8 | platformBrowserDynamic().bootstrapModule(AppModule); 9 | }) -------------------------------------------------------------------------------- /examples/apollo/imports/declarations.d.ts: -------------------------------------------------------------------------------- 1 | declare module "meteor/apollo" { 2 | export var meteorClientConfig: any; 3 | export var createApolloServer: any; 4 | export var createMeteorNetworkInterface: any; 5 | } -------------------------------------------------------------------------------- /examples/apollo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-meteor-apollo", 3 | "private": true, 4 | "scripts": { 5 | "start": "meteor run" 6 | }, 7 | "dependencies": { 8 | "@angular/common": "^7.1.1", 9 | "@angular/compiler": "^7.1.1", 10 | "@angular/compiler-cli": "^7.1.1", 11 | "@angular/core": "^7.1.1", 12 | "@angular/platform-browser": "^7.1.1", 13 | "@angular/platform-browser-dynamic": "^7.1.1", 14 | "@babel/runtime": "^7.13.7", 15 | "apollo-angular": "^1.5.0", 16 | "apollo-angular-link-http": "^1.4.0", 17 | "apollo-cache-inmemory": "^1.3.11", 18 | "apollo-client": "^2.4.7", 19 | "apollo-link": "^1.2.4", 20 | "apollo-server": "^2.2.5", 21 | "apollo-server-express": "^2.2.5", 22 | "body-parser": "^1.18.3", 23 | "express": "^4.16.4", 24 | "graphql": "^14.0.2", 25 | "graphql-server-express": "^1.4.0", 26 | "graphql-tag": "^2.10.0", 27 | "graphql-tools": "^4.0.3", 28 | "meteor-node-stubs": "^0.4.1", 29 | "rxjs": "^6.3.0", 30 | "tslib": "^1.9.3", 31 | "zone.js": "^0.8.26" 32 | }, 33 | "devDependencies": { 34 | "@types/meteor": "^1.4.23" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /examples/apollo/server/main.ts: -------------------------------------------------------------------------------- 1 | import { WebApp } from "meteor/webapp"; 2 | 3 | const { ApolloServer, gql } = require('apollo-server-express'); 4 | 5 | // Construct a schema, using GraphQL schema language 6 | const typeDefs = gql` 7 | type Query { 8 | hello: String 9 | } 10 | `; 11 | 12 | // Provide resolver functions for your schema fields 13 | const resolvers = { 14 | Query: { 15 | hello: () => 'Hello world!', 16 | }, 17 | }; 18 | 19 | const server = new ApolloServer({ typeDefs, resolvers }); 20 | 21 | server.applyMiddleware({ app: WebApp.connectHandlers }); -------------------------------------------------------------------------------- /examples/apollo/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowSyntheticDefaultImports": true, 4 | "baseUrl": ".", 5 | "declaration": false, 6 | "emitDecoratorMetadata": true, 7 | "importHelpers": true, 8 | "experimentalDecorators": true, 9 | "lib": [ 10 | "dom", 11 | "es2015", 12 | "esnext.asynciterable" 13 | ], 14 | "module": "commonjs", 15 | "moduleResolution": "node", 16 | "sourceMap": true, 17 | "target": "es2015", 18 | "skipLibCheck": true, 19 | "stripInternal": true, 20 | "noImplicitAny": false, 21 | "paths": { 22 | "*": ["*"] 23 | } 24 | }, 25 | "include": [ 26 | "imports/**/*.ts", 27 | "client/**/*.ts", 28 | "server/**/*.ts" 29 | ], 30 | "types": [ 31 | "@types/meteor", 32 | "@types/node" 33 | ], 34 | "exclude": [ 35 | "node_modules" 36 | ], 37 | "compileOnSave": false, 38 | "atom": { 39 | "rewriteTsconfig": false 40 | } 41 | } -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["config:js-lib", ":meteor"], 3 | "rebaseStalePrs": true, 4 | "ignoreDeps": ["rollup", "rollup-plugin-commonjs", "rollup-plugin-hypothetical", "rollup-plugin-node-resolve"] 5 | } 6 | -------------------------------------------------------------------------------- /run_tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | (cd examples/MeteorCLI && sh run_tests.sh) 3 | exit_code=$?; if [ ${exit_code} -gt 0 ]; then exit ${exit_code}; fi 4 | (cd examples/angularjs && sh run_tests.sh) 5 | exit_code=$?; if [ ${exit_code} -gt 0 ]; then exit ${exit_code}; fi 6 | --------------------------------------------------------------------------------