@modern-js/tailwindcss-generator 3.1.37 → 3.1.38-alpha.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +32247 -646
- package/package.json +5 -5
- package/src/index.ts +22 -2
- package/templates/js-template/tailwind.config.js +4 -0
- package/templates/ts-template/tailwind.config.ts +5 -0
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "3.1.
|
18
|
+
"version": "3.1.38-alpha.0",
|
19
19
|
"jsnext:source": "./src/index.ts",
|
20
20
|
"main": "./dist/index.js",
|
21
21
|
"files": [
|
@@ -29,11 +29,11 @@
|
|
29
29
|
"@types/node": "^14",
|
30
30
|
"jest": "^29",
|
31
31
|
"typescript": "^5",
|
32
|
-
"@
|
32
|
+
"@modern-js/generator-utils": "3.1.38-alpha.0",
|
33
33
|
"@scripts/jest-config": "2.32.1",
|
34
|
-
"@modern-js/generator-
|
35
|
-
"@
|
36
|
-
"@modern-js/generator
|
34
|
+
"@modern-js/generator-common": "3.1.38-alpha.0",
|
35
|
+
"@scripts/build": "2.32.1",
|
36
|
+
"@modern-js/dependence-generator": "3.1.38-alpha.0"
|
37
37
|
},
|
38
38
|
"sideEffects": false,
|
39
39
|
"publishConfig": {
|
package/src/index.ts
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
import path from 'path';
|
2
2
|
import { GeneratorContext, GeneratorCore } from '@modern-js/codesmith';
|
3
3
|
import { AppAPI } from '@modern-js/codesmith-api-app';
|
4
|
-
import {
|
4
|
+
import {
|
5
|
+
i18n,
|
6
|
+
Language,
|
7
|
+
DependenceGenerator,
|
8
|
+
} from '@modern-js/generator-common';
|
9
|
+
import { isTsProject } from '@modern-js/generator-utils';
|
5
10
|
|
6
11
|
const getGeneratorPath = (generator: string, distTag: string) => {
|
7
12
|
if (process.env.CODESMITH_ENV === 'development') {
|
@@ -17,8 +22,23 @@ export const handleTemplateFile = async (
|
|
17
22
|
generator: GeneratorCore,
|
18
23
|
appApi: AppAPI,
|
19
24
|
) => {
|
25
|
+
const appDir = context.materials.default.basePath;
|
26
|
+
const language = isTsProject(appDir) ? Language.TS : Language.JS;
|
27
|
+
|
28
|
+
if (language === Language.TS) {
|
29
|
+
await appApi.forgeTemplate(
|
30
|
+
'templates/ts-template/**/*',
|
31
|
+
undefined,
|
32
|
+
resourceKey => resourceKey.replace('templates/ts-template/', ''),
|
33
|
+
);
|
34
|
+
} else {
|
35
|
+
appApi.forgeTemplate('templates/js-template/**/*', undefined, resourceKey =>
|
36
|
+
resourceKey.replace('templates/js-template/', ''),
|
37
|
+
);
|
38
|
+
}
|
39
|
+
|
20
40
|
const { dependencies, peerDependencies, devDependencies } = context.config;
|
21
|
-
const tailwindVersion = '~3.
|
41
|
+
const tailwindVersion = '~3.3.3';
|
22
42
|
if (dependencies?.tailwindcss) {
|
23
43
|
dependencies.tailwindcss = tailwindVersion;
|
24
44
|
}
|