Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update node-fetch and use newer style #97

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
167 changes: 114 additions & 53 deletions package-lock.json

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

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"type": "git",
"url": "https://github.com/oracc/nisaba.git"
},
"type": "module",
"engines": {
"vscode": "^1.44.0"
},
Expand All @@ -20,7 +21,7 @@
"onCommand:ucl-rsdg.lemmatiseAtf",
"onCommand:ucl-rsdg.aboutNisaba"
],
"main": "./dist/extension",
"main": "./dist/extension.js",
"contributes": {
"commands": [
{
Expand Down Expand Up @@ -129,12 +130,12 @@
"package": "npx vsce package",
"lint": "eslint src --ext ts",
"pretest": "npm run compile && npm run lint",
"test": "node ./out/test/runTest.js"
"test": "node ./out/test/runTest.cjs"
},
"dependencies": {
"adm-zip": "^0.5.5",
"mimemessage": "^1.0.5",
"node-fetch": "^2.6.7",
"node-fetch": "^3.1.1",
"winston": "^3.3.3",
"winston-transport": "^4.4.0",
"xml2js": "^0.4.23"
Expand All @@ -143,7 +144,6 @@
"@types/adm-zip": "^0.4.33",
"@types/mocha": "^7.0.2",
"@types/node": "^13.13.52",
"@types/node-fetch": "^2.5.12",
"@types/vscode": "^1.44.0",
"@types/xml2js": "^0.4.8",
"@typescript-eslint/eslint-plugin": "^5.1.0",
Expand Down
8 changes: 4 additions & 4 deletions src/client/SOAP_client.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { default as fetch }from 'node-fetch';
import { createEnvelopeMessage, extractLogs, getResponseCode, MultipartMessage, ServerAction } from './mime';
import { ServerResult } from './server_result';
import { log } from '../logger';
import fetch from 'node-fetch';
import { createEnvelopeMessage, extractLogs, getResponseCode, MultipartMessage, ServerAction } from './mime.js';
import { ServerResult } from './server_result.js';
import { log } from '../logger.js';

/*
1. Gather all the information for the message from the text (start with hardcoded)
Expand Down
4 changes: 2 additions & 2 deletions src/client/mime.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import mimemessage = require('mimemessage');
import * as AdmZip from 'adm-zip';
import * as mimemessage from 'mimemessage';
import AdmZip from 'adm-zip';
import { parseString } from 'xml2js';

/**
Expand Down
10 changes: 5 additions & 5 deletions src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { basename } from 'path';

import { lemmatise, ServerFunction, validate } from './server/messages';
import { lemmatise, ServerFunction, validate } from './server/messages.js';

// The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
import * as vscode from 'vscode';
import * as nisabaLogger from './logger';
import { handleResult, initView } from './view';
import { PreviewPanel } from './preview';
import { getProjectCode } from './atf_model';
import * as nisabaLogger from './logger.js';
import { handleResult, initView } from './view.js';
import { PreviewPanel } from './preview.js';
import { getProjectCode } from './atf_model.js';

// Logging output channel
const nisabaOutputChannel = vscode.window.createOutputChannel("Nisaba");
Expand Down
2 changes: 1 addition & 1 deletion src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as os from 'os';
import * as path from 'path';
import * as vscode from 'vscode';
import * as winston from 'winston';
import * as TransportStream from 'winston-transport';
import TransportStream from 'winston-transport';

class OutputChannelTransport extends TransportStream {
outputChannel: vscode.OutputChannel;
Expand Down
4 changes: 2 additions & 2 deletions src/server/messages.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ServerResult } from '../client/server_result';
import { SOAPClient } from '../client/SOAP_client';
import { ServerResult } from '../client/server_result.js';
import { SOAPClient } from '../client/SOAP_client.js';

// The interface of functions which have to send information to the server
// (for convenience in typing in other files)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/test/suite/atf.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as assert from 'assert';
import * as fs from 'fs';
import * as path from 'path';
import * as vscode from 'vscode';
import { getProjectCode } from '../../atf_model';
import { getProjectCode } from '../../atf_model.js';

suite('ATF Model Test Suite', () => {
vscode.window.showInformationMessage('Start ATF tests.');
Expand Down
4 changes: 2 additions & 2 deletions src/test/suite/extension.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as assert from 'assert';
import assert from 'assert';
import * as fs from 'fs';
import * as path from 'path';
import * as vscode from 'vscode';
import * as nisaba from '../../extension';
import * as nisaba from '../../extension.js';

suite('Extension Test Suite', () => {
vscode.window.showInformationMessage('Start all tests.');
Expand Down
Loading