-
Notifications
You must be signed in to change notification settings - Fork 2
feat: project setup #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
c68c387
feat: import setup from rabbitmq-stream
0a458d3
feat: add tsup and github actions
31bca3d
chore: updated dependencies and replaced mocha with vitest for esm co…
779c2b0
chore: add test envs
8f917d0
feat: finish implementing acceptance test, switched to got instead of ky
19a71ef
chore: fix tests setup and update workflows
d562d68
chore: downgrade got and cspell package in order to support node v18
796f44d
chore: remove unnecessary tsconfig in tests
c57d15b
fix: check-ts command in package json
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| # This workflow will do a clean installation of node dependencies, cache/restore them, 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: Node.js CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| matrix: | ||
| node-version: [22.x] | ||
| # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
|
|
||
| services: | ||
| rabbitmq: | ||
| image: rabbitmq:4.1.0-management | ||
| options: --hostname test-node --name test-node | ||
| env: | ||
| RABBITMQ_HOSTNAME: "test-node" | ||
| RABBITMQ_DEFAULT_USER: "test-user" | ||
| RABBITMQ_DEFAULT_PASS: "test-password" | ||
| volumes: | ||
| # these directories will be empty until checkout, but they will be | ||
| # populated by the time we restart the service | ||
| - ${{ github.workspace }}/conf:/etc/rabbitmq | ||
| ports: | ||
| - 5672:5672 | ||
| - 15672:15672 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Use Node.js ${{ matrix.node-version }} | ||
| uses: actions/setup-node@v3 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| cache: "npm" | ||
| # - name: Generate certificates | ||
| # env: | ||
| # CN: test-node | ||
| # run: | | ||
| # git clone https://github.com/rabbitmq/tls-gen tls-gen | ||
| # cd tls-gen/basic | ||
| # make | ||
| # cd ../.. | ||
| # cp -a tls-gen/basic/result certs/ | ||
| # sudo chown -R 999:999 certs | ||
| # sudo mv certs/server_test-node_certificate.pem certs/server_rabbitmq_certificate.pem | ||
| # sudo mv certs/server_test-node_key.pem certs/server_rabbitmq_key.pem | ||
| - name: Restart RabbitMQ | ||
| run: | | ||
| docker restart test-node | ||
| sleep 2 | ||
| docker exec test-node rabbitmqctl await_startup | ||
| - run: npm ci | ||
| - run: npm run check | ||
| - run: npm run build --if-present | ||
| - run: | | ||
| docker exec test-node rabbitmqctl add_user 'O=client,CN=test-node' '' | ||
| docker exec test-node rabbitmqctl clear_password 'O=client,CN=test-node' | ||
| docker exec test-node rabbitmqctl set_permissions 'O=client,CN=test-node' '.*' '.*' '.*' | ||
| - run: npm test | ||
| env: | ||
| RABBITMQ_USER: "test-user" | ||
| RABBITMQ_PASSWORD: "test-password" | ||
| # - run: cd example && npm install && npm start | ||
| # env: | ||
| # RABBITMQ_USER: "test-user" | ||
| # RABBITMQ_PASSWORD: "test-password" | ||
| # - run: cd performance_test && npm install && npm run perftest 100000 | ||
| # env: | ||
| # RABBITMQ_USER: "test-user" | ||
| # RABBITMQ_PASSWORD: "test-password" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| dist/ | ||
| node_modules/ | ||
| .envrc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "semi": false, | ||
| "arrowParens": "always", | ||
| "singleQuote": false, | ||
| "printWidth": 120, | ||
| "trailingComma": "es5" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| nodejs 22.15.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { | ||
| // Use IntelliSense to learn about possible attributes. | ||
| // Hover to view descriptions of existing attributes. | ||
| // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
| "version": "0.2.0", | ||
| "configurations": [ | ||
| { | ||
| "type": "node", | ||
| "request": "launch", | ||
| "name": "Launch Program", | ||
| "skipFiles": ["<node_internals>/**"], | ||
| "program": "${file}", | ||
| "preLaunchTask": "tsc: build - tsconfig.json", | ||
| "outFiles": ["${workspaceFolder}/dist/**/*.js"] | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| [rabbitmq_management]. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| loopback_users = none | ||
| loopback_users.guest = false | ||
| listeners.tcp.default = 5672 | ||
| log.file.level = debug | ||
| log.console = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "language": "en", | ||
| "words": [ | ||
| "ackmode", | ||
| "ampq", | ||
| "amqpvalue", | ||
| "perftest", | ||
| "prefetch", | ||
| "RABBITMQ", | ||
| "rabbitmqctl", | ||
| "Sasl" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| services: | ||
| rabbitmq-rhea: | ||
| image: rabbitmq:4.1.0-management | ||
| container_name: rabbitmq-rhea | ||
| restart: unless-stopped | ||
| hostname: "rabbitmq" | ||
| ports: | ||
| - "15672:15672" | ||
| - "5672:5672" | ||
| environment: | ||
| RABBITMQ_DEFAULT_USER: "rabbit" | ||
| RABBITMQ_DEFAULT_PASS: "rabbit" | ||
| volumes: | ||
| - ./conf/:/etc/rabbitmq/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import js from "@eslint/js" | ||
| import globals from "globals" | ||
| import tseslint from "typescript-eslint" | ||
| import { defineConfig } from "eslint/config" | ||
|
|
||
| export default defineConfig([ | ||
| { files: ["**/*.{js,mjs,cjs,ts}"], plugins: { js }, extends: ["js/recommended"] }, | ||
| { files: ["**/*.{js,mjs,cjs,ts}"], languageOptions: { globals: globals.browser } }, | ||
| tseslint.configs.recommended, | ||
| ]) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to be more permissive with version, following what rhea supports
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alright, i will put the same versions as in rhea workflow https://github.com/amqp/rhea/blob/main/.github/workflows/node.js.yml#L18