Skip to content

Commit

Permalink
Merge pull request #207 from crutchcorn/master
Browse files Browse the repository at this point in the history
Migrate all imports to new namespace
  • Loading branch information
Tyriar authored Apr 4, 2024
2 parents 4b1a555 + 9769a01 commit 21d4161
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions _docs/api/addons/attach.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ The attach addon provides methods for attaching a terminal to a WebSocket stream
This allows easy hooking of the terminal front-end to background processes and interact with it, just like you would do with in a local terminal. This means that the front-end terminal (a [`Terminal`](/docs/api/Terminal/) instance) will render the stdout and stderr logs of the back-end process and will send to it all keyboard and mouse events captured.

```ts
import { Terminal } from 'xterm';
import { AttachAddon } from 'xterm-addon-attach';
import { Terminal } from '@xterm/xterm';
import { AttachAddon } from '@xterm/addon-attach';

const term = new Terminal();
const socket = new WebSocket('wss://docker.example.com/containers/mycontainerid/attach/ws');
Expand Down
4 changes: 2 additions & 2 deletions _docs/api/addons/fit.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ category: addon
The fit addon provides the `fit` method that lets you adjust the size and geometry (columns 𝗑 rows) of the terminal to fit the size of the parent element.

```ts
import { Terminal } from 'xterm';
import { FitAddon } from 'xterm-addon-fit';
import { Terminal } from '@xterm/xterm';
import { FitAddon } from '@xterm/addon-fit';

const term = new Terminal();
const fitAddon = new FitAddon();
Expand Down
5 changes: 3 additions & 2 deletions _docs/guides/download.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ The best way to download xterm.js for use in your project is with [`npm`](http:/

```bash
# Install with npm
npm install --save xterm
npm install @xterm/xterm

# Or alternatively, install with Yarn
yarn add @xterm/xterm
```

## GitHub Releases
Expand All @@ -42,4 +43,4 @@ Xterm.js stopped supporting Bower since version 3.0.0. You should use [`npm`](ht

## Importing in your application

Next, take a look at the different ways of [importing xterm.js](/docs/guides/import) into your project.
Next, take a look at the different ways of [importing xterm.js](/docs/guides/import) into your project.
2 changes: 1 addition & 1 deletion _docs/guides/import.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The preferred way to import xterm.js and its addons is the [`import` statement](

```javascript

import { Terminal } from 'xterm';
import { Terminal } from '@xterm/xterm';

const term = new Terminal();

Expand Down
8 changes: 4 additions & 4 deletions _docs/guides/using-addons.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ To use an xterm.js addon, you have to:
## Usage example

```ts
import { Terminal } from 'xterm';
import { FitAddon } from 'xterm-addon-fit';
import { Terminal } from '@xterm/xterm';
import { FitAddon } from '@xterm/addon-fit';

const term = new Terminal();
const fitAddon = new FitAddon();
Expand All @@ -34,7 +34,7 @@ fitAddon.fit();
Creating an addon is quite simple, you just need to export some object that has an `activate` and `dispose` method. The following addon logs any `onData` events coming from the terminal which fire when the user types:

```ts
import { Terminal, IDisposable } from 'xterm';
import { Terminal, IDisposable } from '@xterm/xterm';

class DataLoggerAddon {
private _disposables: IDisposable[] = [];
Expand All @@ -55,4 +55,4 @@ Use `Terminal.loadAddon` to start logging the data events:
```ts
const terminal = new Terminal();
terminal.loadAddon(new ExampleAddon());
```
```

0 comments on commit 21d4161

Please sign in to comment.