@toptal/davinci-code 1.7.5-alpha-fix-bundle-analyze-e1cf8407.5 → 1.7.5-alpha-feature-esm-migration-b7a1c917.29
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/bin/{davinci-code.js → davinci-code.mjs} +4 -2
- package/docs/module.md +2 -2
- package/docs/new-component.md +1 -1
- package/docs/new-page.md +1 -1
- package/docs/stories.md +0 -1
- package/package.json +6 -6
- package/src/commands/{component.js → component.mjs} +6 -6
- package/src/commands/{module.js → module.mjs} +5 -5
- package/src/commands/{stories.js → stories.mjs} +4 -4
- package/src/constants.mjs +5 -0
- package/src/index.mjs +11 -0
- package/src/{templates.js → templates.mjs} +7 -4
- package/src/constants.js +0 -5
- package/src/index.js +0 -11
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import cliEngine from '@toptal/davinci-cli-shared'
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import code from '../src/index.mjs'
|
|
6
|
+
|
|
7
|
+
const { commands } = code
|
|
6
8
|
|
|
7
9
|
cliEngine.loadCommands(commands, 'davinci-code')
|
|
8
10
|
|
package/docs/module.md
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Creates a new module in `/modules` directory with the prepared inner structure of the module.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
davinci-code module
|
|
6
|
+
davinci-code module <moduleName>
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
Arguments:
|
|
10
10
|
|
|
11
|
-
- `
|
|
11
|
+
- `moduleName` - the name of the module to create
|
package/docs/new-component.md
CHANGED
package/docs/new-page.md
CHANGED
package/docs/stories.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toptal/davinci-code",
|
|
3
|
-
"version": "1.7.5-alpha-
|
|
3
|
+
"version": "1.7.5-alpha-feature-esm-migration-b7a1c917.29+b7a1c917",
|
|
4
4
|
"description": "Code generation package for frontend applications",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
"homepage": "https://github.com/toptal/davinci/tree/master/packages/code#readme",
|
|
15
15
|
"license": "ISC",
|
|
16
16
|
"bin": {
|
|
17
|
-
"davinci-code": "./bin/davinci-code.
|
|
17
|
+
"davinci-code": "./bin/davinci-code.mjs"
|
|
18
18
|
},
|
|
19
|
-
"main": "src/index.
|
|
19
|
+
"main": "src/index.mjs",
|
|
20
20
|
"files": [
|
|
21
21
|
"src",
|
|
22
22
|
"bin",
|
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
"url": "git+https://github.com/toptal/davinci.git"
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
32
|
-
"test": "
|
|
32
|
+
"test": "../../bin/unit-test.bash"
|
|
33
33
|
},
|
|
34
34
|
"bugs": {
|
|
35
35
|
"url": "https://github.com/toptal/davinci/issues"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@toptal/davinci-cli-shared": "1.10.3-alpha-
|
|
38
|
+
"@toptal/davinci-cli-shared": "1.10.3-alpha-feature-esm-migration-b7a1c917.29+b7a1c917",
|
|
39
39
|
"hygen": "^6.2.11",
|
|
40
40
|
"lodash.camelcase": "^4.3.0",
|
|
41
41
|
"lodash.kebabcase": "^4.1.1"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "b7a1c917fc2cee48f71652bb6d6eda3ae34c42f5"
|
|
44
44
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import kebabCase from 'lodash.kebabcase'
|
|
2
|
+
import camelCase from 'lodash.camelcase'
|
|
3
|
+
import { print } from '@toptal/davinci-cli-shared'
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import templates from '../templates.mjs'
|
|
6
|
+
import { CORE_MODULE } from '../constants.mjs'
|
|
7
7
|
|
|
8
8
|
const componentCommandCreator = {
|
|
9
9
|
command: 'new <templateName> [name] [moduleName]',
|
|
@@ -26,4 +26,4 @@ const componentCommandCreator = {
|
|
|
26
26
|
},
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
export default componentCommandCreator
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import kebabCase from 'lodash.kebabcase'
|
|
2
|
+
import { print } from '@toptal/davinci-cli-shared'
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
import templates from '../templates.mjs'
|
|
5
|
+
import { CORE_MODULE } from '../constants.mjs'
|
|
6
6
|
|
|
7
7
|
const moduleCommandCreator = {
|
|
8
8
|
command: 'module [name]',
|
|
@@ -16,4 +16,4 @@ const moduleCommandCreator = {
|
|
|
16
16
|
},
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
export default moduleCommandCreator
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { print } from '@toptal/davinci-cli-shared'
|
|
2
|
+
import fs from 'fs/promises'
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
import templates from '../templates.mjs'
|
|
5
5
|
|
|
6
6
|
const storiesCommandCreator = {
|
|
7
7
|
command: 'stories <componentDirectory>',
|
|
@@ -27,4 +27,4 @@ const storiesCommandCreator = {
|
|
|
27
27
|
},
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
export default storiesCommandCreator
|
package/src/index.mjs
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import moduleCommandCreator from './commands/module.mjs';
|
|
2
|
+
import componentCommandCreator from './commands/component.mjs';
|
|
3
|
+
import storiesCommandCreator from './commands/stories.mjs';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
commands: [
|
|
7
|
+
moduleCommandCreator,
|
|
8
|
+
storiesCommandCreator,
|
|
9
|
+
componentCommandCreator,
|
|
10
|
+
],
|
|
11
|
+
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { fileURLToPath } from 'node:url'
|
|
2
|
+
import path from 'node:path'
|
|
3
|
+
import fs from 'fs'
|
|
4
|
+
import { runSync } from '@toptal/davinci-cli-shared'
|
|
5
|
+
|
|
6
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
4
7
|
|
|
5
8
|
const rootDir = path.join(__dirname, '..')
|
|
6
9
|
const templatesDir = path.join(rootDir, './_templates')
|
|
@@ -33,7 +36,7 @@ const generate = (template, name, moduleName) => {
|
|
|
33
36
|
})
|
|
34
37
|
}
|
|
35
38
|
|
|
36
|
-
|
|
39
|
+
export default {
|
|
37
40
|
generateModule,
|
|
38
41
|
generate,
|
|
39
42
|
}
|
package/src/constants.js
DELETED
package/src/index.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
const moduleCommandCreator = require('./commands/module')
|
|
2
|
-
const componentCommandCreator = require('./commands/component')
|
|
3
|
-
const storiesCommandCreator = require('./commands/stories')
|
|
4
|
-
|
|
5
|
-
module.exports = {
|
|
6
|
-
commands: [
|
|
7
|
-
moduleCommandCreator,
|
|
8
|
-
storiesCommandCreator,
|
|
9
|
-
componentCommandCreator,
|
|
10
|
-
],
|
|
11
|
-
}
|