diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 0000000000..c236b52b07 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,46 @@ +coverage: + status: + patch: + default: + threshold: 2% + target: 90% + project: + default: false + state: + target: 68% + flags: + - state + template: + target: 90% + flags: + - template + cdk: + target: 72% + flags: + - cdk + eslint-plugin: + target: 90% + flags: + - eslint-plugin + +flags: + state: + paths: + - libs/state + carryforward: true + template: + paths: + - libs/template + carryforward: true + cdk: + paths: + - libs/cdk + carryforward: true + eslint-plugin: + paths: + - libs/eslint-plugin + carryforward: true + +comment: + layout: diff, flags, files + require_changes: true diff --git a/.commitlintrc.json b/.commitlintrc.json new file mode 100644 index 0000000000..5a98932308 --- /dev/null +++ b/.commitlintrc.json @@ -0,0 +1,26 @@ +{ + "extends": ["@commitlint/config-angular"], + "rules": { + "subject-empty": [2, "never"], + "scope-enum": [ + 2, + "always", + [ + "cdk", + "template", + "state", + "docs", + "demos", + "schematics", + "ci", + "eslint" + ] + ], + "type-empty": [2, "never"], + "type-enum": [ + 2, + "always", + ["fix", "feat", "perf", "docs", "refactor", "test", "chore"] + ] + } +} diff --git a/.editorconfig b/.editorconfig index 59d9a3a3e7..493aaa0524 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,4 +1,4 @@ -# Editor configuration, see https://editorconfig.org +# Editor configuration, see http://editorconfig.org root = true [*] @@ -8,9 +8,5 @@ indent_size = 2 insert_final_newline = true trim_trailing_whitespace = true -[*.ts] -quote_type = single - -[*.md] +[*.{md,mdx}] max_line_length = off -trim_trailing_whitespace = false diff --git a/.eslintrc.json b/.eslintrc.json index 0be733b75e..1e26b0af85 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -13,8 +13,20 @@ "allow": [], "depConstraints": [ { - "sourceTag": "*", + "sourceTag": "type:app", "onlyDependOnLibsWithTags": ["*"] + }, + { + "sourceTag": "template", + "onlyDependOnLibsWithTags": ["type:test-util", "cdk"] + }, + { + "sourceTag": "state", + "onlyDependOnLibsWithTags": ["type:test-util", "cdk"] + }, + { + "sourceTag": "cdk", + "onlyDependOnLibsWithTags": ["type:test-util"] } ] } @@ -23,20 +35,37 @@ }, { "files": ["*.ts", "*.tsx"], - "extends": ["plugin:@nx/typescript"], - "rules": {} + "extends": [ + "prettier", + "eslint:recommended", + "plugin:@nx/typescript", + "plugin:@angular-eslint/recommended", + "plugin:@typescript-eslint/recommended" + ], + "parserOptions": { + "project": "./tsconfig.*?.json" + }, + "rules": { + "@typescript-eslint/ban-ts-comment": "warn", + "@typescript-eslint/no-inferrable-types": "warn", + "@typescript-eslint/ban-types": "warn", + "@typescript-eslint/no-empty-interface": "warn", + "@typescript-eslint/no-empty-function": "warn", + "prefer-rest-params": "warn", + "no-prototype-builtins": "warn", + "no-empty": "warn" + } }, { "files": ["*.js", "*.jsx"], - "extends": ["plugin:@nx/javascript"], - "rules": {} - }, - { - "files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"], - "env": { - "jest": true - }, - "rules": {} + "extends": [ + "prettier", + "plugin:@angular-eslint/template/recommended", + "plugin:@nx/javascript" + ], + "rules": { + "@typescript-eslint/no-non-null-assertion": "off" + } } ] } diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md new file mode 100644 index 0000000000..dd468a5812 --- /dev/null +++ b/.github/CODE_OF_CONDUCT.md @@ -0,0 +1,78 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +- The use of sexualized language or imagery and unwelcome sexual attention or + advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or electronic + address, without explicit permission +- Devaluating people's ideas, wasting their time and pushing them down because of personal issues +- Having a "not invented here" mentality and forcefully exclude other opinions/ideas +- Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at office@hladky.at (you can talk to Maria or Michael). All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000000..8dfd197c0d --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,66 @@ +# Contributing to RxAngular + +We love your input! We want to make contributing to this project as easy and transparent as possible, whether it's: + +- Reporting a bug +- Discussing the current state of the code +- Submitting a fix +- Proposing new features +- Becoming a maintainer + +## We Develop with Github + +We use github to host code, to track issues and feature requests, as well as accept pull requests. + +## We Use [Github Flow](github-flow), So All Code Changes Happen Through Pull Requests + +Pull requests are the best way to propose changes to the codebase (we use [Github Flow](github-flow)). We actively welcome your pull requests: + +1. Fork the repo and create your branch from `main`. +2. If you've added code that should be tested, add tests. +3. If you've changed APIs, update the documentation. +4. Ensure the test suite passes. +5. Make sure your code lints. +6. Issue that pull request! + +## Any contributions you make will be under the MIT Software License + +In short, when you submit code changes, your submissions are understood to be under the same [MIT License](mit) that covers the project. +Feel free to contact the maintainers if that's a concern. + +## Report bugs using Github's [issues](issues) + +We use GitHub issues to track public bugs. Report a bug by [opening a new issue](new-issue); it's that easy! + +## Write bug reports with detail, background, and sample code + +**Great Bug Reports** tend to have: + +- A quick summary and/or background +- Steps to reproduce + - Be specific! + - Give sample code if you can. In best case create a [stackblitz](stackblitz.com) demo +- What you expected would happen +- What actually happens +- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work) + +People _love_ thorough bug reports. + +## Use a Consistent Coding Style + +See: [@TODO insert link to coding guidelines here]() + +## License + +By contributing, you agree that your contributions will be licensed under its [MIT License](mit). + +## References + +This document was adapted from the open-source contribution guidelines for [Facebook's Draft](https://github.com/facebook/draft-js/blob/a9316a723f9e918afde44dea68b5f9f39b7d9b00/CONTRIBUTING.md) + + + +[mit]: https://choosealicense.com/licenses/mit/ +[github-flow]: https://guides.github.com/introduction/flow/index.html +[issues]: https://github.com/rx-angular/rx-angular/issues +[new-issue]: https://github.com/rx-angular/rx-angular/issues/new diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000000..426a2136eb --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,2 @@ +# These are supported funding for platforms +open_collective: rx-angular diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000000..2c3ec04680 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,93 @@ +--- +name: Bug report +about: Create a report to help us improve +title: 'Title of the bug' +labels: '' +assignees: '' +--- + +# Description + + + +# Steps to Reproduce the Issue + + + +# Environment + + + +# Related to Other Issues + + + +# Tasks to Resolve This + + + +# Notes + + diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000000..4c7dedf33c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: RxAngular Community Support + url: https://github.com/rx-angular/rx-angular/ + about: Please ask and answer questions here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000000..b670fd7f92 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,34 @@ +--- +name: Feature request +about: Suggest a feature for this project +title: 'Title of the feature request' +labels: '' +assignees: '' +--- + +# Problem Solved By The Feature + + + +# Solution + + + +# alternatives Considered + + + +# Additional Context + + diff --git a/.github/SECURITY.md b/.github/SECURITY.md new file mode 100644 index 0000000000..28b2499fa2 --- /dev/null +++ b/.github/SECURITY.md @@ -0,0 +1,5 @@ +# Security Policy + +## Reporting a Vulnerability + +Please use the GitHub Issue Tracker to report vulnerabilities. diff --git a/.github/SUPPORT.md b/.github/SUPPORT.md new file mode 100644 index 0000000000..8eb32c32d2 --- /dev/null +++ b/.github/SUPPORT.md @@ -0,0 +1,70 @@ +# Support + +> This project has a [Code of Conduct][coc]. +> By interacting with this repository, organisation, or community you agree to +> abide by its terms. + +Welcome to RxAngular! 👋 +The toolkit for fully reactive, high performance angular applications. +We’re excited that you’re using this repository and we’d love to help. +To help us help you, please read through the following guidelines. + +Please understand that people involved with this project often do so in their spare time besides their daily business. You are not entitled to free customer service. + +## Table of Contents + +- [Questions](#questions) + - [Asking quality questions](#asking-quality-questions) +- [Contributions](#contributions) +- [License](#license) + +## Questions + +Please chat and ask questions on [slack][slack]! +Jump in there and lurk, talk to us, and help others. + +### Asking quality questions + +Help us help you! + +Spending time framing a question and adding support links or resources makes it +much easier for us to help. +It’s easy to fall into the trap of asking something too specific when you’re +close to a problem. +Then, those trying to help you out have to spend a lot of time asking additional +questions to understand what you are hoping to achieve. + +Spending the extra time up front can help save everyone time in the long run. + +- Try to define what you need help with: + - Is there something in particular you want to do? + - What problem are you encountering and what steps have you taken to try + and fix it? + - Is there a concept you’re not understanding? +- Learn about the [rubber duck debugging method][rubberduck] +- Avoid falling for the [XY problem][xy] +- Search on GitHub and Slack to see if a similar question has been asked +- If possible, provide sample code, a [StackBlitz][stackblitz], or a video +- The more time you put into asking your question, the better we can help you + +## Contributions + +See [`CONTRIBUTING.md`][contributing] on how to contribute. + +## License + +[MIT][license] © + +## References + +This document was adapted from the open-source support guidelines for [remarkjs](https://github.com/remarkjs/.github/edit/main/support.md) + + + +[license]: https://github.com/rx-angular/rx-angular/blob/main/LICENSE.md +[coc]: https://github.com/rx-angular/rx-angular/.github/blob/main/CODE_OF_CONDUCT.md +[rubberduck]: https://rubberduckdebugging.com +[xy]: https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem/66378#66378 +[stackblitz]: https://stackblitz.com +[slack]: https://rxangular.slack.com +[contributing]: https://github.com/rx-angular/rx-angular/.github/blob/main/CONTRIBUTING.md diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml new file mode 100644 index 0000000000..58bd41ae0a --- /dev/null +++ b/.github/actions/setup/action.yml @@ -0,0 +1,34 @@ +name: Setup +description: Set up Node.js, cache and install dependencies +inputs: + node-version: + description: Node.js version + required: false + default: '18.15.0' # latest working version for our CI +runs: + using: composite + steps: + # Requires git checkout with fetch depth 0 + - name: Derive appropriate SHAs for base and head for `nx affected` commands + uses: nrwl/nx-set-shas@v3 + + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: ${{ inputs.node-version }} + cache: 'yarn' + + - name: Cypress executable cache + uses: actions/cache@v3 + with: + path: | + ~/.cache/Cypress + key: ${{ runner.os }}-node-${{ inputs.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-node-${{ inputs.node-version }}- + + - name: Install dependencies + shell: bash + run: yarn --frozen-lockfile --no-progress --non-interactive --prefer-offline --ignore-engines + env: + HUSKY_SKIP_INSTALL: 'true' diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000000..31327340e9 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,36 @@ +⚙️ Chore: + - '.github/*' + - '.tools/*' + +🃏 Demos: + - ./apps/demos/* + - ./apps/demos/**/* + +'🛠️ CDK': + - libs/cdk/* + - libs/cdk/**/* + +'{ } State': + - libs/state/* + - libs/state/**/* + +' Template': + - libs/template/* + - libs/template/**/* + +📖 Docs API: + - libs/**/docs/**/* + +📚 Docs Web: + - apps/docs/* + - apps/docs/**/* + +🔬 Experimental: + - libs/**/experimental/* + - libs/**/experimental/**/* + +🛂 Test: + - libs/**/spec/* + - libs/**/spec/**/* + - libs/**/perf/* + - libs/**/perf/**/* diff --git a/.github/poc/release.yml b/.github/poc/release.yml new file mode 100644 index 0000000000..26ef454d94 --- /dev/null +++ b/.github/poc/release.yml @@ -0,0 +1,53 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Release State + +on: + - pull_request + #- push: + # Sequence of patterns matched against refs/tags + #tags: + # - 'state@*' # Push event +jobs: + build-docs: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [12.x] + + steps: + - uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.ref }} + fetch-depth: 0 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: git fetch --no-tags --prune --depth=5 origin main + - name: set Environment Variables + id: release + run: | + VERSION=$(node --eval="process.stdout.write(require('./libs/state/package.json').version)") # e.g. 2.4.2 + NEW_VERSION=$(node --eval="process.stdout.write(?)") + if [ $REPOSITORY = "main" ]; then IS_PRE='false'; else IS_PRE='true'; fi + if [ $REPOSITORY = "main" ]; then POSTFIX='' ; else POSTFIX='PRE'; fi + RELEASEBODY=$(awk -v RS='Release ' '/'$VERSION':(.*)/') + RELEASEBODY="${RELEASEBODY//'%'/'%25'}" + RELEASEBODY="${RELEASEBODY//$'\n'/'%0A'}" + RELEASEBODY="${RELEASEBODY//$'\r'/'%0D'}" + echo "::set-output name=version::${VERSION}" + echo "::set-output name=IS_PRERELEASE::${IS_PRE}" + echo "::set-output name=RELEASENAME_POSTFIX::${POSTFIX}" + echo "::set-output name=RELEASEBODY::${RELEASEBODY}" + echo "::set-env name=body::${RELEASEBODY}" + env: + REPOSITORY: ${{ github.event.repository.name }} + + + + + diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml new file mode 100644 index 0000000000..ed3b4fe99b --- /dev/null +++ b/.github/workflows/build-and-test.yml @@ -0,0 +1,221 @@ +name: rx-angular CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +concurrency: + # Group concurrency on workflow, then: + # - Is merge run? Group on branch name (`refs/heads/main`) + # - Is pull request? Group on pull request branch name, for example `feat/add-awesome-feature` + group: >- + ${{ github.workflow }}-${{ + github.event_name == 'push' + && github.ref + || github.head_ref + }} + # Run merge workflows in sequence to prevent parallel deployments and releases + # Cancel stale pull request runs in progress for the same branch + cancel-in-progress: ${{ github.event_name != 'push' }} + +env: + NODE_OPTIONS: --max-old-space-size=6144 + NX_VERBOSE_LOGGING: false + docs-name: docs + docs-path: dist/apps/docs + +jobs: + dte_agents: + name: DTE Agent ${{ matrix.agent }} + runs-on: ubuntu-latest + timeout-minutes: 20 + + # The Free GitHub plan has a limit of 20 concurrent jobs on Ubuntu images + # Reference: https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration + # If we need to, we can optimize for 2 simultaneous workflow runs: + # 2 x 1 main job = 2 concurrent jobs + # 2 x 9 agent jobs = 18 concurrent jobs + # Total = 20 concurrent jobs + # + # However, we don't have many projects or targets in this workspace, so we + # lower the number of agents to reduce spent compute time. + strategy: + matrix: + # Must match the argument passed to `nx-cloud --agent-count` in the dte_coordinator job + agent: [1, 2, 3, 4] + + steps: + - name: Checkout all commits + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set up dependencies + uses: ./.github/actions/setup + + - name: Start Nx Cloud DTE Agent + run: yarn nx-cloud start-agent + + # We're using Nx Cloud for Distributed Task Execution + # Reference: https://nx.dev/using-nx/dte + # + # The coordinator outputs the combination of task outputs from the agents, + # both terminal and file outputs + dte_coordinator: + name: DTE Coordinator + runs-on: ubuntu-latest + env: + NX_CLOUD_DISTRIBUTED_EXECUTION: true + NX_DISTRIBUTED_TASK_EXECUTION: true + + steps: + - name: Checkout all commits + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set up dependencies + uses: ./.github/actions/setup + + - name: Start Nx Cloud DTE + # The --agent-count parameter must match the number of strategies run by the dte_agents job + run: yarn nx-cloud start-ci-run --agent-count=4 + + - name: Lint Nx workspace + env: + # DTE is disabled to run this step on the DTE coordinator while the agents are set up + NX_CLOUD_DISTRIBUTED_EXECUTION: false + NX_DISTRIBUTED_TASK_EXECUTION: false + run: yarn nx workspace-lint + - name: Check formatting + env: + # DTE is disabled to run this step on the DTE coordinator while the agents are set up + NX_CLOUD_DISTRIBUTED_EXECUTION: false + NX_DISTRIBUTED_TASK_EXECUTION: false + run: yarn nx format:check + + # Distribution strategy for 2 vCPUs per hosted runner (GitHub Free): + # + + # lint: 2 tasks assigned at a time, 1 task per vCPU + - name: Run Affected lint + run: yarn nx affected:lint --parallel --max-parallel=2 --quiet + + # test: 1 task assigned at a time with 2 parallel processes, 1 process per vCPU + - name: Run Affected test + id: test + run: yarn nx affected:test --parallel --max-parallel=1 --max-workers=2 --ci --code-coverage + + # build: 2 tasks assigned at a time, 1 task per vCPU + - name: Run Affected build + run: yarn nx affected:build --exclude=docs --parallel --max-parallel=2 + + # e2e: 1 tasks assigned at a time, 1 process per agent + - name: Run Affected e2e + run: yarn nx affected:e2e --max-parallel=1 + + # component test: no clue about parallelism here + - name: Run Affected component tests + run: yarn nx affected -t component-test --parallel=false + + - name: Stop Nx Cloud DTE agents + if: ${{ always() }} + run: yarn nx-cloud stop-all-agents + + # Upload coverage reports to Codecov + - name: Upload state coverage + if: steps.test.outcome == 'success' + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: coverage/state/lcov.info + flags: state + + - name: Upload template coverage + if: steps.test.outcome == 'success' + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: coverage/template/lcov.info + flags: template + + - name: Upload cdk coverage + if: steps.test.outcome == 'success' + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: coverage/cdk/lcov.info + flags: cdk + + - name: Upload eslint-plugin coverage + if: steps.test.outcome == 'success' + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: coverage/eslint-plugin/lcov.info + flags: eslint-plugin + + # The docs project is built in a separate job because it requires Node.js 16 + build-docs: + name: Build docs + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + + steps: + - name: Checkout all commits + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set up dependencies + uses: ./.github/actions/setup + + - name: Build docs + env: + NX_CLOUD_DISTRIBUTED_EXECUTION: false + NX_DISTRIBUTED_TASK_EXECUTION: false + run: yarn nx build docs + + - name: '[Merge] Upload docs' + if: github.ref == 'refs/heads/main' + uses: actions/upload-artifact@v3 + with: + name: ${{ env.docs-name }} + path: ${{ env.docs-path }} + + deploy-docs: + name: '[Merge] Deploy docs' + runs-on: ubuntu-latest + # Grant GITHUB_TOKEN the permissions required to make a Pages deployment + permissions: + pages: write # to deploy to Pages + id-token: write # to verify the deployment originates from an appropriate source + if: github.ref == 'refs/heads/main' + + # Deploy to the github-pages environment + environment: + name: github-pages + url: www.rx-angular.io + #url: ${{ steps.deployment.outputs.page_url }} + + needs: [build-docs] + + steps: + - name: Download docs + uses: actions/download-artifact@v3 + with: + name: ${{ env.docs-name }} + path: ${{ env.docs-path }} + + - name: Set up GitHub Pages + uses: actions/configure-pages@v2 + + - name: Upload docs to GitHub Pages + uses: actions/upload-pages-artifact@v1 + with: + path: ${{ env.docs-path }} + + - name: Deploy docs to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000000..ca576df547 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,67 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ main ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ main ] + schedule: + - cron: '37 11 * * 2' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + language: [ 'javascript' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] + # Learn more: + # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml new file mode 100644 index 0000000000..7d88197569 --- /dev/null +++ b/.github/workflows/label.yml @@ -0,0 +1,19 @@ +# This workflow will triage pull requests and apply a label based on the +# paths that are modified in the pull request. +# +# To use this workflow, you will need to set up a .github/labeler.yml +# file with configuration. For more information, see: +# https://github.com/actions/labeler/blob/master/README.md + +name: Labeler +on: [pull_request_target] + +jobs: + label: + + runs-on: ubuntu-latest + + steps: + - uses: actions/labeler@v2 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.gitignore b/.gitignore index 25ece6f5ac..912b7687ef 100644 --- a/.gitignore +++ b/.gitignore @@ -1,44 +1,49 @@ # See http://help.github.com/ignore-files/ for more about ignoring files. -# Compiled output +# compiled output /dist /tmp /out-tsc -/bazel-out +/docs/test-coverage -# Node -/node_modules -npm-debug.log -yarn-error.log +# dependencies +node_modules/ # IDEs and editors -.idea/ +/.idea .project .classpath .c9/ *.launch .settings/ *.sublime-workspace +apps/docs/generated +apps/docs/generated/* +docs/demos -# Visual Studio Code +# IDE - VSCode .vscode/* !.vscode/settings.json !.vscode/tasks.json !.vscode/launch.json !.vscode/extensions.json -.history/* -# Miscellaneous +# misc /.angular/cache -.sass-cache/ +/.sass-cache /connect.lock /coverage /libpeerconnection.log +npm-debug.log +yarn-error.log testem.log /typings +package-lock.json -# System files +# System Files .DS_Store Thumbs.db -.angular +# Generated Docusaurus files +.docusaurus/ +.cache-loader/ diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 0000000000..31354ec138 --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100755 index 0000000000..0bd658f496 --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx --no-install commitlint --edit "$1" diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000000..36af219892 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx lint-staged diff --git a/projects/docs/src/assets/.gitkeep b/.nojekyll similarity index 100% rename from projects/docs/src/assets/.gitkeep rename to .nojekyll diff --git a/.nxignore b/.nxignore new file mode 100644 index 0000000000..f8891c6e34 --- /dev/null +++ b/.nxignore @@ -0,0 +1 @@ +libs/**/*.md diff --git a/.prettierignore b/.prettierignore index bbc02998ea..0166a34c22 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,4 +1,8 @@ # Add files here to ignore them from prettier formatting + /dist /coverage -.angular +/node_modules +/**/images/**/* +.docusaurus/ +CHANGELOG.md diff --git a/.vscode/extensions.json b/.vscode/extensions.json index cbe2e9105f..b8c64d2e79 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,9 +1,8 @@ { "recommendations": [ - "angular.ng-template", "nrwl.angular-console", + "angular.ng-template", "esbenp.prettier-vscode", - "firsttris.vscode-jest-runner", - "dbaeumer.vscode-eslint" + "firsttris.vscode-jest-runner" ] } diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000..8b6b9cce04 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,110 @@ +# Contributing to RxAngular + +We would love for you to contribute to RxAngular and help make it even better than it is today! +As a contributor, here are the guidelines we would like you to follow: + +- [Developing](#developing) +- [Issues and Bugs](#issue) +- [Feature Requests](#feature) +- [Coding Rules](#rules) + +## Developing + +Start by installing all dependencies (we're using Yarn): + +```sh +yarn +``` + +You can start developing and then run tests for the affected target: + +```sh +yarn nx affected:test +``` + +Either you can run all tests for all targets: + +```sh +yarn nx run-many --all --target=test +``` + +## Found a Bug? + +If you find a bug in the source code, you can help us by submitting an issue to our [GitHub Repository](https://github.com/rx-angular/rx-angular). +Even better, you can submit a Pull Request with a fix. + +## Missing a Feature? + +You can _request_ a new feature by submitting an issue to our GitHub Repository. +If you would like to _implement_ a new feature, please consider the size of the change in order to determine the right steps to proceed: + +- For a **Major Feature**, first open an issue and outline your proposal so that it can be discussed. + This process allows us to better coordinate our efforts, prevent duplication of work, and help you to craft the change so that it is successfully accepted into the project. + + **Note**: Adding a new topic to the documentation, or significantly re-writing a topic, counts as a major feature. + +- **Small Features** can be crafted and directly submitted as a Pull Request. + +## Commit Message Format + +We have very precise rules over how our Git commit messages must be formatted. +This format leads to **easier to read commit history**. + +Each commit message consists of a **header**, a **body**, and a **footer**. + +``` +
+ + + +