Skip to content

Commit

Permalink
merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed Jan 29, 2022
2 parents 2cea507 + 5364114 commit de74a3a
Show file tree
Hide file tree
Showing 143 changed files with 2,161 additions and 1,824 deletions.
29 changes: 29 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,34 @@
# rollup changelog

## 2.66.1

_2022-01-25_

### Bug Fixes

- Only warn for conflicting names in namespace reexports if it actually causes problems (#4363)
- Only allow explicit exports or reexports as synthetic namespaces and hide them from namespace reexports (#4364)

### Pull Requests

- [#4362](https://github.com/rollup/rollup/pull/4362): refactor: convert exportsByName object to map (@lukastaegert)
- [#4363](https://github.com/rollup/rollup/pull/4363): Do not warn unnecessarily for namespace conflicts (@lukastaegert)
- [#4364](https://github.com/rollup/rollup/pull/4364): Do not expose synthetic namespace export in entries and namespaces (@lukastaegert)

## 2.66.0

_2022-01-22_

### Features

- Note if a module has a default export in ModuleInfo to allow writing better proxy modules (#4356)
- Add option to wait until all imported ids have been resolved when awaiting `this.load` (#4358)

### Pull Requests

- [#4356](https://github.com/rollup/rollup/pull/4356): Add hasDefaultExport to ModuleInfo (@lukastaegert)
- [#4358](https://github.com/rollup/rollup/pull/4358): Add "resolveDependencies" option to "this.load" (@lukastaegert)

## 2.65.0

_2022-01-21_
Expand Down
30 changes: 16 additions & 14 deletions build-plugins/generate-license-file.ts
@@ -1,24 +1,24 @@
import { readFileSync, writeFileSync } from 'fs';
import { PluginImpl } from 'rollup';
import license, { Dependency, Person } from 'rollup-plugin-license';
import type { PluginImpl } from 'rollup';
import license, { type Dependency, type Person } from 'rollup-plugin-license';

function generateLicenseFile(dependencies: Dependency[]) {
function generateLicenseFile(dependencies: readonly Dependency[]) {
const coreLicense = readFileSync('LICENSE-CORE.md');
const licenses = new Set();
const dependencyLicenseTexts = dependencies
const licenses = new Set<string>();
const dependencyLicenseTexts = Array.from(dependencies)
.sort(({ name: nameA }, { name: nameB }) => (nameA! > nameB! ? 1 : -1))
.map(({ name, license, licenseText, author, maintainers, contributors, repository }) => {
let text = `## ${name}\n`;
if (license) {
text += `License: ${license}\n`;
}
const names = new Set();
if (author && author.name) {
const names = new Set<string>();
if (author?.name) {
names.add(author.name);
}
// TODO there is an inconsistency in the rollup-plugin-license types
for (const person of contributors.concat(maintainers as unknown as Person[])) {
if (person && person.name) {
if (person?.name) {
names.add(person.name);
}
}
Expand All @@ -39,7 +39,7 @@ function generateLicenseFile(dependencies: Dependency[]) {
.join('\n') +
'\n';
}
licenses.add(license);
licenses.add(license!);
return text;
})
.join('\n---------------------------------------\n\n');
Expand All @@ -59,16 +59,18 @@ function generateLicenseFile(dependencies: Dependency[]) {
}
}

export default function getLicenseHandler(): {
interface LicenseHandler {
collectLicenses: PluginImpl;
writeLicense: PluginImpl;
} {
const licenses = new Map();
}

export default function getLicenseHandler(): LicenseHandler {
const licenses = new Map<string, Dependency>();
return {
collectLicenses() {
function addLicenses(dependencies: Dependency[]) {
function addLicenses(dependencies: readonly Dependency[]) {
for (const dependency of dependencies) {
licenses.set(dependency.name, dependency);
licenses.set(dependency.name!, dependency);
}
}

Expand Down
6 changes: 3 additions & 3 deletions cli/run/loadConfigFile.ts
Expand Up @@ -2,14 +2,14 @@ import { promises as fs } from 'fs';
import { extname, isAbsolute } from 'path';
import { pathToFileURL } from 'url';
import * as rollup from '../../src/node-entry';
import { MergedRollupOptions } from '../../src/rollup/types';
import type { MergedRollupOptions } from '../../src/rollup/types';
import { bold } from '../../src/utils/colors';
import { error } from '../../src/utils/error';
import { mergeOptions } from '../../src/utils/options/mergeOptions';
import { GenericConfigObject } from '../../src/utils/options/options';
import type { GenericConfigObject } from '../../src/utils/options/options';
import relativeId from '../../src/utils/relativeId';
import { stderr } from '../logging';
import batchWarnings, { BatchWarnings } from './batchWarnings';
import batchWarnings, { type BatchWarnings } from './batchWarnings';
import { addCommandPluginsToInputOptions, addPluginsFromCommandOption } from './commandPlugins';

function supportsNativeESM(): boolean {
Expand Down
2 changes: 1 addition & 1 deletion cli/run/loadConfigFromCommand.ts
Expand Up @@ -4,7 +4,7 @@ import batchWarnings, { BatchWarnings } from './batchWarnings';
import { addCommandPluginsToInputOptions } from './commandPlugins';
import { stdinName } from './stdin';

export default async function loadConfigFromCommand(command: Record<string, any>): Promise<{
export default async function loadConfigFromCommand(command: Record<string, unknown>): Promise<{
options: MergedRollupOptions[];
warnings: BatchWarnings;
}> {
Expand Down
2 changes: 1 addition & 1 deletion cli/run/resetScreen.ts
@@ -1,4 +1,4 @@
import { MergedRollupOptions } from '../../src/rollup/types';
import type { MergedRollupOptions } from '../../src/rollup/types';
import { stderr } from '../logging';

const CLEAR_SCREEN = '\u001Bc';
Expand Down
2 changes: 1 addition & 1 deletion cli/run/stdin.ts
@@ -1,4 +1,4 @@
import { Plugin } from '../../src/rollup/types';
import type { Plugin } from '../../src/rollup/types';

export const stdinName = '-';

Expand Down
8 changes: 4 additions & 4 deletions cli/run/waitForInput.ts
@@ -1,5 +1,5 @@
import { PluginContext } from 'rollup';
import { NormalizedInputOptions, Plugin } from '../../src/rollup/types';
import type { PluginContext } from 'rollup';
import type { NormalizedInputOptions, Plugin } from '../../src/rollup/types';
import { bold } from '../../src/utils/colors';
import { stderr } from '../logging';

Expand All @@ -8,9 +8,9 @@ export function waitForInputPlugin(): Plugin {
async buildStart(this: PluginContext, options: NormalizedInputOptions) {
const inputSpecifiers = Array.isArray(options.input)
? options.input
: Object.keys(options.input as { [entryAlias: string]: string });
: Object.keys(options.input);

let lastAwaitedSpecifier = null;
let lastAwaitedSpecifier: string | null = null;
checkSpecifiers: while (true) {
for (const specifier of inputSpecifiers) {
if ((await this.resolve(specifier)) === null) {
Expand Down
5 changes: 3 additions & 2 deletions cli/run/watch-cli.ts
@@ -1,14 +1,15 @@
import { type FSWatcher, promises } from 'fs';
import process from 'process';
import chokidar from 'chokidar';
import dateTime from 'date-time';
import ms from 'pretty-ms';
import onExit from 'signal-exit';
import * as rollup from '../../src/node-entry';
import { MergedRollupOptions, RollupWatcher } from '../../src/rollup/types';
import type { MergedRollupOptions, RollupWatcher } from '../../src/rollup/types';
import { bold, cyan, green, underline } from '../../src/utils/colors';
import relativeId from '../../src/utils/relativeId';
import { handleError, stderr } from '../logging';
import { BatchWarnings } from './batchWarnings';
import type { BatchWarnings } from './batchWarnings';
import { getConfigPath } from './getConfigPath';
import loadAndParseConfigFile from './loadConfigFile';
import loadConfigFromCommand from './loadConfigFromCommand';
Expand Down

0 comments on commit de74a3a

Please sign in to comment.