@domain-first/project-structure 8.8.0 → 8.9.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/init.cjs CHANGED
@@ -638,12 +638,53 @@ const save_pending_changes_savePendingChanges = async ()=>{
638
638
  writePendingChanges();
639
639
  return true;
640
640
  };
641
+ const package_scripts_addPackageScripts = async (file, additions)=>{
642
+ const original = file.data;
643
+ const manifest = JSON.parse(original);
644
+ const scripts = {
645
+ ...manifest.scripts
646
+ };
647
+ const selected = {};
648
+ for (const [name, command] of Object.entries(additions)){
649
+ let target = name;
650
+ if (Object.hasOwn(scripts, name) && scripts[name] !== command) {
651
+ const action = await interaction_select({
652
+ key: `scriptConflicts.${name}`,
653
+ message: `Script "${name}" already exists: ${scripts[name]}`,
654
+ choices: [
655
+ 'Keep existing',
656
+ 'Replace',
657
+ 'Use another name'
658
+ ]
659
+ });
660
+ if ('Keep existing' === action) continue;
661
+ if ('Use another name' === action) target = await interaction_input({
662
+ key: `scriptNames.${name}`,
663
+ message: "New script name:",
664
+ validate: (value)=>!/^[a-zA-Z0-9:_-]+$/.test(value) || Object.hasOwn(scripts, value) || Object.hasOwn(additions, value) ? "Enter an unused script name (letters, numbers, :, _, -)." : true
665
+ });
666
+ }
667
+ scripts[target] = command;
668
+ selected[name] = target;
669
+ }
670
+ if (JSON.stringify(manifest.scripts) !== JSON.stringify(scripts)) {
671
+ manifest.scripts = scripts;
672
+ const indent = original.match(/\n([\t ]+)"/)?.[1] ?? ' ';
673
+ file.update(`${JSON.stringify(manifest, null, indent)}\n`);
674
+ }
675
+ return selected;
676
+ };
677
+ const package_scripts_describeScripts = (selected, descriptions)=>Object.entries(descriptions).filter(([name])=>selected[name]).map(([name, description])=>`npm run ${selected[name]} — ${description}`);
641
678
  const context_dependencies_crossContextImplementation = 'cross-context';
642
679
  new Map([
643
680
  [
644
681
  'prisma',
645
682
  'prisma-infrastructure-service'
646
683
  ],
684
+ [
685
+ 'drizzle',
686
+ 'drizzle-infrastructure-service'
687
+ ],
647
688
  [
648
689
  'in-memory',
649
690
  'in-memory-db-infrastructure-service'
@@ -822,43 +863,6 @@ const next_app_nextAppFolder = (root)=>[
822
863
  'src/app'
823
864
  ].find((folder)=>new file_system_Folder(external_node_path_default().join(root, folder)).exists) ?? 'app';
824
865
  require("node:module");
825
- const package_scripts_addPackageScripts = async (file, additions)=>{
826
- const original = file.data;
827
- const manifest = JSON.parse(original);
828
- const scripts = {
829
- ...manifest.scripts
830
- };
831
- const selected = {};
832
- for (const [name, command] of Object.entries(additions)){
833
- let target = name;
834
- if (Object.hasOwn(scripts, name) && scripts[name] !== command) {
835
- const action = await interaction_select({
836
- key: `scriptConflicts.${name}`,
837
- message: `Script "${name}" already exists: ${scripts[name]}`,
838
- choices: [
839
- 'Keep existing',
840
- 'Replace',
841
- 'Use another name'
842
- ]
843
- });
844
- if ('Keep existing' === action) continue;
845
- if ('Use another name' === action) target = await interaction_input({
846
- key: `scriptNames.${name}`,
847
- message: "New script name:",
848
- validate: (value)=>!/^[a-zA-Z0-9:_-]+$/.test(value) || Object.hasOwn(scripts, value) || Object.hasOwn(additions, value) ? "Enter an unused script name (letters, numbers, :, _, -)." : true
849
- });
850
- }
851
- scripts[target] = command;
852
- selected[name] = target;
853
- }
854
- if (JSON.stringify(manifest.scripts) !== JSON.stringify(scripts)) {
855
- manifest.scripts = scripts;
856
- const indent = original.match(/\n([\t ]+)"/)?.[1] ?? ' ';
857
- file.update(`${JSON.stringify(manifest, null, indent)}\n`);
858
- }
859
- return selected;
860
- };
861
- const package_scripts_describeScripts = (selected, descriptions)=>Object.entries(descriptions).filter(([name])=>selected[name]).map(([name, description])=>`npm run ${selected[name]} — ${description}`);
862
866
  const gitignore_addGitignoreEntry = (root, entry)=>{
863
867
  const gitignore = new file_system_File(external_node_path_default().join(root, '.gitignore'));
864
868
  const ignored = gitignore.exists ? gitignore.data : '';