Skip to content

build: no longer add pure annotations to es5 bundles #6107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions tools/package-tools/build-release.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {join} from 'path';
import {mkdirpSync} from 'fs-extra';
import {copyFiles} from './copy-files';
import {addPureAnnotationsToFile} from './pure-annotations';
import {replaceVersionPlaceholders} from './version-placeholders';
import {inlinePackageMetadataFiles} from './metadata-inlining';
import {createTypingsReexportFile} from './typings-reexport';
Expand Down Expand Up @@ -43,8 +42,6 @@ export function composeRelease(packageName: string, options: ComposeReleaseOptio
if (options.useSecondaryEntryPoints) {
createFilesForSecondaryEntryPoint(packageName, packagePath, releasePath);
}

addPureAnnotationsToFile(join(releasePath, '@angular', `${packageName}.es5.js`));
}

/** Creates files necessary for a secondary entry-point. */
Expand Down
2 changes: 1 addition & 1 deletion tools/package-tools/copy-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {join, dirname} from 'path';
/** Function to copy files that match a glob to another directory. */
export function copyFiles(fromPath: string, fileGlob: string, outDir: string) {
glob(fileGlob, {cwd: fromPath}).forEach(filePath => {
let fileDestPath = join(outDir, filePath);
const fileDestPath = join(outDir, filePath);
mkdirpSync(dirname(fileDestPath));
copySync(join(fromPath, filePath), fileDestPath);
});
Expand Down
2 changes: 1 addition & 1 deletion tools/package-tools/entry-point-package-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ export function createEntryPointPackageJson(destDir: string, packageName: string
es2015: `../@angular/${packageName}/${entryPointName}.js`,
};

writeFileSync(join(destDir, 'package.json'), JSON.stringify(content), 'utf-8');
writeFileSync(join(destDir, 'package.json'), JSON.stringify(content, null, 2), 'utf-8');
}
16 changes: 9 additions & 7 deletions tools/package-tools/metadata-reexport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ import {join} from 'path';

/** Creates a metadata file that re-exports the metadata bundle inside of the typings. */
export function createMetadataReexportFile(destDir: string, from: string, name: string) {
const metadataReExport = `{
"__symbolic":"module",
"version":3,"metadata":{},
"exports":[{"from":"${from}"}],
"flatModuleIndexRedirect": true
}`;
writeFileSync(join(destDir, `${name}.metadata.json`), metadataReExport, 'utf-8');
const metadataJsonContent = JSON.stringify({
__symbolic: 'module',
version: 3,
metadata: {},
exports: [{from}],
flatModuleIndexRedirect: true
}, null, 2);

writeFileSync(join(destDir, `${name}.metadata.json`), metadataJsonContent, 'utf-8');
}
33 changes: 0 additions & 33 deletions tools/package-tools/pure-annotations.ts

This file was deleted.