Skip to content

Commit 37768bb

Browse files
authored
Merge pull request #2 from NShahri/typescript
Port DataLoader to TypeScript
2 parents a107730 + 9fc234f commit 37768bb

26 files changed

+8767
-8402
lines changed

.eslintignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.eslintrc

Lines changed: 0 additions & 177 deletions
This file was deleted.

.flowconfig

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/workflows/validation.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
name: Flow check, Lint and Tests
1+
name: Typescript check, Lint and Tests
22

3-
on: push
3+
on: [push, pull_request]
44

55
jobs:
66
validation:
@@ -17,13 +17,13 @@ jobs:
1717
uses: actions/setup-node@v4
1818
with:
1919
node-version: ${{ matrix.node-version }}
20-
cache: 'yarn'
20+
cache: 'npm'
2121

22-
- name: Install Dependencies using Yarn
23-
run: yarn --ignore-engines
22+
- name: Install Dependencies using NPM
23+
run: npm install
2424

2525
- name: Tests
26-
run: yarn test:ci
26+
run: npm test:ci
2727

2828
- name: Upload coverage to Codecov
2929
uses: codecov/codecov-action@v4

.gitignore

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,3 @@ npm-debug.log
99
node_modules
1010
coverage
1111
dist
12-
13-
# Generated with release scripts
14-
index.d.ts
15-
index.js
16-
index.js.flow

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ We actively welcome your pull requests for documentation and code.
1717
4. Ensure the test suite passes.
1818
5. Make sure your code lints.
1919
6. If you haven't already, complete the Contributor License Agreement ("CLA").
20-
7. Run `yarn changeset` and describe the change you're proposing. Commit the file it creates in `.changeset` to the repo. [You can read more about changeset here.](https://github.com/changesets/changesets)
20+
7. Run `npx @changesets/cli` and describe the change you're proposing. Commit the file it creates in `.changeset` to the repo. [You can read more about changeset here.](https://github.com/changesets/changesets)
2121
8. Open a Pull Request so we can review and incorporate your change.
2222

2323
## Releases
2424

2525
To release a new version:
26-
1. Run `yarn changeset version` to bump the version of the package.
27-
2. Run `yarn release` this will create a new release on GitHub and publish the package to NPM.
26+
1. Run `npx @changesets/cli version` to bump the version of the package.
27+
2. Run `npx @changesets/cli publish` this will create a new release on GitHub and publish the package to NPM.
2828

2929
## Issues
3030

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -653,9 +653,8 @@ DataLoader and how it works.
653653
[graphql-js]: https://github.com/graphql/graphql-js
654654
[cache algorithms]: https://en.wikipedia.org/wiki/Cache_algorithms
655655
[express]: http://expressjs.com/
656-
[babel/polyfill]: https://babeljs.io/docs/usage/polyfill/
657656
[lru_map]: https://github.com/rsms/js-lru
658-
[source code]: https://github.com/graphql/dataloader/blob/main/src/index.js
657+
[source code]: https://github.com/graphql/dataloader/blob/main/src/index.ts
659658

660659
# Contributing to this repo
661660

babel.config.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

eslint.config.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import js from '@eslint/js';
2+
import globals from 'globals';
3+
import tseslint from 'typescript-eslint';
4+
import eslintConfigPrettier from 'eslint-config-prettier';
5+
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
6+
import { defineConfig } from 'eslint/config';
7+
8+
export default defineConfig([
9+
{
10+
files: ['**/*.{js,mjs,cjs,ts,mts,cts}'],
11+
plugins: { js },
12+
extends: ['js/recommended'],
13+
languageOptions: { globals: { ...globals.browser, ...globals.node } },
14+
},
15+
tseslint.configs.recommended,
16+
eslintConfigPrettier,
17+
eslintPluginPrettierRecommended,
18+
]);

0 commit comments

Comments
 (0)