@iconify/tools 2.1.0-beta.2 → 2.1.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -33,7 +33,6 @@ require('stream');
33
33
  require('extract-zip');
34
34
  require('tar');
35
35
  require('@iconify/utils/lib/colors');
36
- require('local-pkg');
37
36
 
38
37
  async function downloadGitRepo(options) {
39
38
  const { remote, branch } = options;
@@ -29,7 +29,6 @@ import 'stream';
29
29
  import 'extract-zip';
30
30
  import 'tar';
31
31
  import '@iconify/utils/lib/colors';
32
- import 'local-pkg';
33
32
 
34
33
  async function downloadGitRepo(options) {
35
34
  const { remote, branch } = options;
@@ -23,7 +23,6 @@ require('../api/download.cjs');
23
23
  require('extract-zip');
24
24
  require('tar');
25
25
  require('@iconify/utils/lib/colors');
26
- require('local-pkg');
27
26
  require('../../svg/parse.cjs');
28
27
  require('@iconify/utils/lib/misc/objects');
29
28
  require('path');
@@ -19,7 +19,6 @@ import '../api/download.mjs';
19
19
  import 'extract-zip';
20
20
  import 'tar';
21
21
  import '@iconify/utils/lib/colors';
22
- import 'local-pkg';
23
22
  import '../../svg/parse.mjs';
24
23
  import '@iconify/utils/lib/misc/objects';
25
24
  import 'path';
@@ -42,7 +42,6 @@ require('../icon-set/props.cjs');
42
42
  require('@iconify/utils/lib/misc/objects');
43
43
  require('tar');
44
44
  require('@iconify/utils/lib/colors');
45
- require('local-pkg');
46
45
  require('./helpers/untar.cjs');
47
46
  require('./npm/version.cjs');
48
47
  require('./gitlab/hash.cjs');
@@ -38,7 +38,6 @@ import '../icon-set/props.mjs';
38
38
  import '@iconify/utils/lib/misc/objects';
39
39
  import 'tar';
40
40
  import '@iconify/utils/lib/colors';
41
- import 'local-pkg';
42
41
  import './helpers/untar.mjs';
43
42
  import './npm/version.mjs';
44
43
  import './gitlab/hash.mjs';
@@ -2,21 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const localPkg = require('local-pkg');
6
- const fs = require('fs');
5
+ require('local-pkg');
6
+ require('fs');
7
7
 
8
- let cache;
9
- async function getVersion() {
10
- const packageName = "@iconify/types/package.json";
11
- const filename = localPkg.resolveModule(packageName);
12
- if (!filename) {
13
- throw new Error(`Cannot resolve ${packageName}`);
14
- }
15
- const content = JSON.parse(await fs.promises.readFile(filename, "utf8"));
16
- return cache = content.version;
17
- }
18
8
  async function getTypesVersion() {
19
- return cache || await getVersion();
9
+ throw new Error(`getTypesVersion() is deprecated, use wildcard to make packages work with all versions`);
20
10
  }
21
11
 
22
12
  exports.getTypesVersion = getTypesVersion;
@@ -1,18 +1,8 @@
1
- import { resolveModule } from 'local-pkg';
2
- import { promises } from 'fs';
1
+ import 'local-pkg';
2
+ import 'fs';
3
3
 
4
- let cache;
5
- async function getVersion() {
6
- const packageName = "@iconify/types/package.json";
7
- const filename = resolveModule(packageName);
8
- if (!filename) {
9
- throw new Error(`Cannot resolve ${packageName}`);
10
- }
11
- const content = JSON.parse(await promises.readFile(filename, "utf8"));
12
- return cache = content.version;
13
- }
14
4
  async function getTypesVersion() {
15
- return cache || await getVersion();
5
+ throw new Error(`getTypesVersion() is deprecated, use wildcard to make packages work with all versions`);
16
6
  }
17
7
 
18
8
  export { getTypesVersion };
@@ -5,10 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const fs = require('fs');
6
6
  const export_helpers_prepare = require('./helpers/prepare.cjs');
7
7
  const misc_writeJson = require('../misc/write-json.cjs');
8
- const export_helpers_typesVersion = require('./helpers/types-version.cjs');
9
8
  const export_helpers_customFiles = require('./helpers/custom-files.cjs');
10
9
  require('pathe');
11
- require('local-pkg');
12
10
 
13
11
  const defaultTypesContent = `import type { IconifyIcon } from '@iconify/types';
14
12
  declare const data: IconifyIcon;
@@ -48,7 +46,7 @@ async function exportIconPackage(iconSet, options) {
48
46
  iconSetInfo: info,
49
47
  ...customPackageProps,
50
48
  dependencies: dependencies || {
51
- "@iconify/types": "^" + await export_helpers_typesVersion.getTypesVersion()
49
+ "@iconify/types": "*"
52
50
  }
53
51
  };
54
52
  await misc_writeJson.writeJSONFile(dir + "/package.json", packageJSON);
@@ -1,10 +1,8 @@
1
1
  import { promises } from 'fs';
2
2
  import { prepareDirectoryForExport } from './helpers/prepare.mjs';
3
3
  import { writeJSONFile } from '../misc/write-json.mjs';
4
- import { getTypesVersion } from './helpers/types-version.mjs';
5
4
  import { exportCustomFiles } from './helpers/custom-files.mjs';
6
5
  import 'pathe';
7
- import 'local-pkg';
8
6
 
9
7
  const defaultTypesContent = `import type { IconifyIcon } from '@iconify/types';
10
8
  declare const data: IconifyIcon;
@@ -44,7 +42,7 @@ async function exportIconPackage(iconSet, options) {
44
42
  iconSetInfo: info,
45
43
  ...customPackageProps,
46
44
  dependencies: dependencies || {
47
- "@iconify/types": "^" + await getTypesVersion()
45
+ "@iconify/types": "*"
48
46
  }
49
47
  };
50
48
  await writeJSONFile(dir + "/package.json", packageJSON);
@@ -6,10 +6,8 @@ const fs = require('fs');
6
6
  const defaults = require('@iconify/utils/lib/icon/defaults');
7
7
  const export_helpers_prepare = require('./helpers/prepare.cjs');
8
8
  const misc_writeJson = require('../misc/write-json.cjs');
9
- const export_helpers_typesVersion = require('./helpers/types-version.cjs');
10
9
  const export_helpers_customFiles = require('./helpers/custom-files.cjs');
11
10
  require('pathe');
12
- require('local-pkg');
13
11
 
14
12
  const exportTypes = {
15
13
  icons: "IconifyJSON",
@@ -76,7 +74,7 @@ async function exportJSONPackage(iconSet, options) {
76
74
  exports: packageJSONExports,
77
75
  iconSet: packageJSONIconSet,
78
76
  dependencies: dependencies || {
79
- "@iconify/types": "^" + await export_helpers_typesVersion.getTypesVersion()
77
+ "@iconify/types": "*"
80
78
  }
81
79
  };
82
80
  const dtsContent = [];
@@ -2,10 +2,8 @@ import { promises } from 'fs';
2
2
  import { defaultIconDimensions } from '@iconify/utils/lib/icon/defaults';
3
3
  import { prepareDirectoryForExport } from './helpers/prepare.mjs';
4
4
  import { writeJSONFile } from '../misc/write-json.mjs';
5
- import { getTypesVersion } from './helpers/types-version.mjs';
6
5
  import { exportCustomFiles } from './helpers/custom-files.mjs';
7
6
  import 'pathe';
8
- import 'local-pkg';
9
7
 
10
8
  const exportTypes = {
11
9
  icons: "IconifyJSON",
@@ -72,7 +70,7 @@ async function exportJSONPackage(iconSet, options) {
72
70
  exports: packageJSONExports,
73
71
  iconSet: packageJSONIconSet,
74
72
  dependencies: dependencies || {
75
- "@iconify/types": "^" + await getTypesVersion()
73
+ "@iconify/types": "*"
76
74
  }
77
75
  };
78
76
  const dtsContent = [];
package/lib/index.cjs CHANGED
@@ -83,10 +83,8 @@ require('stream');
83
83
  require('extract-zip');
84
84
  require('tar');
85
85
  require('@iconify/utils/lib/colors');
86
- require('local-pkg');
87
86
  require('./download/gitlab/types.cjs');
88
87
  require('./colors/attribs.cjs');
89
- require('./export/helpers/types-version.cjs');
90
88
  require('./export/helpers/custom-files.cjs');
91
89
 
92
90
 
package/lib/index.mjs CHANGED
@@ -79,8 +79,6 @@ import 'stream';
79
79
  import 'extract-zip';
80
80
  import 'tar';
81
81
  import '@iconify/utils/lib/colors';
82
- import 'local-pkg';
83
82
  import './download/gitlab/types.mjs';
84
83
  import './colors/attribs.mjs';
85
- import './export/helpers/types-version.mjs';
86
84
  import './export/helpers/custom-files.mjs';
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "type": "module",
4
4
  "description": "Collection of functions for cleaning up and parsing SVG for Iconify project",
5
5
  "author": "Vjacheslav Trushkin",
6
- "version": "2.1.0-beta.2",
6
+ "version": "2.1.0-beta.3",
7
7
  "license": "MIT",
8
8
  "bugs": "https://github.com/iconify/tools/issues",
9
9
  "homepage": "https://github.com/iconify/tools",