mirror of
https://github.com/Kong/insomnia.git
synced 2026-10-22 14:55:16 -04:00
chore(pre-req script): move all sdk files to sdk workspace - INS-3379 (#7255)
* feat: move script sdk to one workspace and update importing paths * test: add jest config for enabling tests * fix: failed to build package because of missing .node loader
This commit is contained in:
1 parent
a15e649602
commit
2d9e2da52e
37 files changed
+84
-32
No files matched your search
Generated
+11
-1
@@ -14,7 +14,8 @@
|
||||
"packages/insomnia-send-request",
|
||||
"packages/insomnia",
|
||||
"packages/insomnia-inso",
|
||||
"packages/insomnia-smoke-test"
|
||||
"packages/insomnia-smoke-test",
|
||||
"packages/insomnia-sdk"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@jest/globals": "^29.7.0",
|
||||
@@ -12917,6 +12918,10 @@
|
||||
"resolved": "packages/insomnia-inso",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/insomnia-sdk": {
|
||||
"resolved": "packages/insomnia-sdk",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/insomnia-send-request": {
|
||||
"resolved": "packages/insomnia-send-request",
|
||||
"link": true
|
||||
@@ -22927,6 +22932,11 @@
|
||||
"@esbuild/win32-x64": "0.20.2"
|
||||
}
|
||||
},
|
||||
"packages/insomnia-sdk": {
|
||||
"version": "0.1.0",
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {}
|
||||
},
|
||||
"packages/insomnia-send-request": {
|
||||
"version": "9.0.0-beta.3",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
+2
-1
@@ -20,7 +20,8 @@
|
||||
"packages/insomnia-send-request",
|
||||
"packages/insomnia",
|
||||
"packages/insomnia-inso",
|
||||
"packages/insomnia-smoke-test"
|
||||
"packages/insomnia-smoke-test",
|
||||
"packages/insomnia-sdk"
|
||||
],
|
||||
"scripts": {
|
||||
"dev": "npm start --workspace=packages/insomnia",
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
/** @type { import('@jest/types').Config.InitialOptions } */
|
||||
|
||||
module.exports = {
|
||||
preset: '../../jest-preset.js',
|
||||
globals: {
|
||||
'ts-jest': {
|
||||
isolatedModules: true,
|
||||
tsconfig: '../../tsconfig.base.json',
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "insomnia-sdk",
|
||||
"version": "0.1.0",
|
||||
"description": "",
|
||||
"main": "src/objects/index.ts",
|
||||
"types": "src/objects/index.ts",
|
||||
"devDependencies": {},
|
||||
"scripts": {
|
||||
"test": "jest"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/Kong/insomnia.git",
|
||||
"directory": "packages/insomnia-testing"
|
||||
},
|
||||
"author": "Kong <office@konghq.com>",
|
||||
"license": "Apache-2.0",
|
||||
"bugs": {
|
||||
"url": "https://github.com/Kong/insomnia/issues"
|
||||
},
|
||||
"homepage": "https://github.com/Kong/insomnia#readme"
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+3
-2
@@ -1,5 +1,6 @@
|
||||
import type { OAuth2ResponseType, RequestAuthentication } from '../../models/request';
|
||||
import { OAuth1SignatureMethod } from '../../network/o-auth-1/constants';
|
||||
import type { OAuth2ResponseType, RequestAuthentication } from 'insomnia/src/models/request';
|
||||
import { OAuth1SignatureMethod } from 'insomnia/src/network/o-auth-1/constants';
|
||||
|
||||
import { Property } from './properties';
|
||||
import { Variable, VariableList } from './variables';
|
||||
|
||||
File renamed without changes.
File renamed without changes.
+1
-1
@@ -1,7 +1,7 @@
|
||||
import { Cookie as InsomniaCookie, CookieJar as InsomniaCookieJar } from 'insomnia/src/models/cookie-jar';
|
||||
import { Cookie as ToughCookie } from 'tough-cookie';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
import { Cookie as InsomniaCookie, CookieJar as InsomniaCookieJar } from '../../../src/models/cookie-jar';
|
||||
import { Property, PropertyList } from './properties';
|
||||
|
||||
export interface CookieOptions {
|
||||
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,7 @@
|
||||
export * as Collection from './collection';
|
||||
export * from './interfaces';
|
||||
export * from './insomnia';
|
||||
export * from './request';
|
||||
export * from './environments';
|
||||
export * from './urls';
|
||||
export * from './cookies';
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
import { expect } from 'chai';
|
||||
import { ClientCertificate } from 'insomnia/src/models/client-certificate';
|
||||
import { RequestHeader } from 'insomnia/src/models/request';
|
||||
import { Settings } from 'insomnia/src/models/settings';
|
||||
|
||||
import { ClientCertificate } from '../../models/client-certificate';
|
||||
import { RequestHeader } from '../../models/request';
|
||||
import { Settings } from '../../models/settings';
|
||||
import { toPreRequestAuth } from './auth';
|
||||
import { CookieObject } from './cookies';
|
||||
import { Environment, Variables } from './environments';
|
||||
+4
-4
@@ -1,7 +1,7 @@
|
||||
import { ClientCertificate } from '../../models/client-certificate';
|
||||
import { CookieJar as InsomniaCookieJar } from '../../models/cookie-jar';
|
||||
import type { Request } from '../../models/request';
|
||||
import { Settings } from '../../models/settings';
|
||||
import { CookieJar as InsomniaCookieJar } from 'insomnia/src//models/cookie-jar';
|
||||
import { ClientCertificate } from 'insomnia/src/models/client-certificate';
|
||||
import type { Request } from 'insomnia/src/models/request';
|
||||
import { Settings } from 'insomnia/src/models/settings';
|
||||
|
||||
export interface RequestContext {
|
||||
request: Request;
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
+4
-5
@@ -1,8 +1,7 @@
|
||||
import { init as initClientCertificate } from '../../../src/models/client-certificate';
|
||||
import { Request as InsomniaRequest, RequestBody as InsomniaRequestBody, RequestPathParameter } from '../..//models/request';
|
||||
import { ClientCertificate } from '../../models/client-certificate';
|
||||
import { RequestBodyParameter } from '../../models/request';
|
||||
import { Settings } from '../../models/settings';
|
||||
import { Settings } from 'insomnia/src//models/settings';
|
||||
import { ClientCertificate, init as initClientCertificate } from 'insomnia/src/models/client-certificate';
|
||||
import { Request as InsomniaRequest, RequestBody as InsomniaRequestBody, RequestBodyParameter, RequestPathParameter } from 'insomnia/src/models/request';
|
||||
|
||||
import { AuthOptions, AuthOptionTypes, fromPreRequestAuth, RequestAuth } from './auth';
|
||||
import { CertificateOptions } from './certificates';
|
||||
import { Certificate } from './certificates';
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
import { RESPONSE_CODE_REASONS } from '../../common/constants';
|
||||
import { RESPONSE_CODE_REASONS } from 'insomnia/src/common/constants';
|
||||
|
||||
import { Cookie, CookieOptions } from './cookies';
|
||||
import { CookieList } from './cookies';
|
||||
import { Header, HeaderDefinition, HeaderList } from './headers';
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
import type { CurlRequestOutput } from 'insomnia/src/main/network/libcurl-promise';
|
||||
import type { Settings } from 'insomnia/src/models/settings';
|
||||
import { Cookie } from 'tough-cookie';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
import type { CurlRequestOutput } from '../../main/network/libcurl-promise';
|
||||
import type { Settings } from '../../models/settings';
|
||||
import { RequestAuth } from './auth';
|
||||
import { fromPreRequestAuth } from './auth';
|
||||
import type { CookieOptions } from './cookies';
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -54,6 +54,9 @@ export default async function build(options: Options) {
|
||||
sourcemap: true,
|
||||
format: 'cjs',
|
||||
external: ['electron'],
|
||||
loader: {
|
||||
'.node': 'copy',
|
||||
},
|
||||
});
|
||||
const main = esbuild.build({
|
||||
entryPoints: ['./src/main.development.ts'],
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { contextBridge, ipcRenderer, IpcRendererEvent } from 'electron';
|
||||
import { Collection as CollectionModule, RequestContext } from 'insomnia-sdk';
|
||||
|
||||
import type { Compression } from './models/response';
|
||||
import * as CollectionModule from './sdk/objects';
|
||||
import type { RequestContext } from './sdk/objects/interfaces';
|
||||
|
||||
export interface HiddenBrowserWindowToMainBridgeAPI {
|
||||
requireInterceptor: (module: string) => any;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import * as fs from 'node:fs';
|
||||
|
||||
import { initInsomniaObject, InsomniaObject } from 'insomnia-sdk';
|
||||
import { RequestContext } from 'insomnia-sdk';
|
||||
import { mergeClientCertificates, mergeRequests, mergeSettings } from 'insomnia-sdk';
|
||||
import { mergeCookieJar } from 'insomnia-sdk';
|
||||
import * as _ from 'lodash';
|
||||
|
||||
import { invariant } from '../src/utils/invariant';
|
||||
import { mergeCookieJar } from './sdk/objects/cookies';
|
||||
import { initInsomniaObject, InsomniaObject } from './sdk/objects/insomnia';
|
||||
import { RequestContext } from './sdk/objects/interfaces';
|
||||
import { mergeClientCertificates, mergeRequests, mergeSettings } from './sdk/objects/request';
|
||||
|
||||
export interface HiddenBrowserWindowBridgeAPI {
|
||||
runPreRequestScript: (options: { script: string; context: RequestContext }) => Promise<RequestContext>;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { RequestContext } from 'insomnia-sdk';
|
||||
|
||||
import type { CurlRequestOptions, CurlRequestOutput } from '../main/network/libcurl-promise';
|
||||
import { CookieJar } from '../models/cookie-jar';
|
||||
import { Request } from '../models/request';
|
||||
import { RequestContext } from '../sdk/objects/interfaces';
|
||||
|
||||
const cancelRequestFunctionMap = new Map<string, () => void>();
|
||||
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
import { Snippet } from 'codemirror';
|
||||
import { CookieObject, Environment, InsomniaObject, Request as ScriptRequest, Url, Variables } from 'insomnia-sdk';
|
||||
import React, { FC, Fragment, useRef } from 'react';
|
||||
|
||||
import { Settings } from '../../../models/settings';
|
||||
import { CookieObject } from '../../../sdk/objects/cookies';
|
||||
import { Environment, Variables } from '../../../sdk/objects/environments';
|
||||
import { InsomniaObject } from '../../../sdk/objects/insomnia';
|
||||
import { Request as ScriptRequest } from '../../../sdk/objects/request';
|
||||
import { Url } from '../../../sdk/objects/urls';
|
||||
import { Dropdown, DropdownButton, DropdownItem, DropdownSection, ItemContent } from '../base/dropdown';
|
||||
import { CodeEditor, CodeEditorHandle } from '../codemirror/code-editor';
|
||||
|
||||
|
||||
Reference in new issue
Block a user