Skip to content

Commit

Permalink
Remove babel. Update vite configs. (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
johndatserakis authored Mar 18, 2023
1 parent edf485f commit 2d0239c
Show file tree
Hide file tree
Showing 88 changed files with 4,852 additions and 8,456 deletions.
4 changes: 0 additions & 4 deletions .babelrc

This file was deleted.

2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.17.6
16.17.0
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# CHANGELOG.md

## 6.0.0

- Use vite for serving app and building library
- Remove rollup
- Remove babel
- Update package.json exports

## 5.0.8

- Fix index bug. Thank you @tasinttttttt.
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Or, you can include it through the browser.
<link
rel="stylesheet"
type="text/css"
href="https://unpkg.com/file-upload-with-preview/dist/file-upload-with-preview.min.css"
href="https://unpkg.com/file-upload-with-preview/dist/style.css"
/>

<script src="https://unpkg.com/file-upload-with-preview/dist/file-upload-with-preview.iife.js"></script>
Expand All @@ -43,11 +43,11 @@ Or, you can include it through the browser.

This is a simple frontend utility meant to help the file-upload process on your website.

It is written in pure JavaScript and has no dependencies. You can check out the live demo [here](https://johndatserakis.github.io/file-upload-with-preview).
It is written in pure JavaScript using TypeScript and has no dependencies. You can check out the live demo [here](https://johndatserakis.github.io/file-upload-with-preview).

For the most part, browsers do a good job of handling image-uploads. That being said - I find the ability to show our users a preview of their upload can go a long way in increasing the confidence in their upload.

file-upload-with-preview aims to address the issue of showing a preview of a user's uploaded image in a simple to use package.
`file-upload-with-preview` aims to address the issue of showing a preview of a user's uploaded image in a simple to use package.

## Features

Expand All @@ -63,16 +63,16 @@ file-upload-with-preview aims to address the issue of showing a preview of a use
This library looks for a specific HTML element to display the file-upload. Simply add the below `div` to your HTML. Make sure to populate your unique id in the `data-upload-id` attribute.

```html
<div class="custom-file-container" data-upload-id="myFirstImage"></div>
<div class="custom-file-container" data-upload-id="my-unique-id"></div>
```

Then, initialize your file-upload in the JavaScript like below:

```javascript
import { FileUploadWithPreview } from 'file-upload-with-preview';
import 'file-upload-with-preview/dist/file-upload-with-preview.min.css';
import 'file-upload-with-preview/dist/style.css';

const upload = new FileUploadWithPreview('myFirstImage');
const upload = new FileUploadWithPreview('my-unique-id');
```

If you're importing directly in the browser, use the following instead:
Expand All @@ -85,11 +85,11 @@ If you're importing directly in the browser, use the following instead:
<link
rel="stylesheet"
type="text/css"
href="https://unpkg.com/file-upload-with-preview/dist/file-upload-with-preview.min.css"
href="https://unpkg.com/file-upload-with-preview/dist/style.css"
/>
</head>
<body>
<div class="custom-file-container" data-upload-id="myFirstImage"></div>
<div class="custom-file-container" data-upload-id="my-unique-id"></div>
<script src="https://unpkg.com/file-upload-with-preview"></script>
</body>
</html>
Expand All @@ -98,7 +98,7 @@ If you're importing directly in the browser, use the following instead:
Then initialize like this:

```javascript
const upload = new FileUploadWithPreview.FileUploadWithPreview('myFirstImage');
const upload = new FileUploadWithPreview.FileUploadWithPreview('my-unique-id');
```

Then when you're ready to use the user's file for an API call or whatever, just access the user's uploaded file/files in the `cachedFileArray` property of your initialized object like this:
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions dist/constants/events.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
1 change: 1 addition & 0 deletions dist/constants/file.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
1 change: 1 addition & 0 deletions dist/constants/images.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
1 change: 1 addition & 0 deletions dist/constants/style.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
1 change: 1 addition & 0 deletions dist/constants/text.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions dist/file-upload-with-preview.cjs

Large diffs are not rendered by default.

1,360 changes: 0 additions & 1,360 deletions dist/file-upload-with-preview.cjs.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export interface Images {
*/
successVideoImage?: string;
}
export declare type PresetFiles = string[];
export type PresetFiles = string[];
/**
* Options to customize the library
*/
Expand Down Expand Up @@ -100,7 +100,7 @@ export interface Options {
*/
text?: Text;
}
export declare type RequiredOptions = Required<Options> & {
export type RequiredOptions = Required<Options> & {
images: Required<Images>;
text: Required<Text>;
};
Expand Down
1 change: 1 addition & 0 deletions dist/file-upload-with-preview.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1,351 changes: 0 additions & 1,351 deletions dist/file-upload-with-preview.esm.js

This file was deleted.

1,399 changes: 34 additions & 1,365 deletions dist/file-upload-with-preview.iife.js

Large diffs are not rendered by default.

Binary file added dist/file-upload-with-preview.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
231 changes: 231 additions & 0 deletions dist/file-upload-with-preview.js

Large diffs are not rendered by default.

120 changes: 0 additions & 120 deletions dist/file-upload-with-preview.min.css

This file was deleted.

1 change: 0 additions & 1 deletion dist/types/src/index.d.ts → dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import './index.scss';
export * from './constants/events';
export * from './constants/images';
export * from './file-upload-with-preview';
Expand Down
1 change: 1 addition & 0 deletions dist/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
1 change: 1 addition & 0 deletions dist/types/events.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions dist/types/example/index.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion dist/types/example/index.d.ts.map

This file was deleted.

3 changes: 0 additions & 3 deletions dist/types/jest/constants/file.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion dist/types/jest/constants/file.d.ts.map

This file was deleted.

1 change: 0 additions & 1 deletion dist/types/src/constants/events.d.ts.map

This file was deleted.

1 change: 0 additions & 1 deletion dist/types/src/constants/file.d.ts.map

This file was deleted.

1 change: 0 additions & 1 deletion dist/types/src/constants/images.d.ts.map

This file was deleted.

1 change: 0 additions & 1 deletion dist/types/src/constants/style.d.ts.map

This file was deleted.

1 change: 0 additions & 1 deletion dist/types/src/constants/text.d.ts.map

This file was deleted.

1 change: 0 additions & 1 deletion dist/types/src/file-upload-with-preview.d.ts.map

This file was deleted.

2 changes: 0 additions & 2 deletions dist/types/src/file-upload-with-preview.spec.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion dist/types/src/file-upload-with-preview.spec.d.ts.map

This file was deleted.

1 change: 0 additions & 1 deletion dist/types/src/index.d.ts.map

This file was deleted.

1 change: 0 additions & 1 deletion dist/types/src/types/events.d.ts.map

This file was deleted.

1 change: 0 additions & 1 deletion dist/types/src/utils/file.d.ts.map

This file was deleted.

File renamed without changes.
1 change: 1 addition & 0 deletions dist/utils/file.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes
34 changes: 34 additions & 0 deletions docs/assets/index-4b89c21a.js

Large diffs are not rendered by default.

File renamed without changes.
34 changes: 0 additions & 34 deletions docs/assets/index.27d13032.js

This file was deleted.

Loading

0 comments on commit 2d0239c

Please sign in to comment.