From b4c7f7767a77b68107d18ef9fb3e1feafc88c18f Mon Sep 17 00:00:00 2001 From: Mathieu Colmon Date: Wed, 7 Oct 2026 16:56:54 +0000 Subject: [PATCH] Prepare 4.0.0 stable release --- README.md | 14 +++++++------- docs/README.es.md | 14 +++++++------- docs/README.fr.md | 14 +++++++------- docs/README.pt.md | 14 +++++++------- docs/data-api.md | 2 +- docs/release-4.0.0.md | 17 +++++++++++++++++ llms.txt | 4 ++-- package-lock.json | 4 ++-- package.json | 2 +- scripts/smoke.mjs | 4 ++-- src/quick-start.ts | 6 +++--- tests/unit/quick-start.test.ts | 2 +- 12 files changed, 57 insertions(+), 40 deletions(-) create mode 100644 docs/release-4.0.0.md diff --git a/README.md b/README.md index d37e48a..ecd06db 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ ### One request, real data -> **V4 release candidate is available on npm under `next`.** Install with `npm install @mathieuc/tradingview@next`. The default `latest` tag is still v3 and does not export `getCandles`. +> **V4 is the default npm release.** Install with `npm install @mathieuc/tradingview` to use `getCandles` and the new data API. ```js import { getCandles } from '@mathieuc/tradingview/data'; @@ -33,10 +33,10 @@ Prefer to start without code? The setup paths below work too. ### Interactive quick-start -The interactive launcher is included starting with **4.0.0-rc.1**: +The interactive launcher is included in V4: ```bash -npx @mathieuc/tradingview@next +npx @mathieuc/tradingview ``` Run it from your project directory with Node.js 20+. Choose a path: @@ -45,7 +45,7 @@ Run it from your project directory with Node.js 20+. Choose a path: 2. **Claude Code CLI** — starts your installed `claude` CLI here with a ready-to-use project prompt. 3. **Codex CLI** — starts your installed `codex` CLI here with the same prompt. 4. **Another local coding agent** — prints the prompt to paste into your agent. -5. **Install the library only** — runs `npm install @mathieuc/tradingview@next` here, without generating files or starting an agent. +5. **Install the library only** — runs `npm install @mathieuc/tradingview` here, without generating files or starting an agent. Claude Code and Codex must already be installed and authenticated. Their normal permission prompts remain enabled. If launch fails, the prompt is printed for manual use. If no browser is available, the hosted link remains visible. @@ -59,11 +59,11 @@ node bin/tradingview.mjs ### Install manually ```bash -npm install @mathieuc/tradingview@next -# Or: bun add @mathieuc/tradingview@next +npm install @mathieuc/tradingview +# Or: bun add @mathieuc/tradingview ``` -`next` installs the V4 release candidate; the default `latest` tag still installs V3. Do not mix the V4 imports with a V3 installation. +V4 is installed by default. V3 remains available with `@mathieuc/tradingview@3`; read the migration guide before upgrading existing V3 projects. The V4 package is ESM with TypeScript declarations. CommonJS projects can `require()` it on Node 20.19+ or 22.12+, or use `await import()`. diff --git a/docs/README.es.md b/docs/README.es.md index e0c788c..bcc5cf3 100644 --- a/docs/README.es.md +++ b/docs/README.es.md @@ -16,7 +16,7 @@ ### Una consulta, datos reales -> **La versión candidata V4 está disponible en npm bajo la etiqueta `next`.** Instálala con `npm install @mathieuc/tradingview@next`. La etiqueta predeterminada `latest` sigue en V3 y no exporta `getCandles`. +> **V4 es la versión predeterminada en npm.** Instálala con `npm install @mathieuc/tradingview` para usar `getCandles` y la nueva API de datos. ```js import { getCandles } from '@mathieuc/tradingview/data'; @@ -33,10 +33,10 @@ console.log(candles.at(-1)); // { time, open, high, low, close, volume } ### Inicio rápido interactivo -El asistente interactivo está incluido a partir de **4.0.0-rc.1**: +El asistente interactivo está incluido en la V4: ```bash -npx @mathieuc/tradingview@next +npx @mathieuc/tradingview ``` Ejecútalo desde el directorio de tu proyecto con Node.js 20+. Elige una opción: @@ -45,7 +45,7 @@ Ejecútalo desde el directorio de tu proyecto con Node.js 20+. Elige una opción 2. **Claude Code CLI** — inicia tu CLI `claude` instalado en este directorio con un prompt de proyecto listo para usar. 3. **Codex CLI** — inicia tu CLI `codex` instalado en este directorio con el mismo prompt. 4. **Otro agente de programación local** — muestra el prompt para pegarlo en tu agente. -5. **Instalar solo la biblioteca** — ejecuta `npm install @mathieuc/tradingview@next` aquí, sin generar archivos ni iniciar un agente. +5. **Instalar solo la biblioteca** — ejecuta `npm install @mathieuc/tradingview` aquí, sin generar archivos ni iniciar un agente. Claude Code y Codex deben estar instalados y autenticados. Sus solicitudes de permiso habituales siguen activadas. Si el inicio falla, se muestra el prompt para usarlo manualmente. Si no hay navegador disponible, el enlace alojado sigue visible. @@ -59,11 +59,11 @@ node bin/tradingview.mjs ### Instalación manual ```bash -npm install @mathieuc/tradingview@next -# O: bun add @mathieuc/tradingview@next +npm install @mathieuc/tradingview +# O: bun add @mathieuc/tradingview ``` -`next` instala la versión candidata V4; la etiqueta predeterminada `latest` todavía instala V3. No mezcles imports de V4 con una instalación de V3. +V4 se instala por defecto. V3 sigue disponible con `@mathieuc/tradingview@3`; consulta la guía de migración antes de actualizar un proyecto V3. El paquete V4 es ESM con declaraciones TypeScript. Los proyectos CommonJS pueden usar `require()` en Node 20.19+ o 22.12+, o `await import()`. diff --git a/docs/README.fr.md b/docs/README.fr.md index 806c0f9..f5711ba 100644 --- a/docs/README.fr.md +++ b/docs/README.fr.md @@ -16,7 +16,7 @@ ### Une requête, de vraies données -> **La release candidate V4 est disponible sur npm sous le tag `next`.** Installez-la avec `npm install @mathieuc/tradingview@next`. Le tag par défaut `latest` reste sur la V3 et n’exporte pas `getCandles`. +> **La V4 est la version npm par défaut.** Installez-la avec `npm install @mathieuc/tradingview` pour utiliser `getCandles` et la nouvelle API de données. ```js import { getCandles } from '@mathieuc/tradingview/data'; @@ -33,10 +33,10 @@ Vous préférez commencer sans coder ? Les parcours ci-dessous le permettent aus ### Quick-start interactif -Le lanceur interactif est inclus à partir de **4.0.0-rc.1** : +Le lanceur interactif est inclus dans la V4 : ```bash -npx @mathieuc/tradingview@next +npx @mathieuc/tradingview ``` Lancez-le depuis le dossier de votre projet avec Node.js 20+. Choisissez un parcours : @@ -45,7 +45,7 @@ Lancez-le depuis le dossier de votre projet avec Node.js 20+. Choisissez un parc 2. **Claude Code CLI** — démarre votre CLI `claude` installé dans ce dossier, avec un prompt de projet prêt à l’emploi. 3. **Codex CLI** — démarre votre CLI `codex` installé dans ce dossier, avec le même prompt. 4. **Un autre coding-agent local** — affiche le prompt à coller dans votre agent. -5. **Installer seulement la librairie** — exécute `npm install @mathieuc/tradingview@next` dans ce dossier, sans générer de fichiers ni démarrer d’agent. +5. **Installer seulement la librairie** — exécute `npm install @mathieuc/tradingview` dans ce dossier, sans générer de fichiers ni démarrer d’agent. Claude Code et Codex doivent déjà être installés et authentifiés. Leurs demandes d’autorisation habituelles restent actives. Si le lancement échoue, le prompt est affiché pour une utilisation manuelle. Si aucun navigateur n’est disponible, le lien hébergé reste visible. @@ -59,11 +59,11 @@ node bin/tradingview.mjs ### Installation manuelle ```bash -npm install @mathieuc/tradingview@next -# Ou : bun add @mathieuc/tradingview@next +npm install @mathieuc/tradingview +# Ou : bun add @mathieuc/tradingview ``` -`next` installe la release candidate V4 ; le tag par défaut `latest` installe encore la V3. Ne mélangez pas les imports V4 avec une installation V3. +La V4 est installée par défaut. La V3 reste disponible avec `@mathieuc/tradingview@3` ; consultez le guide de migration avant de mettre à jour un projet V3. Le paquet V4 est ESM avec des déclarations TypeScript. Les projets CommonJS peuvent utiliser `require()` avec Node 20.19+ ou 22.12+, ou `await import()`. diff --git a/docs/README.pt.md b/docs/README.pt.md index 0d086e1..e28660f 100644 --- a/docs/README.pt.md +++ b/docs/README.pt.md @@ -16,7 +16,7 @@ ### Uma consulta, dados reais -> **A release candidate V4 está disponível no npm com a tag `next`.** Instale com `npm install @mathieuc/tradingview@next`. A tag padrão `latest` continua na V3 e não exporta `getCandles`. +> **A V4 é a versão padrão no npm.** Instale com `npm install @mathieuc/tradingview` para usar `getCandles` e a nova API de dados. ```js import { getCandles } from '@mathieuc/tradingview/data'; @@ -33,10 +33,10 @@ Prefere começar sem código? Os caminhos abaixo também funcionam. ### Início rápido interativo -O assistente interativo está incluído a partir da **4.0.0-rc.1**: +O assistente interativo está incluído na V4: ```bash -npx @mathieuc/tradingview@next +npx @mathieuc/tradingview ``` Execute no diretório do seu projeto com Node.js 20+. Escolha um caminho: @@ -45,7 +45,7 @@ Execute no diretório do seu projeto com Node.js 20+. Escolha um caminho: 2. **Claude Code CLI** — inicia seu CLI `claude` instalado neste diretório com um prompt de projeto pronto para usar. 3. **Codex CLI** — inicia seu CLI `codex` instalado neste diretório com o mesmo prompt. 4. **Outro agente de programação local** — exibe o prompt para colar no seu agente. -5. **Instalar apenas a biblioteca** — executa `npm install @mathieuc/tradingview@next` aqui, sem gerar arquivos nem iniciar um agente. +5. **Instalar apenas a biblioteca** — executa `npm install @mathieuc/tradingview` aqui, sem gerar arquivos nem iniciar um agente. Claude Code e Codex devem estar instalados e autenticados. As solicitações normais de permissão continuam ativas. Se a inicialização falhar, o prompt será exibido para uso manual. Se não houver navegador disponível, o link hospedado continuará visível. @@ -59,11 +59,11 @@ node bin/tradingview.mjs ### Instalação manual ```bash -npm install @mathieuc/tradingview@next -# Ou: bun add @mathieuc/tradingview@next +npm install @mathieuc/tradingview +# Ou: bun add @mathieuc/tradingview ``` -`next` instala a release candidate V4; a tag padrão `latest` ainda instala a V3. Não misture imports da V4 com uma instalação da V3. +A V4 é instalada por padrão. A V3 continua disponível com `@mathieuc/tradingview@3`; consulte o guia de migração antes de atualizar um projeto V3. O pacote V4 é ESM com declarações TypeScript. Projetos CommonJS podem usar `require()` no Node 20.19+ ou 22.12+, ou `await import()`. diff --git a/docs/data-api.md b/docs/data-api.md index ddc5f5e..4132eea 100644 --- a/docs/data-api.md +++ b/docs/data-api.md @@ -2,7 +2,7 @@ [README](../README.md) · [Low-level API](low-level-api.md) · [Migrating from v3](migration-v4.md) · [Examples](../examples) -**V4 beta is currently available from this repository only; the latest npm release is still v3.** Build this checkout before running the examples below. +**V4 is the default npm release.** Install `@mathieuc/tradingview` before running the examples below. The data API is the simplest way to use this library, in any application. Each function opens what it needs, waits for complete data, and releases every websocket session (and the connection it opened) before returning, including on errors, timeouts and cancellation. diff --git a/docs/release-4.0.0.md b/docs/release-4.0.0.md new file mode 100644 index 0000000..6b699fb --- /dev/null +++ b/docs/release-4.0.0.md @@ -0,0 +1,17 @@ +# 4.0.0 + +Release channel: `latest`. This is the stable V4 release; V3 remains available by installing `@mathieuc/tradingview@3` explicitly. + +## Highlights + +- Make the V4 TypeScript/ESM data API the default installation: candles, quotes, indicators, screeners, watchlists and low-level sessions. +- Include an interactive `npx @mathieuc/tradingview` quick-start with hosted and local-agent paths, plus library-only installation. +- Point the quick-start, agent prompt, and English/French/Spanish/Portuguese guides at the stable package instead of `next`. + +## Migration + +V4 is a breaking rewrite with no V3 compatibility layer. Existing V3 projects should follow [the migration guide](migration-v4.md) and [the coverage matrix](v4-coverage.md). The npm `next` tag remains on 4.0.0-rc.2; install `@mathieuc/tradingview` for the stable version. + +## Verification + +The final release gate is `npm ci`, `npm run check`, `npm run test:bun`, a packed-tarball smoke test, and a fresh public-registry installation under Node and Bun. CI covers Node 20/22/24 and Bun. The published tarball and `latest` dist-tag must be checked against the locally packed release. diff --git a/llms.txt b/llms.txt index 8c5aa3b..2b22d7b 100644 --- a/llms.txt +++ b/llms.txt @@ -3,7 +3,7 @@ # https://www.npmjs.com/package/@mathieuc/tradingview Independent community library for TradingView market data. Not an official TradingView API. -Version 4 release candidate: TypeScript, ESM, Node >= 20 or Bun. Breaking rewrite of v3 (no compatibility layer). Install the prerelease with npm install @mathieuc/tradingview@next; the default latest tag remains v3. +Version 4 is the default npm release: TypeScript, ESM, Node >= 20 or Bun. Breaking rewrite of v3 (no compatibility layer). Install with npm install @mathieuc/tradingview. Existing V3 projects should consult docs/migration-v4.md before upgrading. Simple data API (import from '@mathieuc/tradingview/data' or the root entry): - getCandles({ symbol, timeframe?, count?, from?, to?, chartType?, ... }) -> Candle[] oldest first, time in Unix seconds. @@ -22,5 +22,5 @@ Low-level API: TradingViewClient, client.createChart() (ChartSession: setMarket, Pine studies need a TradingView account (session cookies). Built-in studies and candles/quotes work anonymously, with history limits. Docs: docs/data-api.md, docs/low-level-api.md, docs/migration-v4.md, docs/v4-coverage.md, docs/v4-reliability.md, docs/protocol-contributing.md. Examples: examples/. -The next release adds an interactive setup CLI: npx @mathieuc/tradingview@next (not present in RC.0). It opens Molted Studio, launches a local coding agent with a prompt, prints that prompt, or installs the library. It is not a market-data query CLI. No MCP server, backtesting engine or hosted trading API is shipped. +The interactive setup CLI is available with npx @mathieuc/tradingview. It opens Molted Studio, launches a local coding agent with a prompt, prints that prompt, or installs the library. It is not a market-data query CLI. No MCP server, backtesting engine or hosted trading API is shipped. Questions and bugs: https://github.com/Mathieu2301/TradingView-API/issues/new/choose diff --git a/package-lock.json b/package-lock.json index 5954dc4..ccdc87c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@mathieuc/tradingview", - "version": "4.0.0-rc.2", + "version": "4.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@mathieuc/tradingview", - "version": "4.0.0-rc.2", + "version": "4.0.0", "license": "ISC", "dependencies": { "ws": "^8.18.0" diff --git a/package.json b/package.json index 0c22b23..be71b59 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mathieuc/tradingview", - "version": "4.0.0-rc.2", + "version": "4.0.0", "description": "TradingView market data for JavaScript and TypeScript: candles, quotes, indicators and strategies, with a simple data API and full low-level access.", "type": "module", "main": "./dist/index.js", diff --git a/scripts/smoke.mjs b/scripts/smoke.mjs index d4a322d..14f3c2c 100644 --- a/scripts/smoke.mjs +++ b/scripts/smoke.mjs @@ -34,7 +34,7 @@ try { const help = run('node', [launcher, '--help'], dir); if (!help.includes('Autonomous agent (recommended)')) throw new Error('CLI help missing'); const prompt = run('node', [launcher, '--choice', '4'], dir); - if (!prompt.includes('@mathieuc/tradingview@next')) throw new Error('CLI prompt missing'); + if (!prompt.includes('@mathieuc/tradingview')) throw new Error('CLI prompt missing'); const noTty = spawnSync('node', [launcher], { cwd: dir, encoding: 'utf8' }); if (noTty.status !== 1 || !noTty.stderr.includes('--choice')) throw new Error('CLI non-TTY guard failed'); const bin = join(dir, 'node_modules', '.bin', 'tradingview'); @@ -57,7 +57,7 @@ writeFileSync(process.env.TV_CAPTURE, JSON.stringify({ args: process.argv.slice( }); if (child.status !== 0) throw new Error(`CLI choice ${choice} failed: ${child.stderr}`); const received = JSON.parse(readFileSync(captured, 'utf8')); - const expected = choice === '5' ? ['install', '@mathieuc/tradingview@next'] : [AGENT_PROMPT]; + const expected = choice === '5' ? ['install', '@mathieuc/tradingview'] : [AGENT_PROMPT]; if (received.cwd !== dir || JSON.stringify(received.args) !== JSON.stringify(expected)) throw new Error(`CLI choice ${choice} altered argv or cwd`); } console.log('quick-start packed CLI ok'); diff --git a/src/quick-start.ts b/src/quick-start.ts index af7ebc1..afe0fe4 100644 --- a/src/quick-start.ts +++ b/src/quick-start.ts @@ -2,11 +2,11 @@ import { spawnSync, type SpawnSyncOptions, type SpawnSyncReturns } from 'node:ch import { createInterface } from 'node:readline/promises'; export const LANDING_URL = 'https://molted.studio/dreams/market-watch-alerts'; -export const PACKAGE_SPEC = '@mathieuc/tradingview@next'; +export const PACKAGE_SPEC = '@mathieuc/tradingview'; export const AGENT_PROMPT = `Help me build a project using TradingView-API V4 (${PACKAGE_SPEC}). First ask what I want to build and inspect the current project and its instructions before making changes. Read https://github.com/Mathieu2301/TradingView-API/blob/main/llms.txt and the data API guide at https://github.com/Mathieu2301/TradingView-API/blob/main/docs/data-api.md; use the docs shipped with the installed package as the version-specific reference. -Use Node.js 20+ and install ${PACKAGE_SPEC} with the project's package manager. The default latest tag is still V3: do not mix the V3 Client API with V4. +Use Node.js 20+ and install ${PACKAGE_SPEC} with the project's package manager. V4 is the default release; use the migration guide before upgrading a V3 project. Preserve existing files and project configuration. For a new project, start with a small runnable ESM (.mjs) example using getCandles from '@mathieuc/tradingview/data' and anonymous BINANCE:BTCUSDT data, then adapt it to my goal. Use timeouts, handle errors, and stop watchers or close clients on shutdown. Run the example and report observed results honestly, with exact commands to run it again. Only request TradingView credentials if my feature needs them; keep them in local environment variables, out of source control and logs. Explain any account or market-data limitations relevant to my goal. @@ -14,7 +14,7 @@ This is an independent community library, not an official TradingView API. Do no export const HELP = `TradingView-API quick-start (Node.js 20+) -Usage: npx @mathieuc/tradingview@next [--choice 1|2|3|4|5] +Usage: npx @mathieuc/tradingview [--choice 1|2|3|4|5] 1. Autonomous agent (recommended) 2. Claude Code CLI diff --git a/tests/unit/quick-start.test.ts b/tests/unit/quick-start.test.ts index 49f1722..ebd9cbd 100644 --- a/tests/unit/quick-start.test.ts +++ b/tests/unit/quick-start.test.ts @@ -42,7 +42,7 @@ describe('quick-start', () => { expect(runChoice('4', { log: (s) => messages.push(s), run: () => { throw new Error('must not spawn'); } })).toBe(0); expect(messages.join('\n')).toContain(AGENT_PROMPT); }); - it('only installs the V4 next package', () => { + it('installs the default V4 package', () => { expect(runChoice('5', { platform: 'linux', log: () => {}, run: (cmd, args) => { expect(cmd).toBe('npm'); expect(args).toEqual(['install', PACKAGE_SPEC]);