@microtronics/studio-cli 1.3.0-alpha.0 → 1.3.0-alpha.2

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.
@@ -445,6 +445,24 @@ export declare namespace DDE {
445
445
  description: string;
446
446
  markdownDescription: string;
447
447
  };
448
+ flexibleContainers: {
449
+ type: string;
450
+ additionalProperties: boolean;
451
+ description: string;
452
+ markdownDescription: string;
453
+ properties: {
454
+ timeseries: {
455
+ type: string;
456
+ description: string;
457
+ markdownDescription: string;
458
+ };
459
+ config: {
460
+ type: string;
461
+ description: string;
462
+ markdownDescription: string;
463
+ };
464
+ };
465
+ };
448
466
  constants: {
449
467
  type: string;
450
468
  description: string;
@@ -536,7 +554,7 @@ export declare namespace DDE {
536
554
  };
537
555
  };
538
556
  patternProperties: {
539
- "^(?!.*^field\\d+$)(?!.*^ch\\d+$)(?!(dde|cloudProject|constants|state|result|volatile|timeseries|aloha|setting|command|storage|relations))[a-zA-Z_][0-9a-zA-Z_]*$": {
557
+ "^(?!.*^field\\d+$)(?!.*^ch\\d+$)(?!(dde|cloudProject|flexibleContainers|constants|state|result|volatile|timeseries|aloha|setting|command|storage|relations))[a-zA-Z_][0-9a-zA-Z_]*$": {
540
558
  type: string;
541
559
  description: string;
542
560
  $ref: string;
@@ -566,6 +584,24 @@ export declare namespace DDE {
566
584
  cloudProject: {
567
585
  type: string;
568
586
  };
587
+ flexibleContainers: {
588
+ type: string;
589
+ additionalProperties: boolean;
590
+ description: string;
591
+ markdownDescription: string;
592
+ properties: {
593
+ timeseries: {
594
+ type: string;
595
+ description: string;
596
+ markdownDescription: string;
597
+ };
598
+ config: {
599
+ type: string;
600
+ description: string;
601
+ markdownDescription: string;
602
+ };
603
+ };
604
+ };
569
605
  constants: {
570
606
  type: string;
571
607
  description: string;
@@ -2565,6 +2601,25 @@ export declare namespace DLO {
2565
2601
  * EXPECT_* macros and `main()`. Empty for anything that is not a spec root.
2566
2602
  */
2567
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;
2568
2623
  /**
2569
2624
  * The DLO Compiler
2570
2625
  */
@@ -2950,6 +3005,49 @@ export declare enum HttpMethod {
2950
3005
  */
2951
3006
  export declare function install(cwd: URI, fs: LocalFS, logger: Log.Logger, env: Globals.ENV, apiToken: string | null, dependencies: string[], development?: boolean): Promise<void>;
2952
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
+
2953
3051
  export declare namespace Library {
2954
3052
  /**
2955
3053
  * Creates the library.tar.gz archive content
@@ -5781,6 +5879,9 @@ declare interface PawnModuleOptions {
5781
5879
  printErr?: (data: string) => void;
5782
5880
  }
5783
5881
 
5882
+ /** pawncc truncates a public's name to `sNAMEMAX` characters. */
5883
+ declare const PUBLIC_NAME_MAX = 31;
5884
+
5784
5885
  /**
5785
5886
  * Publishes a package to the registry with the specified settings and configurations.
5786
5887
  *
@@ -5855,12 +5956,22 @@ export declare interface StampPollerStatus {
5855
5956
  paused: boolean;
5856
5957
  }
5857
5958
 
5959
+ /** The public a `STEP` declares - a continuation of `itPublicName(slug)`. */
5960
+ declare function stepPublicName(slug: string, n: number): string;
5961
+
5858
5962
  /**
5859
5963
  * Opens the transports for a device given its serial number. The default (WebUSB) factory
5860
5964
  * is used by {@link openDevice} unless a test/consumer supplies its own.
5861
5965
  */
5862
5966
  export declare type TransportFactory = (serial: string, needDebug?: boolean) => Promise<DeviceTransports>;
5863
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
+
5864
5975
  /**
5865
5976
  * Upload result interface
5866
5977
  */
@@ -5927,6 +6038,8 @@ declare namespace YamlPreCompiler {
5927
6038
  private fileDiagnostics;
5928
6039
  private readonly libraryDDE;
5929
6040
  private libraryYaml;
6041
+ private flexibleContainers;
6042
+ private readonly historyPlusDirectionContainers;
5930
6043
  constructor(manifest: Manifest.Manifest, libraryFiles: DDE_Core.LibraryFile[], ddeHistory: DDE.HistoryJson | null);
5931
6044
  /**
5932
6045
  * Parse the given library files and return the diagnostics
@@ -5950,6 +6063,7 @@ declare namespace YamlPreCompiler {
5950
6063
  parsedDDE: DDE_Core.DDEJson;
5951
6064
  diagnostics: Diagnostics.File[];
5952
6065
  parsedYaml: null | Document_2.Parsed<ParsedNode, true>;
6066
+ lineCounter: LineCounter;
5953
6067
  };
5954
6068
  private yamlDocToDdeJson;
5955
6069
  private reservedTopLevelKeys;
@@ -5972,6 +6086,12 @@ declare namespace YamlPreCompiler {
5972
6086
  private validateContainerRelation;
5973
6087
  private findRelatedShadowField;
5974
6088
  private mergeAndFormat;
6089
+ private readFlexibleContainers;
6090
+ private flexibleSwitchGroupFor;
6091
+ private flexibleSwitchFor;
6092
+ private isPlusDirection;
6093
+ private normalizeTransferDirection;
6094
+ private warnIfHistoryDirectionNarrowed;
5975
6095
  private combineDDE;
5976
6096
  private initialContainerByteOffset;
5977
6097
  private updateShadowFieldInformation;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microtronics/studio-cli",
3
- "version": "1.3.0-alpha.0",
3
+ "version": "1.3.0-alpha.2",
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.1.1",
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",