@spark-ui/cli-utils 2.0.0 → 2.0.1

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/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.0.1](https://github.com/adevinta/spark/compare/@spark-ui/cli-utils@2.0.0...@spark-ui/cli-utils@2.0.1) (2023-02-22)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **cli-utils:** cli command was failing ([719200e](https://github.com/adevinta/spark/commit/719200e62c210c7763950501553b9088187bd179))
11
+
6
12
  # [2.0.0](https://github.com/adevinta/spark/compare/@spark-ui/cli-utils@1.4.0...@spark-ui/cli-utils@2.0.0) (2023-02-22)
7
13
 
8
14
  ### Code Refactoring
@@ -24,10 +24,10 @@ if (!configFile) {
24
24
  }
25
25
 
26
26
  const configFilePath = join(process.cwd(), configFile)
27
- const configFileIsInJS = configFile === 'spark.theme.config.js'
27
+ const configFileIsMJS = /spark\.theme\.config\.(mjs)$/.test(configFile)
28
28
 
29
29
  const allowedExtensions = ['.ts', '.mts', '.cts', '.js', '.cjs', '.mjs']
30
- const jsFileExtension = '.js'
30
+ const jsFileExtension = '.mjs'
31
31
  const configFileExtension = extname(configFilePath)
32
32
  if (!allowedExtensions.includes(configFileExtension)) {
33
33
  system.exit(`Your spark.theme.config file extension (${configFileExtension}) is not supported.`)
@@ -36,10 +36,10 @@ if (!allowedExtensions.includes(configFileExtension)) {
36
36
  const configFileContent = readFileSync(configFilePath, 'utf-8')
37
37
  const jsCode = transformSync(configFileContent, { loader: 'ts' }).code
38
38
 
39
- const jsFilePath = configFilePath.replace(/\.ts$|\.mts$|\.cts$|\.mjs|\.cjs$/, jsFileExtension)
39
+ const jsFilePath = configFilePath.replace(/\.ts$|\.mts$|\.cts$|\.js|\.cjs$/, jsFileExtension)
40
40
  const jsFileContents = jsCode
41
41
 
42
- if (!configFileIsInJS) writeFileSync(jsFilePath, jsFileContents)
42
+ if (!configFileIsMJS) writeFileSync(jsFilePath, jsFileContents)
43
43
 
44
44
  import(jsFilePath)
45
45
  .then(module => {
@@ -53,7 +53,7 @@ import(jsFilePath)
53
53
  })
54
54
 
55
55
  child.on('exit', code => {
56
- if (!configFileIsInJS) unlinkSync(jsFilePath)
56
+ if (!configFileIsMJS) unlinkSync(jsFilePath)
57
57
  logger.success(
58
58
  `✨ Your Spark Tailwind theme config file has been successfully created: ${join(
59
59
  process.cwd(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spark-ui/cli-utils",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Spark CLI utils",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -17,9 +17,11 @@
17
17
  "camel-case": "4.1.2",
18
18
  "chalk": "5.2.0",
19
19
  "commander": "10.0.0",
20
+ "deepmerge": "4.3.0",
20
21
  "esbuild": "0.17.8",
21
22
  "fs-extra": "11.1.0",
22
23
  "glob": "8.1.0",
24
+ "hex-rgb": "5.0.0",
23
25
  "pascal-case": "3.1.2"
24
26
  },
25
27
  "repository": {
@@ -27,5 +29,5 @@
27
29
  "url": "git@github.com:adevinta/spark.git",
28
30
  "directory": "packages/utils/cli"
29
31
  },
30
- "gitHead": "a7cfc5667178ab46c812a43423f57d10037a5c6a"
32
+ "gitHead": "07c6cdbb00c9cbac14593f9e2348b70004345615"
31
33
  }