From 59e285662d4ba2d3927d948502eab4c3d0200191 Mon Sep 17 00:00:00 2001 From: Julian Jandl Date: Mon, 6 Jun 2022 20:59:15 +0200 Subject: [PATCH 1/3] chore: setup simple ci pipeline --- .github/CODE_OF_CONDUCT.md | 78 +++++++++++++++++++ .github/CONTRIBUTING.md | 66 ++++++++++++++++ .github/FUNDING.yml | 2 + .github/ISSUE_TEMPLATE/bug_report.md | 93 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 5 ++ .github/ISSUE_TEMPLATE/feature_request.md | 34 +++++++++ .github/SECURITY.md | 5 ++ .github/SUPPORT.md | 70 +++++++++++++++++ .github/actions/setup/action.yml | 37 +++++++++ .github/workflows/build-and-test.yml | 50 ++++++++++++ .github/workflows/codeql-analysis.yml | 67 ++++++++++++++++ package.json | 6 +- 12 files changed, 512 insertions(+), 1 deletion(-) create mode 100644 .github/CODE_OF_CONDUCT.md create mode 100644 .github/CONTRIBUTING.md create mode 100644 .github/FUNDING.yml create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/SECURITY.md create mode 100644 .github/SUPPORT.md create mode 100644 .github/actions/setup/action.yml create mode 100644 .github/workflows/build-and-test.yml create mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..dd468a5 --- /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 0000000..73c0444 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,66 @@ +# Contributing to rxjs-zone-less + +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/rxjs-zone-less/issues +[new-issue]: https://github.com/rx-angular/rxjs-zone-less/issues/new diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..426a213 --- /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 0000000..2c3ec04 --- /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 0000000..4c7dedf --- /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 0000000..b670fd7 --- /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 0000000..28b2499 --- /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 0000000..96f1677 --- /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 rx-angular/rxjs-zone-less! 👋 +A set of wrappers for RxJS to avoid unnecessary change detection and zone interference in Angular. +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/rxjs-zone-less/blob/main/LICENSE.md +[coc]: https://github.com/rx-angular/rxjs-zone-less/.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/rxjs-zone-less/.github/blob/main/CONTRIBUTING.md diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml new file mode 100644 index 0000000..0a20260 --- /dev/null +++ b/.github/actions/setup/action.yml @@ -0,0 +1,37 @@ +name: Setup +description: Setup Node.js, cache and install dependencies +inputs: + node-version: + description: Node.js version + required: false + default: '14' +runs: + using: composite + steps: + - name: Checkout all commits + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Derive appropriate SHAs for base and head for `nx affected` commands + uses: nrwl/nx-set-shas@v2 + + - name: Use Node.js + uses: actions/setup-node@v2 + with: + node-version: ${{ inputs.node-version }} + + - uses: actions/cache@v2 + id: npm-cache + with: + path: node_modules + key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-npm- + + - name: Install dependencies + if: steps.npm-cache.outputs.cache-hit != 'true' + shell: bash + run: npm ci + env: + HUSKY_SKIP_INSTALL: 'true' diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml new file mode 100644 index 0000000..74df347 --- /dev/null +++ b/.github/workflows/build-and-test.yml @@ -0,0 +1,50 @@ +name: build & test + +on: + push: + branches: [main] + pull_request: + branches: [main] +env: +# NX_CLOUD_DISTRIBUTED_EXECUTION: true +# NX_DISTRIBUTED_TASK_EXECUTION: true + NX_VERBOSE_LOGGING: false + +jobs: +# agents: +# runs-on: ubuntu-latest +# +# name: Agent 1 +# timeout-minutes: 20 +# +# strategy: +# matrix: +# agent: [1, 2, 3] +# +# steps: +# - uses: actions/checkout@v2 +# - uses: ./.github/actions/setup +# +# - name: Start Nx Agent ${{ matrix.agent }} +# run: yarn nx-cloud start-agent + + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: ./.github/actions/setup + +# - run: npx nx-cloud start-ci-run + + - name: Run Affected lint + run: npm run affected:lint -- --parallel=4 + + - name: Run Affected test + run: npm run affected:test -- --parallel=4 + + # don't run build in parallel, can cause dead locks + - name: Run Affected build + run: npm run affected:build + +# - run: npx nx-cloud stop-all-agents diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..ca576df --- /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/package.json b/package.json index 513a419..4729ebe 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,11 @@ "name": "rxjs-zone-less", "version": "0.0.0", "license": "MIT", - "scripts": {}, + "scripts": { + "affected:lint": "nx affected:lint", + "affected:test": "nx affected:test", + "affected:build": "nx affected:build" + }, "private": true, "dependencies": { "rxjs": "^7.5.4", From 0e02a418833c234750a041da7926870141281e6b Mon Sep 17 00:00:00 2001 From: Julian Jandl Date: Mon, 6 Jun 2022 21:07:13 +0200 Subject: [PATCH 2/3] chore: set defaultBase and implicitDependencies --- nx.json | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/nx.json b/nx.json index 8c81ef0..b39db27 100644 --- a/nx.json +++ b/nx.json @@ -3,7 +3,17 @@ "$schema": "./node_modules/nx/schemas/nx-schema.json", "npmScope": "rxjs-zone-less", "affected": { - "defaultBase": "main" + "defaultBase": "origin/main" + }, + "implicitDependencies": { + "package.json": { + "dependencies": "*", + "devDependencies": "*" + }, + "tsconfig.base.json": "*", + "tsconfig.*.json": "*", + "nx.json": "*", + ".eslintrc.json": "*" }, "cli": { "defaultCollection": "@nrwl/workspace" From e702320898142fef641e8576ad03a21c1c54500a Mon Sep 17 00:00:00 2001 From: Julian Jandl Date: Mon, 6 Jun 2022 21:10:57 +0200 Subject: [PATCH 3/3] chore: fix lint configuration --- .eslintrc.json | 3 --- .github/workflows/build-and-test.yml | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 506a6e5..228431c 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -29,9 +29,6 @@ "plugin:@nrwl/nx/typescript", "plugin:@typescript-eslint/recommended" ], - "parserOptions": { - "project": "./tsconfig.*?.json" - }, "rules": { "@typescript-eslint/ban-ts-comment": "warn", "@typescript-eslint/no-inferrable-types": "warn", diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 74df347..055030a 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -38,7 +38,7 @@ jobs: # - run: npx nx-cloud start-ci-run - name: Run Affected lint - run: npm run affected:lint -- --parallel=4 + run: npm run affected:lint -- --quiet --parallel=4 - name: Run Affected test run: npm run affected:test -- --parallel=4