@microtronics/studio-cli 1.3.0-alpha.1 → 1.3.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/main.js +499 -64
- package/dist/studio-cli.d.ts +75 -0
- package/out/api.js +501 -66
- package/out/studio-cli.d.ts +75 -0
- package/package.json +2 -2
package/out/studio-cli.d.ts
CHANGED
|
@@ -2601,6 +2601,25 @@ export declare namespace DLO {
|
|
|
2601
2601
|
* EXPECT_* macros and `main()`. Empty for anything that is not a spec root.
|
|
2602
2602
|
*/
|
|
2603
2603
|
export function getSpecCompileDefines(filePath: string, source?: string): string[];
|
|
2604
|
+
/**
|
|
2605
|
+
* The identifier the pre-compiler derives from an `IT("title")` of a spec root: the title
|
|
2606
|
+
* lower-cased, every run of characters outside `[A-Za-z0-9_]` collapsed into one `_`,
|
|
2607
|
+
* leading/trailing `_` dropped and truncated to `IT_SLUG_MAX` (22) so that
|
|
2608
|
+
* `__it_<slug>__<n>` still fits pawncc's 31 character public name limit.
|
|
2609
|
+
*/
|
|
2610
|
+
export const itSlug: typeof ItNaming.itSlug;
|
|
2611
|
+
/** `itSlug()` made unique within one spec by appending `_2`, `_3`, ... */
|
|
2612
|
+
export const uniqueItSlug: typeof ItNaming.uniqueItSlug;
|
|
2613
|
+
/** The public an `IT` declares: `__it_<slug>`. */
|
|
2614
|
+
export const itPublicName: typeof ItNaming.itPublicName;
|
|
2615
|
+
/** The public a `STEP` declares: `__it_<slug>__<n>`. */
|
|
2616
|
+
export const stepPublicName: typeof ItNaming.stepPublicName;
|
|
2617
|
+
export const IT_PREFIX = "__it_";
|
|
2618
|
+
export const IT_SLUG_MAX: number;
|
|
2619
|
+
export const PUBLIC_NAME_MAX = 31;
|
|
2620
|
+
/** `// @it <slug> "<title>"` - the marker the pre-compiler leaves on a rewritten line. */
|
|
2621
|
+
export const itMarkerComment: typeof ItNaming.itMarkerComment;
|
|
2622
|
+
export const IT_MARKER_RE: RegExp;
|
|
2604
2623
|
/**
|
|
2605
2624
|
* The DLO Compiler
|
|
2606
2625
|
*/
|
|
@@ -2986,6 +3005,49 @@ export declare enum HttpMethod {
|
|
|
2986
3005
|
*/
|
|
2987
3006
|
export declare function install(cwd: URI, fs: LocalFS, logger: Log.Logger, env: Globals.ENV, apiToken: string | null, dependencies: string[], development?: boolean): Promise<void>;
|
|
2988
3007
|
|
|
3008
|
+
/** Matches the marker `itMarkerComment()` writes, capturing the slug and the raw title. */
|
|
3009
|
+
declare const IT_MARKER_RE: RegExp;
|
|
3010
|
+
|
|
3011
|
+
/** What `IT` pastes in front of the id/slug to get the public name. */
|
|
3012
|
+
declare const IT_PREFIX = "__it_";
|
|
3013
|
+
|
|
3014
|
+
/** Longest slug that keeps `__it_<slug>__<n>` (n up to 99) inside `PUBLIC_NAME_MAX`: 22. */
|
|
3015
|
+
declare const IT_SLUG_MAX: number;
|
|
3016
|
+
|
|
3017
|
+
/**
|
|
3018
|
+
* The marker the pre-compiler leaves on the line it rewrote: `// @it <slug> "<title>"`, with
|
|
3019
|
+
* the title kept exactly as it was written (escapes included). It lets the runner and the
|
|
3020
|
+
* language server map a public back to its title without re-deriving the slug.
|
|
3021
|
+
*/
|
|
3022
|
+
declare function itMarkerComment(slug: string, rawTitle: string): string;
|
|
3023
|
+
|
|
3024
|
+
declare namespace ItNaming {
|
|
3025
|
+
export {
|
|
3026
|
+
itSlug,
|
|
3027
|
+
uniqueItSlug,
|
|
3028
|
+
itPublicName,
|
|
3029
|
+
stepPublicName,
|
|
3030
|
+
itMarkerComment,
|
|
3031
|
+
PUBLIC_NAME_MAX,
|
|
3032
|
+
IT_PREFIX,
|
|
3033
|
+
IT_SLUG_MAX,
|
|
3034
|
+
IT_MARKER_RE
|
|
3035
|
+
}
|
|
3036
|
+
}
|
|
3037
|
+
|
|
3038
|
+
/** The public an `IT` declares. */
|
|
3039
|
+
declare function itPublicName(slug: string): string;
|
|
3040
|
+
|
|
3041
|
+
/**
|
|
3042
|
+
* The identifier part of the public an `IT("title")` declares: the title lower-cased, every
|
|
3043
|
+
* run of characters outside `[A-Za-z0-9_]` collapsed into a single `_`, leading and trailing
|
|
3044
|
+
* `_` dropped and the result truncated to `maxLength` (`IT_SLUG_MAX` by default).
|
|
3045
|
+
*
|
|
3046
|
+
* Empty when the title has nothing to slug (`"---"`), which the caller has to report - there
|
|
3047
|
+
* is no name to give the public.
|
|
3048
|
+
*/
|
|
3049
|
+
declare function itSlug(title: string, maxLength?: number): string;
|
|
3050
|
+
|
|
2989
3051
|
export declare namespace Library {
|
|
2990
3052
|
/**
|
|
2991
3053
|
* Creates the library.tar.gz archive content
|
|
@@ -5817,6 +5879,9 @@ declare interface PawnModuleOptions {
|
|
|
5817
5879
|
printErr?: (data: string) => void;
|
|
5818
5880
|
}
|
|
5819
5881
|
|
|
5882
|
+
/** pawncc truncates a public's name to `sNAMEMAX` characters. */
|
|
5883
|
+
declare const PUBLIC_NAME_MAX = 31;
|
|
5884
|
+
|
|
5820
5885
|
/**
|
|
5821
5886
|
* Publishes a package to the registry with the specified settings and configurations.
|
|
5822
5887
|
*
|
|
@@ -5891,12 +5956,22 @@ export declare interface StampPollerStatus {
|
|
|
5891
5956
|
paused: boolean;
|
|
5892
5957
|
}
|
|
5893
5958
|
|
|
5959
|
+
/** The public a `STEP` declares - a continuation of `itPublicName(slug)`. */
|
|
5960
|
+
declare function stepPublicName(slug: string, n: number): string;
|
|
5961
|
+
|
|
5894
5962
|
/**
|
|
5895
5963
|
* Opens the transports for a device given its serial number. The default (WebUSB) factory
|
|
5896
5964
|
* is used by {@link openDevice} unless a test/consumer supplies its own.
|
|
5897
5965
|
*/
|
|
5898
5966
|
export declare type TransportFactory = (serial: string, needDebug?: boolean) => Promise<DeviceTransports>;
|
|
5899
5967
|
|
|
5968
|
+
/**
|
|
5969
|
+
* `itSlug()` made unique within one spec: on a collision `_2`, `_3`, ... is appended, the base
|
|
5970
|
+
* re-truncated so the suffixed slug still fits `IT_SLUG_MAX`. Returns an empty string for a
|
|
5971
|
+
* title that slugs to nothing.
|
|
5972
|
+
*/
|
|
5973
|
+
declare function uniqueItSlug(title: string, taken: ReadonlySet<string>): string;
|
|
5974
|
+
|
|
5900
5975
|
/**
|
|
5901
5976
|
* Upload result interface
|
|
5902
5977
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microtronics/studio-cli",
|
|
3
|
-
"version": "1.3.0-alpha.
|
|
3
|
+
"version": "1.3.0-alpha.3",
|
|
4
4
|
"description": "Microtronics Studio CLI Tool",
|
|
5
5
|
"main": "./out/api.js",
|
|
6
6
|
"typings": "./out/studio-cli.d.ts",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"mocha": "^10.8.2",
|
|
77
77
|
"mocha-junit-reporter": "^2.2.1",
|
|
78
78
|
"openapi-typescript": "^7.6.0",
|
|
79
|
-
"pawncc-wasm": "bitbucket:microtronics-core/pawncc-wasm#v1.
|
|
79
|
+
"pawncc-wasm": "bitbucket:microtronics-core/pawncc-wasm#v1.2.0",
|
|
80
80
|
"resedit": "^3.0.2",
|
|
81
81
|
"tar": "^7.5.7",
|
|
82
82
|
"ts-node": "^10.9.2",
|