diff --git a/package-lock.json b/package-lock.json index a6fe2a1a..f99859f6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ "@freearhey/chronos": "^0.0.1", "@freearhey/core": "^0.14.3", "@freearhey/search-js": "^0.2.0", + "@freearhey/storage-js": "^0.2.0", "@ntlab/sfetch": "^1.2.0", "@octokit/core": "^7.0.5", "@octokit/plugin-paginate-rest": "^13.2.1", @@ -90,9 +91,6 @@ "unzipit": "^1.4.3", "uuid": "^13.0.0", "wildcard-match": "^5.1.4" - }, - "devDependencies": { - "@freearhey/storage-js": "^0.2.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -1212,7 +1210,6 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/@freearhey/storage-js/-/storage-js-0.2.0.tgz", "integrity": "sha512-IPFeOqE6/N8CdCxld5q4/eYR71eysn3FOizRmN3PGLUcnR3QiMjoYC/CwKFJYGuYs1CTK8pGTvik4d/WqIiDqg==", - "dev": true, "license": "MIT", "dependencies": { "@types/fs-extra": "^11.0.4", @@ -12609,7 +12606,6 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/@freearhey/storage-js/-/storage-js-0.2.0.tgz", "integrity": "sha512-IPFeOqE6/N8CdCxld5q4/eYR71eysn3FOizRmN3PGLUcnR3QiMjoYC/CwKFJYGuYs1CTK8pGTvik4d/WqIiDqg==", - "dev": true, "requires": { "@types/fs-extra": "^11.0.4", "fs-extra": "^11.3.1", diff --git a/package.json b/package.json index 6de1887e..918da0b3 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ ], "testTimeout": 10000, "transformIgnorePatterns": [ - "/node_modules/(?!parse-duration/.*|@freearhey/core/.*|glob/.*|srcset/.*|balanced-match/.*|minimatch/.*)" + "/node_modules/(?!parse-duration/.*|glob/.*|srcset/.*|balanced-match/.*|minimatch/.*)" ] }, "dependencies": { @@ -42,6 +42,7 @@ "@freearhey/chronos": "^0.0.1", "@freearhey/core": "^0.14.3", "@freearhey/search-js": "^0.2.0", + "@freearhey/storage-js": "^0.2.0", "@ntlab/sfetch": "^1.2.0", "@octokit/core": "^7.0.5", "@octokit/plugin-paginate-rest": "^13.2.1", @@ -118,8 +119,5 @@ "unzipit": "^1.4.3", "uuid": "^13.0.0", "wildcard-match": "^5.1.4" - }, - "devDependencies": { - "@freearhey/storage-js": "^0.2.0" } } diff --git a/scripts/commands/api/generate.ts b/scripts/commands/api/generate.ts index 8fd2f068..17b03aa3 100644 --- a/scripts/commands/api/generate.ts +++ b/scripts/commands/api/generate.ts @@ -1,4 +1,5 @@ -import { Logger, Collection, Storage } from '@freearhey/core' +import { Logger, Collection } from '@freearhey/core' +import { Storage } from '@freearhey/storage-js' import { SITES_DIR, API_DIR } from '../../constants' import { GuideChannel } from '../../models' import { ChannelsParser } from '../../core' diff --git a/scripts/commands/channels/edit.ts b/scripts/commands/channels/edit.ts index 3618fbff..8298343a 100644 --- a/scripts/commands/channels/edit.ts +++ b/scripts/commands/channels/edit.ts @@ -1,4 +1,5 @@ -import { Storage, Collection, Logger, Dictionary } from '@freearhey/core' +import { Collection, Logger, Dictionary } from '@freearhey/core' +import { Storage } from '@freearhey/storage-js' import type { DataProcessorData } from '../../types/dataProcessor' import type { DataLoaderData } from '../../types/dataLoader' import { ChannelSearchableData } from '../../types/channel' diff --git a/scripts/commands/channels/parse.ts b/scripts/commands/channels/parse.ts index 8ada776e..fa0fa35d 100644 --- a/scripts/commands/channels/parse.ts +++ b/scripts/commands/channels/parse.ts @@ -1,4 +1,5 @@ -import { Logger, File, Storage } from '@freearhey/core' +import { Logger } from '@freearhey/core' +import { Storage, File } from '@freearhey/storage-js' import { ChannelsParser } from '../../core' import { ChannelList } from '../../models' import { pathToFileURL } from 'node:url' diff --git a/scripts/commands/epg/grab.ts b/scripts/commands/epg/grab.ts index 9e111294..6c8cc8f2 100644 --- a/scripts/commands/epg/grab.ts +++ b/scripts/commands/epg/grab.ts @@ -1,4 +1,5 @@ -import { Logger, Timer, Storage, Collection } from '@freearhey/core' +import { Logger, Timer, Collection } from '@freearhey/core' +import { Storage } from '@freearhey/storage-js' import { QueueCreator, Job, ChannelsParser } from '../../core' import { Option, program } from 'commander' import { SITES_DIR } from '../../constants' diff --git a/scripts/commands/sites/init.ts b/scripts/commands/sites/init.ts index 9d3a34a8..44afd09b 100644 --- a/scripts/commands/sites/init.ts +++ b/scripts/commands/sites/init.ts @@ -1,4 +1,5 @@ -import { Logger, Storage } from '@freearhey/core' +import { Logger } from '@freearhey/core' +import { Storage } from '@freearhey/storage-js' import { SITES_DIR } from '../../constants' import { pathToFileURL } from 'node:url' import { program } from 'commander' diff --git a/scripts/commands/sites/update.ts b/scripts/commands/sites/update.ts index e1e1ef21..889f12fe 100644 --- a/scripts/commands/sites/update.ts +++ b/scripts/commands/sites/update.ts @@ -1,5 +1,6 @@ import { IssueLoader, HTMLTable, ChannelsParser } from '../../core' -import { Logger, Storage, Collection } from '@freearhey/core' +import { Logger, Collection } from '@freearhey/core' +import { Storage } from '@freearhey/storage-js' import { ChannelList, Issue, Site } from '../../models' import { SITES_DIR, ROOT_DIR } from '../../constants' import { Channel } from 'epg-grabber' diff --git a/scripts/core/channelsParser.ts b/scripts/core/channelsParser.ts index d47aee7d..1ddcdfd2 100644 --- a/scripts/core/channelsParser.ts +++ b/scripts/core/channelsParser.ts @@ -1,5 +1,5 @@ -import { parseChannels } from 'epg-grabber' -import { Storage } from '@freearhey/core' +import { EPGGrabber } from 'epg-grabber' +import { Storage } from '@freearhey/storage-js' import { ChannelList } from '../models' interface ChannelsParserProps { @@ -15,7 +15,7 @@ export class ChannelsParser { async parse(filepath: string): Promise { const content = await this.storage.load(filepath) - const parsed = parseChannels(content) + const parsed = EPGGrabber.parseChannelsXML(content) return new ChannelList({ channels: parsed }) } diff --git a/scripts/core/dataLoader.ts b/scripts/core/dataLoader.ts index 9f4c4cfb..d46478df 100644 --- a/scripts/core/dataLoader.ts +++ b/scripts/core/dataLoader.ts @@ -1,6 +1,6 @@ import type { DataLoaderProps, DataLoaderData } from '../types/dataLoader' import cliProgress, { MultiBar } from 'cli-progress' -import { Storage } from '@freearhey/core' +import { Storage } from '@freearhey/storage-js' import { ApiClient } from './apiClient' import numeral from 'numeral' diff --git a/scripts/core/guideManager.ts b/scripts/core/guideManager.ts index ea97d631..a84304ac 100644 --- a/scripts/core/guideManager.ts +++ b/scripts/core/guideManager.ts @@ -1,4 +1,5 @@ -import { Collection, Logger, Zip, Storage, StringTemplate } from '@freearhey/core' +import { Collection, Logger, Zip, StringTemplate } from '@freearhey/core' +import { Storage } from '@freearhey/storage-js' import epgGrabber from 'epg-grabber' import { OptionValues } from 'commander' import { Channel, Feed, Guide } from '../models'