@mikarinneoracle/oci-cdk-code-only-preview 0.0.17 → 0.0.19

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/bin/ocdk.js CHANGED
@@ -122,18 +122,15 @@ if (command === 'tail:execution-log') {
122
122
  const projectDir = process.cwd();
123
123
  const projectScript = path.join(projectDir, 'tail-function-logs.js');
124
124
  if (fs.existsSync(projectScript)) {
125
- // A stack synth creates a placeholder script. Refresh it from Terraform
126
- // outputs before executing so it never masks the working fallback tailer.
127
- const projectScriptContent = fs.readFileSync(projectScript, 'utf8');
128
- if (projectScriptContent.includes('__EXECUTION_LOG_ID__') || projectScriptContent.includes('__LOG_GROUP_ID__')) {
129
- const configureLogs = spawnSync('node', [path.join(root, 'bin', 'write-log-config.js')], {
130
- stdio: 'inherit',
131
- cwd: projectDir,
132
- shell: false,
133
- env: process.env,
134
- });
135
- if (configureLogs.status !== 0) process.exit(configureLogs.status ?? 1);
136
- }
125
+ // Refresh on every run. Older generated scripts can have empty defaults
126
+ // instead of placeholders, so inspecting their content is not reliable.
127
+ const configureLogs = spawnSync('node', [path.join(root, 'bin', 'write-log-config.js')], {
128
+ stdio: 'inherit',
129
+ cwd: projectDir,
130
+ shell: false,
131
+ env: process.env,
132
+ });
133
+ if (configureLogs.status !== 0) process.exit(configureLogs.status ?? 1);
137
134
  const result = spawnSync('node', [projectScript, ...args.slice(1)], {
138
135
  stdio: 'inherit',
139
136
  cwd: projectDir,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikarinneoracle/oci-cdk-code-only-preview",
3
- "version": "0.0.17",
3
+ "version": "0.0.19",
4
4
  "description": "OCI CDK stack for OCI Functions, API Gateway, and related infrastructure",
5
5
  "main": "lib/index.js",
6
6
  "bin": {
@@ -16,13 +16,15 @@ function debug(...args) {
16
16
  }
17
17
 
18
18
  // Defaults: in-code (injected by npx ocdk write-log-config when writing tail-function-logs.js) or env vars. Placeholders become empty.
19
+ const EXECUTION_LOG_ID_PLACEHOLDER = ['__EXECUTION', '_LOG_ID__'].join('');
20
+ const LOG_GROUP_ID_PLACEHOLDER = ['__LOG', '_GROUP_ID__'].join('');
19
21
  let DEFAULT_EXECUTION_LOG_ID = '__EXECUTION_LOG_ID__';
20
22
  let DEFAULT_LOG_GROUP_ID = '__LOG_GROUP_ID__';
21
23
  if (DEBUG) {
22
- debug('in-code defaults: execution_log=', DEFAULT_EXECUTION_LOG_ID === '__EXECUTION_LOG_ID__' ? 'placeholder' : 'set', 'log_group=', DEFAULT_LOG_GROUP_ID === '__LOG_GROUP_ID__' ? 'placeholder' : 'set');
24
+ debug('in-code defaults: execution_log=', DEFAULT_EXECUTION_LOG_ID === EXECUTION_LOG_ID_PLACEHOLDER ? 'placeholder' : 'set', 'log_group=', DEFAULT_LOG_GROUP_ID === LOG_GROUP_ID_PLACEHOLDER ? 'placeholder' : 'set');
23
25
  }
24
- if (DEFAULT_EXECUTION_LOG_ID === '__EXECUTION_LOG_ID__') DEFAULT_EXECUTION_LOG_ID = '';
25
- if (DEFAULT_LOG_GROUP_ID === '__LOG_GROUP_ID__') DEFAULT_LOG_GROUP_ID = '';
26
+ if (DEFAULT_EXECUTION_LOG_ID === EXECUTION_LOG_ID_PLACEHOLDER) DEFAULT_EXECUTION_LOG_ID = '';
27
+ if (DEFAULT_LOG_GROUP_ID === LOG_GROUP_ID_PLACEHOLDER) DEFAULT_LOG_GROUP_ID = '';
26
28
  if (DEBUG) {
27
29
  debug('final execution_log:', DEFAULT_EXECUTION_LOG_ID ? `${DEFAULT_EXECUTION_LOG_ID.slice(0, 30)}...` : '(empty)', 'log_group:', DEFAULT_LOG_GROUP_ID ? `${DEFAULT_LOG_GROUP_ID.slice(0, 30)}...` : '(empty)');
28
30
  }