@rindo/core 3.0.0 → 3.1.0

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.
Files changed (111) hide show
  1. package/cli/config-flags.d.ts +122 -122
  2. package/cli/index.cjs +2301 -2432
  3. package/cli/index.d.ts +19 -19
  4. package/cli/index.js +2302 -2433
  5. package/cli/package.json +1 -1
  6. package/compiler/package.json +1 -1
  7. package/compiler/rindo.d.ts +73 -73
  8. package/compiler/rindo.js +66137 -62812
  9. package/compiler/rindo.min.js +2 -2
  10. package/compiler/sys/in-memory-fs.d.ts +218 -218
  11. package/compiler/transpile.d.ts +32 -32
  12. package/dev-server/client/app-error.d.ts +18 -18
  13. package/dev-server/client/events.d.ts +6 -6
  14. package/dev-server/client/hmr-components.d.ts +1 -1
  15. package/dev-server/client/hmr-external-styles.d.ts +1 -1
  16. package/dev-server/client/hmr-images.d.ts +1 -1
  17. package/dev-server/client/hmr-inline-styles.d.ts +1 -1
  18. package/dev-server/client/hmr-util.d.ts +9 -9
  19. package/dev-server/client/hmr-window.d.ts +10 -10
  20. package/dev-server/client/index.d.ts +6 -6
  21. package/dev-server/client/index.js +781 -781
  22. package/dev-server/client/logger.d.ts +5 -5
  23. package/dev-server/client/package.json +1 -1
  24. package/dev-server/client/progress.d.ts +3 -3
  25. package/dev-server/client/status.d.ts +4 -4
  26. package/dev-server/connector.html +2 -2
  27. package/dev-server/index.d.ts +3 -3
  28. package/dev-server/index.js +228 -228
  29. package/dev-server/open-in-editor-api.js +1 -1
  30. package/dev-server/package.json +1 -1
  31. package/dev-server/server-process.js +1301 -1279
  32. package/dev-server/ws.js +1 -1
  33. package/dev-server/xdg-open +0 -0
  34. package/internal/app-data/index.cjs +88 -88
  35. package/internal/app-data/index.d.ts +4 -4
  36. package/internal/app-data/index.js +88 -88
  37. package/internal/app-data/package.json +1 -1
  38. package/internal/client/css-shim.js +1 -1
  39. package/internal/client/dom.js +1 -1
  40. package/internal/client/index.js +3380 -3373
  41. package/internal/client/package.json +1 -1
  42. package/internal/client/patch-browser.js +155 -155
  43. package/internal/client/patch-esm.js +25 -25
  44. package/internal/client/shadow-css.js +382 -382
  45. package/internal/hydrate/package.json +1 -1
  46. package/internal/index.d.ts +2 -2
  47. package/internal/index.js +1 -1
  48. package/internal/package.json +1 -1
  49. package/internal/rindo-private.d.ts +2272 -2268
  50. package/internal/rindo-public-compiler.d.ts +2377 -2353
  51. package/internal/rindo-public-docs.d.ts +139 -139
  52. package/internal/rindo-public-runtime.d.ts +1636 -1636
  53. package/internal/testing/package.json +1 -1
  54. package/mock-doc/index.cjs +4766 -4766
  55. package/mock-doc/index.d.ts +1006 -1006
  56. package/mock-doc/index.js +4766 -4766
  57. package/mock-doc/package.json +1 -1
  58. package/package.json +10 -10
  59. package/screenshot/connector-base.d.ts +42 -42
  60. package/screenshot/connector-local.d.ts +7 -7
  61. package/screenshot/index.d.ts +3 -3
  62. package/screenshot/index.js +615 -615
  63. package/screenshot/package.json +1 -1
  64. package/screenshot/pixel-match.d.ts +1 -1
  65. package/screenshot/pixel-match.js +14 -14
  66. package/screenshot/screenshot-compare.d.ts +3 -3
  67. package/screenshot/screenshot-fs.d.ts +15 -15
  68. package/sys/node/autoprefixer.js +2 -2
  69. package/sys/node/glob.js +1 -1
  70. package/sys/node/graceful-fs.js +1 -1
  71. package/sys/node/index.d.ts +22 -22
  72. package/sys/node/index.js +6 -3
  73. package/sys/node/node-fetch.js +1 -1
  74. package/sys/node/package.json +1 -1
  75. package/sys/node/prompts.js +1 -1
  76. package/sys/node/worker.js +1 -1
  77. package/testing/index.d.ts +12 -12
  78. package/testing/index.js +7 -3
  79. package/testing/jest/jest-config.d.ts +16 -16
  80. package/testing/jest/jest-environment.d.ts +15 -15
  81. package/testing/jest/jest-preprocessor.d.ts +59 -59
  82. package/testing/jest/jest-runner.d.ts +10 -10
  83. package/testing/jest/jest-screenshot.d.ts +2 -2
  84. package/testing/jest/jest-serializer.d.ts +4 -4
  85. package/testing/jest/jest-setup-test-framework.d.ts +1 -1
  86. package/testing/matchers/attributes.d.ts +14 -14
  87. package/testing/matchers/class-list.d.ts +12 -12
  88. package/testing/matchers/events.d.ts +21 -21
  89. package/testing/matchers/html.d.ts +12 -12
  90. package/testing/matchers/index.d.ts +23 -23
  91. package/testing/matchers/screenshot.d.ts +5 -5
  92. package/testing/matchers/text.d.ts +4 -4
  93. package/testing/mock-fetch.d.ts +11 -11
  94. package/testing/mocks.d.ts +56 -56
  95. package/testing/package.json +1 -1
  96. package/testing/puppeteer/index.d.ts +2 -2
  97. package/testing/puppeteer/puppeteer-browser.d.ts +6 -6
  98. package/testing/puppeteer/puppeteer-declarations.d.ts +403 -403
  99. package/testing/puppeteer/puppeteer-element.d.ts +67 -67
  100. package/testing/puppeteer/puppeteer-emulate.d.ts +2 -2
  101. package/testing/puppeteer/puppeteer-events.d.ts +21 -21
  102. package/testing/puppeteer/puppeteer-page.d.ts +2 -2
  103. package/testing/puppeteer/puppeteer-screenshot.d.ts +4 -4
  104. package/testing/reset-build-conditionals.d.ts +2 -2
  105. package/testing/spec-page.d.ts +2 -2
  106. package/testing/test-transpile.d.ts +2 -2
  107. package/testing/testing-logger.d.ts +25 -25
  108. package/testing/testing-sys.d.ts +6 -6
  109. package/testing/testing-utils.d.ts +79 -79
  110. package/testing/testing.d.ts +2 -2
  111. package/dependencies.json +0 -120
@@ -1,218 +1,218 @@
1
- import type * as d from '../../internal/index';
2
- /**
3
- * An in-memory FS which proxies the underlying OS filesystem using a simple
4
- * in-memory cache. FS writes can accumulate on the in-memory system, using an
5
- * API similar to Node.js' `"fs"` module, and then be committed to disk as a
6
- * unit.
7
- *
8
- * Files written to the in-memory system can be edited, deleted, and so on.
9
- * This allows the compiler to proceed freely as if it is modifying the
10
- * filesystem, modifying the world in whatever way suits it, while deferring
11
- * actual FS writes until the end of the compilation process, making actual
12
- * changes to the filesystem on disk contingent on an error-free build or any
13
- * other condition.
14
- *
15
- * Usage example:
16
- *
17
- * ```ts
18
- * // create an in-memory FS
19
- * const sys = createSystem();
20
- * const inMemoryFs = createInMemoryFs(sys);
21
- *
22
- * // do a few fs operations
23
- * await inMemoryFs.writeFile("path/to/file.js", 'console.log("hey!");')
24
- * await inMemoryFs.remove("path/to/another_file.ts");
25
- *
26
- * // commit the results to disk
27
- * const commitStats = await inMemoryFs.commit();
28
- * ```
29
- *
30
- * In the above example the write operation and the delete operation (w/
31
- * `.remove`) are both queued in the in-memory proxy but not committed to
32
- * disk until the `.commit` method is called.
33
- */
34
- export type InMemoryFileSystem = ReturnType<typeof createInMemoryFs>;
35
- /**
36
- * A node in the in-memory file system. This may represent a file or
37
- * a directory, and pending copy, write, and delete operations may be stored
38
- * on it.
39
- */
40
- export interface FsItem {
41
- fileText: string;
42
- isFile: boolean;
43
- isDirectory: boolean;
44
- size: number;
45
- mtimeMs: number;
46
- exists: boolean;
47
- queueCopyFileToDest: string;
48
- queueWriteToDisk: boolean;
49
- queueDeleteFromDisk?: boolean;
50
- useCache: boolean;
51
- }
52
- /**
53
- * Storage format for the in-memory cache used to proxy the OS filesystem.
54
- *
55
- * Filesystem paths (of type `string`) are mapped to objects satisfying the
56
- * `FsItem` interface.
57
- */
58
- export type FsItems = Map<string, FsItem>;
59
- /**
60
- * Options supported by write methods on the in-memory filesystem.
61
- */
62
- export interface FsWriteOptions {
63
- inMemoryOnly?: boolean;
64
- clearFileCache?: boolean;
65
- immediateWrite?: boolean;
66
- useCache?: boolean;
67
- /**
68
- * An optional tag for the current output target for which this file is being
69
- * written.
70
- */
71
- outputTargetType?: string;
72
- }
73
- /**
74
- * Results from a write operation on the in-memory filesystem.
75
- */
76
- export interface FsWriteResults {
77
- changedContent: boolean;
78
- queuedWrite: boolean;
79
- ignored: boolean;
80
- }
81
- /**
82
- * Options supported by read methods on the in-memory filesystem.
83
- */
84
- export interface FsReadOptions {
85
- useCache?: boolean;
86
- setHash?: boolean;
87
- }
88
- /**
89
- * Options supported by the readdir option on the in-memory filesystem.
90
- */
91
- interface FsReaddirOptions {
92
- inMemoryOnly?: boolean;
93
- recursive?: boolean;
94
- /**
95
- * Directory names to exclude. Just the basename,
96
- * not the entire path. Basically for "node_modules".
97
- */
98
- excludeDirNames?: string[];
99
- /**
100
- * Extensions we know we can avoid. Each extension
101
- * should include the `.` so that we can test for both
102
- * `.d.ts.` and `.ts`. If `excludeExtensions` isn't provided it
103
- * doesn't try to exclude anything. This only checks against
104
- * the filename, not directory names when recursive.
105
- */
106
- excludeExtensions?: string[];
107
- }
108
- /**
109
- * A result from a directory read operation
110
- */
111
- interface FsReaddirItem {
112
- absPath: string;
113
- relPath: string;
114
- isDirectory: boolean;
115
- isFile: boolean;
116
- }
117
- /**
118
- * Information about a file in the in-memory filesystem.
119
- */
120
- interface FsStat {
121
- exists: boolean;
122
- isFile: boolean;
123
- isDirectory: boolean;
124
- size: number;
125
- }
126
- /**
127
- * Create an in-memory FS which proxies the underlying OS filesystem using an
128
- * in-memory cache. FS writes can accumulate on the in-memory system, using an
129
- * API similar to Node.js' `"fs"` module, and then be committed to disk as a
130
- * unit.
131
- *
132
- * Files written to the in-memory system can be edited, deleted, and so on.
133
- * This allows the compiler to proceed freely as if it is modifying the
134
- * filesystem, modifying the world in whatever way suits it, while deferring
135
- * actual FS writes until the end of the compilation process, making actual
136
- * changes to the filesystem on disk contingent on an error-free build or any
137
- * other condition.
138
- *
139
- * @param sys a compiler system object
140
- * @returns an in-memory filesystem interface
141
- */
142
- export declare const createInMemoryFs: (sys: d.CompilerSystem) => {
143
- access: (filePath: string) => Promise<boolean>;
144
- accessSync: (filePath: string) => boolean;
145
- cancelDeleteDirectoriesFromDisk: (dirPaths: string[]) => void;
146
- cancelDeleteFilesFromDisk: (filePaths: string[]) => void;
147
- clearCache: () => void;
148
- clearDirCache: (dirPath: string) => void;
149
- clearFileCache: (filePath: string) => void;
150
- commit: () => Promise<FsCommitResults>;
151
- copyFile: (src: string, dest: string) => Promise<void>;
152
- emptyDirs: (dirs: string[]) => Promise<void>;
153
- getBuildOutputs: () => d.BuildOutput[];
154
- getItem: (itemPath: string) => FsItem;
155
- getMemoryStats: () => string;
156
- readFile: (filePath: string, opts?: FsReadOptions) => Promise<string>;
157
- readFileSync: (filePath: string, opts?: FsReadOptions) => string;
158
- readdir: (dirPath: string, opts?: FsReaddirOptions) => Promise<FsReaddirItem[]>;
159
- remove: (itemPath: string) => Promise<void>;
160
- stat: (itemPath: string) => Promise<FsStat>;
161
- statSync: (itemPath: string) => FsStat;
162
- sys: d.CompilerSystem;
163
- writeFile: (filePath: string, content: string, opts?: FsWriteOptions) => Promise<FsWriteResults>;
164
- writeFiles: (files: {
165
- [filePath: string]: string;
166
- } | Map<string, string>, opts?: FsWriteOptions) => Promise<FsWriteResults[]>;
167
- };
168
- /**
169
- * The information needed to carry out a file copy operation.
170
- *
171
- * `[ source, destination ]`
172
- */
173
- type FileCopyTuple = [string, string];
174
- /**
175
- * Collected instructions for all pending filesystem operations saved
176
- * to the in-memory filesystem.
177
- */
178
- interface FsCommitInstructions {
179
- filesToDelete: string[];
180
- filesToWrite: string[];
181
- /**
182
- * Files queued for copy operations are stored as an array of `[source, dest]`
183
- * tuples.
184
- */
185
- filesToCopy: FileCopyTuple[];
186
- dirsToDelete: string[];
187
- dirsToEnsure: string[];
188
- }
189
- /**
190
- * Results from committing pending filesystem operations
191
- */
192
- interface FsCommitResults {
193
- filesCopied: FileCopyTuple[];
194
- filesWritten: string[];
195
- filesDeleted: string[];
196
- dirsDeleted: string[];
197
- dirsAdded: string[];
198
- }
199
- /**
200
- * Given the current state of the in-memory proxy filesystem, collect all of
201
- * the changes that need to be made in order to commit the currently-pending
202
- * operations (e.g. write, copy, delete) to the OS filesystem.
203
- *
204
- * @param items the storage data structure for the in-memory FS cache
205
- * @returns a collection of all the operations that need to be done
206
- */
207
- export declare const getCommitInstructions: (items: FsItems) => FsCommitInstructions;
208
- /**
209
- * Check whether a given filepath should be ignored
210
- *
211
- * We have a little ignore list, and we just check whether the
212
- * filepath ends with any of the strings on the ignore list.
213
- *
214
- * @param filePath the filepath to check!
215
- * @returns whether we should ignore it or not
216
- */
217
- export declare const shouldIgnore: (filePath: string) => boolean;
218
- export {};
1
+ import type * as d from '../../internal/index';
2
+ /**
3
+ * An in-memory FS which proxies the underlying OS filesystem using a simple
4
+ * in-memory cache. FS writes can accumulate on the in-memory system, using an
5
+ * API similar to Node.js' `"fs"` module, and then be committed to disk as a
6
+ * unit.
7
+ *
8
+ * Files written to the in-memory system can be edited, deleted, and so on.
9
+ * This allows the compiler to proceed freely as if it is modifying the
10
+ * filesystem, modifying the world in whatever way suits it, while deferring
11
+ * actual FS writes until the end of the compilation process, making actual
12
+ * changes to the filesystem on disk contingent on an error-free build or any
13
+ * other condition.
14
+ *
15
+ * Usage example:
16
+ *
17
+ * ```ts
18
+ * // create an in-memory FS
19
+ * const sys = createSystem();
20
+ * const inMemoryFs = createInMemoryFs(sys);
21
+ *
22
+ * // do a few fs operations
23
+ * await inMemoryFs.writeFile("path/to/file.js", 'console.log("hey!");')
24
+ * await inMemoryFs.remove("path/to/another_file.ts");
25
+ *
26
+ * // commit the results to disk
27
+ * const commitStats = await inMemoryFs.commit();
28
+ * ```
29
+ *
30
+ * In the above example the write operation and the delete operation (w/
31
+ * `.remove`) are both queued in the in-memory proxy but not committed to
32
+ * disk until the `.commit` method is called.
33
+ */
34
+ export type InMemoryFileSystem = ReturnType<typeof createInMemoryFs>;
35
+ /**
36
+ * A node in the in-memory file system. This may represent a file or
37
+ * a directory, and pending copy, write, and delete operations may be stored
38
+ * on it.
39
+ */
40
+ export interface FsItem {
41
+ fileText: string;
42
+ isFile: boolean;
43
+ isDirectory: boolean;
44
+ size: number;
45
+ mtimeMs: number;
46
+ exists: boolean;
47
+ queueCopyFileToDest: string;
48
+ queueWriteToDisk: boolean;
49
+ queueDeleteFromDisk?: boolean;
50
+ useCache: boolean;
51
+ }
52
+ /**
53
+ * Storage format for the in-memory cache used to proxy the OS filesystem.
54
+ *
55
+ * Filesystem paths (of type `string`) are mapped to objects satisfying the
56
+ * `FsItem` interface.
57
+ */
58
+ export type FsItems = Map<string, FsItem>;
59
+ /**
60
+ * Options supported by write methods on the in-memory filesystem.
61
+ */
62
+ export interface FsWriteOptions {
63
+ inMemoryOnly?: boolean;
64
+ clearFileCache?: boolean;
65
+ immediateWrite?: boolean;
66
+ useCache?: boolean;
67
+ /**
68
+ * An optional tag for the current output target for which this file is being
69
+ * written.
70
+ */
71
+ outputTargetType?: string;
72
+ }
73
+ /**
74
+ * Results from a write operation on the in-memory filesystem.
75
+ */
76
+ export interface FsWriteResults {
77
+ changedContent: boolean;
78
+ queuedWrite: boolean;
79
+ ignored: boolean;
80
+ }
81
+ /**
82
+ * Options supported by read methods on the in-memory filesystem.
83
+ */
84
+ export interface FsReadOptions {
85
+ useCache?: boolean;
86
+ setHash?: boolean;
87
+ }
88
+ /**
89
+ * Options supported by the readdir option on the in-memory filesystem.
90
+ */
91
+ interface FsReaddirOptions {
92
+ inMemoryOnly?: boolean;
93
+ recursive?: boolean;
94
+ /**
95
+ * Directory names to exclude. Just the basename,
96
+ * not the entire path. Basically for "node_modules".
97
+ */
98
+ excludeDirNames?: string[];
99
+ /**
100
+ * Extensions we know we can avoid. Each extension
101
+ * should include the `.` so that we can test for both
102
+ * `.d.ts.` and `.ts`. If `excludeExtensions` isn't provided it
103
+ * doesn't try to exclude anything. This only checks against
104
+ * the filename, not directory names when recursive.
105
+ */
106
+ excludeExtensions?: string[];
107
+ }
108
+ /**
109
+ * A result from a directory read operation
110
+ */
111
+ interface FsReaddirItem {
112
+ absPath: string;
113
+ relPath: string;
114
+ isDirectory: boolean;
115
+ isFile: boolean;
116
+ }
117
+ /**
118
+ * Information about a file in the in-memory filesystem.
119
+ */
120
+ interface FsStat {
121
+ exists: boolean;
122
+ isFile: boolean;
123
+ isDirectory: boolean;
124
+ size: number;
125
+ }
126
+ /**
127
+ * Create an in-memory FS which proxies the underlying OS filesystem using an
128
+ * in-memory cache. FS writes can accumulate on the in-memory system, using an
129
+ * API similar to Node.js' `"fs"` module, and then be committed to disk as a
130
+ * unit.
131
+ *
132
+ * Files written to the in-memory system can be edited, deleted, and so on.
133
+ * This allows the compiler to proceed freely as if it is modifying the
134
+ * filesystem, modifying the world in whatever way suits it, while deferring
135
+ * actual FS writes until the end of the compilation process, making actual
136
+ * changes to the filesystem on disk contingent on an error-free build or any
137
+ * other condition.
138
+ *
139
+ * @param sys a compiler system object
140
+ * @returns an in-memory filesystem interface
141
+ */
142
+ export declare const createInMemoryFs: (sys: d.CompilerSystem) => {
143
+ access: (filePath: string) => Promise<boolean>;
144
+ accessSync: (filePath: string) => boolean;
145
+ cancelDeleteDirectoriesFromDisk: (dirPaths: string[]) => void;
146
+ cancelDeleteFilesFromDisk: (filePaths: string[]) => void;
147
+ clearCache: () => void;
148
+ clearDirCache: (dirPath: string) => void;
149
+ clearFileCache: (filePath: string) => void;
150
+ commit: () => Promise<FsCommitResults>;
151
+ copyFile: (src: string, dest: string) => Promise<void>;
152
+ emptyDirs: (dirs: string[]) => Promise<void>;
153
+ getBuildOutputs: () => d.BuildOutput[];
154
+ getItem: (itemPath: string) => FsItem;
155
+ getMemoryStats: () => string;
156
+ readFile: (filePath: string, opts?: FsReadOptions) => Promise<string>;
157
+ readFileSync: (filePath: string, opts?: FsReadOptions) => string;
158
+ readdir: (dirPath: string, opts?: FsReaddirOptions) => Promise<FsReaddirItem[]>;
159
+ remove: (itemPath: string) => Promise<void>;
160
+ stat: (itemPath: string) => Promise<FsStat>;
161
+ statSync: (itemPath: string) => FsStat;
162
+ sys: d.CompilerSystem;
163
+ writeFile: (filePath: string, content: string, opts?: FsWriteOptions) => Promise<FsWriteResults>;
164
+ writeFiles: (files: {
165
+ [filePath: string]: string;
166
+ } | Map<string, string>, opts?: FsWriteOptions) => Promise<FsWriteResults[]>;
167
+ };
168
+ /**
169
+ * The information needed to carry out a file copy operation.
170
+ *
171
+ * `[ source, destination ]`
172
+ */
173
+ type FileCopyTuple = [string, string];
174
+ /**
175
+ * Collected instructions for all pending filesystem operations saved
176
+ * to the in-memory filesystem.
177
+ */
178
+ interface FsCommitInstructions {
179
+ filesToDelete: string[];
180
+ filesToWrite: string[];
181
+ /**
182
+ * Files queued for copy operations are stored as an array of `[source, dest]`
183
+ * tuples.
184
+ */
185
+ filesToCopy: FileCopyTuple[];
186
+ dirsToDelete: string[];
187
+ dirsToEnsure: string[];
188
+ }
189
+ /**
190
+ * Results from committing pending filesystem operations
191
+ */
192
+ interface FsCommitResults {
193
+ filesCopied: FileCopyTuple[];
194
+ filesWritten: string[];
195
+ filesDeleted: string[];
196
+ dirsDeleted: string[];
197
+ dirsAdded: string[];
198
+ }
199
+ /**
200
+ * Given the current state of the in-memory proxy filesystem, collect all of
201
+ * the changes that need to be made in order to commit the currently-pending
202
+ * operations (e.g. write, copy, delete) to the OS filesystem.
203
+ *
204
+ * @param items the storage data structure for the in-memory FS cache
205
+ * @returns a collection of all the operations that need to be done
206
+ */
207
+ export declare const getCommitInstructions: (items: FsItems) => FsCommitInstructions;
208
+ /**
209
+ * Check whether a given filepath should be ignored
210
+ *
211
+ * We have a little ignore list, and we just check whether the
212
+ * filepath ends with any of the strings on the ignore list.
213
+ *
214
+ * @param filePath the filepath to check!
215
+ * @returns whether we should ignore it or not
216
+ */
217
+ export declare const shouldIgnore: (filePath: string) => boolean;
218
+ export {};
@@ -1,32 +1,32 @@
1
- import type { TranspileOptions, TranspileResults } from '../internal/index';
2
- /**
3
- * The `transpile()` function inputs source code as a string, with various options
4
- * within the second argument. The function is stateless and returns a `Promise` of the
5
- * results, including diagnostics and the transpiled code. The `transpile()` function
6
- * does not handle any bundling, minifying, or precompiling any CSS preprocessing like
7
- * Sass or Less. The `transpileSync()` equivalent is available so the same function
8
- * it can be called synchronously. However, TypeScript must be already loaded within
9
- * the global for it to work, where as the async `transpile()` function will load
10
- * TypeScript automatically.
11
- *
12
- * Since TypeScript is used, the source code will transpile from TypeScript to JavaScript,
13
- * and does not require Babel presets. Additionally, the results includes an `imports`
14
- * array of all the import paths found in the source file. The transpile options can be
15
- * used to set the `module` format, such as `cjs`, and JavaScript `target` version, such
16
- * as `es2017`.
17
- *
18
- * @param code the code to transpile
19
- * @param opts options for the transpilation process
20
- * @returns a Promise wrapping the results of the transpilation
21
- */
22
- export declare const transpile: (code: string, opts?: TranspileOptions) => Promise<TranspileResults>;
23
- /**
24
- * Synchronous equivalent of the `transpile()` function. When used in a browser
25
- * environment, TypeScript must already be available globally, where as the async
26
- * `transpile()` function will load TypeScript automatically.
27
- *
28
- * @param code the code to transpile
29
- * @param opts options for the transpilation process
30
- * @returns the results of the transpilation
31
- */
32
- export declare const transpileSync: (code: string, opts?: TranspileOptions) => TranspileResults;
1
+ import type { TranspileOptions, TranspileResults } from '../internal/index';
2
+ /**
3
+ * The `transpile()` function inputs source code as a string, with various options
4
+ * within the second argument. The function is stateless and returns a `Promise` of the
5
+ * results, including diagnostics and the transpiled code. The `transpile()` function
6
+ * does not handle any bundling, minifying, or precompiling any CSS preprocessing like
7
+ * Sass or Less. The `transpileSync()` equivalent is available so the same function
8
+ * it can be called synchronously. However, TypeScript must be already loaded within
9
+ * the global for it to work, where as the async `transpile()` function will load
10
+ * TypeScript automatically.
11
+ *
12
+ * Since TypeScript is used, the source code will transpile from TypeScript to JavaScript,
13
+ * and does not require Babel presets. Additionally, the results includes an `imports`
14
+ * array of all the import paths found in the source file. The transpile options can be
15
+ * used to set the `module` format, such as `cjs`, and JavaScript `target` version, such
16
+ * as `es2017`.
17
+ *
18
+ * @param code the code to transpile
19
+ * @param opts options for the transpilation process
20
+ * @returns a Promise wrapping the results of the transpilation
21
+ */
22
+ export declare const transpile: (code: string, opts?: TranspileOptions) => Promise<TranspileResults>;
23
+ /**
24
+ * Synchronous equivalent of the `transpile()` function. When used in a browser
25
+ * environment, TypeScript must already be available globally, where as the async
26
+ * `transpile()` function will load TypeScript automatically.
27
+ *
28
+ * @param code the code to transpile
29
+ * @param opts options for the transpilation process
30
+ * @returns the results of the transpilation
31
+ */
32
+ export declare const transpileSync: (code: string, opts?: TranspileOptions) => TranspileResults;
@@ -1,18 +1,18 @@
1
- interface AppErrorData {
2
- window: Window;
3
- buildResults: any;
4
- openInEditor?: OpenInEditorCallback;
5
- }
6
- type OpenInEditorCallback = (data: {
7
- file: string;
8
- line: number;
9
- column: number;
10
- }) => void;
11
- export declare const appError: (data: AppErrorData) => {
12
- diagnostics: any[];
13
- status: string;
14
- };
15
- export declare const clearAppErrorModal: (data: {
16
- window: Window;
17
- }) => void;
18
- export {};
1
+ interface AppErrorData {
2
+ window: Window;
3
+ buildResults: any;
4
+ openInEditor?: OpenInEditorCallback;
5
+ }
6
+ type OpenInEditorCallback = (data: {
7
+ file: string;
8
+ line: number;
9
+ column: number;
10
+ }) => void;
11
+ export declare const appError: (data: AppErrorData) => {
12
+ diagnostics: any[];
13
+ status: string;
14
+ };
15
+ export declare const clearAppErrorModal: (data: {
16
+ window: Window;
17
+ }) => void;
18
+ export {};
@@ -1,6 +1,6 @@
1
- export declare const emitBuildLog: (win: Window, buildLog: any) => void;
2
- export declare const emitBuildResults: (win: Window, buildResults: any) => void;
3
- export declare const emitBuildStatus: (win: Window, buildStatus: string) => void;
4
- export declare const onBuildLog: (win: Window, cb: (buildLog: any) => void) => void;
5
- export declare const onBuildResults: (win: Window, cb: (buildResults: any) => void) => void;
6
- export declare const onBuildStatus: (win: Window, cb: (buildStatus: string) => void) => void;
1
+ export declare const emitBuildLog: (win: Window, buildLog: any) => void;
2
+ export declare const emitBuildResults: (win: Window, buildResults: any) => void;
3
+ export declare const emitBuildStatus: (win: Window, buildStatus: string) => void;
4
+ export declare const onBuildLog: (win: Window, cb: (buildLog: any) => void) => void;
5
+ export declare const onBuildResults: (win: Window, cb: (buildResults: any) => void) => void;
6
+ export declare const onBuildStatus: (win: Window, cb: (buildStatus: string) => void) => void;
@@ -1 +1 @@
1
- export declare const hmrComponents: (elm: Element, versionId: string, hmrTagNames: string[]) => string[];
1
+ export declare const hmrComponents: (elm: Element, versionId: string, hmrTagNames: string[]) => string[];
@@ -1 +1 @@
1
- export declare const hmrExternalStyles: (elm: Element, versionId: string, cssFileNames: string[]) => string[];
1
+ export declare const hmrExternalStyles: (elm: Element, versionId: string, cssFileNames: string[]) => string[];
@@ -1 +1 @@
1
- export declare const hmrImages: (win: Window, doc: Document, versionId: string, imageFileNames: string[]) => string[];
1
+ export declare const hmrImages: (win: Window, doc: Document, versionId: string, imageFileNames: string[]) => string[];
@@ -1 +1 @@
1
- export declare const hmrInlineStyles: (elm: Element, versionId: string, stylesUpdatedData: any[]) => any[];
1
+ export declare const hmrInlineStyles: (elm: Element, versionId: string, stylesUpdatedData: any[]) => any[];
@@ -1,9 +1,9 @@
1
- export declare const getHmrHref: (versionId: string, fileName: string, testUrl: string) => string;
2
- export declare const setQueryString: (url: string, qsKey: string, qsValue: string) => string;
3
- export declare const setHmrQueryString: (url: string, versionId: string) => string;
4
- export declare const updateCssUrlValue: (versionId: string, fileName: string, oldCss: string) => string;
5
- export declare const isLinkStylesheet: (elm: Element) => boolean;
6
- export declare const isTemplate: (elm: Element) => boolean;
7
- export declare const setHmrAttr: (elm: Element, versionId: string) => void;
8
- export declare const hasShadowRoot: (elm: Element) => boolean;
9
- export declare const isElement: (elm: Element) => boolean;
1
+ export declare const getHmrHref: (versionId: string, fileName: string, testUrl: string) => string;
2
+ export declare const setQueryString: (url: string, qsKey: string, qsValue: string) => string;
3
+ export declare const setHmrQueryString: (url: string, versionId: string) => string;
4
+ export declare const updateCssUrlValue: (versionId: string, fileName: string, oldCss: string) => string;
5
+ export declare const isLinkStylesheet: (elm: Element) => boolean;
6
+ export declare const isTemplate: (elm: Element) => boolean;
7
+ export declare const setHmrAttr: (elm: Element, versionId: string) => void;
8
+ export declare const hasShadowRoot: (elm: Element) => boolean;
9
+ export declare const isElement: (elm: Element) => boolean;
@@ -1,10 +1,10 @@
1
- export declare const hmrWindow: (data: {
2
- window: Window;
3
- hmr: any;
4
- }) => {
5
- updatedComponents: string[];
6
- updatedExternalStyles: string[];
7
- updatedInlineStyles: string[];
8
- updatedImages: string[];
9
- versionId: string;
10
- };
1
+ export declare const hmrWindow: (data: {
2
+ window: Window;
3
+ hmr: any;
4
+ }) => {
5
+ updatedComponents: string[];
6
+ updatedExternalStyles: string[];
7
+ updatedInlineStyles: string[];
8
+ updatedImages: string[];
9
+ versionId: string;
10
+ };
@@ -1,6 +1,6 @@
1
- export { appError, clearAppErrorModal } from './app-error';
2
- export { emitBuildLog, emitBuildResults, emitBuildStatus, onBuildLog, onBuildResults, onBuildStatus } from './events';
3
- export { hmrWindow } from './hmr-window';
4
- export { logBuild, logDiagnostic, logDisabled, logReload, logWarn } from './logger';
5
- export { initBuildProgress } from './progress';
6
- export { initBuildStatus } from './status';
1
+ export { appError, clearAppErrorModal } from './app-error';
2
+ export { emitBuildLog, emitBuildResults, emitBuildStatus, onBuildLog, onBuildResults, onBuildStatus } from './events';
3
+ export { hmrWindow } from './hmr-window';
4
+ export { logBuild, logDiagnostic, logDisabled, logReload, logWarn } from './logger';
5
+ export { initBuildProgress } from './progress';
6
+ export { initBuildStatus } from './status';