@virmator/init 13.0.4 → 13.1.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/configs/github/workflows/tagged-release.yml +0 -6
- package/configs/package-mono-package-node/package.json +3 -0
- package/configs/package-mono-package-web/package.json +3 -0
- package/configs/package-mono-root/package.json +3 -0
- package/configs/package-top-package-node/package.json +3 -0
- package/configs/package-top-package-web/package.json +3 -0
- package/dist/init.js +10 -4
- package/package.json +6 -2
package/dist/init.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Tests for this plugin are inside the `virmator` package since a lot of `init`'s functionality is
|
|
3
3
|
* missed without the other packages.
|
|
4
4
|
*/
|
|
5
|
-
import { awaitedBlockingMap, filterObject, getEnumTypedValues, isEnumValue, joinWithFinalConjunction, } from '@augment-vir/common';
|
|
5
|
+
import { awaitedBlockingMap, filterObject, getEnumTypedValues, isEnumValue, joinWithFinalConjunction, pickObjectKeys, } from '@augment-vir/common';
|
|
6
6
|
import { readPackageJson, writeJson } from '@augment-vir/node-js';
|
|
7
7
|
import { copyConfigFile, defineVirmatorPlugin, NpmDepType, PackageType, VirmatorEnv, VirmatorNoTraceError, } from '@virmator/core';
|
|
8
8
|
import { basename, join } from 'node:path';
|
|
@@ -308,7 +308,7 @@ export const virmatorInitPlugin = defineVirmatorPlugin(import.meta.dirname, {
|
|
|
308
308
|
},
|
|
309
309
|
},
|
|
310
310
|
},
|
|
311
|
-
}, async ({ cliInputs: { filteredArgs }, package: { cwdPackagePath }, virmator: { allPlugins }, log, runInstallDeps, }) => {
|
|
311
|
+
}, async ({ cliInputs: { filteredArgs }, package: { cwdPackagePath, cwdPackageJson }, virmator: { allPlugins }, log, runInstallDeps, }) => {
|
|
312
312
|
const packageType = filteredArgs.find((arg) => isEnumValue(arg, PackageType));
|
|
313
313
|
const packageEnv = filteredArgs.find((arg) => isEnumValue(arg, VirmatorEnv));
|
|
314
314
|
if (!packageEnv) {
|
|
@@ -328,9 +328,9 @@ export const virmatorInitPlugin = defineVirmatorPlugin(import.meta.dirname, {
|
|
|
328
328
|
await awaitedBlockingMap(relevantConfigs, async (config) => {
|
|
329
329
|
await copyConfigFile(config, log, true);
|
|
330
330
|
});
|
|
331
|
-
await writePackageJson(cwdPackagePath);
|
|
331
|
+
await writePackageJson(cwdPackageJson, cwdPackagePath);
|
|
332
332
|
});
|
|
333
|
-
async function writePackageJson(packagePath) {
|
|
333
|
+
async function writePackageJson(originalPackageJson, packagePath) {
|
|
334
334
|
const currentPackageJson = await readPackageJson(packagePath);
|
|
335
335
|
const git = simpleGit(packagePath);
|
|
336
336
|
const remotes = await git.getRemotes(true);
|
|
@@ -340,6 +340,12 @@ async function writePackageJson(packagePath) {
|
|
|
340
340
|
name: basename(packagePath),
|
|
341
341
|
...gitProperties,
|
|
342
342
|
...currentPackageJson,
|
|
343
|
+
...pickObjectKeys(originalPackageJson, [
|
|
344
|
+
'dependencies',
|
|
345
|
+
'devDependencies',
|
|
346
|
+
'overrides',
|
|
347
|
+
'peerDependencies',
|
|
348
|
+
]),
|
|
343
349
|
};
|
|
344
350
|
await writeJson(join(packagePath, 'package.json'), packageJson);
|
|
345
351
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@virmator/init",
|
|
3
|
-
"version": "13.0
|
|
3
|
+
"version": "13.1.0",
|
|
4
4
|
"description": "Default init plugin for virmator.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"virmator",
|
|
@@ -37,7 +37,11 @@
|
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/node": "^22.1.0",
|
|
39
39
|
"element-vir": "^22.2.2",
|
|
40
|
-
"tsx": "^4.16.5"
|
|
40
|
+
"tsx": "^4.16.5",
|
|
41
|
+
"type-fest": "^4.23.0"
|
|
42
|
+
},
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": ">=22"
|
|
41
45
|
},
|
|
42
46
|
"publishConfig": {
|
|
43
47
|
"access": "public"
|