@kubohiroya/turbowarp-text-lines 0.1.1 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,154 +0,0 @@
1
- <!doctype html>
2
- <html lang="ja">
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1">
6
- <meta name="description" content="TurboWarp拡張機能「Text Lines」の図解付き利用ガイド。">
7
- <title>Text Lines — 利用ガイド</title>
8
- <link rel="icon" href="../assets/favicon.svg" type="image/svg+xml">
9
- <link rel="stylesheet" href="../assets/styles.css">
10
- <link rel="alternate" hreflang="en" href="https://kubohiroya.github.io/turbowarp-text-lines/">
11
- <link rel="alternate" hreflang="ja" href="https://kubohiroya.github.io/turbowarp-text-lines/ja/">
12
- </head>
13
- <body>
14
- <header class="site-header">
15
- <nav class="nav" aria-label="メインナビゲーション">
16
- <a class="brand" href="#top">
17
- <span class="brand-mark" aria-hidden="true">≡</span>
18
- <span>Text Lines</span>
19
- </a>
20
- <div class="nav-links">
21
- <a href="#start">使い始める</a>
22
- <a href="#blocks">ブロック</a>
23
- <a class="language-link" href="../" lang="en" hreflang="en">English</a>
24
- </div>
25
- </nav>
26
- </header>
27
-
28
- <main id="top">
29
- <section class="hero">
30
- <p class="eyebrow">TurboWarp拡張機能ガイド</p>
31
- <h1>テキストを、行ごとに。</h1>
32
- <p class="lead">3つのシンプルなブロックで、テキストの行数を数え、1行を取り出し、全行をScratchのリストへ書き込めます。</p>
33
- <div class="hero-actions">
34
- <a class="button primary" href="#start">Text Linesを使い始める</a>
35
- <a class="button" href="https://github.com/kubohiroya/turbowarp-text-lines">GitHubでソースを見る</a>
36
- </div>
37
- </section>
38
-
39
- <section class="section" id="start">
40
- <div class="section-heading">
41
- <p class="eyebrow">クイックスタート</p>
42
- <h2>拡張機能を読み込む</h2>
43
- <p>Text LinesはScratchのリストへ直接書き込むため、サンドボックスなしで実行する必要があります。</p>
44
- </div>
45
- <div class="quick-start">
46
- <article class="step">
47
- <h3>ダウンロード</h3>
48
- <p>リポジトリから<a href="https://github.com/kubohiroya/turbowarp-text-lines/blob/main/dist/text-lines.js"><code>text-lines.js</code></a>を取得します。</p>
49
- </article>
50
- <article class="step">
51
- <h3>TurboWarpへ追加</h3>
52
- <p>TurboWarp Desktopで「拡張機能」から「カスタム拡張機能」を選び、ダウンロードしたファイルを読み込みます。</p>
53
- </article>
54
- <article class="step">
55
- <h3>リスト操作を許可</h3>
56
- <p>確認画面で<strong>サンドボックス化せずに拡張機能を実行</strong>を有効にします。</p>
57
- </article>
58
- </div>
59
- </section>
60
-
61
- <section class="section" aria-labelledby="how-heading">
62
- <div class="section-heading">
63
- <p class="eyebrow">動作のしくみ</p>
64
- <h2 id="how-heading">1つの入力から、3つの結果へ</h2>
65
- <p>入力テキストを改行位置で分割し、選んだブロックに応じて行を利用します。</p>
66
- </div>
67
- <figure class="diagram" aria-labelledby="diagram-caption">
68
- <div class="diagram-input">
69
- <span class="diagram-label">入力テキスト</span>
70
- <pre class="text-sample">りんご
71
- バナナ
72
- さくらんぼ</pre>
73
- </div>
74
- <div class="diagram-path">
75
- <div class="scratch-block reporter">number of lines in <span class="argument">テキスト</span></div>
76
- <div class="arrow" aria-hidden="true">→</div>
77
- <div class="result"><span class="diagram-label">返す値</span>3</div>
78
- </div>
79
- <div class="diagram-path">
80
- <div class="scratch-block reporter">line <span class="argument">2</span> of <span class="argument">テキスト</span></div>
81
- <div class="arrow" aria-hidden="true">→</div>
82
- <div class="result"><span class="diagram-label">返す値</span>バナナ</div>
83
- </div>
84
- <div class="diagram-path">
85
- <div class="scratch-block">put lines of <span class="argument">テキスト</span> into list <span class="argument">項目</span></div>
86
- <div class="arrow" aria-hidden="true">→</div>
87
- <div class="result list-result">
88
- <span class="diagram-label">リスト「項目」の新しい内容</span>
89
- <ol><li>りんご</li><li>バナナ</li><li>さくらんぼ</li></ol>
90
- </div>
91
- </div>
92
- <figcaption id="diagram-caption">リスト用ブロックは既存の項目を置き換えます。丸い2つの値ブロックは値を返すだけです。</figcaption>
93
- </figure>
94
- </section>
95
-
96
- <section class="section" id="blocks">
97
- <div class="section-heading">
98
- <p class="eyebrow">ブロック一覧</p>
99
- <h2>必要な結果に合わせて選ぶ</h2>
100
- <p>ブロック名は、TurboWarp上で探しやすいように実際の英語表記で示しています。</p>
101
- </div>
102
- <div class="block-grid">
103
- <article class="block-card">
104
- <div class="scratch-block reporter">number of lines in <span class="argument">テキスト</span></div>
105
- <div class="block-copy">
106
- <h3>行数を数える</h3>
107
- <p>入力に含まれる行の数を返します。</p>
108
- <ul><li>空の入力は、空の1行として数えます。</li><li>末尾の改行後には、空の最終行ができます。</li></ul>
109
- </div>
110
- </article>
111
- <article class="block-card">
112
- <div class="scratch-block reporter">line <span class="argument">1</span> of <span class="argument">テキスト</span></div>
113
- <div class="block-copy">
114
- <h3>1行を取り出す</h3>
115
- <p>指定した位置の行を返します。</p>
116
- <ul><li>行番号は1から始まります。</li><li>無効な行番号では空文字列を返します。</li></ul>
117
- </div>
118
- </article>
119
- <article class="block-card">
120
- <div class="scratch-block">put lines of <span class="argument">テキスト</span> into list <span class="argument">リスト</span></div>
121
- <div class="block-copy">
122
- <h3>リストへ入れる</h3>
123
- <p>入力を分割し、各行を1つずつリスト項目として書き込みます。</p>
124
- <ul><li>ステージまたはスプライトのリストをメニューから選べます。</li><li>既存のリスト項目は置き換えられます。</li></ul>
125
- </div>
126
- </article>
127
- </div>
128
- </section>
129
-
130
- <section class="section" aria-labelledby="details-heading">
131
- <div class="section-heading">
132
- <p class="eyebrow">詳しい仕様</p>
133
- <h2 id="details-heading">改行コードとリストの安全性</h2>
134
- </div>
135
- <div class="notes-grid">
136
- <article class="note-card">
137
- <h3>異なるOSでも動作</h3>
138
- <p>LF(<code>\n</code>)、CRLF(<code>\r\n</code>)、CR(<code>\r</code>)を、いずれも1つの改行として扱います。</p>
139
- </article>
140
- <article class="note-card">
141
- <h3>リストはすぐに更新</h3>
142
- <p>コマンドブロックの実行直後に、選択したリストとリストモニターが更新されます。</p>
143
- <div class="callout"><strong>実行前の注意:</strong>残したいリスト内容はコピーしてください。このブロックを実行すると置き換えられます。</div>
144
- </article>
145
- </div>
146
- </section>
147
- </main>
148
-
149
- <footer class="site-footer">
150
- <p>TurboWarp用 Text Lines</p>
151
- <p><a href="https://github.com/kubohiroya/turbowarp-text-lines">ソースコードとライセンス</a></p>
152
- </footer>
153
- </body>
154
- </html>
@@ -1,4 +0,0 @@
1
- allowBuilds:
2
- esbuild: set this to true or false
3
- minimumReleaseAgeExclude:
4
- - '@kubohiroya/vite-plugin-turbowarp-extension@0.1.0'
@@ -1,67 +0,0 @@
1
- import {readFile, writeFile} from 'node:fs/promises';
2
-
3
- const START = '<!-- BEGIN GENERATED BLOCKS -->';
4
- const END = '<!-- END GENERATED BLOCKS -->';
5
-
6
- const definitions = JSON.parse(
7
- await readFile(new URL('../src/block-definitions.json', import.meta.url), 'utf8')
8
- );
9
- const readmeUrl = new URL('../README.md', import.meta.url);
10
- const readme = await readFile(readmeUrl, 'utf8');
11
-
12
- const generated = definitions.blocks.map(renderBlock).join('\n\n');
13
- const replacement = `${START}\n\n${generated}\n\n${END}`;
14
-
15
- if (!readme.includes(START) || !readme.includes(END)) {
16
- throw new Error('README.md does not contain the generated block markers.');
17
- }
18
-
19
- const next = readme.replace(
20
- new RegExp(`${escapeRegExp(START)}[\\s\\S]*?${escapeRegExp(END)}`),
21
- replacement
22
- );
23
- await writeFile(readmeUrl, next);
24
-
25
- function renderBlock(block) {
26
- const rows = [
27
- ['Type', titleCase(block.blockType)],
28
- ['Opcode', `\`${block.opcode}\``]
29
- ];
30
- for (const [name, argument] of Object.entries(block.arguments ?? {})) {
31
- const details = [titleCase(argument.type)];
32
- if (argument.menu) details.push(`menu: \`${argument.menu}\``);
33
- if (argument.defaultValue !== undefined) {
34
- details.push(`default: \`${formatDefault(argument.defaultValue)}\``);
35
- }
36
- rows.push([
37
- `\`${name}\``,
38
- details.join(', ')
39
- ]);
40
- }
41
- return [
42
- `### \`${block.text}\``,
43
- '',
44
- block.description,
45
- '',
46
- '<details>',
47
- '<summary>Block metadata</summary>',
48
- '',
49
- '| Property | Value |',
50
- '|---|---|',
51
- ...rows.map(([name, value]) => `| ${name} | ${value} |`),
52
- '',
53
- '</details>'
54
- ].join('\n');
55
- }
56
-
57
- function titleCase(value) {
58
- return value.charAt(0) + value.slice(1).toLowerCase();
59
- }
60
-
61
- function formatDefault(value) {
62
- return String(value).replaceAll('\\', '\\\\').replaceAll('\n', '\\n').replaceAll('`', '\\`');
63
- }
64
-
65
- function escapeRegExp(value) {
66
- return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
67
- }
@@ -1,34 +0,0 @@
1
- {
2
- "extensionName": "Text Lines",
3
- "blocks": [
4
- {
5
- "opcode": "lineCount",
6
- "blockType": "REPORTER",
7
- "text": "number of lines in [TEXT]",
8
- "description": "Returns the number of lines in the supplied text.",
9
- "arguments": {
10
- "TEXT": {"type": "STRING", "defaultValue": "first line\nsecond line"}
11
- }
12
- },
13
- {
14
- "opcode": "lineAt",
15
- "blockType": "REPORTER",
16
- "text": "line [LINE] of [TEXT]",
17
- "description": "Returns one line using a one-based line number. Invalid line numbers return an empty string.",
18
- "arguments": {
19
- "TEXT": {"type": "STRING", "defaultValue": "first line\nsecond line"},
20
- "LINE": {"type": "NUMBER", "defaultValue": 1}
21
- }
22
- },
23
- {
24
- "opcode": "writeLinesToList",
25
- "blockType": "COMMAND",
26
- "text": "put lines of [TEXT] into list [LIST]",
27
- "description": "Replaces the contents of the named Scratch list with the lines of the supplied text.",
28
- "arguments": {
29
- "TEXT": {"type": "STRING", "defaultValue": "first line\nsecond line"},
30
- "LIST": {"type": "STRING", "menu": "LIST_MENU"}
31
- }
32
- }
33
- ]
34
- }
package/src/extension.ts DELETED
@@ -1,99 +0,0 @@
1
- import definitions from './block-definitions.json' with {type: 'json'};
2
-
3
- type BlockTypeName = 'COMMAND' | 'REPORTER';
4
- type ArgumentTypeName = 'STRING' | 'NUMBER';
5
-
6
- interface DefinitionArgument {
7
- type: ArgumentTypeName;
8
- defaultValue?: string | number;
9
- menu?: string;
10
- }
11
-
12
- interface BlockDefinition {
13
- opcode: string;
14
- blockType: BlockTypeName;
15
- text: string;
16
- description: string;
17
- arguments: Record<string, DefinitionArgument>;
18
- }
19
-
20
- const blockDefinitions = definitions.blocks as readonly BlockDefinition[];
21
-
22
- export class TextLinesExtension {
23
- getInfo() {
24
- const translate = Scratch.translate;
25
- return {
26
- id: 'kubohiroyatextlines',
27
- name: translate(definitions.extensionName),
28
- docsURI: 'https://kubohiroya.github.io/turbowarp-text-lines/',
29
- color1: '#5B80A5',
30
- blocks: blockDefinitions.map((block) => this.toScratchBlock(block)),
31
- menus: {
32
- LIST_MENU: {
33
- acceptReporters: true,
34
- items: 'getLists'
35
- }
36
- }
37
- };
38
- }
39
-
40
- getLists(): Array<string | {text: string; value: string}> {
41
- const stage = Scratch.vm.runtime.getTargetForStage();
42
- const editingTarget = Scratch.vm.editingTarget;
43
- const lists = [
44
- ...(stage ? Object.values(stage.variables) : []),
45
- ...(editingTarget && editingTarget !== stage ? Object.values(editingTarget.variables) : [])
46
- ].filter((variable) => variable.type === 'list');
47
-
48
- if (lists.length === 0) return [''];
49
- return lists.map((list) => ({text: list.name, value: list.id}));
50
- }
51
-
52
- lineCount(args: {TEXT: unknown}): number {
53
- return splitLines(Scratch.Cast.toString(args.TEXT)).length;
54
- }
55
-
56
- lineAt(args: {TEXT: unknown; LINE: unknown}): string {
57
- const lines = splitLines(Scratch.Cast.toString(args.TEXT));
58
- const line = Math.trunc(Scratch.Cast.toNumber(args.LINE));
59
- if (!Number.isFinite(line) || line < 1 || line > lines.length) return '';
60
- return lines[line - 1] ?? '';
61
- }
62
-
63
- writeLinesToList(args: {TEXT: unknown; LIST: unknown}, util: ScratchBlockUtility): void {
64
- const listIdOrName = Scratch.Cast.toString(args.LIST);
65
- const stage = Scratch.vm.runtime.getTargetForStage();
66
- const variable =
67
- util.target.lookupVariableById(listIdOrName) ??
68
- stage?.lookupVariableById(listIdOrName) ??
69
- util.target.lookupVariableByNameAndType(listIdOrName, 'list') ??
70
- stage?.lookupVariableByNameAndType(listIdOrName, 'list');
71
- if (!variable || variable.type !== 'list') throw new Error(`List not found: ${listIdOrName}`);
72
- variable.value = splitLines(Scratch.Cast.toString(args.TEXT));
73
- variable._monitorUpToDate = false;
74
- }
75
-
76
- private toScratchBlock(block: BlockDefinition): Record<string, unknown> {
77
- return {
78
- opcode: block.opcode,
79
- blockType: Scratch.BlockType[block.blockType],
80
- text: Scratch.translate(block.text),
81
- arguments: Object.fromEntries(
82
- Object.entries(block.arguments).map(([name, argument]) => [
83
- name,
84
- Object.fromEntries(
85
- Object.entries({
86
- type: Scratch.ArgumentType[argument.type],
87
- defaultValue: argument.defaultValue,
88
- menu: argument.menu
89
- }).filter(([, value]) => value !== undefined)
90
- )
91
- ])
92
- )
93
- };
94
- }
95
- }
96
-
97
- export function splitLines(text: string): string[] {
98
- return text.split(/\r\n|\n|\r/);
99
- }
package/src/globals.d.ts DELETED
@@ -1,26 +0,0 @@
1
- interface ScratchVariable {
2
- id: string;
3
- value: unknown[];
4
- type: string;
5
- name: string;
6
- _monitorUpToDate?: boolean;
7
- }
8
- interface ScratchTarget {
9
- variables: Record<string, ScratchVariable>;
10
- lookupVariableById(id: string): ScratchVariable | null;
11
- lookupVariableByNameAndType(name: string, type: string): ScratchVariable | null;
12
- }
13
- interface ScratchBlockUtility { target: ScratchTarget; }
14
- interface ScratchTranslate {
15
- (text: string): string;
16
- (message: {default: string; description?: string}, placeholders?: Record<string, string | number>): string;
17
- }
18
- interface ScratchApi {
19
- extensions: { unsandboxed: boolean; register(extension: unknown): void };
20
- BlockType: Record<'COMMAND' | 'REPORTER', string>;
21
- ArgumentType: Record<'STRING' | 'NUMBER', string>;
22
- Cast: { toString(value: unknown): string; toNumber(value: unknown): number };
23
- translate: ScratchTranslate;
24
- vm: { editingTarget: ScratchTarget | null; runtime: { getTargetForStage(): ScratchTarget | null } };
25
- }
26
- declare const Scratch: ScratchApi;
package/src/index.ts DELETED
@@ -1,7 +0,0 @@
1
- import {TextLinesExtension} from './extension.js';
2
-
3
- if (!Scratch.extensions.unsandboxed) {
4
- throw new Error('Text Lines must run unsandboxed to write to Scratch lists.');
5
- }
6
-
7
- Scratch.extensions.register(new TextLinesExtension());
@@ -1,168 +0,0 @@
1
- import {beforeEach, describe, expect, it, vi} from 'vitest';
2
- import {TextLinesExtension, splitLines} from '../src/extension.js';
3
-
4
- beforeEach(() => {
5
- vi.stubGlobal('Scratch', {
6
- Cast: {
7
- toString: (value: unknown) => String(value ?? ''),
8
- toNumber: (value: unknown) => Number(value)
9
- }
10
- });
11
- });
12
-
13
- describe('splitLines', () => {
14
- it('supports LF, CRLF, and CR', () => {
15
- expect(splitLines('a\nb\r\nc\rd')).toEqual(['a', 'b', 'c', 'd']);
16
- });
17
- });
18
-
19
- describe('TextLinesExtension', () => {
20
- it('defines the list argument as a dynamic menu', () => {
21
- vi.stubGlobal('Scratch', {
22
- translate: (text: string) => text,
23
- BlockType: {COMMAND: 'command', REPORTER: 'reporter'},
24
- ArgumentType: {STRING: 'string', NUMBER: 'number'}
25
- });
26
- const extension = new TextLinesExtension();
27
-
28
- expect(extension.getInfo()).toMatchObject({
29
- docsURI: 'https://kubohiroya.github.io/turbowarp-text-lines/',
30
- blocks: [
31
- {},
32
- {},
33
- {arguments: {LIST: {type: 'string', menu: 'LIST_MENU'}}}
34
- ],
35
- menus: {LIST_MENU: {acceptReporters: true, items: 'getLists'}}
36
- });
37
- });
38
-
39
- it('counts lines', () => {
40
- const extension = new TextLinesExtension();
41
- expect(extension.lineCount({TEXT: 'a\nb'})).toBe(2);
42
- });
43
-
44
- it('returns a one-based line', () => {
45
- const extension = new TextLinesExtension();
46
- expect(extension.lineAt({TEXT: 'a\nb', LINE: 2})).toBe('b');
47
- expect(extension.lineAt({TEXT: 'a\nb', LINE: 3})).toBe('');
48
- });
49
-
50
- it('replaces a Scratch list with lines', () => {
51
- const extension = new TextLinesExtension();
52
- const list: ScratchVariable = {
53
- id: 'list-id',
54
- name: 'lines',
55
- type: 'list',
56
- value: []
57
- };
58
- const target = {
59
- variables: {list},
60
- lookupVariableById: (id: string) => (id === 'list-id' ? list : null),
61
- lookupVariableByNameAndType: (name: string, type: string) =>
62
- name === 'lines' && type === 'list' ? list : null
63
- };
64
- vi.stubGlobal('Scratch', {
65
- Cast: {
66
- toString: (value: unknown) => String(value ?? ''),
67
- toNumber: (value: unknown) => Number(value)
68
- },
69
- vm: {editingTarget: target, runtime: {getTargetForStage: () => target}}
70
- });
71
- extension.writeLinesToList({TEXT: 'a\nb', LIST: 'list-id'}, {target});
72
- expect(list.value).toEqual(['a', 'b']);
73
- expect(list._monitorUpToDate).toBe(false);
74
- });
75
-
76
- it('keeps supporting list names from existing blocks', () => {
77
- const extension = new TextLinesExtension();
78
- const list = {id: 'list-id', name: 'lines', type: 'list', value: [] as unknown[]};
79
- const target = {
80
- variables: {list},
81
- lookupVariableById: () => null,
82
- lookupVariableByNameAndType: (name: string, type: string) =>
83
- name === 'lines' && type === 'list' ? list : null
84
- };
85
- vi.stubGlobal('Scratch', {
86
- Cast: {
87
- toString: (value: unknown) => String(value ?? ''),
88
- toNumber: (value: unknown) => Number(value)
89
- },
90
- vm: {editingTarget: target, runtime: {getTargetForStage: () => target}}
91
- });
92
- extension.writeLinesToList({TEXT: 'a\nb', LIST: 'lines'}, {target});
93
- expect(list.value).toEqual(['a', 'b']);
94
- });
95
-
96
- it('writes to the current target when the stage is unavailable', () => {
97
- const extension = new TextLinesExtension();
98
- const list = {id: 'list-id', name: 'lines', type: 'list', value: [] as unknown[]};
99
- const target = {
100
- variables: {list},
101
- lookupVariableById: (id: string) => (id === 'list-id' ? list : null),
102
- lookupVariableByNameAndType: () => null
103
- };
104
- vi.stubGlobal('Scratch', {
105
- Cast: {
106
- toString: (value: unknown) => String(value ?? ''),
107
- toNumber: (value: unknown) => Number(value)
108
- },
109
- vm: {editingTarget: target, runtime: {getTargetForStage: () => null}}
110
- });
111
-
112
- extension.writeLinesToList({TEXT: 'a\nb', LIST: 'list-id'}, {target});
113
- expect(list.value).toEqual(['a', 'b']);
114
- });
115
-
116
- it('lists stage and editing-target lists using their IDs', () => {
117
- const extension = new TextLinesExtension();
118
- const stageList = {id: 'stage-list', name: 'shared', type: 'list', value: []};
119
- const localList = {id: 'local-list', name: 'local', type: 'list', value: []};
120
- const stage = {
121
- variables: {stageList},
122
- lookupVariableById: () => null,
123
- lookupVariableByNameAndType: () => null
124
- };
125
- const editingTarget = {
126
- variables: {localList},
127
- lookupVariableById: () => null,
128
- lookupVariableByNameAndType: () => null
129
- };
130
- vi.stubGlobal('Scratch', {
131
- vm: {editingTarget, runtime: {getTargetForStage: () => stage}}
132
- });
133
-
134
- expect(extension.getLists()).toEqual([
135
- {text: 'shared', value: 'stage-list'},
136
- {text: 'local', value: 'local-list'}
137
- ]);
138
- });
139
-
140
- it('returns a safe menu fallback when no lists exist', () => {
141
- const extension = new TextLinesExtension();
142
- const stage = {
143
- variables: {},
144
- lookupVariableById: () => null,
145
- lookupVariableByNameAndType: () => null
146
- };
147
- vi.stubGlobal('Scratch', {
148
- vm: {editingTarget: stage, runtime: {getTargetForStage: () => stage}}
149
- });
150
-
151
- expect(extension.getLists()).toEqual(['']);
152
- });
153
-
154
- it('lists editing-target lists when the stage is unavailable', () => {
155
- const extension = new TextLinesExtension();
156
- const localList = {id: 'local-list', name: 'local', type: 'list', value: []};
157
- const editingTarget = {
158
- variables: {localList},
159
- lookupVariableById: () => null,
160
- lookupVariableByNameAndType: () => null
161
- };
162
- vi.stubGlobal('Scratch', {
163
- vm: {editingTarget, runtime: {getTargetForStage: () => null}}
164
- });
165
-
166
- expect(extension.getLists()).toEqual([{text: 'local', value: 'local-list'}]);
167
- });
168
- });
package/tsconfig.json DELETED
@@ -1,14 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2022",
4
- "module": "NodeNext",
5
- "moduleResolution": "NodeNext",
6
- "resolveJsonModule": true,
7
- "strict": true,
8
- "noUncheckedIndexedAccess": true,
9
- "exactOptionalPropertyTypes": true,
10
- "skipLibCheck": true,
11
- "types": ["vitest/globals"]
12
- },
13
- "include": ["src", "tests", "vite.config.ts"]
14
- }
package/vite.config.ts DELETED
@@ -1,15 +0,0 @@
1
- import {defineConfig} from 'vite';
2
- import {turboWarpExtension} from '@kubohiroya/vite-plugin-turbowarp-extension';
3
-
4
- export default defineConfig({
5
- plugins: [
6
- turboWarpExtension({
7
- id: 'kubohiroyatextlines',
8
- name: 'Text Lines',
9
- description: 'Count, read, and split text by lines in TurboWarp.',
10
- author: 'Hiroya Kubo',
11
- license: 'MPL-2.0',
12
- fileName: 'text-lines.js'
13
- })
14
- ]
15
- });