@brunoluizdesiqueira/bbuilder-cli 1.0.2 → 1.0.4

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/README.md CHANGED
@@ -100,6 +100,38 @@ npm run version-packages
100
100
  npm run release
101
101
  ```
102
102
 
103
+ ### Troubleshooting do publish automático
104
+
105
+ Se a PR de release for mergeada, a versão subir para o `package.json`, mas o publish no npm falhar com erro parecido com:
106
+
107
+ ```text
108
+ E404 Not Found - PUT https://registry.npmjs.org/@brunoluizdesiqueira%2fbbuilder-cli - Not found
109
+ ```
110
+
111
+ verifique estes pontos:
112
+
113
+ 1. o Trusted Publisher do pacote está configurado para:
114
+ - owner/user: `brunoluizdesiqueira`
115
+ - repository: `b-cli`
116
+ - workflow: `release.yml`
117
+ 2. o repositório GitHub é público
118
+ 3. o workflow `Release` tem `permissions.id-token: write`
119
+ 4. o workflow roda com Node e npm atuais
120
+
121
+ O ajuste que resolveu esse cenário neste projeto foi:
122
+
123
+ - usar `actions/setup-node@v5`
124
+ - executar o workflow com Node `24`
125
+ - atualizar o npm antes do publish
126
+ - definir no `package.json`:
127
+
128
+ ```json
129
+ "publishConfig": {
130
+ "access": "public",
131
+ "provenance": true
132
+ }
133
+ ```
134
+
103
135
  ## CI/CD
104
136
 
105
137
  O repositório agora está preparado com GitHub Actions:
@@ -70,7 +70,23 @@ function buildCompilerFlags(buildType) {
70
70
  }
71
71
  }
72
72
  function buildDependencies(opts) {
73
- return opts.dependencyPaths.map(p => `"${p}"`).join(';');
73
+ // execa passes each compiler switch as a single argv entry, so we should
74
+ // not embed quotes inside the semicolon-separated list. Doing that can make
75
+ // dcc64 fail to resolve paths such as the Delphi runtime library.
76
+ return opts.dependencyPaths.join(';');
77
+ }
78
+ function quoteForCmd(value) {
79
+ if (!value)
80
+ return '""';
81
+ return `"${value.replace(/"/g, '""')}"`;
82
+ }
83
+ async function runWindowsCommand(executable, args, cwd) {
84
+ const command = [quoteForCmd(executable), ...args.map(quoteForCmd)].join(' ');
85
+ await (0, execa_1.default)('cmd.exe', ['/d', '/s', '/c', command], {
86
+ cwd,
87
+ stdio: 'inherit',
88
+ windowsVerbatimArguments: true,
89
+ });
74
90
  }
75
91
  async function runCgrc(opts, projectName) {
76
92
  const tempDir = path.join(os.tmpdir(), `BimerBuild_${projectName}`);
@@ -78,7 +94,7 @@ async function runCgrc(opts, projectName) {
78
94
  const resFile = path.join(tempDir, `${projectName}.res`);
79
95
  (0, output_1.step)('Compilando recursos e embutindo ícone...');
80
96
  try {
81
- await (0, execa_1.default)(path.win32.join(opts.delphiDir, 'bin', 'cgrc.exe'), [vrcFile, `-fo${resFile}`], { stdio: 'inherit' });
97
+ await runWindowsCommand(path.win32.join(opts.delphiDir, 'bin', 'cgrc.exe'), [vrcFile, `-fo${resFile}`]);
82
98
  }
83
99
  catch {
84
100
  (0, output_1.fatal)('Falha do compilador CGRC ao gerar o arquivo de recursos .res.');
@@ -121,10 +137,7 @@ async function runDcc64(opts, projectName, workspaceDir) {
121
137
  `${projectName}.dpr`,
122
138
  ];
123
139
  try {
124
- await (0, execa_1.default)(dcc64, args, {
125
- cwd: workspaceDir,
126
- stdio: 'inherit',
127
- });
140
+ await runWindowsCommand(dcc64, args, workspaceDir);
128
141
  }
129
142
  catch {
130
143
  (0, output_1.fatal)('Falha na compilação do Delphi. Verifique os logs de erro acima.');
@@ -62,9 +62,11 @@ function runDoctor(config, resolvedConfigPath) {
62
62
  const checks = [];
63
63
  const cgrcPath = path.win32.join(config.delphiDir, 'bin', 'cgrc.exe');
64
64
  const dcc64Path = path.win32.join(config.delphiDir, 'bin', 'dcc64.exe');
65
+ const delphiRuntimePath = path.win32.join(config.delphiDir, 'lib', 'Win64', 'release');
65
66
  checks.push(checkFile('Arquivo de configuração em uso', resolvedConfigPath));
66
67
  checks.push(checkPath('repoBase', config.repoBase));
67
68
  checks.push(checkPath('delphiDir', config.delphiDir));
69
+ checks.push(checkPath('Delphi runtime Win64', delphiRuntimePath));
68
70
  checks.push(checkPath('libRoot', config.libRoot));
69
71
  checks.push(checkPath('libErp', config.libErp));
70
72
  checks.push(checkPath('libAlterdata', config.libAlterdata));
@@ -81,6 +83,11 @@ function runDoctor(config, resolvedConfigPath) {
81
83
  ok: Array.isArray(config.dependencyPaths) && config.dependencyPaths.length > 0,
82
84
  detail: `${config.dependencyPaths.length} path(s)`,
83
85
  });
86
+ checks.push({
87
+ label: 'Delphi runtime presente em dependencyPaths',
88
+ ok: config.dependencyPaths.includes(delphiRuntimePath),
89
+ detail: delphiRuntimePath,
90
+ });
84
91
  console.log('');
85
92
  console.log(chalk_1.default.cyan(' Diagnóstico do Ambiente'));
86
93
  console.log(chalk_1.default.blue(' ───────────────────────'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brunoluizdesiqueira/bbuilder-cli",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "CLI de build local para projetos Delphi do Bimer",
5
5
  "license": "ISC",
6
6
  "repository": {