Skip to content

Commit

Permalink
Revert "Desktop: Add OneNote Importer (#10642)"
Browse files Browse the repository at this point in the history
This reverts commit b248700.

We need to find a solution to make building the Rust package optional
  • Loading branch information
laurent22 committed Nov 9, 2024
1 parent 551bcc6 commit 33942d4
Show file tree
Hide file tree
Showing 194 changed files with 7 additions and 15,886 deletions.
3 changes: 0 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ plugin_types/
readme/
packages/react-native-vosk/lib/
packages/lib/countable/Countable.js
packages/onenote-converter/pkg/onenote_converter.js

# AUTO-GENERATED - EXCLUDED TYPESCRIPT BUILD
packages/app-cli/app/LinkSelector.js
Expand Down Expand Up @@ -1175,8 +1174,6 @@ packages/lib/services/interop/InteropService_Importer_Md.test.js
packages/lib/services/interop/InteropService_Importer_Md.js
packages/lib/services/interop/InteropService_Importer_Md_frontmatter.test.js
packages/lib/services/interop/InteropService_Importer_Md_frontmatter.js
packages/lib/services/interop/InteropService_Importer_OneNote.test.js
packages/lib/services/interop/InteropService_Importer_OneNote.js
packages/lib/services/interop/InteropService_Importer_Raw.test.js
packages/lib/services/interop/InteropService_Importer_Raw.js
packages/lib/services/interop/Module.test.js
Expand Down
1 change: 0 additions & 1 deletion .github/scripts/run_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ echo "IS_MACOS=$IS_MACOS"
echo "Node $( node -v )"
echo "Npm $( npm -v )"
echo "Yarn $( yarn -v )"
echo "Rust $( rustc --version )"

# =============================================================================
# Install packages
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ jobs:
node-version: '18'
cache: 'yarn'

- uses: dtolnay/rust-toolchain@stable

- name: Install Yarn
run: |
corepack enable
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/github-actions-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ jobs:
- uses: actions/checkout@v4
- uses: olegtarasov/[email protected]
- uses: dtolnay/rust-toolchain@stable
- uses: actions/setup-node@v4
with:
# We need to pin the version to 18.15, because 18.16+ fails with this error:
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -1151,8 +1151,6 @@ packages/lib/services/interop/InteropService_Importer_Md.test.js
packages/lib/services/interop/InteropService_Importer_Md.js
packages/lib/services/interop/InteropService_Importer_Md_frontmatter.test.js
packages/lib/services/interop/InteropService_Importer_Md_frontmatter.js
packages/lib/services/interop/InteropService_Importer_OneNote.test.js
packages/lib/services/interop/InteropService_Importer_OneNote.js
packages/lib/services/interop/InteropService_Importer_Raw.test.js
packages/lib/services/interop/InteropService_Importer_Raw.js
packages/lib/services/interop/Module.test.js
Expand Down
3 changes: 0 additions & 3 deletions Dockerfile.server
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ COPY packages/utils ./packages/utils
COPY packages/lib ./packages/lib
COPY packages/server ./packages/server

# We don't want to build onenote-converter since it is not used by the server
RUN sed --in-place '/onenote-converter/d' ./packages/lib/package.json

# For some reason there's both a .yarn/cache and .yarn/berry/cache that are
# being generated, and both have the same content. Not clear why it does this
# but we can delete it anyway. We can delete the cache because we use
Expand Down
3 changes: 0 additions & 3 deletions joplin.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
},
],
"settings": {
"rust-analyzer.linkedProjects": [
"./packages/onenote-converter/Cargo.toml",
],
"files.exclude": {
"_mydocs/mdtest/": true,
"_releases/": true,
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
42 changes: 0 additions & 42 deletions packages/app-cli/tests/support/onenote/many_svgs.html

This file was deleted.

Binary file not shown.
Binary file removed packages/app-cli/tests/support/onenote/subpages.zip
Binary file not shown.
Binary file not shown.

This file was deleted.

4 changes: 0 additions & 4 deletions packages/app-desktop/gui/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const { ResourceScreen } = require('./ResourceScreen.js');
import Navigator from './Navigator';
import WelcomeUtils from '@joplin/lib/WelcomeUtils';
import JoplinCloudLoginScreen from './JoplinCloudLoginScreen';
import InteropService from '@joplin/lib/services/interop/InteropService';
import WindowCommandsAndDialogs from './WindowCommandsAndDialogs/WindowCommandsAndDialogs';
import { defaultWindowId, stateUtils, WindowState } from '@joplin/lib/reducer';
import bridge from '../services/bridge';
Expand Down Expand Up @@ -92,9 +91,6 @@ async function initialize() {
type: 'NOTE_VISIBLE_PANES_SET',
panes: Setting.value('noteVisiblePanes'),
});

InteropService.instance().document = document;
InteropService.instance().xmlSerializer = new XMLSerializer();
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
Expand Down
15 changes: 2 additions & 13 deletions packages/lib/BaseModel.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import paginationToSql from './models/utils/paginationToSql';
import Database from './database';
import uuid from './uuid';
import time from './time';
import JoplinDatabase, { TableField } from './JoplinDatabase';
import { LoadOptions, SaveOptions } from './models/utils/types';
import ActionLogger, { ItemActionType as ItemActionType } from './utils/ActionLogger';
import { BaseItemEntity, SqlQuery } from './services/database/types';
import uuid from './uuid';
const Mutex = require('async-mutex').Mutex;

// New code should make use of this enum
Expand Down Expand Up @@ -80,8 +80,6 @@ class BaseModel {
['TYPE_COMMAND', ModelType.Command],
];

private static uuidGenerator: ()=> string = uuid.create;

public static TYPE_NOTE = ModelType.Note;
public static TYPE_FOLDER = ModelType.Folder;
public static TYPE_SETTING = ModelType.Setting;
Expand Down Expand Up @@ -578,7 +576,7 @@ class BaseModel {

if (options.isNew) {
if (this.useUuid() && !o.id) {
modelId = this.generateUuid();
modelId = uuid.create();
o.id = modelId;
}

Expand Down Expand Up @@ -759,15 +757,6 @@ class BaseModel {
return this.db_;
}

public static generateUuid() {
return this.uuidGenerator();
}

public static setIdGenerator(generator: ()=> string) {
const previous = this.uuidGenerator;
this.uuidGenerator = generator;
return previous;
}
// static isReady() {
// return !!this.db_;
// }
Expand Down
5 changes: 0 additions & 5 deletions packages/lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@
},
"devDependencies": {
"@testing-library/react-hooks": "8.0.1",
"@types/adm-zip": "0.5.5",
"@types/fs-extra": "11.0.4",
"@types/jest": "29.5.12",
"@types/js-yaml": "4.0.9",
"@types/jsdom": "21.1.6",
"@types/markdown-it": "13.0.9",
"@types/mustache": "4.2.5",
"@types/node": "18.19.42",
Expand All @@ -31,7 +29,6 @@
"canvas": "2.11.2",
"clean-html": "1.5.0",
"jest": "29.7.0",
"jsdom": "23.2.0",
"pdfjs-dist": "3.11.174",
"react": "18.3.1",
"react-test-renderer": "18.3.1",
Expand All @@ -47,13 +44,11 @@
"@joplin/fork-sax": "^1.2.56",
"@joplin/fork-uslug": "^1.0.17",
"@joplin/htmlpack": "~3.2",
"@joplin/onenote-converter": "0.0.1",
"@joplin/renderer": "~3.2",
"@joplin/turndown": "^4.0.74",
"@joplin/turndown-plugin-gfm": "^1.0.56",
"@joplin/utils": "~3.2",
"@types/nanoid": "3.0.0",
"adm-zip": "0.5.12",
"async-mutex": "0.5.0",
"base-64": "1.0.0",
"base64-stream": "1.0.0",
Expand Down
28 changes: 0 additions & 28 deletions packages/lib/services/interop/InteropService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ export default class InteropService {
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
private eventEmitter_: any = null;
private static instance_: InteropService;
private document_: Document;
private xmlSerializer_: XMLSerializer;

public static instance(): InteropService {
if (!this.instance_) this.instance_ = new InteropService();
Expand Down Expand Up @@ -135,14 +133,6 @@ export default class InteropService {
isNoteArchive: false, // Tells whether the file can contain multiple notes (eg. Enex or Jex format)
description: _('Text document'),
}, () => new InteropService_Importer_Md()),

makeImportModule({
format: 'zip',
fileExtensions: ['zip'],
sources: [FileSystemItem.File],
isNoteArchive: false, // Tells whether the file can contain multiple notes (eg. Enex or Jex format)
description: _('OneNote Notebook'),
}, dynamicRequireModuleFactory('./InteropService_Importer_OneNote')),
];

const exportModules = [
Expand Down Expand Up @@ -199,22 +189,6 @@ export default class InteropService {
this.eventEmitter_.emit('modulesChanged');
}

public set xmlSerializer(xmlSerializer: XMLSerializer) {
this.xmlSerializer_ = xmlSerializer;
}

public get xmlSerializer() {
return this.xmlSerializer_;
}

public set document(document: Document) {
this.document_ = document;
}

public get document() {
return this.document_;
}

// Find the module that matches the given type ("importer" or "exporter")
// and the given format. Some formats can have multiple associated importers
// or exporters, such as ENEX. In this case, the one marked as "isDefault"
Expand Down Expand Up @@ -299,8 +273,6 @@ export default class InteropService {
format: 'auto',
destinationFolderId: null,
destinationFolder: null,
xmlSerializer: this.xmlSerializer,
document: this.document,
...options,
};

Expand Down
Loading

0 comments on commit 33942d4

Please sign in to comment.