tweakpane-plugin-file-import
Advanced tools
Comparing version 0.1.6 to 1.0.1
{ | ||
"name": "tweakpane-plugin-file-import", | ||
"version": "0.1.6", | ||
"version": "1.0.1", | ||
"description": "A general-purpose and simple file input Tweakpane plugin", | ||
@@ -18,9 +18,10 @@ "homepage": "https://github.com/LuchoTurtle/tweakpane-plugin-file-import", | ||
"scripts": { | ||
"release": "release-it", | ||
"prepare": "run-s clean build", | ||
"prepublishOnly": "npm test", | ||
"start": "npm run watch", | ||
"start": "run-p watch server", | ||
"test": "eslint --ext .ts \"src/**/*.ts\"", | ||
"assets": "run-s clean build assets:version assets:zip", | ||
"assets:version": "node scripts/assets-append-version.js", | ||
"assets:zip": "zip -x \"*types*\" -j -r $(cat package.json | npx json name)-$(cat package.json | npx json version).zip dist", | ||
"assets:zip": "zip -x '*types*' -j -r $(node scripts/dist-name.js)-$(cat package.json | npx json version).zip dist", | ||
"clean": "rimraf dist *.tgz *.zip", | ||
@@ -31,6 +32,6 @@ "build": "run-p build:*", | ||
"build:prod": "rollup --config rollup.config.js --environment BUILD:production", | ||
"release": "release-it", | ||
"format": "run-p format:*", | ||
"format:scss": "prettier --parser scss --write \"src/sass/**/*.scss\"", | ||
"format:ts": "eslint --ext .ts --fix \"src/**/*.ts\"", | ||
"server": "http-server -c-1 -o /test/browser.html", | ||
"watch": "run-p watch:*", | ||
@@ -41,26 +42,19 @@ "watch:sass": "onchange --initial --kill \"src/sass/**/*.scss\" -- npm run build:dev", | ||
"devDependencies": { | ||
"@istanbuljs/nyc-config-typescript": "^1.0.2", | ||
"@rollup/plugin-alias": "^5.0.1", | ||
"@rollup/plugin-node-resolve": "^15.2.3", | ||
"@rollup/plugin-replace": "^5.0.5", | ||
"@rollup/plugin-typescript": "^11.1.5", | ||
"@tweakpane/core": "^1.1.4", | ||
"@types/jsdom": "^21.1.1", | ||
"@types/mocha": "^10.0.1", | ||
"@typescript-eslint/eslint-plugin": "^5.59.8", | ||
"@typescript-eslint/parser": "^5.59.8", | ||
"@rollup/plugin-alias": "^3.1.2", | ||
"@rollup/plugin-node-resolve": "^13.0.0", | ||
"@rollup/plugin-replace": "^2.4.1", | ||
"@rollup/plugin-typescript": "^8.2.0", | ||
"@tweakpane/core": "^2.0.1", | ||
"@typescript-eslint/eslint-plugin": "^6.14.0", | ||
"@typescript-eslint/parser": "6.14.0", | ||
"autoprefixer": "^10.2.4", | ||
"eslint": "^8.42.0", | ||
"eslint-config-prettier": "^9.0.0", | ||
"eslint": "^8.46.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-prettier": "^5.0.1", | ||
"eslint-plugin-simple-import-sort": "^10.0.0", | ||
"install": "^0.13.0", | ||
"jsdom": "^23.0.1", | ||
"mocha": "^10.2.0", | ||
"npm": "^10.2.4", | ||
"http-server": "^14.1.1", | ||
"npm-run-all": "^4.1.5", | ||
"nyc": "^15.1.0", | ||
"onchange": "^7.1.0", | ||
"postcss": "^8.2.6", | ||
"prettier": "3.1.0", | ||
"prettier": "^3.1.1", | ||
"release-it": "^17.0.0", | ||
@@ -72,8 +66,8 @@ "rimraf": "^3.0.2", | ||
"sass": "^1.49.9", | ||
"ts-mocha": "^10.0.0", | ||
"typescript": "^5.3.2" | ||
"tweakpane": "^4.0.0", | ||
"typescript": "^4.9.5" | ||
}, | ||
"peerDependencies": { | ||
"tweakpane": "^3.1.4" | ||
"tweakpane": "^4.0.0" | ||
} | ||
} |
@@ -11,14 +11,33 @@ # `tweakpane-plugin-file-import` | ||
> [!WARNING] | ||
> | ||
> This branch pertains the `v0` of this package. | ||
> This version is meant to add support to those that still use `Tweakpane v3`. | ||
> | ||
> If you are using `Tweakpane v4` (which you should upgrade to), | ||
> go ahead and check out the `main` branch | ||
> and install the latest version of this package. | ||
> The version `1.0.0` and upwards of this package | ||
> only supports `Tweakpane v4`. | ||
> | ||
> If you are still using `Tweakpane v3`, | ||
> **you can only use the `v0` of this package**. | ||
> | ||
> | ||
> You can install it. | ||
> | ||
> ```sh | ||
> npm i tweakpane-plugin-file-import@0.1.4 | ||
> ``` | ||
> | ||
> And use it like so. | ||
> | ||
> ```html | ||
> <script src="https://unpkg.com/tweakpane@3.0.5/dist/tweakpane.js"></script> | ||
> <script src="./tweakpane-plugin-file-import.min.js"></script> | ||
> <script> | ||
> const pane = new Tweakpane.Pane(); | ||
> pane.registerPlugin(TweakpaneFileImportPlugin); | ||
> </script> | ||
> ``` | ||
# Installation | ||
You need [Tweakpane v3](https://github.com/cocopon/tweakpane) to install this plugin. | ||
You need [Tweakpane `v4`](https://github.com/cocopon/tweakpane) to install this plugin. | ||
@@ -28,17 +47,4 @@ You may use https://unpkg.com/tweakpane-plugin-file-import to get the latest version | ||
## Browser | ||
You can install with `npm`: | ||
```html | ||
<script src="https://unpkg.com/tweakpane@3.0.5/dist/tweakpane.js"></script> | ||
<script src="./tweakpane-plugin-file-import.min.js"></script> | ||
<script> | ||
const pane = new Tweakpane.Pane(); | ||
pane.registerPlugin(TweakpaneFileImportPlugin); | ||
</script> | ||
``` | ||
## Package | ||
Alternatively, you can install with `npm`: | ||
```sh | ||
@@ -58,2 +64,7 @@ npm i tweakpane-plugin-file-import | ||
> [!TIP] | ||
> | ||
> Check [`test/browser.html`](/test/browser.html) for an example | ||
> of the plugin being used. | ||
## Usage | ||
@@ -68,2 +79,3 @@ | ||
// If you're using Tweakpane v3 ------- | ||
pane | ||
@@ -79,2 +91,13 @@ .addInput(params, 'file', { | ||
// If you're using Tweakpane v4 ------- | ||
pane | ||
.addBinding(params, 'file', { | ||
view: 'file-input', | ||
lineCount: 3, | ||
filetypes: ['.png', '.jpg'], | ||
}) | ||
.on('change', (ev) => { | ||
console.log(ev.value); | ||
}); | ||
``` | ||
@@ -93,6 +116,11 @@ | ||
If you want to contribute to this package, you are free to open a pull request. | ||
If you want to contribute to this package, you are free to open a pull request. 😊 | ||
### Quickstart | ||
> [!NOTE] | ||
> | ||
> You'll need to have `Node 16` or upwards installed | ||
> in order to properly install and run `package.json` script commands. | ||
Install dependencies: | ||
@@ -104,6 +132,6 @@ | ||
To build the source codes and watch changes, run: | ||
To build the source code and watch changes, run: | ||
```sh | ||
npm watch | ||
npm start | ||
``` | ||
@@ -110,0 +138,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
351619
25
7237
0
154
1