Skip to content

Commit

Permalink
Merge pull request #115 from farhan7reza7/main
Browse files Browse the repository at this point in the history
update to main state
  • Loading branch information
farhan7reza7 authored Feb 2, 2024
2 parents 4bf9bd6 + 1ccffaf commit 5f6e4b0
Show file tree
Hide file tree
Showing 13 changed files with 2,551 additions and 877 deletions.
7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Welcome to the main issue template

For convenience and recommended practices, we have classified issue templates:

[See Classified templates for different kinds of issues](https://github.com/farhan7reza7/if-follow-package/issues/new/choose)

resolves #32
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE~HEAD

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/deno.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# This workflow will install Deno then run `deno lint` and `deno test`.
# For more information see: https://github.com/denoland/setup-deno

name: Deno

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Setup repo
uses: actions/checkout@v3

- name: Setup Deno
# uses: denoland/setup-deno@v1
uses: denoland/setup-deno@61fe2df320078202e33d7d5ad347e7dcfa0e8f31 # v1.1.2
with:
deno-version: v1.x

# Uncomment this step to verify the use of 'deno fmt' on each commit.
# - name: Verify formatting
# run: deno fmt --check

- name: Run linter
run: deno lint || true

- name: Run tests
run: deno test -A || true
8 changes: 5 additions & 3 deletions .github/workflows/npm-publish-github-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
name: github-build-published

on:
workflow_dispatch:
#release:
#types: [created]
#workflow_dispatch:
release:
types:
- created


jobs:
build:
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/test-runner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This workflow will run tests using node.

name: test-runner

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test
env:
TOKEN: ${{ secrets.TOKEN }}
USER: ${{ secrets.USER }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,7 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*


# Important Source codes
source/
16 changes: 14 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,22 @@ and follows the guidelines from [Keep a Changelog](https://keepachangelog.com/).

fixed some issues and configured files for v1.0.1

### [v1.1.0]

#### Added

- Improved handling of methods outcomes.
- Updated readme.md for methods resolved outcome.

#### Fixed

fixed some issues and configured files for publishing if-follow-package v1.1.0 on npm registry


### [Next Release] - Collecting issues and new features for release

### Important changes links:

- [Unreleased](https://github.com/farhan7reza7/if-follow-package/compare/v1.0.1...HEAD)
- [1.0.1](https://github.com/farhan7reza7/if-follow-package/releases/tag/v1.0.1)
- [Unreleased](https://github.com/farhan7reza7/if-follow-package/compare/v1.1.0...HEAD)
- [v1.1.0](https://github.com/farhan7reza7/if-follow-package/releases/tag/v1.1.0)
- [Release](https://github.com/farhan7reza7/if-follow-package/milestone/2)
65 changes: 47 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ if-follow-package
[![github-build-published][github-image]][github-url]
[![CI][ci-image]][ci-url]
[![License][license-image]][licence-url]
[![LinkedIn](https://img.shields.io/badge/LinkedIn-farhan7reza7-blue)](https://www.linkedin.com/in/farhan7reza7/)

Installation
------------
Expand Down Expand Up @@ -145,12 +146,16 @@ Managed Outputs (example user outputs)
// Test case: user is a follower
const result1 = followController.isFollower('farhan7reza7');

console.log(result1); // Output: "Yes, farhan7reza7 follows you!"
result1.then((result) => {
console.log(result); // Output: "Yes, farhan7reza7 follows you!"
});

// Test case: user is not a follower
const result2 = await followController.isFollower('diff-ymd-package');
const result2 = followController.isFollower('diff-ymd-package');

console.log(result2); // Output: "No, diff-ymd-package does not follow you!"
result2.then((result) => {
console.log(result); // Output: "No, diff-ymd-package does not follow you!"
});

```

Expand All @@ -161,12 +166,16 @@ console.log(result2); // Output: "No, diff-ymd-package does not follow you!"
// Test case: user is followed
const result3 = followController.isFollowing('farhan7reza7');

console.log(result3); // Output: "Yes, you follow farhan7reza7!"
result3.then((result) => {
console.log(result); // Output: "Yes, you follow farhan7reza7!"
});

// Test case: user is not followed
const result4 = await followController.isFollowing('anaseem80');
const result4 = followController.isFollowing('anaseem80');

console.log(result4); // Output: "No, you do not follow anaseem80!"
result4.then((result) => {
console.log(result); // Output: "No, you do not follow anaseem80!"
});

```

Expand All @@ -176,7 +185,9 @@ console.log(result4); // Output: "No, you do not follow anaseem80!"

const result5 = followController.totalFollowers();

console.log(result5); // Output: "Your total Followers: 1657"
result5.then((result) => {
console.log(result); // Output: "Your total Followers: 1657"
});

```

Expand All @@ -186,7 +197,9 @@ console.log(result5); // Output: "Your total Followers: 1657"

const result6 = followController.totalFollowings();

console.log(result6); // Output: "Your total Followings: 1067`
result6.then((result) => {
console.log(result); // Output: "Your total Followings: 1067`
});

```

Expand All @@ -196,7 +209,9 @@ console.log(result6); // Output: "Your total Followings: 1067`

const result7 = followController.whoNotFollowingBack();

console.log(result7); // Output: ["diff-ymd-package", "Open-Sourced-Org", "username4", "usernameN"]
result7.then((result) => {
console.log(result); // Output: ["diff-ymd-package", "Open-Sourced-Org", "username4", "usernameN"]
});

```

Expand All @@ -206,7 +221,9 @@ console.log(result7); // Output: ["diff-ymd-package", "Open-Sourced-Org", "usern

const result8 = followController.whoFollowingBack();

console.log(result8); // Output: ["farhan7reza7", "username2", "username3", "usernameN"]
result8.then((result) => {
console.log(result); // Output: ["farhan7reza7", "username2", "username3", "usernameN"]
});

```

Expand All @@ -217,12 +234,16 @@ console.log(result8); // Output: ["farhan7reza7", "username2", "username3", "use
// Test case: user is following back
const result9 = followController.isFollowingBack('farhan7reza7');

console.log(result9); // Output: "Yes, farhan7reza7 following back!"
result9.then((result) => {
console.log(result); // Output: "Yes, farhan7reza7 following back!"
});

// Test case: user is not following back
const result10 = followController.isFollowingBack('diff-ymd-package');

console.log(result10); // Output: "No, diff-ymd-package does not following back!"`
result10.then((result) => {
console.log(result); // Output: "No, diff-ymd-package does not following back!"
});

```

Expand All @@ -232,8 +253,12 @@ console.log(result10); // Output: "No, diff-ymd-package does not following back!

// Test case: unfollow a user who is not following back
const result11 = followController.unfollowNotFollowingBack('diff-ymd-package');
//Console Output: "Unfollowed: diff-ymd-package"

console.log(result11); // Output: "Unfollowed: diff-ymd-package"
// not needed to console, because internally log message, just only call
result11.then((result) => {
console.log(result); // Output: "undefined"
});

```

Expand All @@ -243,11 +268,15 @@ console.log(result11); // Output: "Unfollowed: diff-ymd-package"

// Test case: unfollow all users who are not following back
const result12 = followController.unfollowAllNotFollowingBack();

console.log(result12); /* Output: "Unfollowed: Open-Sourced-Org"
"Unfollowed: username2"
"Unfollowed: username3"
"Unfollowed: usernameN"*/
/* Console Output: "Unfollowed: Open-Sourced-Org"
"Unfollowed: username2"
"Unfollowed: username3"
"Unfollowed: usernameN"*/

// not return anything, and internally log message, just only call
result12.then((result) => {
console.log(result); // Output: "undefined"
});

```

Expand Down
2 changes: 2 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ module.exports = {
'^.+\\.js$': 'babel-jest',
},
testEnvironment: 'node',
//"setupFiles": ["dotenv/config"],

// Add other Jest configuration options if needed
};
Loading

0 comments on commit 5f6e4b0

Please sign in to comment.