@dxtmisha/scripts 0.5.12 → 0.5.14

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dxtmisha/scripts",
3
3
  "private": false,
4
- "version": "0.5.12",
4
+ "version": "0.5.14",
5
5
  "type": "module",
6
6
  "description": "Development scripts and CLI tools for DXT UI projects - automated component generation, library building and project management tools",
7
7
  "keywords": [
@@ -70,7 +70,7 @@ export abstract class AiDocItemAbstract {
70
70
  PropertiesConfig.getWikiLanguage()
71
71
  )
72
72
 
73
- const status = await this.build.make()
73
+ const status = this.isBuildDisabled() || await this.build.make()
74
74
 
75
75
  if (status) {
76
76
  this.makeAi()
@@ -105,6 +105,17 @@ export abstract class AiDocItemAbstract {
105
105
  }
106
106
  }
107
107
 
108
+ /**
109
+ * Checks if the item is marked as not to be built.
110
+ *
111
+ * Проверяет, помечен ли элемент как не подлежащий сборке.
112
+ */
113
+ isBuildDisabled(): boolean {
114
+ return Boolean(
115
+ this.code.read().match('// wiki:build-none')
116
+ )
117
+ }
118
+
108
119
  /**
109
120
  * Returns the path to the Wiki file.
110
121
  *
@@ -1,4 +1,4 @@
1
- import { Datetime, toArray, toKebabCase, transformation } from '@dxtmisha/functional-basic'
1
+ import { Datetime, forEach, toArray, toKebabCase, transformation } from '@dxtmisha/functional-basic'
2
2
 
3
3
  import requireFs from 'fs'
4
4
  import requirePath from 'path'
@@ -64,7 +64,12 @@ export class PropertiesFile {
64
64
  * @param path a sequence of path segments/ последовательность сегментов пути
65
65
  */
66
66
  static joinPath(path: PropertiesFilePath): string {
67
- return requirePath.join(...toArray(path))
67
+ const pathArray = forEach(
68
+ toArray(path),
69
+ item => this.toSep(item)
70
+ ) as string[]
71
+
72
+ return requirePath.join(...pathArray)
68
73
  }
69
74
 
70
75
  /**
@@ -226,6 +231,23 @@ export class PropertiesFile {
226
231
  return new Datetime(this.stat(path)?.mtimeMs, 'full').standard()
227
232
  }
228
233
 
234
+ /**
235
+ * Converts the path to use the current OS separator.
236
+ *
237
+ * Преобразует путь для использования текущего разделителя ОС.
238
+ * @param path path to the directory/ путь к директории
239
+ */
240
+ static toSep(path: PropertiesFilePath): PropertiesFilePath {
241
+ const sep = this.sep()
242
+
243
+ if (sep === '/') {
244
+ return path
245
+ }
246
+
247
+ return this.joinPath(path)
248
+ .replace('/', this.sep())
249
+ }
250
+
229
251
  /**
230
252
  * Reads the contents of the directory.
231
253
  *