Skip to content

Commit

Permalink
Remove --freeze option from the cli
Browse files Browse the repository at this point in the history
  • Loading branch information
JayaKrishnaNamburu committed Dec 22, 2023
1 parent 249574c commit 46314f8
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 57 deletions.
4 changes: 0 additions & 4 deletions docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ If no modules are given, all "imports" in the initial map are relinked.
* `--preload` _[mode]_ Add module preloads to HTML output (default: static, dynamic)
* `--integrity` Add module preloads with integrity attributes to HTML output (default: false)
* `--compact` Output a compact import map (default: false)
* `--freeze` Freeze input map dependencies, i.e. do not modify them (default: false)
* `--stdout` Output the import map to stdout (default: false)
* `--silent` Silence all output (default: false)
* `-h, --help` Display this message
Expand Down Expand Up @@ -90,7 +89,6 @@ If no packages are provided, all "imports" in the initial map are reinstalled.
* `--preload` _[mode]_ Add module preloads to HTML output (default: static, dynamic)
* `--integrity` Add module preloads with integrity attributes to HTML output (default: false)
* `--compact` Output a compact import map (default: false)
* `--freeze` Freeze input map dependencies, i.e. do not modify them (default: false)
* `--stdout` Output the import map to stdout (default: false)
* `--silent` Silence all output (default: false)
* `-h, --help` Display this message
Expand Down Expand Up @@ -141,7 +139,6 @@ Uninstalls packages from an import map. The given packages must be valid package
* `--preload` _[mode]_ Add module preloads to HTML output (default: static, dynamic)
* `--integrity` Add module preloads with integrity attributes to HTML output (default: false)
* `--compact` Output a compact import map (default: false)
* `--freeze` Freeze input map dependencies, i.e. do not modify them (default: false)
* `--stdout` Output the import map to stdout (default: false)
* `--silent` Silence all output (default: false)
* `-h, --help` Display this message
Expand Down Expand Up @@ -174,7 +171,6 @@ Updates packages in an import map to the latest versions that are compatible wit
* `--preload` _[mode]_ Add module preloads to HTML output (default: static, dynamic)
* `--integrity` Add module preloads with integrity attributes to HTML output (default: false)
* `--compact` Output a compact import map (default: false)
* `--freeze` Freeze input map dependencies, i.e. do not modify them (default: false)
* `--stdout` Output the import map to stdout (default: false)
* `--silent` Silence all output (default: false)
* `-h, --help` Display this message
Expand Down
7 changes: 4 additions & 3 deletions src/build/rollup-importmap-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ const isValidUrl = (url: string) => {

export const RollupImportmapPlugin = async (flags: Flags): Promise<Plugin> => {
/*
Install without a freeze might bump the versions.
We would like to maintian 1:1 on what users defined in importmap.
We need to load the importmap from local into the generator.
And then run a re-install. So, the generator uses the importmap
to resolve any dependencies.
*/
const generator = await getGenerator({ ...flags, freeze: true });
const generator = await getGenerator({ ...flags });
await generator.reinstall();

return {
Expand Down
9 changes: 0 additions & 9 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,6 @@ const rootOpt: opt = [
"URL to treat as server root, i.e. rebase import maps against",
{},
];
const freezeOpt: opt = [
"--freeze",
"Freeze input map dependencies, i.e. do not modify them",
{ default: false },
];
const silentOpt: opt = ["--silent", "Silence all output", { default: false }];
const buildConfigOpt: opt = [
"--config <file>",
Expand Down Expand Up @@ -134,7 +129,6 @@ cli
.option(...preloadOpt)
.option(...integrityOpt)
.option(...compactOpt)
.option(...freezeOpt)
.option(...stdoutOpt)
.example(
(name) => `Link a remote package in importmap.json
Expand Down Expand Up @@ -181,7 +175,6 @@ cli
.option(...preloadOpt)
.option(...integrityOpt)
.option(...compactOpt)
.option(...freezeOpt)
.option(...stdoutOpt)
.example(
(name) => `Install a package
Expand Down Expand Up @@ -236,7 +229,6 @@ cli
.option(...preloadOpt)
.option(...integrityOpt)
.option(...compactOpt)
.option(...freezeOpt)
.option(...stdoutOpt)
.example(
(name) => `
Expand Down Expand Up @@ -265,7 +257,6 @@ cli
.option(...preloadOpt)
.option(...integrityOpt)
.option(...compactOpt)
.option(...freezeOpt)
.option(...stdoutOpt)
.example(
(name) => `
Expand Down
1 change: 0 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export interface Flags extends BuildFlags {
preload?: boolean | string;
integrity?: boolean;
compact?: boolean;
freeze?: boolean;
silent?: boolean;
cache?: string;
}
Expand Down
1 change: 0 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ export async function getGenerator(
defaultProvider: getProvider(flags),
resolutions: getResolutions(flags),
cache: getCacheMode(flags),
freeze: flags.freeze,
commonJS: true, // TODO: only for --local flag
});
}
Expand Down
39 changes: 0 additions & 39 deletions test/freeze.test.ts

This file was deleted.

0 comments on commit 46314f8

Please sign in to comment.