orangeslice 1.8.1 → 1.8.2

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.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/dist/cli.js +16 -7
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -8,7 +8,7 @@ Orangeslice provides a `services.*` API for B2B research, enrichment, scraping,
8
8
  npx orangeslice
9
9
  ```
10
10
 
11
- The CLI copies docs to `./orangeslice-docs` and creates `./orangeslice-docs/AGENTS.md` so Claude Code/Cursor can use the docs as source of truth.
11
+ The CLI copies docs to `./orangeslice-docs`, creates `./orangeslice-docs/AGENTS.md`, initializes `package.json` when missing, and installs `orangeslice` in the current directory.
12
12
 
13
13
  Install as a dependency when writing app code:
14
14
 
package/dist/cli.js CHANGED
@@ -99,6 +99,17 @@ Use the docs in this folder as the source of truth for all orangeslice operation
99
99
  `;
100
100
  fs.writeFileSync(AGENTS_FILE, content, "utf8");
101
101
  }
102
+ function ensurePackageJson(cwd) {
103
+ const packageJsonPath = path.join(cwd, "package.json");
104
+ if (fs.existsSync(packageJsonPath))
105
+ return;
106
+ console.log(" No package.json found. Initializing npm project...");
107
+ (0, child_process_1.execSync)("npm init -y", { stdio: "inherit", cwd });
108
+ }
109
+ function installOrangeslice(cwd) {
110
+ console.log(" Installing orangeslice...");
111
+ (0, child_process_1.execSync)("npm install orangeslice", { stdio: "inherit", cwd });
112
+ }
102
113
  async function main() {
103
114
  console.log("\norangeslice\n");
104
115
  const docsDir = resolveDocsDir();
@@ -108,13 +119,11 @@ async function main() {
108
119
  copyDirSync(docsDir, TARGET_DIR);
109
120
  writeAgentsGuide(TARGET_DIR);
110
121
  console.log(` ✓ Docs (${path.basename(docsDir)}) → ./orangeslice-docs/\n`);
111
- // Install package
112
- try {
113
- (0, child_process_1.execSync)("npm install orangeslice", { stdio: "inherit", cwd: process.cwd() });
114
- }
115
- catch {
116
- // no package.json or npm not available
117
- }
122
+ // Always set up package installation in the current directory.
123
+ const cwd = process.cwd();
124
+ ensurePackageJson(cwd);
125
+ installOrangeslice(cwd);
126
+ console.log(" ✓ Package installed in current directory\n");
118
127
  console.log("\nReady - services-style API\n");
119
128
  console.log(" import { services } from 'orangeslice';\n");
120
129
  console.log(" Agent setup (do this first):");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orangeslice",
3
- "version": "1.8.1",
3
+ "version": "1.8.2",
4
4
  "description": "B2B LinkedIn database prospector - 1.15B profiles, 85M companies",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",