Skip to content

Cleanup#127

Open
dajimenezriv-internxt wants to merge 6 commits intomasterfrom
cleanup
Open

Cleanup#127
dajimenezriv-internxt wants to merge 6 commits intomasterfrom
cleanup

Conversation

@dajimenezriv-internxt
Copy link
Copy Markdown
Contributor

@dajimenezriv-internxt dajimenezriv-internxt commented May 4, 2026

What

Do a big cleanup of code that was no longer used. First, we need to find all code that is still used, for that I search org:internxt from '@internxt/inxt-js in github. After that I found the following repos using it:

  • drive-desktop
  • drive-desktop-linux
  • cli
  • drive-server-wip
  • pc-cloud-old
  • drive-desktop-test
  • photos-server
  • pc-cloud
  • drive-server-old

For the relevant ones I search what imports are using from inxt-js:

// repo:internxt/drive-desktop-linux from '@internxt/inxt-js
import { Environment } from '@internxt/inxt-js';
import { GenerateFileKey } from '@internxt/inxt-js/build/lib/utils/crypto';
import { UploadStrategyFunction } from '@internxt/inxt-js/build/lib/core';
import { ActionState } from '@internxt/inxt-js/build/api';
import { DownloadOneShardStrategy } from '@internxt/inxt-js/build/lib/core';
import { DownloadStrategyFunction } from '@internxt/inxt-js/build/lib/core/download/strategy';

// repo:internxt/cli from '@internxt/inxt-js
import { Environment } from '@internxt/inxt-js';
// this is not used in `inxt-js` so it can be removed from the cli (however I haven't deleted it yet)
import { EncryptProgressCallback } from '@internxt/inxt-js/build/lib/core';

// repo:internxt/drive-desktop from '@internxt/inxt-js
import { Environment } from '@internxt/inxt-js';
import { ActionState } from '@internxt/inxt-js/build/api';

// repo:internxt/drive-server-wip from '@internxt/inxt-js
import { Environment } from '@internxt/inxt-js';

So, everything that is not used in one of those 4 repos will be removed.

The only thing that I assumed is no longer in use (since it's a command from 4 years ago) it's the cli command: https://github.com/internxt/inxt-js/pull/127/changes#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L18. So I deleted everything inside the cli folder.

The other part that is a bit tricky is the functions inside the Environment, so for that I used:

repo:internxt/drive-desktop-linux OR repo:internxt/cli OR repo:internxt/drive-desktop OR repo:internxt/drive-server-wip WHATEVER

I've also added knip to track better which functions, constants and so were used in the code and created a github pipeline to check that.

@dajimenezriv-internxt dajimenezriv-internxt self-assigned this May 4, 2026
Comment thread src/index.ts
* @param bucketName Name of the new bucket
* @returns Bucket id
*/
createBucket(bucketName: string): Promise<string> {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread src/index.ts
* @param bucketId Id whose bucket is going to be deleted
* @param cb Callback that will receive the response after deletion
*/
deleteBucket(bucketId: string): Promise<void> {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread src/index.ts
cb(Error('Not implemented yet'), null);
}

setEncryptionKey(newEncryptionKey: string): void {
Copy link
Copy Markdown
Contributor Author

@dajimenezriv-internxt dajimenezriv-internxt May 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread src/index.ts
state.stop();
}

uploadCancel(state: ActionState): void {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread src/index.ts
state.stop();
}

renameFile(bucketId: string, fileId: string, newPlainName: string): Promise<void> {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sg-gs
Copy link
Copy Markdown
Member

sg-gs commented May 5, 2026

So I deleted everything inside the cli folder.

@dajimenezriv-internxt The CLI is for using it locally, as this project does not have a HTTP server to try it, thus, it is not used outside this project

@dajimenezriv-internxt
Copy link
Copy Markdown
Contributor Author

My question is if someone is still using the cli (I didn't even know it existed) so it's worth to mantain? Because for example, right now the upload and uploadMultipart are broken when I changed the upload from callbacks to promises. Not because I wanted to break it, but since it wasn't included in the tsconfig.json I didn't know it was broken until now. So, should we mantain it? In my case, when I have to test something from the environment I call it from windows. However, if we want to allow it from inxt-js, maybe it's easier to just declare a cli.ts file that has commented the code to creating an environment and you just call the function you want to test and it's simpler to mantain.

@dajimenezriv-internxt
Copy link
Copy Markdown
Contributor Author

Another thing, we can keep the cli and the other commands in the environment and I can include them in the tsconfig.json and create another tsconfig.build.json, so at least we know if something it's broken, because I was checking other tests that are called *.unit.ts and some of them are also broken. With that we don't lose any feature that we already had and we start knowing if somethings gets broken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants