diff --git a/packages/plugin-sdk/package.json b/packages/plugin-sdk/package.json index 5098326..6c105c6 100644 --- a/packages/plugin-sdk/package.json +++ b/packages/plugin-sdk/package.json @@ -1,5 +1,5 @@ { - "name": "@sigmacomputing/plugin", + "name": "@sigmacomputing/plugin-sdk", "version": "1.2.0", "description": "Sigma Computing Plugin Client SDK", "license": "MIT", diff --git a/packages/plugin-sdk/tsdown.config.ts b/packages/plugin-sdk/tsdown.config.ts index fdb5930..b14ad3f 100644 --- a/packages/plugin-sdk/tsdown.config.ts +++ b/packages/plugin-sdk/tsdown.config.ts @@ -1,15 +1,2 @@ -import { defineConfig, mergeConfig } from 'tsdown'; - // @ts-ignore - base config is defined outside of this package -import baseConfig from '../../tsdown.base.ts'; - -import packageJson from './package.json' with { type: 'json' }; - -export default mergeConfig( - baseConfig, - defineConfig({ - define: { - __VERSION__: JSON.stringify(packageJson.version), - }, - }), -); +export { default } from '../../tsdown.base.ts'; diff --git a/packages/plugin-sdk/vitest.config.ts b/packages/plugin-sdk/vitest.config.ts index c3e1107..150a68b 100644 --- a/packages/plugin-sdk/vitest.config.ts +++ b/packages/plugin-sdk/vitest.config.ts @@ -1,15 +1,2 @@ -import { defineConfig, mergeConfig } from 'vitest/config'; - // @ts-ignore - base config is defined outside of this package -import baseConfig from '../../vitest.base.ts'; - -import packageJson from './package.json' with { type: 'json' }; - -export default mergeConfig( - baseConfig, - defineConfig({ - define: { - __VERSION__: JSON.stringify(packageJson.version), - }, - }), -); +export { default } from '../../vitest.base.ts'; diff --git a/packages/plugin/README.md b/packages/plugin/README.md new file mode 100644 index 0000000..46a6e0b --- /dev/null +++ b/packages/plugin/README.md @@ -0,0 +1,37 @@ +# `@sigmacomputing/plugin` is deprecated + +> **This package has been renamed to [`@sigmacomputing/plugin-sdk`](https://www.npmjs.com/package/@sigmacomputing/plugin-sdk).** +> +> `@sigmacomputing/plugin` will no longer receive updates. Please migrate your +> projects to `@sigmacomputing/plugin-sdk` to continue receiving new features +> and bug fixes. + +This package is now a thin compatibility shim that re-exports everything from +`@sigmacomputing/plugin-sdk`. It emits a `console.warn` at import time to +remind consumers to migrate. + +## Migrating + +Replace your dependency on `@sigmacomputing/plugin` with `@sigmacomputing/plugin-sdk`: + +```sh +yarn remove @sigmacomputing/plugin +yarn add @sigmacomputing/plugin-sdk +``` + +```sh +npm uninstall @sigmacomputing/plugin +npm install @sigmacomputing/plugin-sdk +``` + +Then update your imports: + +```diff +-import { client, initialize } from '@sigmacomputing/plugin'; ++import { client, initialize } from '@sigmacomputing/plugin-sdk'; +``` + +The public API is unchanged — only the package name is different. + +For documentation, examples, and the changelog, see the +[`@sigmacomputing/plugin-sdk`](https://github.com/sigmacomputing/plugin) repository. diff --git a/packages/plugin/package.json b/packages/plugin/package.json new file mode 100644 index 0000000..1b06fa1 --- /dev/null +++ b/packages/plugin/package.json @@ -0,0 +1,54 @@ +{ + "name": "@sigmacomputing/plugin", + "version": "1.2.0", + "description": "Deprecated: use @sigmacomputing/plugin-sdk instead.", + "license": "MIT", + "type": "module", + "scripts": { + "build": "tsdown", + "build:watch": "tsdown --watch", + "format": "yarn g:format", + "lint": "yarn g:lint", + "publish": "yarn g:publlish", + "types": "yarn g:types" + }, + "dependencies": { + "@sigmacomputing/plugin-sdk": "^1.2.0" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + } + }, + "devDependencies": { + "tsdown": "^0.21.10" + }, + "main": "./dist/cjs/index.cjs", + "module": "./dist/esm/index.js", + "types": "./dist/cjs/index.d.cts", + "unpkg": "./dist/umd/sigmacomputing-plugin.umd.js", + "jsdelivr": "./dist/umd/sigmacomputing-plugin.umd.js", + "exports": { + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/cjs/index.d.cts", + "default": "./dist/cjs/index.cjs" + } + }, + "./package.json": "./package.json" + }, + "files": [ + "dist/**/*", + "src/**/*" + ], + "publishConfig": { + "access": "public" + } +} diff --git a/packages/plugin/src/index.ts b/packages/plugin/src/index.ts new file mode 100644 index 0000000..b4e5ae0 --- /dev/null +++ b/packages/plugin/src/index.ts @@ -0,0 +1,6 @@ +console.warn( + '[@sigmacomputing/plugin] This package is deprecated and will no longer receive updates. ' + + 'Please migrate to @sigmacomputing/plugin-sdk: https://github.com/sigmacomputing/plugin', +); + +export * from '@sigmacomputing/plugin-sdk'; diff --git a/packages/plugin/tsconfig.app.json b/packages/plugin/tsconfig.app.json new file mode 100644 index 0000000..2ed40b8 --- /dev/null +++ b/packages/plugin/tsconfig.app.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.app.json", + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo" + }, + "include": ["src"] +} diff --git a/packages/plugin/tsconfig.json b/packages/plugin/tsconfig.json new file mode 100644 index 0000000..473104a --- /dev/null +++ b/packages/plugin/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.tsbuildinfo", + + "noEmit": true + }, + "files": [], + "references": [ + { "path": "./tsconfig.app.json" }, + { "path": "./tsconfig.node.json" } + ] +} diff --git a/packages/plugin/tsconfig.node.json b/packages/plugin/tsconfig.node.json new file mode 100644 index 0000000..700baa1 --- /dev/null +++ b/packages/plugin/tsconfig.node.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.node.json", + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo" + }, + "include": ["tsdown.config.ts"] +} diff --git a/packages/plugin/tsdown.config.ts b/packages/plugin/tsdown.config.ts new file mode 100644 index 0000000..b14ad3f --- /dev/null +++ b/packages/plugin/tsdown.config.ts @@ -0,0 +1,2 @@ +// @ts-ignore - base config is defined outside of this package +export { default } from '../../tsdown.base.ts'; diff --git a/scripts/bump-version.ts b/scripts/bump-version.ts index 9a115df..449e59e 100644 --- a/scripts/bump-version.ts +++ b/scripts/bump-version.ts @@ -100,13 +100,27 @@ const readCurrentVersion = (): semver.SemVer => { return parsed; }; +const WORKSPACE_DEP_SCOPE = '@sigmacomputing/'; + const writeNewVersion = (pkgPath: string, version: string): void => { const raw = readFileSync(pkgPath, 'utf8'); const pattern = /("version"\s*:\s*")[^"]+(")/; if (!pattern.test(raw)) { throw new Error(`Failed to locate "version" field in ${pkgPath}`); } - writeFileSync(pkgPath, raw.replace(pattern, `$1${version}$2`)); + const withVersion = raw.replace(pattern, `$1${version}$2`); + + const escaped = WORKSPACE_DEP_SCOPE.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); + const depPattern = new RegExp( + `("${escaped}[^"]+"\\s*:\\s*")(\\^|~)?[^"]+(")`, + 'g', + ); + const withDeps = withVersion.replace( + depPattern, + (_match, prefix, range, suffix) => `${prefix}${range ?? '^'}${version}${suffix}`, + ); + + writeFileSync(pkgPath, withDeps); }; type TurboQueryLsResponse = { diff --git a/vitest.base.ts b/vitest.base.ts index d84730c..a3de5fd 100644 --- a/vitest.base.ts +++ b/vitest.base.ts @@ -1,8 +1,11 @@ import { playwright } from '@vitest/browser-playwright'; import { defineConfig } from 'vitest/config'; +import packageJson from './package.json' with { type: 'json' }; + export default defineConfig({ define: { + __VERSION__: JSON.stringify(packageJson.version), __VITEST_BROWSER__: true.toString(), }, oxc: {