Skip to content

Commit

Permalink
Widget: use explicit .ts extension in imports
Browse files Browse the repository at this point in the history
  • Loading branch information
gusthoff committed Nov 2, 2024
1 parent c323ada commit d553b15
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 30 deletions.
4 changes: 2 additions & 2 deletions frontend/src/ts/areas.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as Strings from './strings';
import {CheckOutput} from './server-types';
import * as Strings from './strings.ts';
import {CheckOutput} from './server-types.ts';

/** Class representing an Area */
export class Area {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/ts/download.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import JSZip from 'jszip';
import FileSaver from 'file-saver';
import {ResourceList} from './resource';
import {ResourceList} from './resource.ts';

const COMMON_ADC = `pragma Restrictions (No_Specification_of_Aspect => Import);
pragma Restrictions (No_Use_Of_Pragma => Import);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/ts/server-types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable */

import {ResourceList} from './resource';
import {ResourceList} from './resource.ts';

// FS - From Server
// TS - To Server
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/ts/server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {RunProgram, CheckOutput} from './server-types';
import {RunProgram, CheckOutput} from './server-types.ts';

/**
* Worker class for server REST sequence
Expand Down
16 changes: 8 additions & 8 deletions frontend/src/ts/widget.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import cookies from 'typescript-cookies';

import {Area, OutputArea, LabContainer} from './areas';
import {Editor, EditorTheme} from './editor';
import {Area, OutputArea, LabContainer} from './areas.ts';
import {Editor, EditorTheme} from './editor.ts';
import {getElemsByClass, getElemById, getElemsByTag}
from './dom-utils';
from './dom-utils.ts';
import {downloadProject, UnparsedSwitches,
getUnparsedSwitches} from './download';
import {Resource, ResourceList} from './resource';
import {ServerWorker} from './server';
import {RunProgram, CheckOutput} from './server-types';
import * as Strings from './strings';
getUnparsedSwitches} from './download.ts';
import {Resource, ResourceList} from './resource.ts';
import {ServerWorker} from './server.ts';
import {RunProgram, CheckOutput} from './server-types.ts';
import * as Strings from './strings.ts';

interface EditorView {
readonly header: HTMLButtonElement;
Expand Down
6 changes: 3 additions & 3 deletions frontend/tests/ts/areas.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ chai.use(chaiDom);

// Import package under test
import {Area, OutputArea, LabArea, makeLabArea, LabContainer}
from '../../src/ts/areas';
import * as Strings from '../../src/ts/strings';
import {CheckOutput} from '../../src/ts/server-types';
from '../../src/ts/areas.ts';
import * as Strings from '../../src/ts/strings.ts';
import {CheckOutput} from '../../src/ts/server-types.ts';

describe('Area', () => {
let parent: HTMLDivElement;
Expand Down
2 changes: 1 addition & 1 deletion frontend/tests/ts/dom-utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import chaiDom from 'chai-dom';
chai.use(chaiDom);

import {getElemById, getElemsByClass, getElemsByTag}
from '../../src/ts/dom-utils';
from '../../src/ts/dom-utils.ts';

describe('getElemById()', () => {
const id = 'test-div';
Expand Down
4 changes: 2 additions & 2 deletions frontend/tests/ts/download.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {
findMains,
getMain,
getGprContents,
} from '../../src/ts/download';
import {ResourceList} from '../../src/ts/resource';
} from '../../src/ts/download.ts';
import {ResourceList} from '../../src/ts/resource.ts';

describe('Download', () => {
describe('#getLanguages()', () => {
Expand Down
4 changes: 2 additions & 2 deletions frontend/tests/ts/editor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ chai.use(chaiDom);

import ace from 'brace';

import {Editor, EditorTheme} from '../../src/ts/editor';
import {Resource} from '../../src/ts/resource';
import {Editor, EditorTheme} from '../../src/ts/editor.ts';
import {Resource} from '../../src/ts/resource.ts';

describe('Editor', () => {
let inTest: Editor;
Expand Down
2 changes: 1 addition & 1 deletion frontend/tests/ts/scrolltop.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import chaiDom from 'chai-dom';

chai.use(chaiDom);

import {scrollTop} from '../../src/ts/scrolltop';
import {scrollTop} from '../../src/ts/scrolltop.ts';

/**
* Helper function to trigger window event
Expand Down
4 changes: 2 additions & 2 deletions frontend/tests/ts/server.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ chai.use(chaiAsPromised);

import {Server, WebSocket} from 'mock-socket';

import {ServerWorker} from '../../src/ts/server';
import {CheckOutput, RunProgram} from '../../src/ts/server-types';
import {ServerWorker} from '../../src/ts/server.ts';
import {CheckOutput, RunProgram} from '../../src/ts/server-types.ts';

global.WebSocket = WebSocket;

Expand Down
12 changes: 6 additions & 6 deletions frontend/tests/ts/widget.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import {resolve} from 'path';

import ace from 'brace';

import {OutputArea} from '../../src/ts/areas';
import * as Strings from '../../src/ts/strings';
import {OutputArea} from '../../src/ts/areas.ts';
import * as Strings from '../../src/ts/strings.ts';

import {widgetFactory} from '../../src/ts/widget';
import {ServerWorker} from '../../src/ts/server';
import {CheckOutput, RunProgram} from '../../src/ts/server-types';
import {widgetFactory} from '../../src/ts/widget.ts';
import {ServerWorker} from '../../src/ts/server.ts';
import {CheckOutput, RunProgram} from '../../src/ts/server-types.ts';
import {getElemsByTag, getElemById, getElemsByClass}
from '../../src/ts/dom-utils';
from '../../src/ts/dom-utils.ts';

global.WebSocket = WebSocket;

Expand Down
1 change: 1 addition & 0 deletions frontend/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"allowImportingTsExtensions": true,
"sourceMap": true,
"allowJs": true,
"target": "es2022",
Expand Down

0 comments on commit d553b15

Please sign in to comment.