Skip to content

Commit dbbc970

Browse files
Removes nanoid and is-url dependencies for full esm support
1 parent 10ab31b commit dbbc970

File tree

11 files changed

+144
-117
lines changed

11 files changed

+144
-117
lines changed

build/rollup.config.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,11 @@ export default {
1212
exports: 'default',
1313
globals: {
1414
'is-plain-object': 'isPlainObject',
15-
'nanoid/non-secure': 'nanoid',
16-
'is-url': 'isUrl',
1715
'@braid/vue-formulate-i18n': 'VueFormulateI18n'
1816
},
1917
sourcemap: false
2018
}
2119
],
22-
external: ['nanoid/non-secure'],
2320
plugins: [
2421
commonjs(),
2522
autoExternal(),

build/rollup.iife.config.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ export default {
1313
format: 'iife',
1414
globals: {
1515
'is-plain-object': 'isPlainObject',
16-
'nanoid/non-secure': 'nanoid',
17-
'is-url': 'isUrl',
1816
'@braid/vue-formulate-i18n': 'VueFormulateI18n'
1917
}
2018
},
@@ -24,7 +22,7 @@ export default {
2422
preferBuiltins: false
2523
}),
2624
commonjs(),
27-
internal(['is-plain-object', 'nanoid/non-secure', 'is-url', '@braid/vue-formulate-i18n']),
25+
internal(['is-plain-object', '@braid/vue-formulate-i18n']),
2826
vue({
2927
css: true, // Dynamically inject css as a <style> tag
3028
compileTemplate: true // Explicitly convert template to render function

dist/formulate.esm.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/formulate.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/formulate.umd.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/FormulateSpecimens.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@
4141
</template>
4242

4343
<script>
44-
import { has } from '../src/libs/utils'
45-
import nanoid from 'nanoid/non-secure'
44+
import { has, token } from '../src/libs/utils'
4645
import SpecimenText from './specimens/SpecimenText'
4746
import SpecimenTextarea from './specimens/SpecimenTextarea'
4847
import SpecimenGroup from './specimens/SpecimenGroup'
@@ -81,7 +80,7 @@ export default {
8180
methods: {
8281
showTest (data) {
8382
if (data.component) {
84-
this.testKey = nanoid(5)
83+
this.testKey = token(5)
8584
this.test = data
8685
if (has(data, 'value')) {
8786
this.provingGroundValue = data.value

package-lock.json

Lines changed: 81 additions & 89 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@
9494
},
9595
"dependencies": {
9696
"@braid/vue-formulate-i18n": "^1.16.0",
97-
"is-plain-object": "^3.0.1",
98-
"is-url": "^1.2.4",
99-
"nanoid": "^2.1.11"
97+
"is-plain-object": "^3.0.1"
10098
}
10199
}

src/FileUpload.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import nanoid from 'nanoid/non-secure'
2-
import { setId } from './libs/utils'
1+
import { setId, token } from './libs/utils'
32

43
/**
54
* The file upload class holds and represents a file’s upload state durring
@@ -62,7 +61,7 @@ class FileUpload {
6261
addFileList (fileList) {
6362
for (let i = 0; i < fileList.length; i++) {
6463
const file = fileList[i]
65-
const uuid = nanoid()
64+
const uuid = token()
6665
const removeFile = function () {
6766
this.removeFile(uuid)
6867
}

src/libs/rules.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import isUrl from 'is-url'
21
import FileUpload from '../FileUpload'
3-
import { equals, regexForFormat, isEmpty } from './utils'
2+
import { equals, regexForFormat, isEmpty, isUrl } from './utils'
43

54
/**
65
* Library of rules

0 commit comments

Comments
 (0)