Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove last circular dep #19263

Merged
merged 1 commit into from Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/providers/upload-local/package.json
Expand Up @@ -48,7 +48,7 @@
},
"devDependencies": {
"@strapi/pack-up": "4.17.1",
"@strapi/plugin-upload": "4.17.1",
"@strapi/types": "4.17.1",
"@types/jest": "29.5.2",
"eslint-config-custom": "4.17.1",
"memfs": "4.6.0",
Expand Down
Expand Up @@ -5,27 +5,26 @@ jest.mock('fs', () => fs);

import fse from 'fs-extra';

import type { File } from '@strapi/plugin-upload';

import localProvider from '../index';

describe('Local provider', () => {
beforeAll(() => {
globalThis.strapi = {};
globalThis.strapi.dirs = { static: { public: '' } };
global.strapi = {
dirs: { static: { public: '' } },
} as any;

fse.ensureDirSync('uploads');
});

afterAll(() => {
globalThis.strapi.dirs = undefined;
global.strapi.dirs = undefined as any;
});

describe('upload', () => {
test('Should have relative url to file object', async () => {
const providerInstance = localProvider.init({});

const file: File = {
const file = {
name: 'test',
size: 100,
url: '/',
Expand All @@ -34,7 +33,7 @@ describe('Local provider', () => {
ext: '.json',
mime: 'application/json',
buffer: Buffer.from(''),
};
} as any;

await providerInstance.upload(file);

Expand Down
2 changes: 0 additions & 2 deletions packages/providers/upload-local/src/global.d.ts

This file was deleted.

2 changes: 2 additions & 0 deletions packages/providers/upload-local/src/index.ts
Expand Up @@ -4,6 +4,8 @@ import path from 'path';
import fse from 'fs-extra';
import * as utils from '@strapi/utils';

import type {} from '@strapi/types';

interface File {
name: string;
alternativeText?: string;
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Expand Up @@ -10211,7 +10211,7 @@ __metadata:
resolution: "@strapi/provider-upload-local@workspace:packages/providers/upload-local"
dependencies:
"@strapi/pack-up": "npm:4.17.1"
"@strapi/plugin-upload": "npm:4.17.1"
"@strapi/types": "npm:4.17.1"
"@strapi/utils": "npm:4.17.1"
"@types/jest": "npm:29.5.2"
eslint-config-custom: "npm:4.17.1"
Expand Down