@astryxdesign/cli 0.7.3-canary.d421aed → 0.7.3-canary.e0afabe

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.
@@ -802,8 +802,28 @@ describe('stopped and damaged installs heal', () => {
802
802
  });
803
803
  });
804
804
 
805
+ /** @param {number} pid */
806
+ const alive = pid => {
807
+ try {
808
+ process.kill(pid, 0);
809
+ return true;
810
+ } catch {
811
+ return false;
812
+ }
813
+ };
814
+
815
+ /** @param {() => boolean} done @param {number} ms */
816
+ const waitFor = async (done, ms) => {
817
+ const end = Date.now() + ms;
818
+ while (Date.now() < end) {
819
+ if (done()) return true;
820
+ await new Promise(r => setTimeout(r, 100));
821
+ }
822
+ return done();
823
+ };
824
+
805
825
  describe('runNpm time limit', () => {
806
- it('ends a package manager that ignores SIGTERM, leaving no process behind', () => {
826
+ it('ends a package manager that ignores SIGTERM, leaving no process behind', async () => {
807
827
  const marker = tempDir('npm-pid');
808
828
  const pidFile = path.join(marker, 'pid');
809
829
  const result = runNpm([], {
@@ -819,30 +839,13 @@ describe('runNpm time limit', () => {
819
839
  });
820
840
  expect(/** @type {any} */ (result.error)?.code).toBe('ETIMEDOUT');
821
841
  const pid = Number(fs.readFileSync(pidFile, 'utf-8'));
822
- expect(() => process.kill(pid, 0)).toThrow();
842
+ // The guard sends SIGKILL and exits at once; the killed process can still
843
+ // exist for a moment (the signal in flight, or awaiting reaping).
844
+ expect(await waitFor(() => !alive(pid), 5_000)).toBe(true);
823
845
  });
824
846
  });
825
847
 
826
848
  describe('no install outlives its run', () => {
827
- /** @param {number} pid */
828
- const alive = pid => {
829
- try {
830
- process.kill(pid, 0);
831
- return true;
832
- } catch {
833
- return false;
834
- }
835
- };
836
- /** @param {() => boolean} done @param {number} ms */
837
- const waitFor = async (done, ms) => {
838
- const end = Date.now() + ms;
839
- while (Date.now() < end) {
840
- if (done()) return true;
841
- await new Promise(r => setTimeout(r, 100));
842
- }
843
- return done();
844
- };
845
-
846
849
  it('ends npm when the run that started it is killed outright, and removes its process-id record', async () => {
847
850
  const dir = tempDir('orphan');
848
851
  const pidFile = path.join(dir, 'npm-pid');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astryxdesign/cli",
3
- "version": "0.7.3-canary.d421aed",
3
+ "version": "0.7.3-canary.e0afabe",
4
4
  "displayName": "CLI",
5
5
  "description": "Scaffold projects, browse templates, generate themes, and get agent-ready docs from the command line.",
6
6
  "author": "Meta Open Source",
@@ -106,10 +106,10 @@
106
106
  "zod": "^4.4.3"
107
107
  },
108
108
  "peerDependencies": {
109
- "@astryxdesign/charts": "0.7.3-canary.d421aed",
110
- "@astryxdesign/core": "0.7.3-canary.d421aed",
111
- "@astryxdesign/lab": "0.7.3-canary.d421aed",
112
- "@astryxdesign/theme-neutral": "0.7.3-canary.d421aed"
109
+ "@astryxdesign/charts": "0.7.3-canary.e0afabe",
110
+ "@astryxdesign/core": "0.7.3-canary.e0afabe",
111
+ "@astryxdesign/lab": "0.7.3-canary.e0afabe",
112
+ "@astryxdesign/theme-neutral": "0.7.3-canary.e0afabe"
113
113
  },
114
114
  "peerDependenciesMeta": {
115
115
  "@astryxdesign/charts": {
@@ -126,10 +126,10 @@
126
126
  }
127
127
  },
128
128
  "devDependencies": {
129
- "@astryxdesign/charts": "0.7.3-canary.d421aed",
130
- "@astryxdesign/core": "0.7.3-canary.d421aed",
131
- "@astryxdesign/lab": "0.7.3-canary.d421aed",
132
- "@astryxdesign/theme-neutral": "0.7.3-canary.d421aed",
129
+ "@astryxdesign/charts": "0.7.3-canary.e0afabe",
130
+ "@astryxdesign/core": "0.7.3-canary.e0afabe",
131
+ "@astryxdesign/lab": "0.7.3-canary.e0afabe",
132
+ "@astryxdesign/theme-neutral": "0.7.3-canary.e0afabe",
133
133
  "@heroicons/react": "^2.2.0",
134
134
  "@stylexjs/stylex": "^0.19.0",
135
135
  "@types/babel__core": "^7.20.5",