Skip to content

Commit

Permalink
Merge pull request #1283 from FoalTS/remove-node-fetch
Browse files Browse the repository at this point in the history
Remove `node-fetch` dependency
  • Loading branch information
LoicPoullain authored Aug 22, 2024
2 parents 9044f10 + ed9541a commit 5b2d9b0
Show file tree
Hide file tree
Showing 12 changed files with 5 additions and 103 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ if (!(await verifyPassword(password, user.password))) {
Now that the password problem is solved, you can install the packages and provide your social credentials in the configuration.

```bash
npm install @foal/social node-fetch@2
npm install @foal/social
```

*config/default.json*
Expand Down Expand Up @@ -114,7 +114,6 @@ Open the file and add two new routes.
import { Context, dependency, Get, HttpResponseRedirect } from '@foal/core';
import { GoogleProvider } from '@foal/social';
import { User } from '../../entities';
import * as fetch from 'node-fetch';
import { Disk } from '@foal/storage';

interface GoogleUserInfo {
Expand Down
82 changes: 2 additions & 80 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@
"ajv-formats": "~2.1.1",
"cli-spinner": "~0.2.10",
"colors": "1.4.0",
"commander": "~12.1.0",
"node-fetch": "~2.7.0"
"commander": "~12.1.0"
},
"devDependencies": {
"@types/mocha": "10.0.7",
Expand Down
3 changes: 0 additions & 3 deletions packages/cli/src/generate/generators/upgrade/upgrade.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// 3p
import * as fetch from 'node-fetch';

// FoalTS
import { FileSystem } from '../../file-system';
import { installDependencies, logger } from '../../utils';
Expand Down
1 change: 0 additions & 1 deletion packages/cli/typings/node-fetch/index.d.ts

This file was deleted.

3 changes: 1 addition & 2 deletions packages/social/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@
"lib/"
],
"dependencies": {
"@foal/core": "^4.5.0",
"node-fetch": "~2.7.0"
"@foal/core": "^4.5.0"
},
"devDependencies": {
"@types/mocha": "10.0.7",
Expand Down
1 change: 0 additions & 1 deletion packages/social/src/abstract-provider.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import * as crypto from 'crypto';

// 3p
import { Config, Context, generateToken, HttpResponseRedirect, convertBase64ToBase64url, CookieOptions, HttpResponseOK } from '@foal/core';
import * as fetch from 'node-fetch';

/**
* Tokens returned by an OAuth2 authorization server.
Expand Down
3 changes: 0 additions & 3 deletions packages/social/src/facebook-provider.service.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// std
import { URL } from 'url';

// 3p
import * as fetch from 'node-fetch';

// FoalTS
import { AbstractProvider, SocialTokens } from './abstract-provider.service';
import { UserInfoError } from './user-info.error';
Expand Down
3 changes: 0 additions & 3 deletions packages/social/src/github-provider.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// 3p
import * as fetch from 'node-fetch';

// FoalTS
import { AbstractProvider, SocialTokens } from './abstract-provider.service';
import { UserInfoError } from './user-info.error';
Expand Down
3 changes: 0 additions & 3 deletions packages/social/src/linkedin-provider.service.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// std
import { URL } from 'url';

// 3p
import * as fetch from 'node-fetch';

// FoalTS
import { AbstractProvider, SocialTokens } from './abstract-provider.service';
import { UserInfoError } from './user-info.error';
Expand Down
2 changes: 0 additions & 2 deletions packages/social/src/twitter-provider.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// 3p
import * as fetch from 'node-fetch';

// FoalTS
import { AbstractProvider, SocialTokens } from './abstract-provider.service';
Expand Down
1 change: 0 additions & 1 deletion packages/social/typings/node-fetch/index.d.ts

This file was deleted.

0 comments on commit 5b2d9b0

Please sign in to comment.