Skip to content

Commit

Permalink
linear-issues: publish d.ts and correctly specify devDeps
Browse files Browse the repository at this point in the history
We had a bunch of deps which are only dev deps. Additionally because we
called tsc --clean when bundling we didn't publish the index.d.ts file
which confused vscode when I was importing the provider into Cody.

Finally our cody build is stricter on how we reference built in node
modules. Just for fs/promises I updated all call sites to use the node:
prefix.
  • Loading branch information
keegancsmith committed Jun 27, 2024
1 parent 2c21f2b commit 22c386e
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 29 deletions.
2 changes: 1 addition & 1 deletion client/vscode/test/integration/api.test.cts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as assert from 'assert'
import path from 'path'
import type { ClientConfiguration } from '@openctx/client'
import type { ExtensionApiForTesting } from '@openctx/vscode-lib'
import { copyFile } from 'fs/promises'
import { copyFile } from 'node:fs/promises'
import { before } from 'mocha'
import * as vscode from 'vscode'

Expand Down
2 changes: 1 addition & 1 deletion client/vscode/test/integration/main.cts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { tmpdir } from 'os'
import * as path from 'path'
import { runTests } from '@vscode/test-electron'
import { mkdir, mkdtemp, rm } from 'fs/promises'
import { mkdir, mkdtemp, rm } from 'node:fs/promises'

async function main(): Promise<void> {
// When run, this script's filename is `client/vscode/dist/tsc/test/integration/main.js`, so
Expand Down
2 changes: 1 addition & 1 deletion lib/schema/dev/generateJsonSchemaTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import path from 'path'
import { pathToFileURL } from 'url'
import { readFile } from 'fs/promises'
import { readFile } from 'node:fs/promises'
import { compile as compileJSONSchema } from 'json-schema-to-typescript'

async function generateSchema(schemaPath: string, preamble?: string): Promise<void> {
Expand Down
22 changes: 6 additions & 16 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion provider/devdocs/devdocs.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import url from 'url'
import fs from 'fs/promises'
import fs from 'node:fs/promises'

/** Format of the file found at a location like https://devdocs.io/docs/go/index.json */
interface Index {
Expand Down
2 changes: 1 addition & 1 deletion provider/devdocs/update-fixtures.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path'
import url from 'url'
import fs from 'fs/promises'
import fs from 'node:fs/promises'
import { fetchDoc, fetchIndex } from './devdocs.js'

/**
Expand Down
2 changes: 1 addition & 1 deletion provider/linear-issues/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type {
} from '@openctx/provider'
import dedent from 'dedent'
import { XMLBuilder } from 'fast-xml-parser'
import { readFile } from 'fs/promises'
import { readFile } from 'node:fs/promises'

import type { UserCredentials } from './auth.js'

Expand Down
12 changes: 6 additions & 6 deletions provider/linear-issues/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openctx/provider-linear-issues",
"version": "0.0.4",
"version": "0.0.6",
"description": "Linear Issues context for code AI and editors (OpenCtx provider)",
"license": "Apache-2.0",
"repository": {
Expand All @@ -20,19 +20,19 @@
"build": "tsc --build",
"bundle:watch": "pnpm run bundle --watch",
"bundle": "esbuild --main-fields=module,main --external:vscode --log-level=error --platform=node --bundle --format=esm --outfile=dist/bundle.js index.ts",
"prepublishOnly": "tsc --build --clean && pnpm run --silent bundle",
"prepublishOnly": "tsc --build && pnpm run --silent bundle",
"test": "vitest",
"auth": "node --no-warnings=ExperimentalWarning --es-module-specifier-resolution=node --loader ts-node/esm/transpile-only auth.ts"
},
"dependencies": {
"@openctx/provider": "workspace:*",
"dedent": "^1.5.3",
"fast-xml-parser": "^4.4.0",
"open": "^10.0.4",
"server-destroy": "^1.0.1"
"fast-xml-parser": "^4.4.0"
},
"devDependencies": {
"@types/server-destroy": "^1.0.3",
"@types/vscode": "^1.85.0"
"@types/vscode": "^1.85.0",
"open": "^10.0.4",
"server-destroy": "^1.0.1"
}
}
2 changes: 1 addition & 1 deletion provider/sentry/auth.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { readFile } from 'fs/promises'
import { readFile } from 'node:fs/promises'
import type { Settings } from './settings.js'

/**
Expand Down

0 comments on commit 22c386e

Please sign in to comment.