mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 16:53:24 +00:00
add simply library tests + fix umd and cjs mixup bug + simplify library paths
This commit is contained in:
@@ -3,7 +3,7 @@ module.exports = {
|
|||||||
browser: true,
|
browser: true,
|
||||||
},
|
},
|
||||||
extends: ['airbnb-base', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'],
|
extends: ['airbnb-base', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'],
|
||||||
ignorePatterns: ['lib/*', '/*.js', '/*.ts', '/**/*.test.ts'],
|
ignorePatterns: ['lib/*', '/*.js', '/*.ts', '/**/*.test.ts', 'test/*'],
|
||||||
parser: '@typescript-eslint/parser',
|
parser: '@typescript-eslint/parser',
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
project: './tsconfig.json',
|
project: './tsconfig.json',
|
||||||
|
@@ -3,17 +3,11 @@
|
|||||||
"version": "0.0.6",
|
"version": "0.0.6",
|
||||||
"description": "Package that contains all the providers of movie-web",
|
"description": "Package that contains all the providers of movie-web",
|
||||||
"main": "./lib/index.umd.js",
|
"main": "./lib/index.umd.js",
|
||||||
|
"module": "./lib/index.mjs",
|
||||||
"types": "./lib/index.d.ts",
|
"types": "./lib/index.d.ts",
|
||||||
"files": [
|
"files": [
|
||||||
"./lib"
|
"./lib"
|
||||||
],
|
],
|
||||||
"exports": {
|
|
||||||
".": {
|
|
||||||
"import": "./lib/index.mjs",
|
|
||||||
"require": "./lib/index.umd.js",
|
|
||||||
"types": "./lib/index.d.ts"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/movie-web/providers.git"
|
"url": "git+https://github.com/movie-web/providers.git"
|
||||||
|
@@ -1,7 +1,9 @@
|
|||||||
import { AES, enc } from 'crypto-js';
|
import crypto from 'crypto-js';
|
||||||
|
|
||||||
import { makeEmbed } from '@/providers/base';
|
import { makeEmbed } from '@/providers/base';
|
||||||
|
|
||||||
|
const { AES, enc } = crypto;
|
||||||
|
|
||||||
interface StreamRes {
|
interface StreamRes {
|
||||||
server: number;
|
server: number;
|
||||||
sources: string;
|
sources: string;
|
||||||
|
1
test/README.md
Normal file
1
test/README.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
This folder is only for simple library usage tests in `CJS` and `UMD`. Real unit tests are at `src/__test__`.
|
5
test/index.js
Normal file
5
test/index.js
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
const { makeProviders, makeStandardFetcher } = require('../lib/index.umd.js');
|
||||||
|
|
||||||
|
const providers = makeProviders({
|
||||||
|
fetcher: makeStandardFetcher(fetch),
|
||||||
|
});
|
5
test/index.mjs
Normal file
5
test/index.mjs
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
import { makeProviders, makeStandardFetcher } from '../lib/index.mjs';
|
||||||
|
|
||||||
|
const providers = makeProviders({
|
||||||
|
fetcher: makeStandardFetcher(fetch),
|
||||||
|
});
|
6
test/package.json
Normal file
6
test/package.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"scripts": {
|
||||||
|
"start:umd": "node index.mjs",
|
||||||
|
"start:cjs": "node index.js"
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user