@unisphere/nx 4.12.0 → 4.12.1

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.
@@ -0,0 +1,3 @@
1
+ import { Tree } from '@nx/devkit';
2
+ export default function update(tree: Tree): Promise<void>;
3
+ //# sourceMappingURL=add-migrations-json-to-root-gitignore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-migrations-json-to-root-gitignore.d.ts","sourceRoot":"","sources":["../../../src/migrations/4-12-1/add-migrations-json-to-root-gitignore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAU,MAAM,YAAY,CAAC;AAE1C,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAmC9D"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = update;
4
+ const devkit_1 = require("@nx/devkit");
5
+ async function update(tree) {
6
+ devkit_1.logger.info('🔄 Updating root .gitignore to add migrations-*.json...');
7
+ const gitignorePath = '.gitignore';
8
+ if (!tree.exists(gitignorePath)) {
9
+ devkit_1.logger.warn('âš ī¸ .gitignore file not found, creating one');
10
+ tree.write(gitignorePath, '');
11
+ }
12
+ try {
13
+ const currentContent = tree.read(gitignorePath, 'utf-8') || '';
14
+ let updatedContent = currentContent;
15
+ const entryRegex = /^migrations-\*\.json\s*$/gm;
16
+ if (!entryRegex.test(updatedContent)) {
17
+ if (!updatedContent.includes('# Nx migrations')) {
18
+ updatedContent = updatedContent.trim() + '\n\n# Nx migrations\n';
19
+ }
20
+ if (!updatedContent.includes('migrations-*.json')) {
21
+ updatedContent += 'migrations-*.json\n';
22
+ devkit_1.logger.info('📝 Added migrations-*.json to .gitignore');
23
+ }
24
+ tree.write(gitignorePath, updatedContent);
25
+ devkit_1.logger.info('✅ Successfully updated .gitignore');
26
+ }
27
+ else {
28
+ devkit_1.logger.info('â„šī¸ migrations-*.json already exists in .gitignore');
29
+ }
30
+ }
31
+ catch (error) {
32
+ const errorMessage = error instanceof Error ? error.message : 'Unknown error';
33
+ devkit_1.logger.error(`❌ Failed to update .gitignore: ${errorMessage}`);
34
+ throw new Error(`Failed to update .gitignore: ${errorMessage}`);
35
+ }
36
+ }
package/migrations.json CHANGED
@@ -498,6 +498,14 @@
498
498
  "cli": {
499
499
  "postUpdateMessage": "✅ All applications now have a .env-template file"
500
500
  }
501
+ },
502
+ "4.12.1-add-migrations-json-to-root-gitignore": {
503
+ "version": "4.12.1",
504
+ "description": "Adds migrations-*.json to root .gitignore",
505
+ "factory": "./dist/migrations/4-12-1/add-migrations-json-to-root-gitignore.js",
506
+ "cli": {
507
+ "postUpdateMessage": "✅ .gitignore updated to exclude migrations-*.json"
508
+ }
501
509
  }
502
510
  },
503
511
  "packageJsonUpdates": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unisphere/nx",
3
- "version": "4.12.0",
3
+ "version": "4.12.1",
4
4
  "private": false,
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",