Skip to content

Commit a4a27ab

Browse files
Fix importing issues with the AutoNumeric library
Complete the documentation on how to install and use the component Add a link to the examples page and its source in the Readme Fix the example script imports by removing the unneeded AutoNumeric link Signed-off-by: Alexandre Bonneau <[email protected]>
1 parent c013bb4 commit a4a27ab

10 files changed

+179
-29
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
## Changelog for vue-autoNumeric
22

3+
### 1.0.3
4+
+ Fix importing issues with the `AutoNumeric` library
5+
+ Complete the documentation on how to install and use the component
6+
+ Add a link to the examples page and its source in the Readme
7+
+ Fix the example script imports by removing the unneeded AutoNumeric link
8+
+ Fix issue #4 Error when building with webpack 2 on linux
9+
310
### 1.0.2
411
+ Fix issue #3 Update the value when the `:options` prop is modified
512

README.md

+15-5
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,31 @@ yarn add vue-autonumeric
2424
npm install vue-autonumeric --save
2525
```
2626

27-
You also need to link the [AutoNumeric](https://github.com/autoNumeric/autoNumeric/) library in your html `<head>` tag since `vue-autonumeric` does not bundle it.
28-
You can link AutoNumeric either with a CDN like so:
27+
*Note: In order to minimize the size of the vue-autoNumeric component, the AutoNumeric library dependency **is not** bundled with it.*
28+
29+
This means you **need** to link the [AutoNumeric](https://github.com/autoNumeric/autoNumeric/) library with either ways:
30+
31+
#### ...in your html `<head>` tag
32+
In the html `<head>` tag directly, or by using a CDN like so:
33+
2934
```html
35+
<script src="../node_modules/autonumeric/dist/autonumeric.min.js"></script>
36+
<!-- or -->
3037
<script src="//unpkg.com/autonumeric"></script>
3138
```
3239

33-
...or by importing it too in your source code:
40+
#### ...or by importing it directly as a module
41+
You can choose to directly import the `AutoNumeric` library in your source code using:
3442

3543
```sh
3644
yarn add autonumeric
3745
# or
3846
npm install autonumeric --save
3947
```
4048

41-
You'll then be able to use the vue-autonumeric component:
49+
You'll then be able to use the `vue-autonumeric` component in your scripts using:
4250
```js
43-
import AutoNumeric from 'AutoNumeric';
51+
import AutoNumeric from 'autonumeric';
4452
import VueAutonumeric from 'vue-autonumeric';
4553
```
4654

@@ -120,6 +128,8 @@ The official AutoNumeric [documentation](http://autonumeric.org/#/guide) is usin
120128
<br>
121129
An editable live example is available [on Codepen](https://codepen.io/AnotherLinuxUser/pen/pWgOrZ?editors=1010).
122130

131+
Moreover, you can check the [shipped examples](https://github.com/autoNumeric/vue-autoNumeric/blob/master/examples/index.html) in your browser, and study its [source here](https://github.com/autoNumeric/vue-autoNumeric/tree/master/examples-src).
132+
123133
### Requirements
124134

125135
- [AutoNumeric](https://github.com/autoNumeric/autoNumeric) `^v4`

build/webpack.base.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@ module.exports = {
6868
timings : true,
6969
},
7070

71-
// cf. https://webpack.js.org/configuration/externals/
7271
externals: {
72+
// This prevent bundling the AutoNumeric library inside the vue-autornumeric component
73+
// cf. https://webpack.js.org/configuration/externals/
7374
AutoNumeric: 'autonumeric',
7475
},
7576
};

dist/vue-autonumeric.js

+145-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-autonumeric.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/examples.bundle.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/index.html

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
</head>
2222
<body>
2323
<div id="app"></div>
24-
<script src="//unpkg.com/autonumeric"></script>
2524
<script src="examples.bundle.js"></script>
2625
</body>
2726
</html>

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-autonumeric",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "An AutoNumeric wrapper for Vue.js",
55
"author": "Alexandre Bonneau <[email protected]>",
66
"license": "MIT",
@@ -39,7 +39,7 @@
3939
"components"
4040
],
4141
"dependencies": {
42-
"autonumeric": "^4.1.0-beta.8"
42+
"autonumeric": "^4.1.0-beta.16"
4343
},
4444
"devDependencies": {
4545
"autoprefixer": "^6.7.7",

src/components/VueAutonumeric.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!--
22
vue-autonumeric
33

4-
@version 1.0.0
4+
@version 1.0.3
55
@date 2017-09-19 UTC 08:00
66

77
@author Alexandre Bonneau
@@ -54,7 +54,7 @@ OTHER DEALINGS IN THE SOFTWARE.
5454
</template>
5555

5656
<script type="text/babel">
57-
import AutoNumeric from 'AutoNumeric';
57+
import AutoNumeric from 'autonumeric';
5858

5959
// Custom default autoNumeric option can be set here to override the default autoNumeric ones
6060
const defaultOptions = {};

yarn.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,9 @@ asynckit@^0.4.0:
228228
version "0.4.0"
229229
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
230230

231-
autonumeric@^4.1.0-beta.8:
232-
version "4.1.0-beta.8"
233-
resolved "https://registry.yarnpkg.com/autonumeric/-/autonumeric-4.1.0-beta.8.tgz#6b8c5118e6adce14bd0f07673f71464ee63d645a"
231+
autonumeric@^4.1.0-beta.16:
232+
version "4.1.0-beta.16"
233+
resolved "https://registry.yarnpkg.com/autonumeric/-/autonumeric-4.1.0-beta.16.tgz#7727c93c0aa41f4c50b43023e89b46aca8b21475"
234234

235235
autoprefixer@^6.3.1, autoprefixer@^6.7.7:
236236
version "6.7.7"

0 commit comments

Comments
 (0)