├── .github
└── workflows
│ ├── build.yml
│ └── release.yml
├── .gitignore
├── .golangci.yml
├── .vscode
└── settings.json
├── CODEOWNERS
├── LICENSE
├── README.md
├── examples
├── abort.ts
├── issue-13.ts
├── script.js
├── script.ts
├── simple.ts
└── user.ts
├── go.mod
├── go.sum
├── loader.go
└── register.go
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | name: Build
2 | on: [pull_request]
3 |
4 | jobs:
5 | build:
6 | name: Bundle xk6 extensions
7 | runs-on: ubuntu-latest
8 |
9 | steps:
10 | - name: Check out code
11 | uses: actions/checkout@v4
12 | with:
13 | fetch-depth: 0
14 |
15 | - name: Build
16 | id: build
17 | uses: szkiba/xk6bundler@v0
18 | with:
19 | with: github.com/grafana/xk6-ts=/github/workspace
20 | k6_version: latest
21 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: Release
2 | on:
3 | push:
4 | tags:
5 | - "v*"
6 |
7 | jobs:
8 | release:
9 | name: Bundle xk6 extensions
10 | runs-on: ubuntu-latest
11 | permissions:
12 | contents: write
13 | packages: write
14 | env:
15 | REGISTRY: ghcr.io
16 | IMAGE_NAME: ${{ github.repository }}
17 |
18 | steps:
19 | - name: Checkout code
20 | uses: actions/checkout@v4
21 | with:
22 | fetch-depth: 0
23 |
24 | - name: Build
25 | id: build
26 | uses: szkiba/xk6bundler@v0
27 | with:
28 | with: github.com/grafana/xk6-ts=/github/workspace
29 | k6_version: latest
30 |
31 | - name: Create Release
32 | uses: softprops/action-gh-release@v1
33 | with:
34 | files: dist/*.tar.gz
35 |
36 | - name: Log in to the Container registry
37 | uses: docker/login-action@v3
38 | with:
39 | registry: ${{ env.REGISTRY }}
40 | username: ${{ github.actor }}
41 | password: ${{ secrets.GITHUB_TOKEN }}
42 |
43 | - name: Extract metadata (tags, labels) for Docker
44 | id: meta
45 | uses: docker/metadata-action@v5
46 | with:
47 | images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
48 | tags: |
49 | type=semver,pattern={{version}}
50 | type=semver,pattern={{major}}.{{minor}}
51 | type=semver,pattern={{major}}
52 |
53 | - name: Build and push Docker image
54 | uses: docker/build-push-action@v5
55 | with:
56 | push: true
57 | context: ./${{ steps.build.outputs.dockerdir }}
58 | tags: ${{ steps.meta.outputs.tags }}
59 | labels: ${{ steps.meta.outputs.labels }}
60 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /k6
2 | /k6.exe
3 | /build
4 |
5 | .vscode/*
6 | !.vscode/extensions.json
7 | !.vscode/settings.json
8 |
--------------------------------------------------------------------------------
/.golangci.yml:
--------------------------------------------------------------------------------
1 | # v1.55.2
2 | # Please don't remove the first line. It uses in CI to determine the golangci version
3 | run:
4 | deadline: 5m
5 |
6 | issues:
7 | # Maximum issues count per one linter. Set to 0 to disable. Default is 50.
8 | max-issues-per-linter: 0
9 | # Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
10 | max-same-issues: 0
11 |
12 | # We want to try and improve the comments in the k6 codebase, so individual
13 | # non-golint items from the default exclusion list will gradually be added
14 | # to the exclude-rules below
15 | exclude-use-default: false
16 |
17 | exclude-rules:
18 | # Exclude duplicate code and function length and complexity checking in test
19 | # files (due to common repeats and long functions in test code)
20 | - path: _(test|gen)\.go
21 | linters:
22 | - cyclop
23 | - dupl
24 | - gocognit
25 | - funlen
26 | - lll
27 | - path: js\/modules\/k6\/http\/.*_test\.go
28 | linters:
29 | # k6/http module's tests are quite complex because they often have several nested levels.
30 | # The module is in maintainance mode, so we don't intend to port the tests to a parallel version.
31 | - paralleltest
32 | - tparallel
33 | - linters:
34 | - staticcheck # Tracked in https://github.com/grafana/xk6-grpc/issues/14
35 | text: "The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated."
36 | - linters:
37 | - forbidigo
38 | text: 'use of `os\.(SyscallError|Signal|Interrupt)` forbidden'
39 |
40 | linters-settings:
41 | nolintlint:
42 | # Disable to ensure that nolint directives don't have a leading space. Default is true.
43 | allow-leading-space: false
44 | exhaustive:
45 | default-signifies-exhaustive: true
46 | govet:
47 | check-shadowing: true
48 | cyclop:
49 | max-complexity: 25
50 | maligned:
51 | suggest-new: true
52 | dupl:
53 | threshold: 150
54 | goconst:
55 | min-len: 10
56 | min-occurrences: 4
57 | funlen:
58 | lines: 80
59 | statements: 60
60 | forbidigo:
61 | forbid:
62 | - '^(fmt\\.Print(|f|ln)|print|println)$'
63 | # Forbid everything in os, except os.Signal and os.SyscalError
64 | - '^os\.(.*)$(# Using anything except Signal and SyscallError from the os package is forbidden )?'
65 | # Forbid everything in syscall except the uppercase constants
66 | - '^syscall\.[^A-Z_]+$(# Using anything except constants from the syscall package is forbidden )?'
67 | - '^logrus\.Logger$'
68 |
69 | linters:
70 | disable-all: true
71 | enable:
72 | - asasalint
73 | - asciicheck
74 | - bidichk
75 | - bodyclose
76 | - contextcheck
77 | - cyclop
78 | - dogsled
79 | - dupl
80 | - durationcheck
81 | - errcheck
82 | - errchkjson
83 | - errname
84 | - errorlint
85 | - exhaustive
86 | - exportloopref
87 | - forbidigo
88 | - forcetypeassert
89 | - funlen
90 | - gocheckcompilerdirectives
91 | - gochecknoglobals
92 | - gocognit
93 | - goconst
94 | - gocritic
95 | - gofmt
96 | - gofumpt
97 | - goimports
98 | - gomoddirectives
99 | - goprintffuncname
100 | - gosec
101 | - gosimple
102 | - govet
103 | - importas
104 | - ineffassign
105 | - interfacebloat
106 | - lll
107 | - makezero
108 | - misspell
109 | - nakedret
110 | - nestif
111 | - nilerr
112 | - nilnil
113 | - noctx
114 | - nolintlint
115 | - nosprintfhostport
116 | - paralleltest
117 | - prealloc
118 | - predeclared
119 | - promlinter
120 | - revive
121 | - reassign
122 | - rowserrcheck
123 | - sqlclosecheck
124 | - staticcheck
125 | - stylecheck
126 | - tenv
127 | - tparallel
128 | - typecheck
129 | - unconvert
130 | - unparam
131 | - unused
132 | - usestdlibvars
133 | - wastedassign
134 | - whitespace
135 | fast: false
136 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "go.lintTool": "golangci-lint",
3 | "go.lintFlags": [
4 | "--fast"
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/CODEOWNERS:
--------------------------------------------------------------------------------
1 | * @grafana/k6-extensions
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU AFFERO GENERAL PUBLIC LICENSE
2 | Version 3, 19 November 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU Affero General Public License is a free, copyleft license for
11 | software and other kinds of works, specifically designed to ensure
12 | cooperation with the community in the case of network server software.
13 |
14 | The licenses for most software and other practical works are designed
15 | to take away your freedom to share and change the works. By contrast,
16 | our General Public Licenses are intended to guarantee your freedom to
17 | share and change all versions of a program--to make sure it remains free
18 | software for all its users.
19 |
20 | When we speak of free software, we are referring to freedom, not
21 | price. Our General Public Licenses are designed to make sure that you
22 | have the freedom to distribute copies of free software (and charge for
23 | them if you wish), that you receive source code or can get it if you
24 | want it, that you can change the software or use pieces of it in new
25 | free programs, and that you know you can do these things.
26 |
27 | Developers that use our General Public Licenses protect your rights
28 | with two steps: (1) assert copyright on the software, and (2) offer
29 | you this License which gives you legal permission to copy, distribute
30 | and/or modify the software.
31 |
32 | A secondary benefit of defending all users' freedom is that
33 | improvements made in alternate versions of the program, if they
34 | receive widespread use, become available for other developers to
35 | incorporate. Many developers of free software are heartened and
36 | encouraged by the resulting cooperation. However, in the case of
37 | software used on network servers, this result may fail to come about.
38 | The GNU General Public License permits making a modified version and
39 | letting the public access it on a server without ever releasing its
40 | source code to the public.
41 |
42 | The GNU Affero General Public License is designed specifically to
43 | ensure that, in such cases, the modified source code becomes available
44 | to the community. It requires the operator of a network server to
45 | provide the source code of the modified version running there to the
46 | users of that server. Therefore, public use of a modified version, on
47 | a publicly accessible server, gives the public access to the source
48 | code of the modified version.
49 |
50 | An older license, called the Affero General Public License and
51 | published by Affero, was designed to accomplish similar goals. This is
52 | a different license, not a version of the Affero GPL, but Affero has
53 | released a new version of the Affero GPL which permits relicensing under
54 | this license.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | TERMS AND CONDITIONS
60 |
61 | 0. Definitions.
62 |
63 | "This License" refers to version 3 of the GNU Affero General Public License.
64 |
65 | "Copyright" also means copyright-like laws that apply to other kinds of
66 | works, such as semiconductor masks.
67 |
68 | "The Program" refers to any copyrightable work licensed under this
69 | License. Each licensee is addressed as "you". "Licensees" and
70 | "recipients" may be individuals or organizations.
71 |
72 | To "modify" a work means to copy from or adapt all or part of the work
73 | in a fashion requiring copyright permission, other than the making of an
74 | exact copy. The resulting work is called a "modified version" of the
75 | earlier work or a work "based on" the earlier work.
76 |
77 | A "covered work" means either the unmodified Program or a work based
78 | on the Program.
79 |
80 | To "propagate" a work means to do anything with it that, without
81 | permission, would make you directly or secondarily liable for
82 | infringement under applicable copyright law, except executing it on a
83 | computer or modifying a private copy. Propagation includes copying,
84 | distribution (with or without modification), making available to the
85 | public, and in some countries other activities as well.
86 |
87 | To "convey" a work means any kind of propagation that enables other
88 | parties to make or receive copies. Mere interaction with a user through
89 | a computer network, with no transfer of a copy, is not conveying.
90 |
91 | An interactive user interface displays "Appropriate Legal Notices"
92 | to the extent that it includes a convenient and prominently visible
93 | feature that (1) displays an appropriate copyright notice, and (2)
94 | tells the user that there is no warranty for the work (except to the
95 | extent that warranties are provided), that licensees may convey the
96 | work under this License, and how to view a copy of this License. If
97 | the interface presents a list of user commands or options, such as a
98 | menu, a prominent item in the list meets this criterion.
99 |
100 | 1. Source Code.
101 |
102 | The "source code" for a work means the preferred form of the work
103 | for making modifications to it. "Object code" means any non-source
104 | form of a work.
105 |
106 | A "Standard Interface" means an interface that either is an official
107 | standard defined by a recognized standards body, or, in the case of
108 | interfaces specified for a particular programming language, one that
109 | is widely used among developers working in that language.
110 |
111 | The "System Libraries" of an executable work include anything, other
112 | than the work as a whole, that (a) is included in the normal form of
113 | packaging a Major Component, but which is not part of that Major
114 | Component, and (b) serves only to enable use of the work with that
115 | Major Component, or to implement a Standard Interface for which an
116 | implementation is available to the public in source code form. A
117 | "Major Component", in this context, means a major essential component
118 | (kernel, window system, and so on) of the specific operating system
119 | (if any) on which the executable work runs, or a compiler used to
120 | produce the work, or an object code interpreter used to run it.
121 |
122 | The "Corresponding Source" for a work in object code form means all
123 | the source code needed to generate, install, and (for an executable
124 | work) run the object code and to modify the work, including scripts to
125 | control those activities. However, it does not include the work's
126 | System Libraries, or general-purpose tools or generally available free
127 | programs which are used unmodified in performing those activities but
128 | which are not part of the work. For example, Corresponding Source
129 | includes interface definition files associated with source files for
130 | the work, and the source code for shared libraries and dynamically
131 | linked subprograms that the work is specifically designed to require,
132 | such as by intimate data communication or control flow between those
133 | subprograms and other parts of the work.
134 |
135 | The Corresponding Source need not include anything that users
136 | can regenerate automatically from other parts of the Corresponding
137 | Source.
138 |
139 | The Corresponding Source for a work in source code form is that
140 | same work.
141 |
142 | 2. Basic Permissions.
143 |
144 | All rights granted under this License are granted for the term of
145 | copyright on the Program, and are irrevocable provided the stated
146 | conditions are met. This License explicitly affirms your unlimited
147 | permission to run the unmodified Program. The output from running a
148 | covered work is covered by this License only if the output, given its
149 | content, constitutes a covered work. This License acknowledges your
150 | rights of fair use or other equivalent, as provided by copyright law.
151 |
152 | You may make, run and propagate covered works that you do not
153 | convey, without conditions so long as your license otherwise remains
154 | in force. You may convey covered works to others for the sole purpose
155 | of having them make modifications exclusively for you, or provide you
156 | with facilities for running those works, provided that you comply with
157 | the terms of this License in conveying all material for which you do
158 | not control copyright. Those thus making or running the covered works
159 | for you must do so exclusively on your behalf, under your direction
160 | and control, on terms that prohibit them from making any copies of
161 | your copyrighted material outside their relationship with you.
162 |
163 | Conveying under any other circumstances is permitted solely under
164 | the conditions stated below. Sublicensing is not allowed; section 10
165 | makes it unnecessary.
166 |
167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
168 |
169 | No covered work shall be deemed part of an effective technological
170 | measure under any applicable law fulfilling obligations under article
171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
172 | similar laws prohibiting or restricting circumvention of such
173 | measures.
174 |
175 | When you convey a covered work, you waive any legal power to forbid
176 | circumvention of technological measures to the extent such circumvention
177 | is effected by exercising rights under this License with respect to
178 | the covered work, and you disclaim any intention to limit operation or
179 | modification of the work as a means of enforcing, against the work's
180 | users, your or third parties' legal rights to forbid circumvention of
181 | technological measures.
182 |
183 | 4. Conveying Verbatim Copies.
184 |
185 | You may convey verbatim copies of the Program's source code as you
186 | receive it, in any medium, provided that you conspicuously and
187 | appropriately publish on each copy an appropriate copyright notice;
188 | keep intact all notices stating that this License and any
189 | non-permissive terms added in accord with section 7 apply to the code;
190 | keep intact all notices of the absence of any warranty; and give all
191 | recipients a copy of this License along with the Program.
192 |
193 | You may charge any price or no price for each copy that you convey,
194 | and you may offer support or warranty protection for a fee.
195 |
196 | 5. Conveying Modified Source Versions.
197 |
198 | You may convey a work based on the Program, or the modifications to
199 | produce it from the Program, in the form of source code under the
200 | terms of section 4, provided that you also meet all of these conditions:
201 |
202 | a) The work must carry prominent notices stating that you modified
203 | it, and giving a relevant date.
204 |
205 | b) The work must carry prominent notices stating that it is
206 | released under this License and any conditions added under section
207 | 7. This requirement modifies the requirement in section 4 to
208 | "keep intact all notices".
209 |
210 | c) You must license the entire work, as a whole, under this
211 | License to anyone who comes into possession of a copy. This
212 | License will therefore apply, along with any applicable section 7
213 | additional terms, to the whole of the work, and all its parts,
214 | regardless of how they are packaged. This License gives no
215 | permission to license the work in any other way, but it does not
216 | invalidate such permission if you have separately received it.
217 |
218 | d) If the work has interactive user interfaces, each must display
219 | Appropriate Legal Notices; however, if the Program has interactive
220 | interfaces that do not display Appropriate Legal Notices, your
221 | work need not make them do so.
222 |
223 | A compilation of a covered work with other separate and independent
224 | works, which are not by their nature extensions of the covered work,
225 | and which are not combined with it such as to form a larger program,
226 | in or on a volume of a storage or distribution medium, is called an
227 | "aggregate" if the compilation and its resulting copyright are not
228 | used to limit the access or legal rights of the compilation's users
229 | beyond what the individual works permit. Inclusion of a covered work
230 | in an aggregate does not cause this License to apply to the other
231 | parts of the aggregate.
232 |
233 | 6. Conveying Non-Source Forms.
234 |
235 | You may convey a covered work in object code form under the terms
236 | of sections 4 and 5, provided that you also convey the
237 | machine-readable Corresponding Source under the terms of this License,
238 | in one of these ways:
239 |
240 | a) Convey the object code in, or embodied in, a physical product
241 | (including a physical distribution medium), accompanied by the
242 | Corresponding Source fixed on a durable physical medium
243 | customarily used for software interchange.
244 |
245 | b) Convey the object code in, or embodied in, a physical product
246 | (including a physical distribution medium), accompanied by a
247 | written offer, valid for at least three years and valid for as
248 | long as you offer spare parts or customer support for that product
249 | model, to give anyone who possesses the object code either (1) a
250 | copy of the Corresponding Source for all the software in the
251 | product that is covered by this License, on a durable physical
252 | medium customarily used for software interchange, for a price no
253 | more than your reasonable cost of physically performing this
254 | conveying of source, or (2) access to copy the
255 | Corresponding Source from a network server at no charge.
256 |
257 | c) Convey individual copies of the object code with a copy of the
258 | written offer to provide the Corresponding Source. This
259 | alternative is allowed only occasionally and noncommercially, and
260 | only if you received the object code with such an offer, in accord
261 | with subsection 6b.
262 |
263 | d) Convey the object code by offering access from a designated
264 | place (gratis or for a charge), and offer equivalent access to the
265 | Corresponding Source in the same way through the same place at no
266 | further charge. You need not require recipients to copy the
267 | Corresponding Source along with the object code. If the place to
268 | copy the object code is a network server, the Corresponding Source
269 | may be on a different server (operated by you or a third party)
270 | that supports equivalent copying facilities, provided you maintain
271 | clear directions next to the object code saying where to find the
272 | Corresponding Source. Regardless of what server hosts the
273 | Corresponding Source, you remain obligated to ensure that it is
274 | available for as long as needed to satisfy these requirements.
275 |
276 | e) Convey the object code using peer-to-peer transmission, provided
277 | you inform other peers where the object code and Corresponding
278 | Source of the work are being offered to the general public at no
279 | charge under subsection 6d.
280 |
281 | A separable portion of the object code, whose source code is excluded
282 | from the Corresponding Source as a System Library, need not be
283 | included in conveying the object code work.
284 |
285 | A "User Product" is either (1) a "consumer product", which means any
286 | tangible personal property which is normally used for personal, family,
287 | or household purposes, or (2) anything designed or sold for incorporation
288 | into a dwelling. In determining whether a product is a consumer product,
289 | doubtful cases shall be resolved in favor of coverage. For a particular
290 | product received by a particular user, "normally used" refers to a
291 | typical or common use of that class of product, regardless of the status
292 | of the particular user or of the way in which the particular user
293 | actually uses, or expects or is expected to use, the product. A product
294 | is a consumer product regardless of whether the product has substantial
295 | commercial, industrial or non-consumer uses, unless such uses represent
296 | the only significant mode of use of the product.
297 |
298 | "Installation Information" for a User Product means any methods,
299 | procedures, authorization keys, or other information required to install
300 | and execute modified versions of a covered work in that User Product from
301 | a modified version of its Corresponding Source. The information must
302 | suffice to ensure that the continued functioning of the modified object
303 | code is in no case prevented or interfered with solely because
304 | modification has been made.
305 |
306 | If you convey an object code work under this section in, or with, or
307 | specifically for use in, a User Product, and the conveying occurs as
308 | part of a transaction in which the right of possession and use of the
309 | User Product is transferred to the recipient in perpetuity or for a
310 | fixed term (regardless of how the transaction is characterized), the
311 | Corresponding Source conveyed under this section must be accompanied
312 | by the Installation Information. But this requirement does not apply
313 | if neither you nor any third party retains the ability to install
314 | modified object code on the User Product (for example, the work has
315 | been installed in ROM).
316 |
317 | The requirement to provide Installation Information does not include a
318 | requirement to continue to provide support service, warranty, or updates
319 | for a work that has been modified or installed by the recipient, or for
320 | the User Product in which it has been modified or installed. Access to a
321 | network may be denied when the modification itself materially and
322 | adversely affects the operation of the network or violates the rules and
323 | protocols for communication across the network.
324 |
325 | Corresponding Source conveyed, and Installation Information provided,
326 | in accord with this section must be in a format that is publicly
327 | documented (and with an implementation available to the public in
328 | source code form), and must require no special password or key for
329 | unpacking, reading or copying.
330 |
331 | 7. Additional Terms.
332 |
333 | "Additional permissions" are terms that supplement the terms of this
334 | License by making exceptions from one or more of its conditions.
335 | Additional permissions that are applicable to the entire Program shall
336 | be treated as though they were included in this License, to the extent
337 | that they are valid under applicable law. If additional permissions
338 | apply only to part of the Program, that part may be used separately
339 | under those permissions, but the entire Program remains governed by
340 | this License without regard to the additional permissions.
341 |
342 | When you convey a copy of a covered work, you may at your option
343 | remove any additional permissions from that copy, or from any part of
344 | it. (Additional permissions may be written to require their own
345 | removal in certain cases when you modify the work.) You may place
346 | additional permissions on material, added by you to a covered work,
347 | for which you have or can give appropriate copyright permission.
348 |
349 | Notwithstanding any other provision of this License, for material you
350 | add to a covered work, you may (if authorized by the copyright holders of
351 | that material) supplement the terms of this License with terms:
352 |
353 | a) Disclaiming warranty or limiting liability differently from the
354 | terms of sections 15 and 16 of this License; or
355 |
356 | b) Requiring preservation of specified reasonable legal notices or
357 | author attributions in that material or in the Appropriate Legal
358 | Notices displayed by works containing it; or
359 |
360 | c) Prohibiting misrepresentation of the origin of that material, or
361 | requiring that modified versions of such material be marked in
362 | reasonable ways as different from the original version; or
363 |
364 | d) Limiting the use for publicity purposes of names of licensors or
365 | authors of the material; or
366 |
367 | e) Declining to grant rights under trademark law for use of some
368 | trade names, trademarks, or service marks; or
369 |
370 | f) Requiring indemnification of licensors and authors of that
371 | material by anyone who conveys the material (or modified versions of
372 | it) with contractual assumptions of liability to the recipient, for
373 | any liability that these contractual assumptions directly impose on
374 | those licensors and authors.
375 |
376 | All other non-permissive additional terms are considered "further
377 | restrictions" within the meaning of section 10. If the Program as you
378 | received it, or any part of it, contains a notice stating that it is
379 | governed by this License along with a term that is a further
380 | restriction, you may remove that term. If a license document contains
381 | a further restriction but permits relicensing or conveying under this
382 | License, you may add to a covered work material governed by the terms
383 | of that license document, provided that the further restriction does
384 | not survive such relicensing or conveying.
385 |
386 | If you add terms to a covered work in accord with this section, you
387 | must place, in the relevant source files, a statement of the
388 | additional terms that apply to those files, or a notice indicating
389 | where to find the applicable terms.
390 |
391 | Additional terms, permissive or non-permissive, may be stated in the
392 | form of a separately written license, or stated as exceptions;
393 | the above requirements apply either way.
394 |
395 | 8. Termination.
396 |
397 | You may not propagate or modify a covered work except as expressly
398 | provided under this License. Any attempt otherwise to propagate or
399 | modify it is void, and will automatically terminate your rights under
400 | this License (including any patent licenses granted under the third
401 | paragraph of section 11).
402 |
403 | However, if you cease all violation of this License, then your
404 | license from a particular copyright holder is reinstated (a)
405 | provisionally, unless and until the copyright holder explicitly and
406 | finally terminates your license, and (b) permanently, if the copyright
407 | holder fails to notify you of the violation by some reasonable means
408 | prior to 60 days after the cessation.
409 |
410 | Moreover, your license from a particular copyright holder is
411 | reinstated permanently if the copyright holder notifies you of the
412 | violation by some reasonable means, this is the first time you have
413 | received notice of violation of this License (for any work) from that
414 | copyright holder, and you cure the violation prior to 30 days after
415 | your receipt of the notice.
416 |
417 | Termination of your rights under this section does not terminate the
418 | licenses of parties who have received copies or rights from you under
419 | this License. If your rights have been terminated and not permanently
420 | reinstated, you do not qualify to receive new licenses for the same
421 | material under section 10.
422 |
423 | 9. Acceptance Not Required for Having Copies.
424 |
425 | You are not required to accept this License in order to receive or
426 | run a copy of the Program. Ancillary propagation of a covered work
427 | occurring solely as a consequence of using peer-to-peer transmission
428 | to receive a copy likewise does not require acceptance. However,
429 | nothing other than this License grants you permission to propagate or
430 | modify any covered work. These actions infringe copyright if you do
431 | not accept this License. Therefore, by modifying or propagating a
432 | covered work, you indicate your acceptance of this License to do so.
433 |
434 | 10. Automatic Licensing of Downstream Recipients.
435 |
436 | Each time you convey a covered work, the recipient automatically
437 | receives a license from the original licensors, to run, modify and
438 | propagate that work, subject to this License. You are not responsible
439 | for enforcing compliance by third parties with this License.
440 |
441 | An "entity transaction" is a transaction transferring control of an
442 | organization, or substantially all assets of one, or subdividing an
443 | organization, or merging organizations. If propagation of a covered
444 | work results from an entity transaction, each party to that
445 | transaction who receives a copy of the work also receives whatever
446 | licenses to the work the party's predecessor in interest had or could
447 | give under the previous paragraph, plus a right to possession of the
448 | Corresponding Source of the work from the predecessor in interest, if
449 | the predecessor has it or can get it with reasonable efforts.
450 |
451 | You may not impose any further restrictions on the exercise of the
452 | rights granted or affirmed under this License. For example, you may
453 | not impose a license fee, royalty, or other charge for exercise of
454 | rights granted under this License, and you may not initiate litigation
455 | (including a cross-claim or counterclaim in a lawsuit) alleging that
456 | any patent claim is infringed by making, using, selling, offering for
457 | sale, or importing the Program or any portion of it.
458 |
459 | 11. Patents.
460 |
461 | A "contributor" is a copyright holder who authorizes use under this
462 | License of the Program or a work on which the Program is based. The
463 | work thus licensed is called the contributor's "contributor version".
464 |
465 | A contributor's "essential patent claims" are all patent claims
466 | owned or controlled by the contributor, whether already acquired or
467 | hereafter acquired, that would be infringed by some manner, permitted
468 | by this License, of making, using, or selling its contributor version,
469 | but do not include claims that would be infringed only as a
470 | consequence of further modification of the contributor version. For
471 | purposes of this definition, "control" includes the right to grant
472 | patent sublicenses in a manner consistent with the requirements of
473 | this License.
474 |
475 | Each contributor grants you a non-exclusive, worldwide, royalty-free
476 | patent license under the contributor's essential patent claims, to
477 | make, use, sell, offer for sale, import and otherwise run, modify and
478 | propagate the contents of its contributor version.
479 |
480 | In the following three paragraphs, a "patent license" is any express
481 | agreement or commitment, however denominated, not to enforce a patent
482 | (such as an express permission to practice a patent or covenant not to
483 | sue for patent infringement). To "grant" such a patent license to a
484 | party means to make such an agreement or commitment not to enforce a
485 | patent against the party.
486 |
487 | If you convey a covered work, knowingly relying on a patent license,
488 | and the Corresponding Source of the work is not available for anyone
489 | to copy, free of charge and under the terms of this License, through a
490 | publicly available network server or other readily accessible means,
491 | then you must either (1) cause the Corresponding Source to be so
492 | available, or (2) arrange to deprive yourself of the benefit of the
493 | patent license for this particular work, or (3) arrange, in a manner
494 | consistent with the requirements of this License, to extend the patent
495 | license to downstream recipients. "Knowingly relying" means you have
496 | actual knowledge that, but for the patent license, your conveying the
497 | covered work in a country, or your recipient's use of the covered work
498 | in a country, would infringe one or more identifiable patents in that
499 | country that you have reason to believe are valid.
500 |
501 | If, pursuant to or in connection with a single transaction or
502 | arrangement, you convey, or propagate by procuring conveyance of, a
503 | covered work, and grant a patent license to some of the parties
504 | receiving the covered work authorizing them to use, propagate, modify
505 | or convey a specific copy of the covered work, then the patent license
506 | you grant is automatically extended to all recipients of the covered
507 | work and works based on it.
508 |
509 | A patent license is "discriminatory" if it does not include within
510 | the scope of its coverage, prohibits the exercise of, or is
511 | conditioned on the non-exercise of one or more of the rights that are
512 | specifically granted under this License. You may not convey a covered
513 | work if you are a party to an arrangement with a third party that is
514 | in the business of distributing software, under which you make payment
515 | to the third party based on the extent of your activity of conveying
516 | the work, and under which the third party grants, to any of the
517 | parties who would receive the covered work from you, a discriminatory
518 | patent license (a) in connection with copies of the covered work
519 | conveyed by you (or copies made from those copies), or (b) primarily
520 | for and in connection with specific products or compilations that
521 | contain the covered work, unless you entered into that arrangement,
522 | or that patent license was granted, prior to 28 March 2007.
523 |
524 | Nothing in this License shall be construed as excluding or limiting
525 | any implied license or other defenses to infringement that may
526 | otherwise be available to you under applicable patent law.
527 |
528 | 12. No Surrender of Others' Freedom.
529 |
530 | If conditions are imposed on you (whether by court order, agreement or
531 | otherwise) that contradict the conditions of this License, they do not
532 | excuse you from the conditions of this License. If you cannot convey a
533 | covered work so as to satisfy simultaneously your obligations under this
534 | License and any other pertinent obligations, then as a consequence you may
535 | not convey it at all. For example, if you agree to terms that obligate you
536 | to collect a royalty for further conveying from those to whom you convey
537 | the Program, the only way you could satisfy both those terms and this
538 | License would be to refrain entirely from conveying the Program.
539 |
540 | 13. Remote Network Interaction; Use with the GNU General Public License.
541 |
542 | Notwithstanding any other provision of this License, if you modify the
543 | Program, your modified version must prominently offer all users
544 | interacting with it remotely through a computer network (if your version
545 | supports such interaction) an opportunity to receive the Corresponding
546 | Source of your version by providing access to the Corresponding Source
547 | from a network server at no charge, through some standard or customary
548 | means of facilitating copying of software. This Corresponding Source
549 | shall include the Corresponding Source for any work covered by version 3
550 | of the GNU General Public License that is incorporated pursuant to the
551 | following paragraph.
552 |
553 | Notwithstanding any other provision of this License, you have
554 | permission to link or combine any covered work with a work licensed
555 | under version 3 of the GNU General Public License into a single
556 | combined work, and to convey the resulting work. The terms of this
557 | License will continue to apply to the part which is the covered work,
558 | but the work with which it is combined will remain governed by version
559 | 3 of the GNU General Public License.
560 |
561 | 14. Revised Versions of this License.
562 |
563 | The Free Software Foundation may publish revised and/or new versions of
564 | the GNU Affero General Public License from time to time. Such new versions
565 | will be similar in spirit to the present version, but may differ in detail to
566 | address new problems or concerns.
567 |
568 | Each version is given a distinguishing version number. If the
569 | Program specifies that a certain numbered version of the GNU Affero General
570 | Public License "or any later version" applies to it, you have the
571 | option of following the terms and conditions either of that numbered
572 | version or of any later version published by the Free Software
573 | Foundation. If the Program does not specify a version number of the
574 | GNU Affero General Public License, you may choose any version ever published
575 | by the Free Software Foundation.
576 |
577 | If the Program specifies that a proxy can decide which future
578 | versions of the GNU Affero General Public License can be used, that proxy's
579 | public statement of acceptance of a version permanently authorizes you
580 | to choose that version for the Program.
581 |
582 | Later license versions may give you additional or different
583 | permissions. However, no additional obligations are imposed on any
584 | author or copyright holder as a result of your choosing to follow a
585 | later version.
586 |
587 | 15. Disclaimer of Warranty.
588 |
589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
597 |
598 | 16. Limitation of Liability.
599 |
600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
608 | SUCH DAMAGES.
609 |
610 | 17. Interpretation of Sections 15 and 16.
611 |
612 | If the disclaimer of warranty and limitation of liability provided
613 | above cannot be given local legal effect according to their terms,
614 | reviewing courts shall apply local law that most closely approximates
615 | an absolute waiver of all civil liability in connection with the
616 | Program, unless a warranty or assumption of liability accompanies a
617 | copy of the Program in return for a fee.
618 |
619 | END OF TERMS AND CONDITIONS
620 |
621 | How to Apply These Terms to Your New Programs
622 |
623 | If you develop a new program, and you want it to be of the greatest
624 | possible use to the public, the best way to achieve this is to make it
625 | free software which everyone can redistribute and change under these terms.
626 |
627 | To do so, attach the following notices to the program. It is safest
628 | to attach them to the start of each source file to most effectively
629 | state the exclusion of warranty; and each file should have at least
630 | the "copyright" line and a pointer to where the full notice is found.
631 |
632 |
633 | Copyright (C)
634 |
635 | This program is free software: you can redistribute it and/or modify
636 | it under the terms of the GNU Affero General Public License as published by
637 | the Free Software Foundation, either version 3 of the License, or
638 | (at your option) any later version.
639 |
640 | This program is distributed in the hope that it will be useful,
641 | but WITHOUT ANY WARRANTY; without even the implied warranty of
642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
643 | GNU Affero General Public License for more details.
644 |
645 | You should have received a copy of the GNU Affero General Public License
646 | along with this program. If not, see .
647 |
648 | Also add information on how to contact you by electronic and paper mail.
649 |
650 | If your software can interact with users remotely through a computer
651 | network, you should also make sure that it provides a way for users to
652 | get its source. For example, if your program is a web application, its
653 | interface could display a "Source" link that leads users to an archive
654 | of the code. There are many ways you could offer source, and different
655 | solutions will be better for different programs; see section 13 for the
656 | specific requirements.
657 |
658 | You should also get your employer (if you work as a programmer) or school,
659 | if any, to sign a "copyright disclaimer" for the program, if necessary.
660 | For more information on this, and how to apply and follow the GNU AGPL, see
661 | .
662 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # xk6-ts
2 |
3 | >[!WARNING]
4 | >This extension is deprecated because its functionality [has been included in k6](https://grafana.com/docs/k6/latest/using-k6/javascript-typescript-compatibility-mode/).
5 |
6 | **TypeScript support for k6**
7 |
8 | xk6-ts makes TypeScript a first-class citizen in k6.
9 |
10 | ```sh
11 | k6 run script.ts
12 | ```
13 |
14 |
15 | script.ts
16 |
17 | ```ts file=examples/script.ts
18 | import { User, newUser } from "./user";
19 |
20 | export default () => {
21 | const user: User = newUser("John");
22 | console.log(user);
23 | };
24 | ```
25 |
26 |
27 |
28 |
29 | user.ts
30 |
31 | ```ts file=examples/user.ts
32 | interface User {
33 | name: string;
34 | id: number;
35 | }
36 |
37 | class UserAccount implements User {
38 | name: string;
39 | id: number;
40 |
41 | constructor(name: string) {
42 | this.name = name;
43 | this.id = Math.floor(Math.random() * Number.MAX_SAFE_INTEGER);
44 | }
45 | }
46 |
47 | function newUser(name: string): User {
48 | return new UserAccount(name);
49 | }
50 |
51 | export { User, newUser };
52 | ```
53 |
54 |
55 |
56 | That's it. A test written in TypeScript can be run directly with k6. No need for Node.js, babel, webpack, bundler, build step, etc.
57 |
58 | Do you think modern JavaScript features make TypeScript pointless? xk6-ts can also be used to support modern JavaScript features in k6.
59 |
60 | ```sh
61 | k6 run script.js
62 | ```
63 |
64 |
65 | script.js
66 |
67 | ```ts file=examples/script.js
68 | import { newUser } from "./user";
69 |
70 | export default () => {
71 | const user = newUser("John");
72 | console.log(user);
73 | };
74 | ```
75 |
76 |
77 |
78 |
79 | xk6-ts can be disabled by setting the `XK6_TS` environment variable to `false`.
80 |
81 | To ensure that runtime error messages report the correct source code position, sourcemap generation is enabled by default. Otherwise, due to transpilation and bundling, the source code position is meaningless.
82 | Sourcemap generation can be disabled by setting the value of the `XK6_TS_SOURCEMAP` environment variable to `false`.
83 |
84 | ## Features
85 |
86 | - TypeScript language support
87 | ```bash
88 | k6 run script.ts
89 | ```
90 | - remote (https) TypeScript/JavaScript module support
91 | ```js
92 | import { User } from 'https://example.com/user.ts'
93 | console.log(new User())
94 | ```
95 |
96 | - importing JSON files as JavaScript object
97 | ```js
98 | import object from './example.json'
99 | console.log(object)
100 | ```
101 | - importing text files as JavaScript string
102 | ```js
103 | import string from './example.txt'
104 | console.log(string)
105 | ```
106 | - mix and match JavaScript and TypeScript
107 | - import TypeScript module from JavaScript module
108 | - import JavaScript module from TypeScript module
109 |
110 | ## Download
111 |
112 | You can download pre-built k6 binaries from [Releases](https://github.com/szkiba/xk6-ts/releases/) page. Check [Packages](https://github.com/szkiba/xk6-ts/pkgs/container/xk6-ts) page for pre-built k6 Docker images.
113 |
114 | ## Build
115 |
116 | The [xk6](https://github.com/grafana/xk6) build tool can be used to build a k6 that will include xk6-faker extension:
117 |
118 | ```bash
119 | $ xk6 build --with github.com/szkiba/xk6-ts@latest
120 | ```
121 |
122 | For more build options and how to use xk6, check out the [xk6 documentation](https://github.com/grafana/xk6).
123 |
124 | ## How It Works
125 |
126 | Under the hood, xk6-ts uses the [esbuild](https://github.com/evanw/esbuild) library for transpiling and bundling. To be precise, xk6-ts uses the [k6pack](https://github.com/grafana/k6pack) library, which is based on esbuild.
127 |
128 | Before the test run, transpilation and bundling are done on the fly.
129 |
130 | ## Compatibility warning
131 |
132 | xk6-ts is currently integrated into k6 by modifying the execution of the `k6 run` command. This is a temporary solution, the final integration will be done in a different way. This temporary integration assumes that the last argument of the `k6 run` command line is the name of the script file. That is, contrary to the way the original `k6 run` command line works, xk6-ts does not accept flags after the script file name. By the way, this assumption is not uncommon, many other commands only accept flags before positional arguments. (the original `k6 run` command also accepts flags after the positional argument).
133 |
134 | ## Benchmarking
135 |
136 | Setting the `XK6_TS_BENCHMARK` environment variable to `true` will log the time spent on TypeScript/JavaScript bundling. This time also includes downloading any remote modules.
137 |
--------------------------------------------------------------------------------
/examples/abort.ts:
--------------------------------------------------------------------------------
1 | import exec from "k6/execution";
2 |
3 | export default function () {
4 | exec.test.abort("failed");
5 | }
6 |
--------------------------------------------------------------------------------
/examples/issue-13.ts:
--------------------------------------------------------------------------------
1 | export const options = {
2 | scenarios: {
3 | per_vu_scenario: {
4 | executor: "per-vu-iterations",
5 | vus: 10,
6 | iterations: 10,
7 | startTime: "10s",
8 | },
9 | },
10 | };
11 |
12 | function noop() {}
13 |
14 | export default function () {
15 | noop();
16 | noop();
17 | noop();
18 | noop();
19 | noop();
20 | noop();
21 | noop();
22 | noop();
23 | noop();
24 | noop();
25 | noop();
26 | noop();
27 | noop();
28 | noop();
29 | noop();
30 | noop();
31 | noop();
32 | noop();
33 | noop();
34 | noop();
35 | noop();
36 | noop();
37 | noop();
38 | noop();
39 | noop();
40 | noop();
41 | noop();
42 | noop();
43 | noop();
44 | noop();
45 | noop();
46 | noop();
47 | noop();
48 | noop();
49 | noop();
50 | noop();
51 | noop();
52 | noop();
53 | noop();
54 | noop();
55 | noop();
56 | noop();
57 | noop();
58 | noop();
59 | noop();
60 | noop();
61 | noop();
62 | noop();
63 | noop();
64 | noop();
65 | noop();
66 | noop();
67 | noop();
68 | noop();
69 | noop();
70 | noop();
71 | noop();
72 | noop();
73 | noop();
74 | noop();
75 | noop();
76 | noop();
77 | noop();
78 | noop();
79 | noop();
80 | noop();
81 | noop();
82 | noop();
83 | noop();
84 | noop();
85 | noop();
86 | noop();
87 | noop();
88 | noop();
89 | noop();
90 | noop();
91 | noop();
92 | noop();
93 | noop();
94 | noop();
95 | noop();
96 | noop();
97 | noop();
98 | noop();
99 | noop();
100 | noop();
101 | noop();
102 | noop();
103 | noop();
104 | noop();
105 | noop();
106 | noop();
107 | noop();
108 | noop();
109 | noop();
110 | noop();
111 | noop();
112 | noop();
113 | noop();
114 | noop();
115 | noop();
116 | noop();
117 | noop();
118 | noop();
119 | noop();
120 | noop();
121 | noop();
122 | noop();
123 | noop();
124 | noop();
125 | noop();
126 | noop();
127 | noop();
128 | noop();
129 | noop();
130 | noop();
131 | noop();
132 | noop();
133 | noop();
134 | noop();
135 | noop();
136 | noop();
137 | noop();
138 | noop();
139 | noop();
140 | noop();
141 | noop();
142 | noop();
143 | noop();
144 | noop();
145 | noop();
146 | noop();
147 | noop();
148 | noop();
149 | noop();
150 | noop();
151 | noop();
152 | noop();
153 | noop();
154 | noop();
155 | noop();
156 | noop();
157 | noop();
158 | noop();
159 | noop();
160 | noop();
161 | noop();
162 | noop();
163 | noop();
164 | noop();
165 | noop();
166 | noop();
167 | noop();
168 | noop();
169 | noop();
170 | noop();
171 | noop();
172 | noop();
173 | noop();
174 | noop();
175 | noop();
176 | noop();
177 | noop();
178 | noop();
179 | noop();
180 | noop();
181 | noop();
182 | noop();
183 | noop();
184 | noop();
185 | noop();
186 | noop();
187 | noop();
188 | noop();
189 | noop();
190 | noop();
191 | noop();
192 | noop();
193 | noop();
194 | noop();
195 | noop();
196 | noop();
197 | noop();
198 | noop();
199 | noop();
200 | noop();
201 | noop();
202 | noop();
203 | noop();
204 | noop();
205 | noop();
206 | noop();
207 | noop();
208 | noop();
209 | noop();
210 | noop();
211 | noop();
212 | noop();
213 | noop();
214 | noop();
215 | noop();
216 | noop();
217 | noop();
218 | noop();
219 | noop();
220 | noop();
221 | noop();
222 | noop();
223 | noop();
224 | noop();
225 | noop();
226 | noop();
227 | noop();
228 | noop();
229 | noop();
230 | noop();
231 | noop();
232 | noop();
233 | noop();
234 | noop();
235 | noop();
236 | noop();
237 | noop();
238 | noop();
239 | noop();
240 | noop();
241 | noop();
242 | noop();
243 | noop();
244 | noop();
245 | noop();
246 | noop();
247 | noop();
248 | noop();
249 | noop();
250 | noop();
251 | noop();
252 | noop();
253 | noop();
254 | noop();
255 | noop();
256 | noop();
257 | noop();
258 | noop();
259 | noop();
260 | noop();
261 | noop();
262 | noop();
263 | noop();
264 | noop();
265 | noop();
266 | noop();
267 | noop();
268 | noop();
269 | noop();
270 | noop();
271 | noop();
272 | noop();
273 | noop();
274 | noop();
275 | noop();
276 | noop();
277 | noop();
278 | noop();
279 | noop();
280 | noop();
281 | noop();
282 | noop();
283 | noop();
284 | noop();
285 | noop();
286 | noop();
287 | noop();
288 | noop();
289 | noop();
290 | noop();
291 | noop();
292 | noop();
293 | noop();
294 | noop();
295 | noop();
296 | noop();
297 | noop();
298 | noop();
299 | noop();
300 | noop();
301 | noop();
302 | noop();
303 | noop();
304 | noop();
305 | noop();
306 | noop();
307 | noop();
308 | noop();
309 | noop();
310 | noop();
311 | noop();
312 | noop();
313 | noop();
314 | noop();
315 | noop();
316 | noop();
317 | noop();
318 | noop();
319 | noop();
320 | noop();
321 | noop();
322 | noop();
323 | noop();
324 | noop();
325 | noop();
326 | noop();
327 | noop();
328 | noop();
329 | noop();
330 | noop();
331 | noop();
332 | noop();
333 | noop();
334 | noop();
335 | noop();
336 | noop();
337 | noop();
338 | noop();
339 | noop();
340 | noop();
341 | noop();
342 | noop();
343 | noop();
344 | noop();
345 | noop();
346 | noop();
347 | noop();
348 | noop();
349 | noop();
350 | noop();
351 | noop();
352 | noop();
353 | noop();
354 | noop();
355 | noop();
356 | noop();
357 | noop();
358 | noop();
359 | noop();
360 | noop();
361 | noop();
362 | noop();
363 | noop();
364 | noop();
365 | noop();
366 | noop();
367 | noop();
368 | noop();
369 | noop();
370 | noop();
371 | noop();
372 | noop();
373 | noop();
374 | noop();
375 | noop();
376 | noop();
377 | noop();
378 | noop();
379 | noop();
380 | noop();
381 | noop();
382 | noop();
383 | noop();
384 | noop();
385 | noop();
386 | noop();
387 | noop();
388 | noop();
389 | noop();
390 | noop();
391 | noop();
392 | noop();
393 | noop();
394 | noop();
395 | noop();
396 | noop();
397 | noop();
398 | noop();
399 | noop();
400 | noop();
401 | noop();
402 | noop();
403 | noop();
404 | noop();
405 | noop();
406 | noop();
407 | noop();
408 | noop();
409 | noop();
410 | noop();
411 | noop();
412 | noop();
413 | noop();
414 | noop();
415 | noop();
416 | noop();
417 | noop();
418 | noop();
419 | noop();
420 | noop();
421 | noop();
422 | noop();
423 | noop();
424 | noop();
425 | noop();
426 | noop();
427 | noop();
428 | noop();
429 | noop();
430 | noop();
431 | noop();
432 | noop();
433 | noop();
434 | noop();
435 | noop();
436 | noop();
437 | noop();
438 | noop();
439 | noop();
440 | noop();
441 | noop();
442 | noop();
443 | noop();
444 | noop();
445 | noop();
446 | noop();
447 | noop();
448 | noop();
449 | noop();
450 | noop();
451 | noop();
452 | noop();
453 | noop();
454 | noop();
455 | noop();
456 | noop();
457 | noop();
458 | noop();
459 | noop();
460 | noop();
461 | noop();
462 | noop();
463 | noop();
464 | noop();
465 | noop();
466 | noop();
467 | noop();
468 | noop();
469 | noop();
470 | noop();
471 | noop();
472 | noop();
473 | noop();
474 | noop();
475 | noop();
476 | noop();
477 | noop();
478 | noop();
479 | noop();
480 | noop();
481 | noop();
482 | noop();
483 | noop();
484 | noop();
485 | noop();
486 | noop();
487 | noop();
488 | noop();
489 | noop();
490 | noop();
491 | noop();
492 | noop();
493 | noop();
494 | noop();
495 | noop();
496 | noop();
497 | noop();
498 | noop();
499 | noop();
500 | noop();
501 | noop();
502 | noop();
503 | noop();
504 | noop();
505 | noop();
506 | noop();
507 | noop();
508 | noop();
509 | noop();
510 | noop();
511 | noop();
512 | noop();
513 | noop();
514 | noop();
515 | noop();
516 | noop();
517 | noop();
518 | noop();
519 | noop();
520 | noop();
521 | noop();
522 | noop();
523 | noop();
524 | noop();
525 | noop();
526 | noop();
527 | noop();
528 | noop();
529 | noop();
530 | noop();
531 | noop();
532 | noop();
533 | noop();
534 | noop();
535 | noop();
536 | noop();
537 | noop();
538 | noop();
539 | noop();
540 | noop();
541 | noop();
542 | noop();
543 | noop();
544 | noop();
545 | noop();
546 | noop();
547 | noop();
548 | noop();
549 | noop();
550 | noop();
551 | noop();
552 | noop();
553 | noop();
554 | noop();
555 | noop();
556 | noop();
557 | noop();
558 | noop();
559 | noop();
560 | noop();
561 | noop();
562 | noop();
563 | noop();
564 | noop();
565 | noop();
566 | noop();
567 | noop();
568 | noop();
569 | noop();
570 | noop();
571 | noop();
572 | noop();
573 | noop();
574 | noop();
575 | noop();
576 | noop();
577 | noop();
578 | noop();
579 | noop();
580 | noop();
581 | noop();
582 | noop();
583 | noop();
584 | noop();
585 | noop();
586 | noop();
587 | noop();
588 | noop();
589 | noop();
590 | noop();
591 | noop();
592 | noop();
593 | noop();
594 | noop();
595 | noop();
596 | noop();
597 | noop();
598 | noop();
599 | noop();
600 | noop();
601 | noop();
602 | noop();
603 | noop();
604 | noop();
605 | noop();
606 | noop();
607 | noop();
608 | noop();
609 | noop();
610 | noop();
611 | noop();
612 | noop();
613 | noop();
614 | noop();
615 | noop();
616 | noop();
617 | noop();
618 | noop();
619 | noop();
620 | noop();
621 | noop();
622 | noop();
623 | noop();
624 | noop();
625 | noop();
626 | noop();
627 | noop();
628 | noop();
629 | noop();
630 | noop();
631 | noop();
632 | noop();
633 | noop();
634 | noop();
635 | noop();
636 | noop();
637 | noop();
638 | noop();
639 | noop();
640 | noop();
641 | noop();
642 | noop();
643 | noop();
644 | noop();
645 | noop();
646 | noop();
647 | noop();
648 | noop();
649 | noop();
650 | noop();
651 | noop();
652 | noop();
653 | noop();
654 | noop();
655 | noop();
656 | noop();
657 | noop();
658 | noop();
659 | noop();
660 | noop();
661 | noop();
662 | noop();
663 | noop();
664 | noop();
665 | noop();
666 | noop();
667 | noop();
668 | noop();
669 | noop();
670 | noop();
671 | noop();
672 | noop();
673 | noop();
674 | noop();
675 | noop();
676 | noop();
677 | noop();
678 | noop();
679 | noop();
680 | noop();
681 | noop();
682 | noop();
683 | noop();
684 | noop();
685 | noop();
686 | noop();
687 | noop();
688 | noop();
689 | noop();
690 | noop();
691 | noop();
692 | noop();
693 | noop();
694 | noop();
695 | noop();
696 | noop();
697 | noop();
698 | noop();
699 | noop();
700 | noop();
701 | noop();
702 | noop();
703 | noop();
704 | noop();
705 | noop();
706 | noop();
707 | noop();
708 | noop();
709 | noop();
710 | noop();
711 | noop();
712 | noop();
713 | noop();
714 | noop();
715 | noop();
716 | noop();
717 | noop();
718 | noop();
719 | noop();
720 | noop();
721 | noop();
722 | noop();
723 | noop();
724 | noop();
725 | noop();
726 | noop();
727 | noop();
728 | noop();
729 | noop();
730 | noop();
731 | noop();
732 | noop();
733 | noop();
734 | noop();
735 | noop();
736 | noop();
737 | noop();
738 | noop();
739 | noop();
740 | noop();
741 | noop();
742 | noop();
743 | noop();
744 | noop();
745 | noop();
746 | noop();
747 | noop();
748 | noop();
749 | noop();
750 | noop();
751 | noop();
752 | noop();
753 | noop();
754 | noop();
755 | noop();
756 | noop();
757 | noop();
758 | noop();
759 | noop();
760 | noop();
761 | noop();
762 | noop();
763 | noop();
764 | noop();
765 | noop();
766 | noop();
767 | noop();
768 | noop();
769 | noop();
770 | noop();
771 | noop();
772 | noop();
773 | noop();
774 | noop();
775 | noop();
776 | noop();
777 | noop();
778 | noop();
779 | noop();
780 | noop();
781 | noop();
782 | noop();
783 | noop();
784 | noop();
785 | noop();
786 | noop();
787 | noop();
788 | noop();
789 | noop();
790 | noop();
791 | noop();
792 | noop();
793 | noop();
794 | noop();
795 | noop();
796 | noop();
797 | noop();
798 | noop();
799 | noop();
800 | noop();
801 | noop();
802 | noop();
803 | noop();
804 | noop();
805 | noop();
806 | noop();
807 | noop();
808 | noop();
809 | noop();
810 | noop();
811 | noop();
812 | noop();
813 | noop();
814 | noop();
815 | noop();
816 | noop();
817 | noop();
818 | noop();
819 | noop();
820 | noop();
821 | noop();
822 | noop();
823 | noop();
824 | noop();
825 | noop();
826 | noop();
827 | noop();
828 | noop();
829 | noop();
830 | noop();
831 | noop();
832 | noop();
833 | noop();
834 | noop();
835 | noop();
836 | noop();
837 | noop();
838 | noop();
839 | noop();
840 | noop();
841 | noop();
842 | noop();
843 | noop();
844 | noop();
845 | noop();
846 | noop();
847 | noop();
848 | noop();
849 | noop();
850 | noop();
851 | noop();
852 | noop();
853 | noop();
854 | noop();
855 | noop();
856 | noop();
857 | noop();
858 | noop();
859 | noop();
860 | noop();
861 | noop();
862 | noop();
863 | noop();
864 | noop();
865 | noop();
866 | noop();
867 | noop();
868 | noop();
869 | noop();
870 | noop();
871 | noop();
872 | noop();
873 | noop();
874 | noop();
875 | noop();
876 | noop();
877 | noop();
878 | noop();
879 | noop();
880 | noop();
881 | noop();
882 | noop();
883 | noop();
884 | noop();
885 | noop();
886 | noop();
887 | noop();
888 | noop();
889 | noop();
890 | noop();
891 | noop();
892 | noop();
893 | noop();
894 | noop();
895 | noop();
896 | noop();
897 | noop();
898 | noop();
899 | noop();
900 | noop();
901 | noop();
902 | noop();
903 | noop();
904 | noop();
905 | noop();
906 | noop();
907 | noop();
908 | noop();
909 | noop();
910 | noop();
911 | noop();
912 | noop();
913 | noop();
914 | noop();
915 | noop();
916 | noop();
917 | noop();
918 | noop();
919 | noop();
920 | noop();
921 | noop();
922 | noop();
923 | noop();
924 | noop();
925 | noop();
926 | noop();
927 | noop();
928 | noop();
929 | noop();
930 | noop();
931 | noop();
932 | noop();
933 | noop();
934 | noop();
935 | noop();
936 | noop();
937 | noop();
938 | noop();
939 | noop();
940 | noop();
941 | noop();
942 | noop();
943 | noop();
944 | noop();
945 | noop();
946 | noop();
947 | noop();
948 | noop();
949 | noop();
950 | noop();
951 | noop();
952 | noop();
953 | noop();
954 | noop();
955 | noop();
956 | noop();
957 | noop();
958 | noop();
959 | noop();
960 | noop();
961 | noop();
962 | noop();
963 | noop();
964 | noop();
965 | noop();
966 | noop();
967 | noop();
968 | noop();
969 | noop();
970 | noop();
971 | noop();
972 | noop();
973 | noop();
974 | noop();
975 | noop();
976 | noop();
977 | noop();
978 | noop();
979 | noop();
980 | noop();
981 | noop();
982 | noop();
983 | noop();
984 | noop();
985 | noop();
986 | noop();
987 | noop();
988 | noop();
989 | noop();
990 | noop();
991 | noop();
992 | noop();
993 | noop();
994 | noop();
995 | noop();
996 | noop();
997 | noop();
998 | noop();
999 | noop();
1000 | noop();
1001 | noop();
1002 | noop();
1003 | noop();
1004 | noop();
1005 | noop();
1006 | noop();
1007 | noop();
1008 | noop();
1009 | noop();
1010 | noop();
1011 | noop();
1012 | noop();
1013 | noop();
1014 | noop();
1015 | noop();
1016 | noop();
1017 | noop();
1018 | noop();
1019 | noop();
1020 | noop();
1021 | noop();
1022 | noop();
1023 | noop();
1024 | noop();
1025 | noop();
1026 | noop();
1027 | noop();
1028 | noop();
1029 | noop();
1030 | noop();
1031 | noop();
1032 | noop();
1033 | noop();
1034 | noop();
1035 | noop();
1036 | noop();
1037 | noop();
1038 | noop();
1039 | noop();
1040 | noop();
1041 | noop();
1042 | noop();
1043 | noop();
1044 | noop();
1045 | noop();
1046 | noop();
1047 | noop();
1048 | noop();
1049 | noop();
1050 | noop();
1051 | noop();
1052 | noop();
1053 | noop();
1054 | noop();
1055 | noop();
1056 | noop();
1057 | noop();
1058 | noop();
1059 | noop();
1060 | noop();
1061 | noop();
1062 | noop();
1063 | noop();
1064 | noop();
1065 | noop();
1066 | noop();
1067 | noop();
1068 | noop();
1069 | noop();
1070 | noop();
1071 | noop();
1072 | noop();
1073 | noop();
1074 | noop();
1075 | noop();
1076 | noop();
1077 | noop();
1078 | noop();
1079 | noop();
1080 | noop();
1081 | noop();
1082 | noop();
1083 | noop();
1084 | noop();
1085 | noop();
1086 | noop();
1087 | noop();
1088 | noop();
1089 | noop();
1090 | noop();
1091 | noop();
1092 | noop();
1093 | noop();
1094 | noop();
1095 | noop();
1096 | noop();
1097 | noop();
1098 | noop();
1099 | noop();
1100 | noop();
1101 | noop();
1102 | noop();
1103 | noop();
1104 | noop();
1105 | noop();
1106 | noop();
1107 | noop();
1108 | noop();
1109 | noop();
1110 | noop();
1111 | noop();
1112 | noop();
1113 | noop();
1114 | noop();
1115 | noop();
1116 | noop();
1117 | noop();
1118 | noop();
1119 | noop();
1120 | noop();
1121 | noop();
1122 | noop();
1123 | noop();
1124 | noop();
1125 | noop();
1126 | noop();
1127 | noop();
1128 | noop();
1129 | noop();
1130 | noop();
1131 | noop();
1132 | noop();
1133 | noop();
1134 | noop();
1135 | noop();
1136 | noop();
1137 | noop();
1138 | noop();
1139 | noop();
1140 | noop();
1141 | noop();
1142 | noop();
1143 | noop();
1144 | noop();
1145 | noop();
1146 | noop();
1147 | noop();
1148 | noop();
1149 | noop();
1150 | noop();
1151 | noop();
1152 | noop();
1153 | noop();
1154 | noop();
1155 | noop();
1156 | noop();
1157 | noop();
1158 | noop();
1159 | noop();
1160 | noop();
1161 | noop();
1162 | noop();
1163 | noop();
1164 | noop();
1165 | noop();
1166 | noop();
1167 | noop();
1168 | noop();
1169 | noop();
1170 | noop();
1171 | noop();
1172 | noop();
1173 | noop();
1174 | noop();
1175 | noop();
1176 | noop();
1177 | noop();
1178 | noop();
1179 | noop();
1180 | noop();
1181 | noop();
1182 | noop();
1183 | noop();
1184 | noop();
1185 | noop();
1186 | noop();
1187 | noop();
1188 | noop();
1189 | noop();
1190 | noop();
1191 | noop();
1192 | noop();
1193 | noop();
1194 | noop();
1195 | noop();
1196 | noop();
1197 | noop();
1198 | noop();
1199 | noop();
1200 | noop();
1201 | noop();
1202 | noop();
1203 | noop();
1204 | noop();
1205 | noop();
1206 | noop();
1207 | noop();
1208 | noop();
1209 | noop();
1210 | noop();
1211 | noop();
1212 | noop();
1213 | noop();
1214 | noop();
1215 | noop();
1216 | noop();
1217 | noop();
1218 | noop();
1219 | noop();
1220 | noop();
1221 | noop();
1222 | noop();
1223 | noop();
1224 | noop();
1225 | noop();
1226 | noop();
1227 | noop();
1228 | noop();
1229 | noop();
1230 | noop();
1231 | noop();
1232 | noop();
1233 | noop();
1234 | noop();
1235 | noop();
1236 | noop();
1237 | noop();
1238 | noop();
1239 | noop();
1240 | noop();
1241 | noop();
1242 | noop();
1243 | noop();
1244 | noop();
1245 | noop();
1246 | noop();
1247 | noop();
1248 | noop();
1249 | noop();
1250 | noop();
1251 | noop();
1252 | noop();
1253 | noop();
1254 | noop();
1255 | noop();
1256 | noop();
1257 | noop();
1258 | noop();
1259 | noop();
1260 | noop();
1261 | noop();
1262 | noop();
1263 | noop();
1264 | noop();
1265 | noop();
1266 | noop();
1267 | noop();
1268 | noop();
1269 | noop();
1270 | noop();
1271 | noop();
1272 | noop();
1273 | noop();
1274 | noop();
1275 | noop();
1276 | noop();
1277 | noop();
1278 | noop();
1279 | noop();
1280 | noop();
1281 | noop();
1282 | noop();
1283 | noop();
1284 | noop();
1285 | noop();
1286 | noop();
1287 | noop();
1288 | noop();
1289 | noop();
1290 | noop();
1291 | noop();
1292 | noop();
1293 | noop();
1294 | noop();
1295 | noop();
1296 | noop();
1297 | noop();
1298 | noop();
1299 | noop();
1300 | noop();
1301 | noop();
1302 | noop();
1303 | noop();
1304 | noop();
1305 | noop();
1306 | noop();
1307 | noop();
1308 | noop();
1309 | noop();
1310 | noop();
1311 | noop();
1312 | noop();
1313 | noop();
1314 | noop();
1315 | noop();
1316 | noop();
1317 | noop();
1318 | noop();
1319 | noop();
1320 | noop();
1321 | noop();
1322 | noop();
1323 | noop();
1324 | noop();
1325 | noop();
1326 | noop();
1327 | noop();
1328 | noop();
1329 | noop();
1330 | noop();
1331 | noop();
1332 | noop();
1333 | noop();
1334 | noop();
1335 | noop();
1336 | noop();
1337 | noop();
1338 | noop();
1339 | noop();
1340 | noop();
1341 | noop();
1342 | noop();
1343 | noop();
1344 | noop();
1345 | noop();
1346 | noop();
1347 | noop();
1348 | noop();
1349 | noop();
1350 | noop();
1351 | noop();
1352 | noop();
1353 | noop();
1354 | noop();
1355 | noop();
1356 | noop();
1357 | noop();
1358 | noop();
1359 | noop();
1360 | noop();
1361 | noop();
1362 | noop();
1363 | noop();
1364 | noop();
1365 | noop();
1366 | noop();
1367 | noop();
1368 | noop();
1369 | noop();
1370 | noop();
1371 | noop();
1372 | noop();
1373 | noop();
1374 | noop();
1375 | noop();
1376 | noop();
1377 | noop();
1378 | noop();
1379 | noop();
1380 | noop();
1381 | noop();
1382 | noop();
1383 | noop();
1384 | noop();
1385 | noop();
1386 | noop();
1387 | noop();
1388 | noop();
1389 | noop();
1390 | noop();
1391 | noop();
1392 | noop();
1393 | noop();
1394 | noop();
1395 | noop();
1396 | noop();
1397 | noop();
1398 | noop();
1399 | noop();
1400 | noop();
1401 | noop();
1402 | noop();
1403 | noop();
1404 | noop();
1405 | noop();
1406 | noop();
1407 | noop();
1408 | noop();
1409 | noop();
1410 | noop();
1411 | noop();
1412 | noop();
1413 | noop();
1414 | noop();
1415 | noop();
1416 | noop();
1417 | noop();
1418 | noop();
1419 | noop();
1420 | noop();
1421 | noop();
1422 | noop();
1423 | noop();
1424 | noop();
1425 | noop();
1426 | noop();
1427 | noop();
1428 | noop();
1429 | noop();
1430 | noop();
1431 | noop();
1432 | noop();
1433 | noop();
1434 | noop();
1435 | noop();
1436 | noop();
1437 | noop();
1438 | noop();
1439 | noop();
1440 | noop();
1441 | noop();
1442 | noop();
1443 | noop();
1444 | noop();
1445 | noop();
1446 | noop();
1447 | noop();
1448 | noop();
1449 | noop();
1450 | noop();
1451 | noop();
1452 | noop();
1453 | noop();
1454 | noop();
1455 | noop();
1456 | noop();
1457 | noop();
1458 | noop();
1459 | noop();
1460 | noop();
1461 | noop();
1462 | noop();
1463 | noop();
1464 | noop();
1465 | noop();
1466 | noop();
1467 | noop();
1468 | noop();
1469 | noop();
1470 | noop();
1471 | noop();
1472 | noop();
1473 | noop();
1474 | noop();
1475 | noop();
1476 | noop();
1477 | noop();
1478 | noop();
1479 | noop();
1480 | noop();
1481 | noop();
1482 | noop();
1483 | noop();
1484 | noop();
1485 | noop();
1486 | noop();
1487 | noop();
1488 | noop();
1489 | noop();
1490 | noop();
1491 | noop();
1492 | noop();
1493 | noop();
1494 | noop();
1495 | noop();
1496 | noop();
1497 | noop();
1498 | noop();
1499 | noop();
1500 | noop();
1501 | noop();
1502 | noop();
1503 | noop();
1504 | noop();
1505 | noop();
1506 | noop();
1507 | noop();
1508 | noop();
1509 | noop();
1510 | noop();
1511 | noop();
1512 | noop();
1513 | noop();
1514 | noop();
1515 | noop();
1516 | noop();
1517 | noop();
1518 | noop();
1519 | noop();
1520 | noop();
1521 | noop();
1522 | noop();
1523 | noop();
1524 | noop();
1525 | noop();
1526 | noop();
1527 | noop();
1528 | noop();
1529 | noop();
1530 | noop();
1531 | noop();
1532 | noop();
1533 | noop();
1534 | noop();
1535 | noop();
1536 | noop();
1537 | noop();
1538 | noop();
1539 | noop();
1540 | noop();
1541 | noop();
1542 | noop();
1543 | noop();
1544 | noop();
1545 | noop();
1546 | noop();
1547 | noop();
1548 | noop();
1549 | noop();
1550 | noop();
1551 | noop();
1552 | noop();
1553 | noop();
1554 | noop();
1555 | noop();
1556 | noop();
1557 | noop();
1558 | noop();
1559 | noop();
1560 | noop();
1561 | noop();
1562 | noop();
1563 | noop();
1564 | noop();
1565 | noop();
1566 | noop();
1567 | noop();
1568 | noop();
1569 | noop();
1570 | noop();
1571 | noop();
1572 | noop();
1573 | noop();
1574 | noop();
1575 | noop();
1576 | noop();
1577 | noop();
1578 | noop();
1579 | noop();
1580 | noop();
1581 | noop();
1582 | noop();
1583 | noop();
1584 | noop();
1585 | noop();
1586 | noop();
1587 | noop();
1588 | noop();
1589 | noop();
1590 | noop();
1591 | noop();
1592 | noop();
1593 | noop();
1594 | noop();
1595 | noop();
1596 | noop();
1597 | noop();
1598 | noop();
1599 | noop();
1600 | noop();
1601 | noop();
1602 | noop();
1603 | noop();
1604 | noop();
1605 | noop();
1606 | noop();
1607 | noop();
1608 | noop();
1609 | noop();
1610 | noop();
1611 | noop();
1612 | noop();
1613 | noop();
1614 | noop();
1615 | noop();
1616 | noop();
1617 | noop();
1618 | noop();
1619 | noop();
1620 | noop();
1621 | noop();
1622 | noop();
1623 | noop();
1624 | noop();
1625 | noop();
1626 | noop();
1627 | noop();
1628 | noop();
1629 | noop();
1630 | noop();
1631 | noop();
1632 | noop();
1633 | noop();
1634 | noop();
1635 | noop();
1636 | noop();
1637 | noop();
1638 | noop();
1639 | noop();
1640 | noop();
1641 | noop();
1642 | noop();
1643 | noop();
1644 | noop();
1645 | noop();
1646 | noop();
1647 | noop();
1648 | noop();
1649 | noop();
1650 | noop();
1651 | noop();
1652 | noop();
1653 | noop();
1654 | noop();
1655 | noop();
1656 | noop();
1657 | noop();
1658 | noop();
1659 | noop();
1660 | noop();
1661 | noop();
1662 | noop();
1663 | noop();
1664 | noop();
1665 | noop();
1666 | noop();
1667 | noop();
1668 | noop();
1669 | noop();
1670 | noop();
1671 | noop();
1672 | noop();
1673 | noop();
1674 | noop();
1675 | noop();
1676 | noop();
1677 | noop();
1678 | noop();
1679 | noop();
1680 | noop();
1681 | noop();
1682 | noop();
1683 | noop();
1684 | noop();
1685 | noop();
1686 | noop();
1687 | noop();
1688 | noop();
1689 | noop();
1690 | noop();
1691 | noop();
1692 | noop();
1693 | noop();
1694 | noop();
1695 | noop();
1696 | noop();
1697 | noop();
1698 | noop();
1699 | noop();
1700 | noop();
1701 | noop();
1702 | noop();
1703 | noop();
1704 | noop();
1705 | noop();
1706 | noop();
1707 | noop();
1708 | noop();
1709 | noop();
1710 | noop();
1711 | noop();
1712 | noop();
1713 | noop();
1714 | noop();
1715 | noop();
1716 | noop();
1717 | noop();
1718 | noop();
1719 | noop();
1720 | noop();
1721 | noop();
1722 | noop();
1723 | noop();
1724 | noop();
1725 | noop();
1726 | noop();
1727 | noop();
1728 | noop();
1729 | noop();
1730 | noop();
1731 | noop();
1732 | noop();
1733 | noop();
1734 | noop();
1735 | noop();
1736 | noop();
1737 | noop();
1738 | noop();
1739 | noop();
1740 | noop();
1741 | noop();
1742 | noop();
1743 | noop();
1744 | noop();
1745 | noop();
1746 | noop();
1747 | noop();
1748 | noop();
1749 | noop();
1750 | noop();
1751 | noop();
1752 | noop();
1753 | noop();
1754 | noop();
1755 | noop();
1756 | noop();
1757 | noop();
1758 | noop();
1759 | noop();
1760 | noop();
1761 | noop();
1762 | noop();
1763 | noop();
1764 | noop();
1765 | noop();
1766 | noop();
1767 | noop();
1768 | noop();
1769 | noop();
1770 | noop();
1771 | noop();
1772 | noop();
1773 | noop();
1774 | noop();
1775 | noop();
1776 | noop();
1777 | noop();
1778 | noop();
1779 | noop();
1780 | noop();
1781 | noop();
1782 | noop();
1783 | noop();
1784 | noop();
1785 | noop();
1786 | noop();
1787 | noop();
1788 | noop();
1789 | noop();
1790 | noop();
1791 | noop();
1792 | noop();
1793 | noop();
1794 | noop();
1795 | noop();
1796 | noop();
1797 | noop();
1798 | noop();
1799 | noop();
1800 | noop();
1801 | noop();
1802 | noop();
1803 | noop();
1804 | noop();
1805 | noop();
1806 | noop();
1807 | noop();
1808 | noop();
1809 | noop();
1810 | noop();
1811 | noop();
1812 | noop();
1813 | noop();
1814 | noop();
1815 | noop();
1816 | noop();
1817 | noop();
1818 | noop();
1819 | noop();
1820 | noop();
1821 | noop();
1822 | noop();
1823 | noop();
1824 | noop();
1825 | noop();
1826 | noop();
1827 | noop();
1828 | noop();
1829 | noop();
1830 | noop();
1831 | noop();
1832 | noop();
1833 | noop();
1834 | noop();
1835 | noop();
1836 | noop();
1837 | noop();
1838 | noop();
1839 | noop();
1840 | noop();
1841 | noop();
1842 | noop();
1843 | noop();
1844 | noop();
1845 | noop();
1846 | noop();
1847 | noop();
1848 | noop();
1849 | noop();
1850 | noop();
1851 | noop();
1852 | noop();
1853 | noop();
1854 | noop();
1855 | noop();
1856 | noop();
1857 | noop();
1858 | noop();
1859 | noop();
1860 | noop();
1861 | noop();
1862 | noop();
1863 | noop();
1864 | noop();
1865 | noop();
1866 | noop();
1867 | noop();
1868 | noop();
1869 | noop();
1870 | noop();
1871 | noop();
1872 | noop();
1873 | noop();
1874 | noop();
1875 | noop();
1876 | noop();
1877 | noop();
1878 | noop();
1879 | noop();
1880 | noop();
1881 | noop();
1882 | noop();
1883 | noop();
1884 | noop();
1885 | noop();
1886 | noop();
1887 | noop();
1888 | noop();
1889 | noop();
1890 | noop();
1891 | noop();
1892 | noop();
1893 | noop();
1894 | noop();
1895 | noop();
1896 | noop();
1897 | noop();
1898 | noop();
1899 | noop();
1900 | noop();
1901 | noop();
1902 | noop();
1903 | noop();
1904 | noop();
1905 | noop();
1906 | noop();
1907 | noop();
1908 | noop();
1909 | noop();
1910 | noop();
1911 | noop();
1912 | noop();
1913 | noop();
1914 | noop();
1915 | noop();
1916 | noop();
1917 | noop();
1918 | noop();
1919 | noop();
1920 | noop();
1921 | noop();
1922 | noop();
1923 | noop();
1924 | noop();
1925 | noop();
1926 | noop();
1927 | noop();
1928 | noop();
1929 | noop();
1930 | noop();
1931 | noop();
1932 | noop();
1933 | noop();
1934 | noop();
1935 | noop();
1936 | noop();
1937 | noop();
1938 | noop();
1939 | noop();
1940 | noop();
1941 | noop();
1942 | noop();
1943 | noop();
1944 | noop();
1945 | noop();
1946 | noop();
1947 | noop();
1948 | noop();
1949 | noop();
1950 | noop();
1951 | noop();
1952 | noop();
1953 | noop();
1954 | noop();
1955 | noop();
1956 | noop();
1957 | noop();
1958 | noop();
1959 | noop();
1960 | noop();
1961 | noop();
1962 | noop();
1963 | noop();
1964 | noop();
1965 | noop();
1966 | noop();
1967 | noop();
1968 | noop();
1969 | noop();
1970 | noop();
1971 | noop();
1972 | noop();
1973 | noop();
1974 | noop();
1975 | noop();
1976 | noop();
1977 | noop();
1978 | noop();
1979 | noop();
1980 | noop();
1981 | noop();
1982 | noop();
1983 | noop();
1984 | noop();
1985 | noop();
1986 | noop();
1987 | noop();
1988 | noop();
1989 | noop();
1990 | noop();
1991 | noop();
1992 | noop();
1993 | noop();
1994 | noop();
1995 | noop();
1996 | noop();
1997 | noop();
1998 | noop();
1999 | noop();
2000 | noop();
2001 | noop();
2002 | noop();
2003 | noop();
2004 | noop();
2005 | noop();
2006 | noop();
2007 | noop();
2008 | noop();
2009 | noop();
2010 | noop();
2011 | noop();
2012 | noop();
2013 | noop();
2014 | noop();
2015 | noop();
2016 | noop();
2017 | noop();
2018 | noop();
2019 | noop();
2020 | noop();
2021 | noop();
2022 | noop();
2023 | noop();
2024 | noop();
2025 | noop();
2026 | noop();
2027 | noop();
2028 | noop();
2029 | noop();
2030 | noop();
2031 | noop();
2032 | noop();
2033 | noop();
2034 | noop();
2035 | noop();
2036 | noop();
2037 | noop();
2038 | noop();
2039 | noop();
2040 | noop();
2041 | noop();
2042 | noop();
2043 | noop();
2044 | noop();
2045 | noop();
2046 | noop();
2047 | noop();
2048 | noop();
2049 | noop();
2050 | noop();
2051 | noop();
2052 | noop();
2053 | noop();
2054 | noop();
2055 | noop();
2056 | noop();
2057 | noop();
2058 | noop();
2059 | noop();
2060 | noop();
2061 | noop();
2062 | noop();
2063 | noop();
2064 | noop();
2065 | noop();
2066 | noop();
2067 | noop();
2068 | noop();
2069 | noop();
2070 | noop();
2071 | noop();
2072 | noop();
2073 | noop();
2074 | noop();
2075 | noop();
2076 | noop();
2077 | noop();
2078 | noop();
2079 | noop();
2080 | noop();
2081 | noop();
2082 | noop();
2083 | noop();
2084 | noop();
2085 | noop();
2086 | noop();
2087 | noop();
2088 | noop();
2089 | noop();
2090 | noop();
2091 | noop();
2092 | noop();
2093 | noop();
2094 | noop();
2095 | noop();
2096 | noop();
2097 | noop();
2098 | noop();
2099 | noop();
2100 | noop();
2101 | noop();
2102 | noop();
2103 | noop();
2104 | noop();
2105 | noop();
2106 | noop();
2107 | noop();
2108 | noop();
2109 | noop();
2110 | noop();
2111 | noop();
2112 | noop();
2113 | noop();
2114 | noop();
2115 | noop();
2116 | noop();
2117 | noop();
2118 | noop();
2119 | noop();
2120 | noop();
2121 | noop();
2122 | noop();
2123 | noop();
2124 | noop();
2125 | noop();
2126 | noop();
2127 | noop();
2128 | noop();
2129 | noop();
2130 | noop();
2131 | noop();
2132 | noop();
2133 | noop();
2134 | noop();
2135 | noop();
2136 | noop();
2137 | noop();
2138 | noop();
2139 | noop();
2140 | noop();
2141 | noop();
2142 | noop();
2143 | noop();
2144 | noop();
2145 | noop();
2146 | noop();
2147 | noop();
2148 | noop();
2149 | noop();
2150 | noop();
2151 | noop();
2152 | noop();
2153 | noop();
2154 | noop();
2155 | noop();
2156 | noop();
2157 | noop();
2158 | noop();
2159 | noop();
2160 | noop();
2161 | noop();
2162 | noop();
2163 | noop();
2164 | noop();
2165 | noop();
2166 | noop();
2167 | noop();
2168 | noop();
2169 | noop();
2170 | noop();
2171 | noop();
2172 | noop();
2173 | noop();
2174 | noop();
2175 | noop();
2176 | noop();
2177 | noop();
2178 | noop();
2179 | noop();
2180 | noop();
2181 | noop();
2182 | noop();
2183 | noop();
2184 | noop();
2185 | noop();
2186 | noop();
2187 | noop();
2188 | noop();
2189 | noop();
2190 | noop();
2191 | noop();
2192 | noop();
2193 | noop();
2194 | noop();
2195 | noop();
2196 | noop();
2197 | noop();
2198 | noop();
2199 | noop();
2200 | noop();
2201 | noop();
2202 | noop();
2203 | noop();
2204 | noop();
2205 | noop();
2206 | noop();
2207 | noop();
2208 | noop();
2209 | noop();
2210 | noop();
2211 | noop();
2212 | noop();
2213 | noop();
2214 | noop();
2215 | noop();
2216 | noop();
2217 | noop();
2218 | noop();
2219 | noop();
2220 | noop();
2221 | noop();
2222 | noop();
2223 | noop();
2224 | noop();
2225 | noop();
2226 | noop();
2227 | noop();
2228 | noop();
2229 | noop();
2230 | noop();
2231 | noop();
2232 | noop();
2233 | noop();
2234 | noop();
2235 | noop();
2236 | noop();
2237 | noop();
2238 | noop();
2239 | noop();
2240 | noop();
2241 | noop();
2242 | noop();
2243 | noop();
2244 | noop();
2245 | noop();
2246 | noop();
2247 | noop();
2248 | noop();
2249 | noop();
2250 | noop();
2251 | noop();
2252 | noop();
2253 | noop();
2254 | noop();
2255 | noop();
2256 | noop();
2257 | noop();
2258 | noop();
2259 | noop();
2260 | noop();
2261 | noop();
2262 | noop();
2263 | noop();
2264 | noop();
2265 | noop();
2266 | noop();
2267 | noop();
2268 | noop();
2269 | noop();
2270 | noop();
2271 | noop();
2272 | noop();
2273 | noop();
2274 | noop();
2275 | noop();
2276 | noop();
2277 | noop();
2278 | noop();
2279 | noop();
2280 | noop();
2281 | noop();
2282 | noop();
2283 | noop();
2284 | noop();
2285 | noop();
2286 | noop();
2287 | noop();
2288 | noop();
2289 | noop();
2290 | noop();
2291 | noop();
2292 | noop();
2293 | noop();
2294 | noop();
2295 | noop();
2296 | noop();
2297 | noop();
2298 | noop();
2299 | noop();
2300 | noop();
2301 | noop();
2302 | noop();
2303 | noop();
2304 | noop();
2305 | noop();
2306 | noop();
2307 | noop();
2308 | noop();
2309 | noop();
2310 | noop();
2311 | noop();
2312 | noop();
2313 | noop();
2314 | noop();
2315 | noop();
2316 | noop();
2317 | noop();
2318 | noop();
2319 | noop();
2320 | noop();
2321 | noop();
2322 | noop();
2323 | noop();
2324 | noop();
2325 | noop();
2326 | noop();
2327 | noop();
2328 | noop();
2329 | noop();
2330 | noop();
2331 | noop();
2332 | noop();
2333 | noop();
2334 | noop();
2335 | noop();
2336 | noop();
2337 | noop();
2338 | noop();
2339 | noop();
2340 | noop();
2341 | noop();
2342 | noop();
2343 | noop();
2344 | noop();
2345 | noop();
2346 | noop();
2347 | noop();
2348 | noop();
2349 | noop();
2350 | noop();
2351 | noop();
2352 | noop();
2353 | noop();
2354 | noop();
2355 | noop();
2356 | noop();
2357 | noop();
2358 | noop();
2359 | noop();
2360 | noop();
2361 | noop();
2362 | noop();
2363 | noop();
2364 | noop();
2365 | noop();
2366 | noop();
2367 | noop();
2368 | noop();
2369 | noop();
2370 | noop();
2371 | noop();
2372 | noop();
2373 | noop();
2374 | noop();
2375 | noop();
2376 | noop();
2377 | noop();
2378 | noop();
2379 | noop();
2380 | noop();
2381 | noop();
2382 | noop();
2383 | noop();
2384 | noop();
2385 | noop();
2386 | noop();
2387 | noop();
2388 | noop();
2389 | noop();
2390 | noop();
2391 | noop();
2392 | noop();
2393 | noop();
2394 | noop();
2395 | noop();
2396 | noop();
2397 | noop();
2398 | noop();
2399 | noop();
2400 | noop();
2401 | noop();
2402 | noop();
2403 | noop();
2404 | noop();
2405 | noop();
2406 | noop();
2407 | noop();
2408 | noop();
2409 | noop();
2410 | noop();
2411 | noop();
2412 | noop();
2413 | noop();
2414 | noop();
2415 | noop();
2416 | noop();
2417 | noop();
2418 | noop();
2419 | noop();
2420 | noop();
2421 | noop();
2422 | noop();
2423 | noop();
2424 | noop();
2425 | noop();
2426 | noop();
2427 | noop();
2428 | noop();
2429 | noop();
2430 | noop();
2431 | noop();
2432 | noop();
2433 | noop();
2434 | noop();
2435 | noop();
2436 | noop();
2437 | noop();
2438 | noop();
2439 | noop();
2440 | noop();
2441 | noop();
2442 | noop();
2443 | noop();
2444 | noop();
2445 | noop();
2446 | noop();
2447 | noop();
2448 | noop();
2449 | noop();
2450 | noop();
2451 | noop();
2452 | noop();
2453 | noop();
2454 | noop();
2455 | noop();
2456 | noop();
2457 | noop();
2458 | noop();
2459 | noop();
2460 | noop();
2461 | noop();
2462 | noop();
2463 | noop();
2464 | noop();
2465 | noop();
2466 | noop();
2467 | noop();
2468 | noop();
2469 | noop();
2470 | noop();
2471 | noop();
2472 | noop();
2473 | noop();
2474 | noop();
2475 | noop();
2476 | noop();
2477 | noop();
2478 | noop();
2479 | noop();
2480 | noop();
2481 | noop();
2482 | noop();
2483 | noop();
2484 | noop();
2485 | noop();
2486 | noop();
2487 | noop();
2488 | noop();
2489 | noop();
2490 | noop();
2491 | noop();
2492 | noop();
2493 | noop();
2494 | noop();
2495 | noop();
2496 | noop();
2497 | noop();
2498 | noop();
2499 | noop();
2500 | noop();
2501 | noop();
2502 | noop();
2503 | noop();
2504 | noop();
2505 | noop();
2506 | noop();
2507 | noop();
2508 | noop();
2509 | noop();
2510 | noop();
2511 | noop();
2512 | noop();
2513 | noop();
2514 | noop();
2515 | noop();
2516 | noop();
2517 | noop();
2518 | noop();
2519 | noop();
2520 | noop();
2521 | noop();
2522 | noop();
2523 | noop();
2524 | noop();
2525 | noop();
2526 | noop();
2527 | noop();
2528 | noop();
2529 | noop();
2530 | noop();
2531 | noop();
2532 | noop();
2533 | noop();
2534 | noop();
2535 | noop();
2536 | noop();
2537 | noop();
2538 | noop();
2539 | noop();
2540 | noop();
2541 | noop();
2542 | noop();
2543 | noop();
2544 | noop();
2545 | noop();
2546 | noop();
2547 | noop();
2548 | noop();
2549 | noop();
2550 | noop();
2551 | noop();
2552 | noop();
2553 | noop();
2554 | noop();
2555 | noop();
2556 | noop();
2557 | noop();
2558 | noop();
2559 | noop();
2560 | noop();
2561 | noop();
2562 | noop();
2563 | noop();
2564 | noop();
2565 | noop();
2566 | noop();
2567 | noop();
2568 | noop();
2569 | noop();
2570 | noop();
2571 | noop();
2572 | noop();
2573 | noop();
2574 | noop();
2575 | noop();
2576 | noop();
2577 | noop();
2578 | noop();
2579 | noop();
2580 | noop();
2581 | noop();
2582 | noop();
2583 | noop();
2584 | noop();
2585 | noop();
2586 | noop();
2587 | noop();
2588 | noop();
2589 | noop();
2590 | noop();
2591 | noop();
2592 | noop();
2593 | noop();
2594 | noop();
2595 | noop();
2596 | noop();
2597 | noop();
2598 | noop();
2599 | noop();
2600 | noop();
2601 | noop();
2602 | noop();
2603 | noop();
2604 | noop();
2605 | noop();
2606 | noop();
2607 | noop();
2608 | noop();
2609 | noop();
2610 | noop();
2611 | noop();
2612 | noop();
2613 | noop();
2614 | noop();
2615 | noop();
2616 | noop();
2617 | noop();
2618 | noop();
2619 | noop();
2620 | noop();
2621 | noop();
2622 | noop();
2623 | noop();
2624 | noop();
2625 | noop();
2626 | noop();
2627 | noop();
2628 | noop();
2629 | noop();
2630 | noop();
2631 | noop();
2632 | noop();
2633 | noop();
2634 | noop();
2635 | noop();
2636 | noop();
2637 | noop();
2638 | noop();
2639 | noop();
2640 | noop();
2641 | noop();
2642 | noop();
2643 | noop();
2644 | noop();
2645 | noop();
2646 | noop();
2647 | noop();
2648 | noop();
2649 | noop();
2650 | noop();
2651 | noop();
2652 | noop();
2653 | noop();
2654 | noop();
2655 | noop();
2656 | noop();
2657 | noop();
2658 | noop();
2659 | noop();
2660 | noop();
2661 | noop();
2662 | noop();
2663 | noop();
2664 | noop();
2665 | noop();
2666 | noop();
2667 | noop();
2668 | noop();
2669 | noop();
2670 | noop();
2671 | noop();
2672 | noop();
2673 | noop();
2674 | noop();
2675 | noop();
2676 | noop();
2677 | noop();
2678 | noop();
2679 | noop();
2680 | noop();
2681 | noop();
2682 | noop();
2683 | noop();
2684 | noop();
2685 | noop();
2686 | noop();
2687 | noop();
2688 | noop();
2689 | noop();
2690 | noop();
2691 | noop();
2692 | noop();
2693 | noop();
2694 | noop();
2695 | noop();
2696 | noop();
2697 | noop();
2698 | noop();
2699 | noop();
2700 | noop();
2701 | noop();
2702 | noop();
2703 | noop();
2704 | noop();
2705 | noop();
2706 | noop();
2707 | noop();
2708 | noop();
2709 | noop();
2710 | noop();
2711 | noop();
2712 | noop();
2713 | noop();
2714 | noop();
2715 | noop();
2716 | noop();
2717 | noop();
2718 | noop();
2719 | noop();
2720 | noop();
2721 | noop();
2722 | noop();
2723 | noop();
2724 | noop();
2725 | noop();
2726 | noop();
2727 | noop();
2728 | noop();
2729 | noop();
2730 | noop();
2731 | noop();
2732 | noop();
2733 | noop();
2734 | noop();
2735 | noop();
2736 | noop();
2737 | noop();
2738 | noop();
2739 | noop();
2740 | noop();
2741 | noop();
2742 | noop();
2743 | noop();
2744 | noop();
2745 | noop();
2746 | noop();
2747 | noop();
2748 | noop();
2749 | noop();
2750 | noop();
2751 | noop();
2752 | noop();
2753 | noop();
2754 | noop();
2755 | noop();
2756 | noop();
2757 | noop();
2758 | noop();
2759 | noop();
2760 | noop();
2761 | noop();
2762 | noop();
2763 | noop();
2764 | noop();
2765 | noop();
2766 | noop();
2767 | noop();
2768 | noop();
2769 | noop();
2770 | noop();
2771 | noop();
2772 | noop();
2773 | noop();
2774 | noop();
2775 | noop();
2776 | noop();
2777 | noop();
2778 | noop();
2779 | noop();
2780 | noop();
2781 | noop();
2782 | noop();
2783 | noop();
2784 | noop();
2785 | noop();
2786 | noop();
2787 | noop();
2788 | noop();
2789 | noop();
2790 | noop();
2791 | noop();
2792 | noop();
2793 | noop();
2794 | noop();
2795 | noop();
2796 | noop();
2797 | noop();
2798 | noop();
2799 | noop();
2800 | noop();
2801 | noop();
2802 | noop();
2803 | noop();
2804 | noop();
2805 | noop();
2806 | noop();
2807 | noop();
2808 | noop();
2809 | noop();
2810 | noop();
2811 | noop();
2812 | noop();
2813 | noop();
2814 | noop();
2815 | noop();
2816 | noop();
2817 | noop();
2818 | noop();
2819 | noop();
2820 | noop();
2821 | noop();
2822 | noop();
2823 | noop();
2824 | noop();
2825 | noop();
2826 | noop();
2827 | noop();
2828 | noop();
2829 | noop();
2830 | noop();
2831 | noop();
2832 | noop();
2833 | noop();
2834 | noop();
2835 | noop();
2836 | noop();
2837 | noop();
2838 | noop();
2839 | noop();
2840 | noop();
2841 | noop();
2842 | noop();
2843 | noop();
2844 | noop();
2845 | noop();
2846 | noop();
2847 | noop();
2848 | noop();
2849 | noop();
2850 | noop();
2851 | noop();
2852 | noop();
2853 | noop();
2854 | noop();
2855 | noop();
2856 | noop();
2857 | noop();
2858 | noop();
2859 | noop();
2860 | noop();
2861 | noop();
2862 | noop();
2863 | noop();
2864 | noop();
2865 | noop();
2866 | noop();
2867 | noop();
2868 | noop();
2869 | noop();
2870 | noop();
2871 | noop();
2872 | noop();
2873 | noop();
2874 | noop();
2875 | noop();
2876 | noop();
2877 | noop();
2878 | noop();
2879 | noop();
2880 | noop();
2881 | noop();
2882 | noop();
2883 | noop();
2884 | noop();
2885 | noop();
2886 | noop();
2887 | noop();
2888 | noop();
2889 | noop();
2890 | noop();
2891 | noop();
2892 | noop();
2893 | noop();
2894 | noop();
2895 | noop();
2896 | noop();
2897 | noop();
2898 | noop();
2899 | noop();
2900 | noop();
2901 | noop();
2902 | noop();
2903 | noop();
2904 | noop();
2905 | noop();
2906 | noop();
2907 | noop();
2908 | noop();
2909 | noop();
2910 | noop();
2911 | noop();
2912 | noop();
2913 | noop();
2914 | noop();
2915 | noop();
2916 | noop();
2917 | noop();
2918 | noop();
2919 | noop();
2920 | noop();
2921 | noop();
2922 | noop();
2923 | noop();
2924 | noop();
2925 | noop();
2926 | noop();
2927 | noop();
2928 | noop();
2929 | noop();
2930 | noop();
2931 | noop();
2932 | noop();
2933 | noop();
2934 | noop();
2935 | noop();
2936 | noop();
2937 | noop();
2938 | noop();
2939 | noop();
2940 | noop();
2941 | noop();
2942 | noop();
2943 | noop();
2944 | noop();
2945 | noop();
2946 | noop();
2947 | noop();
2948 | noop();
2949 | noop();
2950 | noop();
2951 | noop();
2952 | noop();
2953 | noop();
2954 | noop();
2955 | noop();
2956 | noop();
2957 | noop();
2958 | noop();
2959 | noop();
2960 | noop();
2961 | noop();
2962 | noop();
2963 | noop();
2964 | noop();
2965 | noop();
2966 | noop();
2967 | noop();
2968 | noop();
2969 | noop();
2970 | noop();
2971 | noop();
2972 | noop();
2973 | noop();
2974 | noop();
2975 | noop();
2976 | noop();
2977 | noop();
2978 | noop();
2979 | noop();
2980 | noop();
2981 | noop();
2982 | noop();
2983 | noop();
2984 | noop();
2985 | noop();
2986 | noop();
2987 | noop();
2988 | noop();
2989 | noop();
2990 | noop();
2991 | noop();
2992 | noop();
2993 | noop();
2994 | noop();
2995 | noop();
2996 | noop();
2997 | noop();
2998 | noop();
2999 | noop();
3000 | noop();
3001 | noop();
3002 | noop();
3003 | noop();
3004 | noop();
3005 | noop();
3006 | noop();
3007 | noop();
3008 | noop();
3009 | noop();
3010 | noop();
3011 | noop();
3012 | noop();
3013 | }
3014 |
--------------------------------------------------------------------------------
/examples/script.js:
--------------------------------------------------------------------------------
1 | import { newUser } from "./user";
2 |
3 | export default () => {
4 | const user = newUser("John");
5 | console.log(user);
6 | };
7 |
--------------------------------------------------------------------------------
/examples/script.ts:
--------------------------------------------------------------------------------
1 | import { User, newUser } from "./user";
2 |
3 | export default () => {
4 | const user: User = newUser("John");
5 | console.log(user);
6 | };
7 |
--------------------------------------------------------------------------------
/examples/simple.ts:
--------------------------------------------------------------------------------
1 | interface User {
2 | name: string;
3 | id: number;
4 | }
5 |
6 | class UserAccount implements User {
7 | name: string;
8 | id: number;
9 |
10 | constructor(name: string) {
11 | this.name = name;
12 | this.id = Math.floor(Math.random() * Number.MAX_SAFE_INTEGER);
13 | }
14 | }
15 |
16 | function newUser(name: string): User {
17 | return new UserAccount(name);
18 | }
19 |
20 | export default () => {
21 | const user: User = newUser("John");
22 | console.log(user);
23 | };
24 |
--------------------------------------------------------------------------------
/examples/user.ts:
--------------------------------------------------------------------------------
1 | interface User {
2 | name: string;
3 | id: number;
4 | }
5 |
6 | class UserAccount implements User {
7 | name: string;
8 | id: number;
9 |
10 | constructor(name: string) {
11 | this.name = name;
12 | this.id = Math.floor(Math.random() * Number.MAX_SAFE_INTEGER);
13 | }
14 | }
15 |
16 | function newUser(name: string): User {
17 | return new UserAccount(name);
18 | }
19 |
20 | export { User, newUser };
21 |
--------------------------------------------------------------------------------
/go.mod:
--------------------------------------------------------------------------------
1 | module github.com/grafana/xk6-ts
2 |
3 | go 1.20
4 |
5 | require (
6 | github.com/grafana/k6pack v0.1.5
7 | github.com/sirupsen/logrus v1.9.3
8 | go.k6.io/k6 v0.51.1-0.20240610082146-1f01a9bc2365
9 | )
10 |
11 | require (
12 | github.com/cenkalti/backoff/v4 v4.2.1 // indirect
13 | github.com/dlclark/regexp2 v1.9.0 // indirect
14 | github.com/dop251/goja v0.0.0-20240516125602-ccbae20bcec2 // indirect
15 | github.com/evanw/esbuild v0.21.2 // indirect
16 | github.com/fatih/color v1.16.0 // indirect
17 | github.com/go-logr/logr v1.4.1 // indirect
18 | github.com/go-logr/stdr v1.2.2 // indirect
19 | github.com/go-sourcemap/sourcemap v2.1.4+incompatible // indirect
20 | github.com/google/pprof v0.0.0-20230728192033-2ba5b33183c6 // indirect
21 | github.com/grafana/sobek v0.0.0-20240607083612-4f0cd64f4e78 // indirect
22 | github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect
23 | github.com/josharian/intern v1.0.0 // indirect
24 | github.com/mailru/easyjson v0.7.7 // indirect
25 | github.com/mattn/go-colorable v0.1.13 // indirect
26 | github.com/mattn/go-isatty v0.0.20 // indirect
27 | github.com/mstoykov/atlas v0.0.0-20220811071828-388f114305dd // indirect
28 | github.com/onsi/ginkgo v1.16.5 // indirect
29 | github.com/onsi/gomega v1.32.0 // indirect
30 | github.com/serenize/snaker v0.0.0-20201027110005-a7ad2135616e // indirect
31 | github.com/spf13/afero v1.1.2 // indirect
32 | go.opentelemetry.io/otel v1.24.0 // indirect
33 | go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 // indirect
34 | go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0 // indirect
35 | go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0 // indirect
36 | go.opentelemetry.io/otel/metric v1.24.0 // indirect
37 | go.opentelemetry.io/otel/sdk v1.24.0 // indirect
38 | go.opentelemetry.io/otel/trace v1.24.0 // indirect
39 | go.opentelemetry.io/proto/otlp v1.1.0 // indirect
40 | golang.org/x/net v0.33.0 // indirect
41 | golang.org/x/sys v0.28.0 // indirect
42 | golang.org/x/text v0.21.0 // indirect
43 | golang.org/x/time v0.5.0 // indirect
44 | google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect
45 | google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect
46 | google.golang.org/grpc v1.63.2 // indirect
47 | google.golang.org/protobuf v1.33.0 // indirect
48 | gopkg.in/guregu/null.v3 v3.3.0 // indirect
49 | )
50 |
--------------------------------------------------------------------------------
/go.sum:
--------------------------------------------------------------------------------
1 | github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M=
2 | github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
3 | github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
4 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
5 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
6 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
7 | github.com/dlclark/regexp2 v1.9.0 h1:pTK/l/3qYIKaRXuHnEnIf7Y5NxfRPfpb7dis6/gdlVI=
8 | github.com/dlclark/regexp2 v1.9.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
9 | github.com/dop251/goja v0.0.0-20240516125602-ccbae20bcec2 h1:OFTHt+yJDo/uaIKMGjEKzc3DGhrpQZoqvMUIloZv6ZY=
10 | github.com/dop251/goja v0.0.0-20240516125602-ccbae20bcec2/go.mod h1:o31y53rb/qiIAONF7w3FHJZRqqP3fzHUr1HqanthByw=
11 | github.com/evanw/esbuild v0.21.2 h1:CLplcGi794CfHLVmUbvVfTMKkykm+nyIHU8SU60KUTA=
12 | github.com/evanw/esbuild v0.21.2/go.mod h1:D2vIQZqV/vIf/VRHtViaUtViZmG7o+kKmlBfVQuRi48=
13 | github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
14 | github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
15 | github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
16 | github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
17 | github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI=
18 | github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
19 | github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
20 | github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
21 | github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
22 | github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
23 | github.com/go-sourcemap/sourcemap v2.1.4+incompatible h1:a+iTbH5auLKxaNwQFg0B+TCYl6lbukKPc7b5x0n1s6Q=
24 | github.com/go-sourcemap/sourcemap v2.1.4+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg=
25 | github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
26 | github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
27 | github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
28 | github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
29 | github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
30 | github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
31 | github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
32 | github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
33 | github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
34 | github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
35 | github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
36 | github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
37 | github.com/google/pprof v0.0.0-20230728192033-2ba5b33183c6 h1:ZgoomqkdjGbQ3+qQXCkvYMCDvGDNg2k5JJDjjdTB6jY=
38 | github.com/google/pprof v0.0.0-20230728192033-2ba5b33183c6/go.mod h1:Jh3hGz2jkYak8qXPD19ryItVnUgpgeqzdkY/D0EaeuA=
39 | github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
40 | github.com/grafana/k6pack v0.1.5 h1:XrOM7GQX30ISzashmegcowxKVhpFULm9fQIZe0+vJXA=
41 | github.com/grafana/k6pack v0.1.5/go.mod h1:cltO5vmQOObJDtKbRkNVGymk3J+MRhriJyQg1JJzeEc=
42 | github.com/grafana/sobek v0.0.0-20240607083612-4f0cd64f4e78 h1:rVCZdB+13G+aQoGm3CBVaDGl0uxZxfjvQgEJy4IeHTA=
43 | github.com/grafana/sobek v0.0.0-20240607083612-4f0cd64f4e78/go.mod h1:6ZH0b0iOxyigeTh+/IlGoL0Hd3lVXA94xoXf0ldNgCM=
44 | github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 h1:Wqo399gCIufwto+VfwCSvsnfGpF/w5E9CNxSwbpD6No=
45 | github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0/go.mod h1:qmOFXW2epJhM0qSnUUYpldc7gVz2KMQwJ/QYCDIa7XU=
46 | github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
47 | github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
48 | github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
49 | github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg=
50 | github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
51 | github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
52 | github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
53 | github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
54 | github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
55 | github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
56 | github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
57 | github.com/mccutchen/go-httpbin v1.1.2-0.20190116014521-c5cb2f4802fa h1:lx8ZnNPwjkXSzOROz0cg69RlErRXs+L3eDkggASWKLo=
58 | github.com/mstoykov/atlas v0.0.0-20220811071828-388f114305dd h1:AC3N94irbx2kWGA8f/2Ks7EQl2LxKIRQYuT9IJDwgiI=
59 | github.com/mstoykov/atlas v0.0.0-20220811071828-388f114305dd/go.mod h1:9vRHVuLCjoFfE3GT06X0spdOAO+Zzo4AMjdIwUHBvAk=
60 | github.com/mstoykov/envconfig v1.5.0 h1:E2FgWf73BQt0ddgn7aoITkQHmgwAcHup1s//MsS5/f8=
61 | github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
62 | github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
63 | github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
64 | github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
65 | github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
66 | github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
67 | github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
68 | github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
69 | github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
70 | github.com/onsi/gomega v1.32.0 h1:JRYU78fJ1LPxlckP6Txi/EYqJvjtMrDC04/MM5XRHPk=
71 | github.com/onsi/gomega v1.32.0/go.mod h1:a4x4gW6Pz2yK1MAmvluYme5lvYTn61afQ2ETw/8n4Lg=
72 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
73 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
74 | github.com/serenize/snaker v0.0.0-20201027110005-a7ad2135616e h1:zWKUYT07mGmVBH+9UgnHXd/ekCK99C8EbDSAt5qsjXE=
75 | github.com/serenize/snaker v0.0.0-20201027110005-a7ad2135616e/go.mod h1:Yow6lPLSAXx2ifx470yD/nUe22Dv5vBvxK/UK9UUTVs=
76 | github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
77 | github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
78 | github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI=
79 | github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
80 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
81 | github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
82 | github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
83 | github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
84 | github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
85 | go.k6.io/k6 v0.51.1-0.20240610082146-1f01a9bc2365 h1:ZXlJs5hXt1hbY4k3jHVJS8xrgypgTZAwbMBVH1EMCgY=
86 | go.k6.io/k6 v0.51.1-0.20240610082146-1f01a9bc2365/go.mod h1:LJKmFwUODAYoxitsJ3Xk+wsyVJDpyQiLyJAVn+oGyVQ=
87 | go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
88 | go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
89 | go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 h1:t6wl9SPayj+c7lEIFgm4ooDBZVb01IhLB4InpomhRw8=
90 | go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0/go.mod h1:iSDOcsnSA5INXzZtwaBPrKp/lWu/V14Dd+llD0oI2EA=
91 | go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0 h1:Mw5xcxMwlqoJd97vwPxA8isEaIoxsta9/Q51+TTJLGE=
92 | go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0/go.mod h1:CQNu9bj7o7mC6U7+CA/schKEYakYXWr79ucDHTMGhCM=
93 | go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0 h1:Xw8U6u2f8DK2XAkGRFV7BBLENgnTGX9i4rQRxJf+/vs=
94 | go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0/go.mod h1:6KW1Fm6R/s6Z3PGXwSJN2K4eT6wQB3vXX6CVnYX9NmM=
95 | go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
96 | go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
97 | go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
98 | go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
99 | go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
100 | go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
101 | go.opentelemetry.io/proto/otlp v1.1.0 h1:2Di21piLrCqJ3U3eXGCTPHE9R8Nh+0uglSnOyxikMeI=
102 | go.opentelemetry.io/proto/otlp v1.1.0/go.mod h1:GpBHCBWiqvVLDqmHZsoMM3C5ySeKTC7ej/RNTae6MdY=
103 | go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
104 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
105 | golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
106 | golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
107 | golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
108 | golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
109 | golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
110 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
111 | golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
112 | golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
113 | golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
114 | golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
115 | golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
116 | golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
117 | golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
118 | golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
119 | golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
120 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
121 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
122 | golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
123 | golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
124 | golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
125 | golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
126 | golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
127 | golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
128 | golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
129 | golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
130 | golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
131 | golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
132 | golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
133 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
134 | golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
135 | golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
136 | golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
137 | golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
138 | golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
139 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
140 | golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
141 | golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
142 | golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
143 | golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
144 | golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
145 | golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
146 | google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY=
147 | google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0=
148 | google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8=
149 | google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de h1:cZGRis4/ot9uVm639a+rHCUaG0JJHEsdyzSQTMX+suY=
150 | google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY=
151 | google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM=
152 | google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA=
153 | google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
154 | google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
155 | google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
156 | google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
157 | google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
158 | google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
159 | google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
160 | google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
161 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
162 | gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
163 | gopkg.in/guregu/null.v3 v3.3.0 h1:8j3ggqq+NgKt/O7mbFVUFKUMWN+l1AmT5jQmJ6nPh2c=
164 | gopkg.in/guregu/null.v3 v3.3.0/go.mod h1:E4tX2Qe3h7QdL+uZ3a0vqvYwKQsRSQKM5V4YltdgH9Y=
165 | gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
166 | gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
167 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
168 | gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
169 | gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
170 | gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
171 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
172 | gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
173 |
--------------------------------------------------------------------------------
/loader.go:
--------------------------------------------------------------------------------
1 | // Package ts contains xk6-ts extension.
2 | package ts
3 |
4 | import (
5 | "os"
6 | "path/filepath"
7 | "time"
8 |
9 | "github.com/grafana/k6pack"
10 | "github.com/sirupsen/logrus"
11 | )
12 |
13 | func init() {
14 | redirectStdin()
15 | }
16 |
17 | func isRunCommand(args []string) (bool, int) {
18 | argn := len(args)
19 |
20 | scriptIndex := argn - 1
21 | if scriptIndex < 0 {
22 | return false, scriptIndex
23 | }
24 |
25 | var runIndex int
26 |
27 | for idx := 0; idx < argn; idx++ {
28 | arg := args[idx]
29 | if arg == "run" && runIndex == 0 {
30 | runIndex = idx
31 |
32 | break
33 | }
34 | }
35 |
36 | if runIndex == 0 {
37 | return false, -1
38 | }
39 |
40 | return true, scriptIndex
41 | }
42 |
43 | //nolint:forbidigo
44 | func redirectStdin() {
45 | if os.Getenv("XK6_TS") == "false" {
46 | return
47 | }
48 |
49 | isRun, scriptIndex := isRunCommand(os.Args)
50 | if !isRun {
51 | return
52 | }
53 |
54 | filename := os.Args[scriptIndex]
55 | if filename == "-" {
56 | return
57 | }
58 |
59 | cwd, _ := os.Getwd()
60 |
61 | opts := &k6pack.Options{
62 | Filename: filename,
63 | SourceMap: os.Getenv("XK6_TS_SOURCEMAP") != "false",
64 | SourceRoot: cwd,
65 | }
66 |
67 | source, err := os.ReadFile(filepath.Clean(filename))
68 | if err != nil {
69 | logrus.WithError(err).Fatal()
70 | }
71 |
72 | packStarted := time.Now()
73 |
74 | jsScript, err := k6pack.Pack(string(source), opts)
75 | if err != nil {
76 | logrus.WithError(err).Fatal()
77 | }
78 |
79 | if os.Getenv("XK6_TS_BENCHMARK") == "true" {
80 | duration := time.Since(packStarted)
81 | logrus.WithField("extension", "xk6-ts").WithField("duration", duration).Info("Bundling completed in ", duration)
82 | }
83 |
84 | os.Args[scriptIndex] = "-"
85 |
86 | reader, writer, err := os.Pipe()
87 | if err != nil {
88 | logrus.WithError(err).Fatal()
89 | }
90 |
91 | os.Stdin = reader
92 |
93 | go func() {
94 | _, werr := writer.Write(jsScript)
95 | writer.Close() //nolint:errcheck,gosec
96 |
97 | if werr != nil {
98 | logrus.WithError(werr).Fatal("stdin redirect failed")
99 | }
100 | }()
101 | }
102 |
--------------------------------------------------------------------------------
/register.go:
--------------------------------------------------------------------------------
1 | package ts
2 |
3 | import (
4 | "go.k6.io/k6/js/modules"
5 | )
6 |
7 | type extension struct{}
8 |
9 | func init() {
10 | modules.Register("k6/x/fake-ts-module-just-for-k6-version-command", new(extension))
11 | }
12 |
--------------------------------------------------------------------------------