@symbo.ls/cli 2.10.208 → 2.10.225

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 symbo.ls
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/bin/convert.js CHANGED
@@ -58,7 +58,7 @@ program
58
58
 
59
59
  // Bundle components
60
60
  await esbuild.build({
61
- entryPoints: origFiles.map(file => path.join(srcPath, file, '/index.jsx')),
61
+ entryPoints: origFiles.map(file => path.join(srcPath, file, './index.js')),
62
62
  bundle: true,
63
63
  sourcemap: true,
64
64
  target: 'node12',
@@ -0,0 +1,14 @@
1
+ export const CustomDesignSystem = {
2
+ color: {
3
+ snowWhite: '#F3F6FB',
4
+ },
5
+ theme: {},
6
+ typography: {},
7
+ space: {},
8
+ media: {},
9
+ icons:{},
10
+ font: {},
11
+ font_family: {},
12
+ timing: {},
13
+ reset: {}
14
+ }
package/bin/create.js ADDED
@@ -0,0 +1,60 @@
1
+ 'use strict'
2
+
3
+ import { execSync } from 'child_process'
4
+ import { program } from './program.js'
5
+ import fs from 'fs'
6
+ import path from 'path'
7
+ import { fileURLToPath } from 'url';
8
+ const __filename = fileURLToPath(import.meta.url);
9
+ const __dirname = path.dirname(__filename);
10
+
11
+ const DESIGN_SYSTEM_FILE_PATH = path.join(
12
+ __dirname, 'create', 'DesignSystem.js')
13
+ const REPO_URLS = {
14
+ domql: 'https://github.com/symbo-ls/create-domql-app.git',
15
+ react: 'https://github.com/symbo-ls/create-react-app.git',
16
+ angular: 'https://github.com/symbo-ls/create-angular-app.git',
17
+ vue2: 'https://github.com/symbo-ls/create-vue2-app.git',
18
+ vue3: 'https://github.com/symbo-ls/create-vue3-app.git',
19
+ }
20
+
21
+ program
22
+ .command('create')
23
+ .description('Create a new project that uses Symbols')
24
+ .argument('dest', 'Project directory name')
25
+ .option('--domql', 'Use Domql in the project (default)')
26
+ .option('--react', 'Use React in the project (default)')
27
+ .option('--angular', 'Use Angular in the project')
28
+ .option('--vue2', 'Use Vue2 in the project')
29
+ .option('--vue3', 'Use Vue3 in the project')
30
+ .action(async (dest, options) => {
31
+ // Determine repo to clone
32
+ let cloneUrl = REPO_URLS.react
33
+ if (options.domql) {
34
+ cloneUrl = REPO_URLS.domql
35
+ } else if (options.angular) {
36
+ cloneUrl = REPO_URLS.angular
37
+ } else if (options.vue2) {
38
+ cloneUrl = REPO_URLS.vue2
39
+ } else if (options.vue3) {
40
+ cloneUrl = REPO_URLS.vue3
41
+ }
42
+
43
+ // Clone
44
+ console.log(`Cloning ${cloneUrl} into ${dest}...`)
45
+ execSync(`git clone ${cloneUrl} ${dest}`)
46
+
47
+ // Install
48
+ const cwd = process.cwd()
49
+ console.log('Installing NPM dependencies...')
50
+ process.chdir(dest)
51
+ execSync(`npm install`)
52
+ process.chdir(cwd)
53
+
54
+ // Copy design system file
55
+ const filePath = path.join(dest, 'DesignSystem.js')
56
+ console.log(`Writing DesignSystem.js to ${filePath}`)
57
+ await fs.promises.copyFile(DESIGN_SYSTEM_FILE_PATH, filePath)
58
+
59
+ console.log('Done!')
60
+ })
package/bin/fetch.js CHANGED
@@ -27,13 +27,18 @@ try {
27
27
  } catch (e) { console.error('Please include symbols.json to your root of respository') }
28
28
 
29
29
  program
30
- .version(pkg.version)
30
+ .version(pkg.version ?? 'unknown')
31
31
 
32
32
  program
33
33
  .command('install')
34
34
  .description('Install Symbols')
35
35
  .option('--framework', 'Which Symbols to install (domql, react)')
36
36
  .action(async (framework) => {
37
+ if (!rc_file || !local_config) {
38
+ console.error('symbols.json not found in the root of the repository')
39
+ return;
40
+ }
41
+
37
42
  // const packageName = `@symbo.ls/${mode || 'uikit'}`
38
43
  const packageName = 'smbls'
39
44
  console.log('Adding', chalk.green.bold(packageName))
package/bin/index.js CHANGED
@@ -8,6 +8,7 @@ import './fetch.js'
8
8
  import './sync.js'
9
9
  import './clean.js'
10
10
  import './convert.js'
11
+ import './create.js'
11
12
 
12
13
  const args = process.argv
13
14
  program.parse(args)
package/bin/require.js CHANGED
@@ -1,8 +1,13 @@
1
1
  import { createRequire } from 'module'
2
+ import path from 'path'
3
+ import fs from 'fs'
2
4
 
3
5
  class ImportError extends Error {} /* Bring in the ability to create the 'require' method */ // eslint-disable-line
4
6
  const require = createRequire(import.meta.url) // construct the require method
5
7
 
6
8
  export const loadModule = async (modulePath) => {
7
- return require(modulePath) // use the require method
9
+ if (fs.existsSync(modulePath))
10
+ return require(modulePath) // use the require method
11
+ else
12
+ return null
8
13
  }
package/bin/sync.js CHANGED
@@ -17,6 +17,10 @@ program
17
17
  .option('-l, --live', 'Bypass the local build')
18
18
  .option('--key', 'Bypass the local build')
19
19
  .action(async (options) => {
20
+ if (!rc) {
21
+ console.error('symbols.json not found in the root of the repository')
22
+ return;
23
+ }
20
24
  rc.then(data => {
21
25
  const opts = { ...data, ...options }
22
26
  const key = data.key || options.key
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symbo.ls/cli",
3
- "version": "2.10.208",
3
+ "version": "2.10.225",
4
4
  "description": "Fetch your Symbols configuration",
5
5
  "main": "bin/fetch.js",
6
6
  "author": "Symbols",
@@ -24,5 +24,5 @@
24
24
  "node-fetch": "^3.1.0",
25
25
  "v8-compile-cache": "^2.3.0"
26
26
  },
27
- "gitHead": "53cfce5a1e7f1d5cb466fcae0a20370eab5eaa2c"
27
+ "gitHead": "ab9664d8dfad6716978095254e3e3526f8cad696"
28
28
  }