@atlaspack/parcel-to-atlaspack 2.14.2-typescript-8a6ec6c8b.0 → 2.14.2-unified-e330ff3d9.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.
- package/dist/bin.js +1 -0
- package/dist/migrations/diff.js +3 -1
- package/dist/migrations/migrate-package-json.js +3 -0
- package/dist/migrations/migrate-parcelrc.js +4 -0
- package/dist/migrations/package-json/migrate-config-fields.js +1 -0
- package/dist/migrations/package-json/migrate-dependencies.js +1 -0
- package/dist/migrations/package-json/migrate-engines-field.js +1 -0
- package/dist/migrations/package-json/sort-package-json-field.js +1 -0
- package/package.json +2 -2
package/dist/bin.js
CHANGED
package/dist/migrations/diff.js
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.diff = diff;
|
|
4
4
|
const jest_diff_1 = require("jest-diff");
|
|
5
|
-
function diff(
|
|
5
|
+
function diff(
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7
|
+
chalk, original, modified) {
|
|
6
8
|
return (0, jest_diff_1.diff)(original, modified, {
|
|
7
9
|
aAnnotation: 'Original',
|
|
8
10
|
aColor: chalk.red,
|
|
@@ -11,6 +11,7 @@ const migrate_engines_field_1 = require("./package-json/migrate-engines-field");
|
|
|
11
11
|
// TODO Update dependencies
|
|
12
12
|
async function migratePackageJson({ cwd, dryRun, skipDependencies, skipEngines, tag, }) {
|
|
13
13
|
const { default: chalk } = await import('chalk');
|
|
14
|
+
// eslint-disable-next-line no-console
|
|
14
15
|
console.log(chalk.blue('[INFO]'), 'Searching for package.json files');
|
|
15
16
|
const packageJsonPaths = await new fdir_1.fdir()
|
|
16
17
|
.withFullPaths()
|
|
@@ -36,6 +37,7 @@ async function migratePackageJson({ cwd, dryRun, skipDependencies, skipEngines,
|
|
|
36
37
|
const { space = 2 } = rawPackageJson.match(/^\s*{.*\n(?<space>\s*)"/)?.groups ?? {};
|
|
37
38
|
const migratedPackageJson = JSON.stringify(packageJson, null, space) + '\n';
|
|
38
39
|
if (dryRun) {
|
|
40
|
+
// eslint-disable-next-line no-console
|
|
39
41
|
console.log(chalk.blue('[INFO]'), `Updated ${(0, node_path_1.relative)(cwd, packageJsonPath)}\n${(0, diff_1.diff)(chalk, rawPackageJson, migratedPackageJson)}`);
|
|
40
42
|
}
|
|
41
43
|
else {
|
|
@@ -43,5 +45,6 @@ async function migratePackageJson({ cwd, dryRun, skipDependencies, skipEngines,
|
|
|
43
45
|
}
|
|
44
46
|
modifiedFiles.push(packageJsonPath);
|
|
45
47
|
}));
|
|
48
|
+
// eslint-disable-next-line no-console
|
|
46
49
|
console.log(chalk.blue('[INFO]'), `Migrated ${modifiedFiles.length} package.json files`);
|
|
47
50
|
}
|
|
@@ -8,6 +8,7 @@ const diff_1 = require("./diff");
|
|
|
8
8
|
// TODO: Support extended config defined in index.json?
|
|
9
9
|
async function migrateParcelRc({ cwd, dryRun }) {
|
|
10
10
|
const { default: chalk } = await import('chalk');
|
|
11
|
+
// eslint-disable-next-line no-console
|
|
11
12
|
console.log(chalk.blue('[INFO]'), 'Searching for .parcelrc files');
|
|
12
13
|
const parcelrcPaths = await new fdir_1.fdir()
|
|
13
14
|
.withFullPaths()
|
|
@@ -21,6 +22,7 @@ async function migrateParcelRc({ cwd, dryRun }) {
|
|
|
21
22
|
const atlaspckrc = parcelrc.replace(/@parcel\//g, '@atlaspack/');
|
|
22
23
|
if (atlaspckrc !== parcelrc) {
|
|
23
24
|
if (dryRun) {
|
|
25
|
+
// eslint-disable-next-line no-console
|
|
24
26
|
console.log(chalk.blue('[INFO]'), `Updated ${(0, node_path_1.relative)(cwd, parcelrcPath)}\n${(0, diff_1.diff)(chalk, parcelrc, atlaspckrc)}`);
|
|
25
27
|
}
|
|
26
28
|
else {
|
|
@@ -29,6 +31,7 @@ async function migrateParcelRc({ cwd, dryRun }) {
|
|
|
29
31
|
}
|
|
30
32
|
const atlaspackrcPath = (0, node_path_1.join)((0, node_path_1.dirname)(parcelrcPath), (0, node_path_1.basename)(parcelrcPath).replace('.parcelrc', '.atlaspackrc'));
|
|
31
33
|
if (dryRun) {
|
|
34
|
+
// eslint-disable-next-line no-console
|
|
32
35
|
console.log(chalk.blue('[INFO]'), `Renamed ${(0, node_path_1.relative)(cwd, parcelrcPath)}`);
|
|
33
36
|
}
|
|
34
37
|
else {
|
|
@@ -36,5 +39,6 @@ async function migrateParcelRc({ cwd, dryRun }) {
|
|
|
36
39
|
}
|
|
37
40
|
modifiedFiles.push(parcelrcPath);
|
|
38
41
|
}));
|
|
42
|
+
// eslint-disable-next-line no-console
|
|
39
43
|
console.log(chalk.blue('[INFO]'), `Migrated ${modifiedFiles.length} .parcelrc files`);
|
|
40
44
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.migrateConfigFields = migrateConfigFields;
|
|
4
4
|
// TODO Preserve order?
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
6
|
function migrateConfigFields(packageJson) {
|
|
6
7
|
let didConfigChange = false;
|
|
7
8
|
for (const field of Object.keys(packageJson).filter((key) => key.startsWith('@parcel/'))) {
|
|
@@ -40,6 +40,7 @@ function getVersion(name, range, tag) {
|
|
|
40
40
|
versions.set(name, version);
|
|
41
41
|
return version;
|
|
42
42
|
}
|
|
43
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
43
44
|
function migrateDependencies(packageJson, tag) {
|
|
44
45
|
let didDependenciesChange = false;
|
|
45
46
|
const skipPackages = new Set([
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.migrateEnginesField = migrateEnginesField;
|
|
4
4
|
const sort_package_json_field_1 = require("./sort-package-json-field");
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
6
|
function migrateEnginesField(packageJson) {
|
|
6
7
|
if (!packageJson.engines?.parcel) {
|
|
7
8
|
return false;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.sortPackageJsonField = sortPackageJsonField;
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4
5
|
function sortPackageJsonField(packageJson, field) {
|
|
5
6
|
const value = { ...packageJson[field] };
|
|
6
7
|
packageJson[field] = {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/parcel-to-atlaspack",
|
|
3
|
-
"version": "2.14.2-
|
|
3
|
+
"version": "2.14.2-unified-e330ff3d9.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/atlassian-labs/atlaspack.git"
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"access": "public"
|
|
36
36
|
},
|
|
37
37
|
"type": "commonjs",
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "e330ff3d90fbf336f87439a65e312d698433990b"
|
|
39
39
|
}
|