typesync 0.13.3 → 0.13.5-0

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.
Files changed (57) hide show
  1. package/README.md +23 -25
  2. package/bin/typesync +2 -2
  3. package/{lib → dist}/cli-util.d.ts +17 -17
  4. package/{lib → dist}/cli.d.ts +2 -2
  5. package/dist/cli.js +297 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/config-service.d.ts +11 -0
  8. package/dist/globber.d.ts +15 -0
  9. package/dist/index.d.ts +4 -0
  10. package/dist/index.js +3 -0
  11. package/dist/package-json-file-service.d.ts +15 -0
  12. package/dist/package-source.d.ts +25 -0
  13. package/dist/type-syncer-C_rkDNfx.js +320 -0
  14. package/dist/type-syncer-C_rkDNfx.js.map +1 -0
  15. package/dist/type-syncer.d.ts +13 -0
  16. package/dist/types.d.ts +103 -0
  17. package/dist/util.d.ts +53 -0
  18. package/dist/versioning.d.ts +14 -0
  19. package/dist/workspace-resolver.d.ts +75 -0
  20. package/package.json +33 -53
  21. package/lib/cli-util.js +0 -74
  22. package/lib/cli-util.js.map +0 -1
  23. package/lib/cli.js +0 -145
  24. package/lib/cli.js.map +0 -1
  25. package/lib/config-service.d.ts +0 -11
  26. package/lib/config-service.js +0 -61
  27. package/lib/config-service.js.map +0 -1
  28. package/lib/fs-utils.js +0 -28
  29. package/lib/fs-utils.js.map +0 -1
  30. package/lib/globber.d.ts +0 -15
  31. package/lib/globber.js +0 -43
  32. package/lib/globber.js.map +0 -1
  33. package/lib/index.d.ts +0 -4
  34. package/lib/index.js +0 -21
  35. package/lib/index.js.map +0 -1
  36. package/lib/package-json-file-service.d.ts +0 -15
  37. package/lib/package-json-file-service.js +0 -48
  38. package/lib/package-json-file-service.js.map +0 -1
  39. package/lib/package-source.d.ts +0 -25
  40. package/lib/package-source.js +0 -49
  41. package/lib/package-source.js.map +0 -1
  42. package/lib/type-syncer.d.ts +0 -13
  43. package/lib/type-syncer.js +0 -237
  44. package/lib/type-syncer.js.map +0 -1
  45. package/lib/types.d.ts +0 -103
  46. package/lib/types.js +0 -14
  47. package/lib/types.js.map +0 -1
  48. package/lib/util.d.ts +0 -53
  49. package/lib/util.js +0 -142
  50. package/lib/util.js.map +0 -1
  51. package/lib/versioning.d.ts +0 -14
  52. package/lib/versioning.js +0 -48
  53. package/lib/versioning.js.map +0 -1
  54. package/lib/workspace-resolver.d.ts +0 -79
  55. package/lib/workspace-resolver.js +0 -70
  56. package/lib/workspace-resolver.js.map +0 -1
  57. /package/{lib → dist}/fs-utils.d.ts +0 -0
@@ -1,25 +0,0 @@
1
- import type { IPackageVersionInfo } from './versioning';
2
- /**
3
- * Fetches info about a package.
4
- */
5
- export interface IPackageSource {
6
- /**
7
- * Fetches package info from an external source.
8
- *
9
- * @param packageName
10
- */
11
- fetch(this: void, packageName: string): Promise<IPackageInfo | null>;
12
- }
13
- /**
14
- * Interface for the Package Info structure.
15
- */
16
- export interface IPackageInfo {
17
- name: string;
18
- latestVersion: string;
19
- deprecated: boolean;
20
- versions: Array<IPackageVersionInfo>;
21
- }
22
- /**
23
- * Creates a package source.
24
- */
25
- export declare function createPackageSource(): IPackageSource;
@@ -1,49 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.createPackageSource = createPackageSource;
7
- const npm_registry_fetch_1 = __importDefault(require("npm-registry-fetch"));
8
- const semver_1 = require("semver");
9
- /**
10
- * Creates a package source.
11
- */
12
- function createPackageSource() {
13
- return {
14
- /**
15
- * Fetches info about a package, or `null` if not found.
16
- */
17
- fetch: async (name) => {
18
- const response = await (0, npm_registry_fetch_1.default)(encodeURI(name)).catch((err) => {
19
- if (err.statusCode === 404) {
20
- return null;
21
- }
22
- /* istanbul ignore next */
23
- throw err;
24
- });
25
- const data = await response?.json();
26
- if (!data?.versions) {
27
- return null;
28
- }
29
- const versionIdentifiers = Object.keys(data.versions)
30
- .sort(semver_1.compare)
31
- .reverse();
32
- const versions = versionIdentifiers.map((v) => {
33
- const item = data.versions[v];
34
- return {
35
- version: item.version,
36
- containsInternalTypings: !!item.types || !!item.typings,
37
- };
38
- });
39
- return {
40
- name: data.name,
41
- deprecated: Boolean(data.versions[versionIdentifiers[0]].deprecated),
42
- latestVersion: data['dist-tags'].latest,
43
- // Sort by version, highest version first.
44
- versions: versions,
45
- };
46
- },
47
- };
48
- }
49
- //# sourceMappingURL=package-source.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"package-source.js","sourceRoot":"","sources":["../src/package-source.ts"],"names":[],"mappings":";;;;;AA6BA,kDAyCC;AAtED,4EAAsC;AACtC,mCAAgC;AAyBhC;;GAEG;AACH,SAAgB,mBAAmB;IACjC,OAAO;QACL;;WAEG;QACH,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;YACpB,MAAM,QAAQ,GAAG,MAAM,IAAA,4BAAK,EAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;gBAC1D,IAAI,GAAG,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;oBAC3B,OAAO,IAAI,CAAA;gBACb,CAAC;gBAED,0BAA0B;gBAC1B,MAAM,GAAG,CAAA;YACX,CAAC,CAAC,CAAA;YAEF,MAAM,IAAI,GAAG,MAAM,QAAQ,EAAE,IAAI,EAAE,CAAA;YAEnC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC;gBACpB,OAAO,IAAI,CAAA;YACb,CAAC;YAED,MAAM,kBAAkB,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;iBAClD,IAAI,CAAC,gBAAO,CAAC;iBACb,OAAO,EAAE,CAAA;YACZ,MAAM,QAAQ,GAAG,kBAAkB,CAAC,GAAG,CAAsB,CAAC,CAAC,EAAE,EAAE;gBACjE,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;gBAC7B,OAAO;oBACL,OAAO,EAAE,IAAI,CAAC,OAAO;oBACrB,uBAAuB,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO;iBACxD,CAAA;YACH,CAAC,CAAC,CAAA;YAEF,OAAO;gBACL,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,UAAU,EAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;gBACpE,aAAa,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM;gBACvC,0CAA0C;gBAC1C,QAAQ,EAAE,QAAQ;aACnB,CAAA;QACH,CAAC;KACF,CAAA;AACH,CAAC"}
@@ -1,13 +0,0 @@
1
- import type { IConfigService } from './config-service';
2
- import type { IGlobber } from './globber';
3
- import type { IPackageJSONService } from './package-json-file-service';
4
- import type { IPackageSource } from './package-source';
5
- import { type ITypeSyncer } from './types';
6
- import type { IWorkspaceResolverService } from './workspace-resolver';
7
- /**
8
- * Creates a type syncer.
9
- *
10
- * @param packageJSONservice
11
- * @param typeDefinitionSource
12
- */
13
- export declare function createTypeSyncer(packageJSONService: IPackageJSONService, workspaceResolverService: IWorkspaceResolverService, packageSource: IPackageSource, configService: IConfigService, globber: IGlobber): ITypeSyncer;
@@ -1,237 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.createTypeSyncer = createTypeSyncer;
27
- const path = __importStar(require("node:path"));
28
- const types_1 = require("./types");
29
- const util_1 = require("./util");
30
- const versioning_1 = require("./versioning");
31
- /**
32
- * Creates a type syncer.
33
- *
34
- * @param packageJSONservice
35
- * @param typeDefinitionSource
36
- */
37
- function createTypeSyncer(packageJSONService, workspaceResolverService, packageSource, configService, globber) {
38
- const fetchPackageInfo = (0, util_1.memoizeAsync)(packageSource.fetch);
39
- return {
40
- sync,
41
- };
42
- /**
43
- * Syncs typings in the specified package.json.
44
- */
45
- async function sync(filePath, flags) {
46
- const dryRun = !!flags.dry;
47
- const syncOpts = await configService.readConfig(filePath, flags);
48
- const { file, subManifests } = await getManifests(filePath, globber, syncOpts.ignoreProjects ?? []);
49
- const syncedFiles = await Promise.all([
50
- syncFile(filePath, file, syncOpts, dryRun),
51
- ...subManifests.map((p) => syncFile(p, null, syncOpts, dryRun)),
52
- ]);
53
- return {
54
- syncedFiles,
55
- };
56
- }
57
- /**
58
- * Get the `package.json` files and sub-packages.
59
- *
60
- * @param filePath
61
- * @param globber
62
- */
63
- async function getManifests(filePath, globber, ignoredWorkspaces) {
64
- const file = await packageJSONService.readPackageFile(filePath);
65
- const subPackages = await workspaceResolverService.getWorkspaces(file, path.dirname(filePath), globber, ignoredWorkspaces);
66
- const subManifests = subPackages.map((p) => path.join(p, 'package.json'));
67
- return {
68
- file,
69
- subManifests,
70
- };
71
- }
72
- /**
73
- * Syncs a single file.
74
- *
75
- * @param filePath
76
- * @param file
77
- * @param allTypings
78
- * @param opts
79
- */
80
- async function syncFile(filePath, file, opts, dryRun) {
81
- const { ignoreDeps, ignorePackages } = opts;
82
- const packageFile = file ?? (await packageJSONService.readPackageFile(filePath));
83
- const allLocalPackages = Object.values(types_1.IDependencySection)
84
- .map((dep) => {
85
- const section = getDependenciesBySection(packageFile, dep);
86
- const ignoredSection = ignoreDeps?.includes(dep);
87
- return getPackagesFromSection(section, ignoredSection, ignorePackages);
88
- })
89
- .flat();
90
- const allPackageNames = (0, util_1.uniq)(allLocalPackages.map((p) => p.name));
91
- const potentiallyUntypedPackages = getPotentiallyUntypedPackages(allPackageNames);
92
- // This is pushed to in the inner `map`, because packages that have DT-typings
93
- // *as well* as internal typings should be excluded.
94
- const used = [];
95
- const devDepsToAdd = await Promise.all(potentiallyUntypedPackages.map(async (t) => {
96
- // Fetch the code package from the source.
97
- const typePackageInfoPromise = fetchPackageInfo(t.typesPackageName);
98
- const codePackageInfo = await fetchPackageInfo(t.codePackageName);
99
- // If the code package was not found, there's nothing else to do.
100
- if (!codePackageInfo) {
101
- return {};
102
- }
103
- const localCodePackage = allLocalPackages.find((p) => p.name === t.codePackageName);
104
- // Find the closest matching code package version relative to what's in our package.json
105
- const closestMatchingCodeVersion = (0, versioning_1.getClosestMatchingVersion)(codePackageInfo.versions, localCodePackage.version);
106
- // If the closest matching version contains internal typings, don't include it.
107
- if (closestMatchingCodeVersion.containsInternalTypings) {
108
- return {};
109
- }
110
- // Look for the closest matching typings package.
111
- const typePackageInfo = await typePackageInfoPromise;
112
- // If the types package was not found, or if it was deprecated, there's nothing else to do.
113
- if (!typePackageInfo || typePackageInfo.deprecated) {
114
- return {};
115
- }
116
- // Gets the closest matching typings version, or the newest one.
117
- const closestMatchingTypingsVersion = (0, versioning_1.getClosestMatchingVersion)(typePackageInfo.versions, localCodePackage.version);
118
- const version = closestMatchingTypingsVersion.version;
119
- const semverRangeSpecifier = '~';
120
- used.push(t);
121
- return {
122
- [t.typesPackageName]: semverRangeSpecifier + version,
123
- };
124
- })).then(util_1.mergeObjects);
125
- const devDeps = packageFile.devDependencies;
126
- if (!dryRun) {
127
- await packageJSONService.writePackageFile(filePath, {
128
- ...packageFile,
129
- devDependencies: (0, util_1.orderObject)({
130
- ...devDepsToAdd,
131
- ...devDeps,
132
- }),
133
- });
134
- }
135
- return {
136
- filePath,
137
- newTypings: used,
138
- package: packageFile,
139
- };
140
- }
141
- }
142
- /**
143
- * Returns an array of packages that do not have a `@types/` package.
144
- *
145
- * @param allPackageNames Used to filter the typings that are new.
146
- * @param allTypings All typings available
147
- */
148
- function getPotentiallyUntypedPackages(allPackageNames) {
149
- const existingTypings = allPackageNames.filter((x) => x.startsWith('@types/'));
150
- return (0, util_1.filterMap)(allPackageNames, (p) => {
151
- // Ignore typings packages themselves.
152
- if (p.startsWith('@types/')) {
153
- return false;
154
- }
155
- const typingsName = getTypingsName(p);
156
- const fullTypingsPackage = (0, util_1.typed)(p);
157
- const alreadyHasTyping = existingTypings.some((t) => t === fullTypingsPackage);
158
- if (alreadyHasTyping) {
159
- return false;
160
- }
161
- return {
162
- typingsName: typingsName,
163
- typesPackageName: fullTypingsPackage,
164
- codePackageName: p,
165
- };
166
- });
167
- }
168
- /**
169
- * Gets the typings name for the specified package name.
170
- * For example, `koa` would be `koa`, but `@koa/router` would be `koa__router`.
171
- *
172
- * @param packageName the package name to generate the typings name for
173
- */
174
- function getTypingsName(packageName) {
175
- const scopeInfo = getPackageScope(packageName);
176
- let typingsName = packageName;
177
- if (scopeInfo && scopeInfo[0] !== 'types') {
178
- typingsName = `${scopeInfo[0]}__${scopeInfo[1]}`;
179
- }
180
- return typingsName;
181
- }
182
- /**
183
- * If a package is scoped, returns the scope + package as a tuple, otherwise null.
184
- *
185
- * @param packageName Package name to check scope for.
186
- */
187
- function getPackageScope(packageName) {
188
- const EXPR = /^@([^/]+)\/(.*)$/i;
189
- const matches = EXPR.exec(packageName);
190
- if (!matches) {
191
- return null;
192
- }
193
- return [matches[1], matches[2]];
194
- }
195
- /**
196
- * Get packages from a dependency section
197
- *
198
- * @param section
199
- * @param ignoredSection
200
- * @param ignorePackages
201
- */
202
- function getPackagesFromSection(section, ignoredSection, ignorePackages) {
203
- return (0, util_1.filterMap)(Object.keys(section), (name) => {
204
- const isTyping = name.startsWith('@types/');
205
- // Never ignore `@types` packages.
206
- if (!isTyping) {
207
- // If it's not a `@types` package, check whether the section or package is ignored.
208
- // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- We want to check for false as well.
209
- if (ignoredSection || ignorePackages?.includes(name)) {
210
- return false;
211
- }
212
- }
213
- return { name, version: section[name] };
214
- });
215
- }
216
- /**
217
- * Get dependencies from a package section
218
- *
219
- * @param file Package file
220
- * @param section Package section, eg: dev, peer
221
- */
222
- function getDependenciesBySection(file, section) {
223
- const dependenciesSection = (() => {
224
- switch (section) {
225
- case types_1.IDependencySection.deps:
226
- return file.dependencies;
227
- case types_1.IDependencySection.dev:
228
- return file.devDependencies;
229
- case types_1.IDependencySection.optional:
230
- return file.optionalDependencies;
231
- case types_1.IDependencySection.peer:
232
- return file.peerDependencies;
233
- }
234
- })();
235
- return dependenciesSection ?? {};
236
- }
237
- //# sourceMappingURL=type-syncer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"type-syncer.js","sourceRoot":"","sources":["../src/type-syncer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,4CAiKC;AAtMD,gDAAiC;AAKjC,mCAWgB;AAChB,iCAOe;AACf,6CAAwD;AAMxD;;;;;GAKG;AACH,SAAgB,gBAAgB,CAC9B,kBAAuC,EACvC,wBAAmD,EACnD,aAA6B,EAC7B,aAA6B,EAC7B,OAAiB;IAEjB,MAAM,gBAAgB,GAAG,IAAA,mBAAY,EAAC,aAAa,CAAC,KAAK,CAAC,CAAA;IAE1D,OAAO;QACL,IAAI;KACL,CAAA;IAED;;OAEG;IACH,KAAK,UAAU,IAAI,CACjB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BAAmB,IAAI,EAAE,CAAA;AAClC,CAAC"}
package/lib/types.d.ts DELETED
@@ -1,103 +0,0 @@
1
- import type { IWorkspacesArray, IWorkspacesSection } from './workspace-resolver';
2
- /**
3
- * The guts of the program.
4
- */
5
- export interface ITypeSyncer {
6
- sync(filePath: string, flags: ICLIArguments['flags']): Promise<ISyncResult>;
7
- }
8
- /**
9
- * Sync options.
10
- */
11
- export interface ISyncOptions {
12
- /**
13
- * Ignore certain deps.
14
- */
15
- ignoreDeps?: Array<IDependencySection>;
16
- /**
17
- * Ignore certain packages.
18
- */
19
- ignorePackages?: Array<string>;
20
- /**
21
- * Skip resolution of certain projects in the workspace.
22
- */
23
- ignoreProjects?: IWorkspacesArray;
24
- }
25
- /**
26
- * Package.json file.
27
- */
28
- export interface IPackageFile {
29
- name?: string;
30
- dependencies?: IDependenciesSection;
31
- devDependencies?: IDependenciesSection;
32
- peerDependencies?: IDependenciesSection;
33
- optionalDependencies?: IDependenciesSection;
34
- workspaces?: IWorkspacesSection;
35
- [key: string]: unknown;
36
- }
37
- /**
38
- * Section in package.json representing dependencies.
39
- */
40
- export type IDependenciesSection = Record<string, string>;
41
- /**
42
- * Package + version record, collected from the {"package": "^1.2.3"} sections.
43
- */
44
- export interface IPackageVersion {
45
- name: string;
46
- version: string;
47
- }
48
- /**
49
- * Describes how a package may be typed.
50
- */
51
- export interface IPackageTypingDescriptor {
52
- typingsName: string;
53
- codePackageName: string;
54
- typesPackageName: string;
55
- }
56
- /**
57
- * A type definition with the corresponding code package name.
58
- */
59
- export interface ISyncedTypeDefinition extends IPackageTypingDescriptor {
60
- codePackageName: string;
61
- }
62
- /**
63
- * Sync result.
64
- */
65
- export interface ISyncResult {
66
- /**
67
- * The files that were synced.
68
- */
69
- syncedFiles: Array<ISyncedFile>;
70
- }
71
- /**
72
- * A file that was synced.
73
- */
74
- export interface ISyncedFile {
75
- /**
76
- * The cwd-relative path to the synced file.
77
- */
78
- filePath: string;
79
- /**
80
- * The package file that was synced.
81
- */
82
- package: IPackageFile;
83
- /**
84
- * The new typings that were added.
85
- */
86
- newTypings: Array<ISyncedTypeDefinition>;
87
- }
88
- /**
89
- * Dependency sections.
90
- */
91
- export declare enum IDependencySection {
92
- dev = "dev",
93
- deps = "deps",
94
- optional = "optional",
95
- peer = "peer"
96
- }
97
- /**
98
- * CLI arguments.
99
- */
100
- export interface ICLIArguments {
101
- flags: Record<string, boolean | string | undefined>;
102
- args: Array<string>;
103
- }
package/lib/types.js DELETED
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IDependencySection = void 0;
4
- /**
5
- * Dependency sections.
6
- */
7
- var IDependencySection;
8
- (function (IDependencySection) {
9
- IDependencySection["dev"] = "dev";
10
- IDependencySection["deps"] = "deps";
11
- IDependencySection["optional"] = "optional";
12
- IDependencySection["peer"] = "peer";
13
- })(IDependencySection || (exports.IDependencySection = IDependencySection = {}));
14
- //# sourceMappingURL=types.js.map
package/lib/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAmGA;;GAEG;AACH,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,iCAAW,CAAA;IACX,mCAAa,CAAA;IACb,2CAAqB,CAAA;IACrB,mCAAa,CAAA;AACf,CAAC,EALW,kBAAkB,kCAAlB,kBAAkB,QAK7B"}
package/lib/util.d.ts DELETED
@@ -1,53 +0,0 @@
1
- import type { IWorkspacesArray, IWorkspacesSection } from './workspace-resolver';
2
- /**
3
- * Returns unique items.
4
- *
5
- * @param source The source to filter
6
- */
7
- export declare function uniq<T>(source: Array<T>): Array<T>;
8
- /**
9
- * Does a `map` and a `filter` in one pass.
10
- *
11
- * @param source The source to filter and map
12
- * @param iteratee The iteratee.
13
- */
14
- export declare function filterMap<T, R>(source: Array<T>, iteratee: (item: T, index: number) => R | false): Array<R>;
15
- /**
16
- * Remove blank attributes in a object.
17
- *
18
- * @param source
19
- */
20
- export declare function shrinkObject<T extends object>(source: T): Required<T>;
21
- /**
22
- * Merges a sequence of objects into a single object using `reduce`.
23
- *
24
- * @param source An array of objects to merge.
25
- */
26
- export declare function mergeObjects<T>(source: Array<T>): T;
27
- /**
28
- * Returns the assumed types package name.
29
- * @param name Package name
30
- */
31
- export declare function typed(name: string): string;
32
- /**
33
- * Returns the assumed code package name based on a types package name.
34
- * @param name
35
- */
36
- export declare function untyped(name: string): string;
37
- /**
38
- * Orders an object.
39
- * @param source
40
- */
41
- export declare function orderObject<T extends Record<string | number | symbol, U>, U>(source: T, comparer?: (a: string, b: string) => number): T;
42
- /**
43
- * Async memoize.
44
- *
45
- * @param fn
46
- */
47
- export declare function memoizeAsync<U extends Array<W>, V, W>(fn: (...args: U) => Promise<V>): (...args: U) => Promise<V>;
48
- /**
49
- * Ensures that we have a valid workspaces array.
50
- *
51
- * @param data
52
- */
53
- export declare function ensureWorkspacesArray(data?: IWorkspacesSection): IWorkspacesArray;
package/lib/util.js DELETED
@@ -1,142 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.uniq = uniq;
4
- exports.filterMap = filterMap;
5
- exports.shrinkObject = shrinkObject;
6
- exports.mergeObjects = mergeObjects;
7
- exports.typed = typed;
8
- exports.untyped = untyped;
9
- exports.orderObject = orderObject;
10
- exports.memoizeAsync = memoizeAsync;
11
- exports.ensureWorkspacesArray = ensureWorkspacesArray;
12
- /**
13
- * Returns unique items.
14
- *
15
- * @param source The source to filter
16
- */
17
- function uniq(source) {
18
- return [...new Set(source)];
19
- }
20
- /**
21
- * Does a `map` and a `filter` in one pass.
22
- *
23
- * @param source The source to filter and map
24
- * @param iteratee The iteratee.
25
- */
26
- function filterMap(source, iteratee) {
27
- const result = [];
28
- let index = 0;
29
- for (const item of source) {
30
- const mapped = iteratee(item, index++);
31
- if (mapped === false)
32
- continue;
33
- result.push(mapped);
34
- }
35
- return result;
36
- }
37
- /**
38
- * Remove blank attributes in a object.
39
- *
40
- * @param source
41
- */
42
- function shrinkObject(source) {
43
- const object = {};
44
- for (const key in source) {
45
- if (typeof source[key] !== 'undefined') {
46
- object[key] = source[key];
47
- }
48
- }
49
- return object;
50
- }
51
- /**
52
- * Merges a sequence of objects into a single object using `reduce`.
53
- *
54
- * @param source An array of objects to merge.
55
- */
56
- function mergeObjects(source) {
57
- return source.reduce((accum, next) => ({ ...accum, ...next }), {});
58
- }
59
- /**
60
- * Returns the assumed types package name.
61
- * @param name Package name
62
- */
63
- function typed(name) {
64
- // If the package is scoped, the typings scheme is slightly different.
65
- if (/^@.*?\//i.test(name)) {
66
- const splat = name.split('/');
67
- return `@types/${splat[0].slice(1)}__${splat[1]}`;
68
- }
69
- return `@types/${name}`;
70
- }
71
- /**
72
- * Returns the assumed code package name based on a types package name.
73
- * @param name
74
- */
75
- function untyped(name) {
76
- const prefix = '@types/';
77
- if (!name.startsWith(prefix)) {
78
- return name;
79
- }
80
- name = name.substring(prefix.length);
81
- const splat = name.split('__');
82
- if (splat.length === 2) {
83
- return `@${splat[0]}/${splat[1]}`;
84
- }
85
- return name;
86
- }
87
- /**
88
- * Orders an object.
89
- * @param source
90
- */
91
- function orderObject(source, comparer) {
92
- const keys = Object.keys(source).sort(comparer);
93
- const result = {};
94
- for (const key of keys) {
95
- result[key] = source[key];
96
- }
97
- return result;
98
- }
99
- /**
100
- * Async memoize.
101
- *
102
- * @param fn
103
- */
104
- function memoizeAsync(fn) {
105
- const cache = new Map();
106
- async function run(...args) {
107
- try {
108
- return await fn(...args);
109
- }
110
- catch (err) {
111
- cache.delete(args[0]);
112
- throw err;
113
- }
114
- }
115
- return async function (...args) {
116
- const key = args[0];
117
- if (cache.has(key)) {
118
- return cache.get(key);
119
- }
120
- const p = run(...args);
121
- cache.set(key, p);
122
- return p;
123
- };
124
- }
125
- /**
126
- * Ensures that we have a valid workspaces array.
127
- *
128
- * @param data
129
- */
130
- function ensureWorkspacesArray(data) {
131
- if (!data) {
132
- return [];
133
- }
134
- if (!Array.isArray(data)) {
135
- return ensureWorkspacesArray(data.packages);
136
- }
137
- if (!data.every((s) => typeof s === 'string')) {
138
- return [];
139
- }
140
- return data;
141
- }
142
- //# sourceMappingURL=util.js.map
package/lib/util.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";;AAOA,oBAEC;AAQD,8BAaC;AAOD,oCAUC;AAOD,oCAEC;AAMD,sBAQC;AAMD,0BAWC;AAMD,kCAWC;AAOD,oCAwBC;AAOD,sDAgBC;AA5JD;;;;GAIG;AACH,SAAgB,IAAI,CAAI,MAAgB;IACtC,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;AAC7B,CAAC;AAED;;;;;GAKG;AACH,SAAgB,SAAS,CACvB,MAAgB,EAChB,QAA+C;IAE/C,MAAM,MAAM,GAAa,EAAE,CAAA;IAC3B,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QAC1B,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAA;QACtC,IAAI,MAAM,KAAK,KAAK;YAAE,SAAQ;QAC9B,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACrB,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC;AAED;;;;GAIG;AACH,SAAgB,YAAY,CAAmB,MAAS;IACtD,MAAM,MAAM,GAAQ,EAAE,CAAA;IAEtB,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;QACzB,IAAI,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,WAAW,EAAE,CAAC;YACvC,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;QAC3B,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC;AAED;;;;GAIG;AACH,SAA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AC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,EAAE,CAAC;QAC9C,OAAO,EAAE,CAAA;IACX,CAAC;IAED,OAAO,IAAI,CAAA;AACb,CAAC"}
@@ -1,14 +0,0 @@
1
- /**
2
- * Version descriptor for versions returned in remote package info.
3
- */
4
- export interface IPackageVersionInfo {
5
- version: string;
6
- containsInternalTypings: boolean;
7
- }
8
- /**
9
- * Gets the closest matching package version info.
10
- *
11
- * @param availableVersions
12
- * @param version
13
- */
14
- export declare function getClosestMatchingVersion(availableVersions: Array<IPackageVersionInfo>, version: string): IPackageVersionInfo;