@anthonylzq/simba.js 1.4.0

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.
@@ -0,0 +1,25 @@
1
+ const writeFile = require('../utils/writeFile')
2
+
3
+ /**
4
+ * @param {String} projectName
5
+ * @returns {Promise<void>}
6
+ */
7
+ module.exports = async projectName => {
8
+ const data = {
9
+ dockerContent: `FROM node:16-alpine
10
+
11
+ WORKDIR /app
12
+
13
+ COPY package.json ./
14
+
15
+ RUN yarn install --prod
16
+
17
+ COPY dist /app/dist
18
+
19
+ CMD [ "yarn", "start" ]
20
+ `,
21
+ dockerFile: 'Dockerfile'
22
+ }
23
+
24
+ await writeFile(`${projectName}/${data.dockerFile}`, data.dockerContent)
25
+ }
@@ -0,0 +1,104 @@
1
+ const writeFile = require('../utils/writeFile')
2
+
3
+ /**
4
+ * @param {String} projectName
5
+ * @returns {Promise<void>}
6
+ */
7
+ module.exports = async projectName => {
8
+ const data = {
9
+ eslintContent: `module.exports = {
10
+ env: {
11
+ node: true
12
+ },
13
+ root: true,
14
+ parser: '@typescript-eslint/parser',
15
+ plugins: [
16
+ '@typescript-eslint',
17
+ 'import',
18
+ 'prettier'
19
+ ],
20
+ extends: [
21
+ 'standard',
22
+ 'eslint:recommended',
23
+ 'plugin:@typescript-eslint/eslint-recommended',
24
+ 'plugin:@typescript-eslint/recommended',
25
+ 'prettier'
26
+ ],
27
+ rules: {
28
+ '@typescript-eslint/no-var-requires': 'off',
29
+ '@typescript-eslint/no-empty-interface': 'off',
30
+ 'arrow-parens': [
31
+ 'error',
32
+ 'as-needed'
33
+ ],
34
+ 'import/extensions': [
35
+ 2,
36
+ {
37
+ ts: 'never',
38
+ js: 'always',
39
+ json: 'always'
40
+ }
41
+ ],
42
+ 'import/no-extraneous-dependencies': [
43
+ 'error',
44
+ {
45
+ devDependencies: ['**/*.test.js', 'webpack.config.js'],
46
+ optionalDependencies: ['**/*.test.js'],
47
+ peerDependencies: ['**/*.test.js']
48
+ }
49
+ ],
50
+ 'max-len': [
51
+ 'error',
52
+ {
53
+ code: 80,
54
+ ignoreComments: true,
55
+ ignoreRegExpLiterals: true,
56
+ ignoreTemplateLiterals: true,
57
+ ignoreTrailingComments: true,
58
+ ignoreStrings: true,
59
+ ignoreUrls: true
60
+ }
61
+ ],
62
+ 'newline-before-return': 'error',
63
+ 'object-curly-spacing': [
64
+ 'error',
65
+ 'always'
66
+ ],
67
+ 'prefer-const': 'error',
68
+ 'prettier/prettier': [
69
+ 'error',
70
+ {
71
+ 'arrowParens': 'avoid',
72
+ 'bracketSpacing': true,
73
+ 'printWidth': 80,
74
+ 'quoteProps': 'as-needed',
75
+ 'semi': false,
76
+ 'singleQuote': true,
77
+ 'tabWidth': 2,
78
+ 'trailingComma': 'none'
79
+ }
80
+ ],
81
+ radix: [
82
+ 'error',
83
+ 'as-needed'
84
+ ],
85
+ 'spaced-comment': ['error', 'always']
86
+ }
87
+ }
88
+ `,
89
+ eslintFile: '.eslintrc.js',
90
+ eslintIgnoreContent: `/dist
91
+ .eslintrc.js
92
+ webpack.config.js
93
+ `,
94
+ eslintIgnoreFile: '.eslintignore'
95
+ }
96
+
97
+ await Promise.all([
98
+ writeFile(`${projectName}/${data.eslintFile}`, data.eslintContent),
99
+ writeFile(
100
+ `${projectName}/${data.eslintIgnoreFile}`,
101
+ data.eslintIgnoreContent
102
+ )
103
+ ])
104
+ }