Skip to content

Commit 0bd47ea

Browse files
chore: Move to monorepo ❗ ❗ ❗ (#7342)
* chore: Move to monorepo Reorganized everything. Removed broken tests from docs app so we can run tests in CI for that again. Some tests are better than no tests. Updates the GitHub actions, some of the README stuff, and build scripts * chore: fix github action commands * chore: Update tslint-etc locations * chore: update README with more information about yarn * chore: fix alias generation location * chore: update lodash to fix TS latest errors * Update CONTRIBUTING.md Co-authored-by: Mladen Jakovljević <jakovljevic.mladen@gmail.com> * Update CONTRIBUTING.md Co-authored-by: Mladen Jakovljević <jakovljevic.mladen@gmail.com> * Update CONTRIBUTING.md Co-authored-by: Mladen Jakovljević <jakovljevic.mladen@gmail.com> * Update CONTRIBUTING.md Co-authored-by: Mladen Jakovljević <jakovljevic.mladen@gmail.com> * Update apps/rxjs.dev/tools/transforms/angular-base-package/index.js Co-authored-by: Mladen Jakovljević <jakovljevic.mladen@gmail.com> * Update apps/rxjs.dev/tools/transforms/config.js Co-authored-by: Mladen Jakovljević <jakovljevic.mladen@gmail.com> * Update packages/rxjs/README.md Co-authored-by: Mladen Jakovljević <jakovljevic.mladen@gmail.com> * Update CONTRIBUTING.md Co-authored-by: Mladen Jakovljević <jakovljevic.mladen@gmail.com> * chore: revert changes to app.component.ts * Revert "Update apps/rxjs.dev/tools/transforms/angular-base-package/index.js" This reverts commit c734d1e. * chore: revert change that broke the build --------- Co-authored-by: Mladen Jakovljević <jakovljevic.mladen@gmail.com>
1 parent 9aa16a9 commit 0bd47ea

File tree

1,186 files changed

+51534
-69277
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,186 files changed

+51534
-69277
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ If your PR is the addition of a new operator, please make sure all these boxes a
77
- [ ] It must have a `-spec.ts` tests file covering the canonical corner cases, with marble diagram tests
88
- [ ] The spec file should have a type definition test at the end of the spec to verify type definition for various use cases
99
- [ ] The operator must be documented in JSDoc style in the implementation file, including also the PNG marble diagram image
10-
- [ ] The operator should be listed in `docs_app/content/guide/operators.md` in a category of operators
10+
- [ ] The operator should be listed in `apps/rxjs.dev/content/guide/operators.md` in a category of operators
1111
- [ ] The operator should also be documented. See [Documentation Guidelines](../CONTRIBUTING.md).
1212
- [ ] You may need to update `MIGRATION.md` if the operator differs from the corresponding one in RxJS v4
1313
-->

.github/workflows/ci_main.yml

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
node: ['16', '18']
15+
node: ['18', '20']
1616

1717
name: Node ${{ matrix.node }} build
1818

@@ -24,24 +24,23 @@ jobs:
2424
cache: npm
2525
- name: install
2626
run: |
27-
npm install -g npm@latest
28-
npm ci
29-
- name: lint
30-
run: npm run lint
31-
- name: build
32-
run: npm run build:package
33-
- name: test
34-
run: npm test
35-
- name: dtslint
36-
run: npm run dtslint
37-
- name: import
38-
if: ${{ matrix.node == '18' }}
39-
run: npm run test:import
40-
- name: import
41-
if: ${{ matrix.node == '16' || matrix.node == '18' }}
42-
run: npm run test:esm
43-
- name: docs
44-
run: |
45-
cd docs_app
46-
npm run setup
47-
npm run build
27+
npm install -g yarn@latest
28+
yarn install
29+
- name: rxjs lint
30+
run: yarn workspace rxjs lint
31+
- name: rxjs build
32+
run: yarn workspace rxjs build
33+
- name: rxjs test
34+
run: yarn workspace rxjs test
35+
- name: rxjs dtslint
36+
run: yarn workspace rxjs dtslint
37+
- name: rxjs test:import
38+
if: ${{ matrix.node == '18' || matrix.node == '20' }}
39+
run: yarn workspace rxjs test:import
40+
- name: rxjs test:esm
41+
if: ${{ matrix.node == '18' || matrix.node == '20' }}
42+
run: yarn workspace rxjs test:esm
43+
- name: rxjs.dev build
44+
run: yarn workspace rxjs.dev build --prod
45+
- name: rxjs.dev test
46+
run: yarn workspace rxjs.dev test --watch=false --browsers=ChromeHeadless

.github/workflows/ci_ts_latest.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
node: ['18']
15+
node: ['20']
1616

1717
name: ts@latest
1818

@@ -24,7 +24,7 @@ jobs:
2424
cache: npm
2525
- name: build
2626
run: |
27-
npm install -g npm@latest
28-
npm ci
29-
npm install --legacy-peer-deps --no-save typescript@latest @types/node@latest
30-
npm run compile
27+
npm install -g yarn@latest
28+
yarn install
29+
yarn workspace rxjs add typescript@latest @types/node@latest --peer --no-save
30+
yarn workspace rxjs compile

.gitignore

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,18 @@ node_modules/
1111
typings/
1212

1313
# Generated
14-
/dist/
15-
/dist-compat/
16-
tmp/
17-
coverage/
18-
img/
19-
spec-js/
20-
spec-build/
21-
.out/
22-
.tmp/
14+
dist/
2315

2416
# Import location artifacts
25-
/ajax/
26-
/fetch/
27-
/operators/
28-
/testing/
29-
/webSocket/
17+
packages/rxjs/ajax/
18+
packages/rxjs/fetch/
19+
packages/rxjs/operators/
20+
packages/rxjs/testing/
21+
packages/rxjs/webSocket/
22+
23+
# Copied Package Files
24+
packages/**/LICENSE.txt
25+
packages/**/CODE_OF_CONDUCT.md
3026

3127
# Misc
3228
npm-debug.log

.make-helpers.js

Lines changed: 0 additions & 42 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ Contents
2727
---
2828

2929
- Related documents
30-
- [Creating Operators](docs_app/content/guide/operators.md#creating-custom-operators)
31-
- [Writing Marble Tests](docs_app/content/guide/testing/marble-testing.md)
30+
- [Creating Operators](apps/rxjs.dev/content/guide/operators.md#creating-custom-operators)
31+
- [Writing Marble Tests](apps/rxjs.dev/content/guide/testing/marble-testing.md)
3232

3333
---
3434

@@ -122,15 +122,15 @@ from the main (upstream) repository:
122122
123123
- The documentation is auto-generated directly from the source code.
124124
- In short: From the source code we generate JSON documents, describing each operator, function ... and render this JSON within an Angular application
125-
- The folder `docs_app` contains everything you need for building and developing the docs
126-
- The [Documentation README](docs_app/README.md) will support you
125+
- The folder `apps/rxjs.dev` contains everything you need for building and developing the docs
126+
- The [Documentation README](apps/rxjs.dev/README.md) will support you
127127
- After a PR is merged to master the docs will be published to https://rxjs.dev/
128128
129129
## Unit Tests
130130
131131
Unit tests are located under the [spec directory](/spec). Unit tests over synchronous operators and operations
132132
can be written in a standard [chai](https://www.chaijs.com/) style. Unit tests written against any
133-
asynchronous operator should be written in [Marble Test Style outlined in detail here](docs_app/content/guide/testing/marble-testing.md).
133+
asynchronous operator should be written in [Marble Test Style outlined in detail here](apps/rxjs.dev/content/guide/testing/marble-testing.md).
134134
135135
Each operator under test must be in its own file to cover the following cases:
136136
@@ -184,7 +184,7 @@ Macro performance tests can be run by hosting the root directory with any web se
184184
then running:
185185
186186
```sh
187-
npm run build_all
187+
yarn build_all
188188
protractor protractor.conf.js
189189
```
190190
@@ -196,7 +196,7 @@ relative performance of our operators versus prior versions. All operators shoul
196196
Micro performance test can be run with:
197197

198198
```sh
199-
npm run build_all
199+
yarn build_all
200200
node perf/micro
201201
```
202202

@@ -210,7 +210,7 @@ node perf/micro zip
210210

211211
We have very precise rules over how our git commit messages can be formatted. This leads to **more
212212
readable messages** that are easy to follow when looking through the **project history**. But also,
213-
we use the git commit messages to **generate the RxJS change log**. Helper script `npm run commit`
213+
we use the git commit messages to **generate the RxJS change log**. Helper script `yarn commit`
214214
provides command line based wizard to format commit message easily.
215215

216216
### Commit Message Format

README.md

Lines changed: 12 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
# <img src="docs_app/src/assets/images/logos/Rx_Logo_S.png" alt="RxJS Logo" width="86" height="86"> RxJS: Reactive Extensions For JavaScript
1+
# <img src="apps/rxjs.dev/src/assets/images/logos/Rx_Logo_S.png" alt="RxJS Logo" width="86" height="86"> RxJS: Reactive Extensions For JavaScript
22

33
![CI](https://github.com/reactivex/rxjs/workflows/CI/badge.svg)
44
[![npm version](https://badge.fury.io/js/rxjs.svg)](http://badge.fury.io/js/rxjs)
55
[![Join the chat at https://gitter.im/Reactive-Extensions/RxJS](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Reactive-Extensions/RxJS?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
66

7-
# RxJS 8
7+
# RxJS 8 Monorepo
88

9-
### FOR 7.X PLEASE GO TO [THE 7.x BRANCH](https://github.com/ReactiveX/rxjs/tree/7.x)
10-
11-
Reactive Extensions Library for JavaScript. This is a rewrite of [Reactive-Extensions/RxJS](https://github.com/Reactive-Extensions/RxJS) and is the latest production-ready version of RxJS. This rewrite is meant to have better performance, better modularity, better debuggable call stacks, while staying mostly backwards compatible, with some breaking changes that reduce the API surface.
9+
Look for RxJS and related packages under the [/packages](/packages/) directory. Applications like the [rxjs.dev](https://rxjs.dev) documentation site are under the [/apps](/apps/) directory.
1210

1311
[Apache 2.0 License](LICENSE.txt)
1412

1513
- [Code of Conduct](CODE_OF_CONDUCT.md)
1614
- [Contribution Guidelines](CONTRIBUTING.md)
17-
- [Maintainer Guidelines](docs_app/content/maintainer-guidelines.md)
15+
- [Maintainer Guidelines](apps/rxjs.dev/content/maintainer-guidelines.md)
1816
- [API Documentation](https://rxjs.dev/)
1917

18+
Reactive Extensions Library for JavaScript. This is a rewrite of [Reactive-Extensions/RxJS](https://github.com/Reactive-Extensions/RxJS) and is the latest production-ready version of RxJS. This rewrite is meant to have better performance, better modularity, better debuggable call stacks, while staying mostly backwards compatible, with some breaking changes that reduce the API surface.
19+
2020
## Versions In This Repository
2121

2222
- [master](https://github.com/ReactiveX/rxjs/commits/master) - This is all of the current work, which is against v8 of RxJS right now
@@ -29,56 +29,11 @@ Most PRs should be made to **master**.
2929

3030
By contributing or commenting on issues in this repository, whether you've read them or not, you're agreeing to the [Contributor Code of Conduct](CODE_OF_CONDUCT.md). Much like traffic laws, ignorance doesn't grant you immunity.
3131

32-
## Installation and Usage
33-
34-
### ES6 via npm
35-
36-
```shell
37-
npm install rxjs
38-
```
39-
40-
It's recommended to pull in the Observable creation methods you need directly from `'rxjs'` as shown below with `range`.
41-
If you're using RxJS version 7.2 or above, you can pull in any operator you need from the same spot, `'rxjs'`.
42-
43-
```ts
44-
import { range, filter, map } from 'rxjs';
45-
46-
range(1, 200)
47-
.pipe(
48-
filter((x) => x % 2 === 1),
49-
map((x) => x + x)
50-
)
51-
.subscribe((x) => console.log(x));
52-
```
53-
54-
If you're using RxJS version below 7.2, you can pull in any operator you need from one spot, under `'rxjs/operators'`.
55-
56-
```ts
57-
import { range } from 'rxjs';
58-
import { filter, map } from 'rxjs/operators';
59-
60-
range(1, 200)
61-
.pipe(
62-
filter((x) => x % 2 === 1),
63-
map((x) => x + x)
64-
)
65-
.subscribe((x) => console.log(x));
66-
```
67-
68-
## Goals
69-
70-
- Smaller overall bundles sizes
71-
- Provide better performance than preceding versions of RxJS
72-
- To model/follow the [Observable Spec Proposal](https://github.com/zenparsing/es-observable) to the observable
73-
- Provide more modular file structure in a variety of formats
74-
- Provide more debuggable call stacks than preceding versions of RxJS
75-
76-
## Building/Testing
77-
78-
- `npm run compile` build everything
79-
- `npm test` run tests
80-
- `npm run dtslint` run dtslint tests
32+
## Development
8133

82-
## Adding documentation
34+
Because of [this issue](https://github.com/npm/rfcs/issues/287#issuecomment-1727960500) we're using `yarn`. (Basically the docs app uses `@types/jasmine`, and the package uses `@types/mocha` and they get hoisted to the top level by `npm install` with workspaces, and then TypeScript vomits everywhere when you try to build).
8335

84-
We appreciate all contributions to the documentation of any type. All of the information needed to get the docs app up and running locally as well as how to contribute can be found in the [documentation directory](./docs_app).
36+
1. `cd` to the repository root
37+
2. `yarn install` to install all dependencies
38+
3. `yarn workspace rxjs test` will run the RxJS test suite
39+
4. `yarn workspace rxjs.dev start` will start the rxjs.dev documentation site local development server

0 commit comments

Comments
 (0)