Skip to content

Commit 55f25f8

Browse files
committed
#270 rename all JS imports to use filenames
1 parent d3232a6 commit 55f25f8

30 files changed

+85
-66
lines changed

.eslintrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ module.exports = {
44
extends: [
55
'eslint:recommended',
66
'plugin:prettier/recommended',
7+
"plugin:import/recommended",
8+
"plugin:import/typescript",
79
'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react
810
'plugin:@typescript-eslint/eslint-recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
911
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
@@ -50,6 +52,8 @@ module.exports = {
5052
'comma-dangle': 'off', // https://eslint.org/docs/rules/comma-dangle
5153
'function-paren-newline': 'off', // https://eslint.org/docs/rules/function-paren-newline
5254
'global-require': 'off', // https://eslint.org/docs/rules/global-require
55+
"import/extensions": ["error", "ignorePackages"],
56+
"import/no-unresolved": "off",
5357
'import/no-dynamic-require': 'off', // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-dynamic-require.md
5458
'no-inner-declarations': 'off', // https://eslint.org/docs/rules/no-inner-declarations// New rules
5559
'class-methods-use-this': 'off',

CONTRIBUTE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ Talk with other devs on our [Discord][discord-url]!
2121
- `pnpm publish -r`
2222
- Choose a new version. Versions should match `atomic-data-rs`.
2323
- This updates the `package.json` files, creates a commit, tags it, pushes it to github, and publishes the builds to npm.
24-
- If this fails, try `pnpm version patch` and `pnpm npm publish`
24+
- If this fails, try `pnpm version patch` and `pnpm publish`
25+
- DONT run `pnpm npm publish`, as it will not resolve workspace dependencies correctly.
2526

2627
## Understanding vite and pnpm workspaces
2728

lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "0.34.1",
2+
"version": "0.34.5",
33
"author": "Joep Meindertsma",
44
"dependencies": {
55
"@noble/ed25519": "1.6.0",

lib/src/EventManager.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { EventManager } from './EventManager';
1+
import { EventManager } from './EventManager.js';
22
enum Events {
33
Click = 'click',
44
LotteryWon = 'lotterywon',

lib/src/agent.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect } from 'chai';
2-
import { Agent } from './index';
2+
import { Agent } from './index.js';
33

44
describe('Agent', () => {
55
it('Constructs valid ', async () => {

lib/src/agent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
generatePublicKeyFromPrivate,
55
properties,
66
tryValidURL,
7-
} from './index';
7+
} from './index.js';
88

99
/**
1010
* An Agent is a user or machine that can write data to an Atomic Server. An

lib/src/authentication.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
import { Agent, getTimestampNow, HeadersObject, signToBase64, Store } from '.';
1+
import {
2+
Agent,
3+
getTimestampNow,
4+
HeadersObject,
5+
signToBase64,
6+
Store,
7+
} from './index.js';
28

39
/** Returns a JSON-AD resource of an Authentication */
410
export async function createAuthentication(subject: string, agent: Agent) {

lib/src/class.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
Property,
88
Resource,
99
Store,
10-
} from './index';
10+
} from './index.js';
1111

1212
/** Returns the Typescript interface string based on the Class */
1313
export async function classToTypescriptDefinition(

lib/src/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
setCookieAuthentication,
1515
signRequest,
1616
Store,
17-
} from './index';
17+
} from './index.js';
1818

1919
/** Works both in node and the browser */
2020
import fetch from 'cross-fetch';

lib/src/commit.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { expect } from 'chai';
2-
import { CommitBuilder } from './commit';
2+
import { CommitBuilder } from './commit.js';
33
import {
44
generatePublicKeyFromPrivate,
55
parseAndApplyCommit,
66
serializeDeterministically,
77
signToBase64,
88
Store,
9-
} from './index';
9+
} from './index.js';
1010

1111
// These are disabled for now, as they require TextEncoder to be available
1212
// https://github.com/facebook/jest/issues/9983

0 commit comments

Comments
 (0)