@teleporthq/teleport-project-plugin-tailwind 0.21.9 → 0.21.10
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/__tests__/index.ts +0 -4
- package/dist/cjs/angular.d.ts +2 -0
- package/dist/cjs/angular.js +95 -0
- package/dist/cjs/angular.js.map +1 -0
- package/dist/cjs/constants.d.ts +3 -0
- package/dist/cjs/constants.js +7 -0
- package/dist/cjs/constants.js.map +1 -0
- package/dist/cjs/default.d.ts +2 -2
- package/dist/cjs/default.js +25 -13
- package/dist/cjs/default.js.map +1 -1
- package/dist/cjs/index.d.ts +12 -7
- package/dist/cjs/index.js +41 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/next.d.ts +2 -0
- package/dist/cjs/{nextjs.js → next.js} +11 -9
- package/dist/cjs/next.js.map +1 -0
- package/dist/cjs/nuxt.d.ts +2 -0
- package/dist/cjs/nuxt.js +110 -0
- package/dist/cjs/nuxt.js.map +1 -0
- package/dist/cjs/preact.d.ts +2 -0
- package/dist/cjs/preact.js +95 -0
- package/dist/cjs/preact.js.map +1 -0
- package/dist/cjs/react.d.ts +2 -0
- package/dist/cjs/react.js +95 -0
- package/dist/cjs/react.js.map +1 -0
- package/dist/cjs/stencil.d.ts +2 -0
- package/dist/cjs/stencil.js +102 -0
- package/dist/cjs/stencil.js.map +1 -0
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/cjs/vue.d.ts +2 -0
- package/dist/cjs/vue.js +110 -0
- package/dist/cjs/vue.js.map +1 -0
- package/dist/esm/angular.d.ts +2 -0
- package/dist/esm/angular.js +91 -0
- package/dist/esm/angular.js.map +1 -0
- package/dist/esm/constants.d.ts +3 -0
- package/dist/esm/constants.js +4 -0
- package/dist/esm/constants.js.map +1 -0
- package/dist/esm/default.d.ts +2 -2
- package/dist/esm/default.js +25 -13
- package/dist/esm/default.js.map +1 -1
- package/dist/esm/index.d.ts +12 -7
- package/dist/esm/index.js +38 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/next.d.ts +2 -0
- package/dist/esm/{nextjs.js → next.js} +11 -9
- package/dist/esm/next.js.map +1 -0
- package/dist/esm/nuxt.d.ts +2 -0
- package/dist/esm/nuxt.js +106 -0
- package/dist/esm/nuxt.js.map +1 -0
- package/dist/esm/preact.d.ts +2 -0
- package/dist/esm/preact.js +91 -0
- package/dist/esm/preact.js.map +1 -0
- package/dist/esm/react.d.ts +2 -0
- package/dist/esm/react.js +91 -0
- package/dist/esm/react.js.map +1 -0
- package/dist/esm/stencil.d.ts +2 -0
- package/dist/esm/stencil.js +98 -0
- package/dist/esm/stencil.js.map +1 -0
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/vue.d.ts +2 -0
- package/dist/esm/vue.js +106 -0
- package/dist/esm/vue.js.map +1 -0
- package/package.json +5 -2
- package/src/angular.ts +54 -0
- package/src/constants.ts +3 -0
- package/src/default.ts +35 -21
- package/src/index.ts +72 -17
- package/src/{nextjs.ts → next.ts} +11 -13
- package/src/nuxt.ts +77 -0
- package/src/preact.ts +54 -0
- package/src/react.ts +54 -0
- package/src/stencil.ts +84 -0
- package/src/vue.ts +67 -0
- package/dist/cjs/nextjs.d.ts +0 -2
- package/dist/cjs/nextjs.js.map +0 -1
- package/dist/esm/nextjs.d.ts +0 -2
- package/dist/esm/nextjs.js.map +0 -1
package/__tests__/index.ts
CHANGED
|
@@ -34,8 +34,6 @@ describe('Plugins adds tailwind as devDependnecy when used with Next', () => {
|
|
|
34
34
|
})
|
|
35
35
|
const plugin = new ProjectPluginTailwind({
|
|
36
36
|
framework: ProjectType.NEXT,
|
|
37
|
-
config: {},
|
|
38
|
-
css: `.tailwind-class{ }`,
|
|
39
37
|
})
|
|
40
38
|
const { files } = await plugin.runAfter(structure)
|
|
41
39
|
const appFile = files.get('_app').files[0]
|
|
@@ -62,8 +60,6 @@ describe('Plugins adds tailwind as devDependnecy when used with Next', () => {
|
|
|
62
60
|
|
|
63
61
|
const plugin = new ProjectPluginTailwind({
|
|
64
62
|
framework: ProjectType.NEXT,
|
|
65
|
-
config: {},
|
|
66
|
-
css: `.tailwind-class{ }`,
|
|
67
63
|
})
|
|
68
64
|
const { files } = await plugin.runAfter(structure)
|
|
69
65
|
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (_) try {
|
|
29
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
+
exports.angularTailwindModifier = void 0;
|
|
51
|
+
var teleport_types_1 = require("@teleporthq/teleport-types");
|
|
52
|
+
var constants_1 = require("./constants");
|
|
53
|
+
var angularTailwindModifier = function (params) { return __awaiter(void 0, void 0, void 0, function () {
|
|
54
|
+
var structure, css, config, path, devDependencies, files, projectSheet, globalStyleSheet;
|
|
55
|
+
var _a;
|
|
56
|
+
return __generator(this, function (_b) {
|
|
57
|
+
structure = params.structure, css = params.css, config = params.config, path = params.path;
|
|
58
|
+
devDependencies = structure.devDependencies, files = structure.files;
|
|
59
|
+
config.content = ['./src/**/*.{html,ts}'];
|
|
60
|
+
projectSheet = (_a = files
|
|
61
|
+
.get('projectStyleSheet')) === null || _a === void 0 ? void 0 : _a.files.find(function (file) { return file.name === 'styles' && file.fileType === teleport_types_1.FileType.CSS; });
|
|
62
|
+
globalStyleSheet = css;
|
|
63
|
+
if (projectSheet) {
|
|
64
|
+
files.delete('projectStyleSheet');
|
|
65
|
+
globalStyleSheet = "".concat(globalStyleSheet, " \n \n ").concat(projectSheet.content);
|
|
66
|
+
}
|
|
67
|
+
files.set('projectStyleSheet', {
|
|
68
|
+
path: path || ['src'],
|
|
69
|
+
files: [
|
|
70
|
+
__assign(__assign({}, projectSheet), { content: globalStyleSheet }),
|
|
71
|
+
],
|
|
72
|
+
});
|
|
73
|
+
files.set('tailwindConfig', {
|
|
74
|
+
files: [
|
|
75
|
+
{
|
|
76
|
+
name: 'tailwind.config',
|
|
77
|
+
fileType: teleport_types_1.FileType.JS,
|
|
78
|
+
content: "module.exports = ".concat(JSON.stringify(config, null, 2)),
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: 'postcss.config',
|
|
82
|
+
fileType: teleport_types_1.FileType.JS,
|
|
83
|
+
content: "module.exports = {\n plugins: {\n tailwindcss: {},\n autoprefixer: {},\n },\n};",
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
path: [''],
|
|
87
|
+
});
|
|
88
|
+
devDependencies.autoprefixer = constants_1.AUTO_PREFIXER;
|
|
89
|
+
devDependencies.postcss = constants_1.POSTCSS;
|
|
90
|
+
devDependencies.tailwindcss = constants_1.TAILWIND;
|
|
91
|
+
return [2 /*return*/];
|
|
92
|
+
});
|
|
93
|
+
}); };
|
|
94
|
+
exports.angularTailwindModifier = angularTailwindModifier;
|
|
95
|
+
//# sourceMappingURL=angular.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
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AAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAE;iBAC/D;gBACD;oBACE,IAAI,EAAE,gBAAgB;oBACtB,QAAQ,EAAE,yBAAQ,CAAC,EAAE;oBACrB,OAAO,EAAE,yFAKd;iBACI;aACF;YACD,IAAI,EAAE,CAAC,EAAE,CAAC;SACX,CAAC,CAAA;QAEF,eAAe,CAAC,YAAY,GAAG,yBAAa,CAAA;QAC5C,eAAe,CAAC,OAAO,GAAG,mBAAO,CAAA;QACjC,eAAe,CAAC,WAAW,GAAG,oBAAQ,CAAA;;;KACvC,CAAA;AAjDY,QAAA,uBAAuB,2BAiDnC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.POSTCSS = exports.TAILWIND = exports.AUTO_PREFIXER = void 0;
|
|
4
|
+
exports.AUTO_PREFIXER = '^10.4.7';
|
|
5
|
+
exports.TAILWIND = '^3.0.24';
|
|
6
|
+
exports.POSTCSS = '^8.4.14';
|
|
7
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG,SAAS,CAAA;AACzB,QAAA,QAAQ,GAAG,SAAS,CAAA;AACpB,QAAA,OAAO,GAAG,SAAS,CAAA"}
|
package/dist/cjs/default.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const defaultTailwindModifier: (
|
|
1
|
+
import { TailwindPluginParams } from '.';
|
|
2
|
+
export declare const defaultTailwindModifier: (params: TailwindPluginParams) => Promise<void>;
|
package/dist/cjs/default.js
CHANGED
|
@@ -49,23 +49,35 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
49
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
50
|
exports.defaultTailwindModifier = void 0;
|
|
51
51
|
var teleport_types_1 = require("@teleporthq/teleport-types");
|
|
52
|
-
var
|
|
53
|
-
|
|
52
|
+
var constants_1 = require("./constants");
|
|
53
|
+
var defaultTailwindModifier = function (params) { return __awaiter(void 0, void 0, void 0, function () {
|
|
54
|
+
var structure, config, css, path, files, devDependencies, rootFolder, projectSheet, globalStyleSheet;
|
|
54
55
|
var _a;
|
|
55
56
|
return __generator(this, function (_b) {
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
structure = params.structure, config = params.config, css = params.css, path = params.path;
|
|
58
|
+
files = structure.files, devDependencies = structure.devDependencies, rootFolder = structure.rootFolder;
|
|
59
|
+
config.content = ['./src/**/*.{html,js,ts,jsx,tsx}', './*.html'];
|
|
58
60
|
projectSheet = (_a = files
|
|
59
61
|
.get('projectStyleSheet')) === null || _a === void 0 ? void 0 : _a.files.find(function (file) { return file.name === 'style' && file.fileType === teleport_types_1.FileType.CSS; });
|
|
62
|
+
globalStyleSheet = css;
|
|
60
63
|
if (projectSheet) {
|
|
61
64
|
files.delete('projectStyleSheet');
|
|
62
|
-
|
|
63
|
-
path: ['src', 'teleporthq'],
|
|
64
|
-
files: [
|
|
65
|
-
__assign(__assign({}, projectSheet), { content: "".concat(css, "\n").concat(projectSheet.content) }),
|
|
66
|
-
],
|
|
67
|
-
});
|
|
65
|
+
globalStyleSheet = "".concat(globalStyleSheet, " \n \n ").concat(projectSheet.content);
|
|
68
66
|
}
|
|
67
|
+
rootFolder.files.forEach(function (file) {
|
|
68
|
+
var name = file.name, fileType = file.fileType;
|
|
69
|
+
if (name === 'package' && fileType === 'json') {
|
|
70
|
+
var jsonContent = JSON.parse(file.content);
|
|
71
|
+
jsonContent.scripts = __assign(__assign({}, jsonContent === null || jsonContent === void 0 ? void 0 : jsonContent.scripts), { tailwind: 'tailwindcss -o style.css -c ./tailwind.config.js' });
|
|
72
|
+
file.content = JSON.stringify(jsonContent, null, 2);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
files.set('projectStyleSheet', {
|
|
76
|
+
path: path || ['src', 'teleporthq'],
|
|
77
|
+
files: [
|
|
78
|
+
__assign(__assign({}, projectSheet), { content: globalStyleSheet }),
|
|
79
|
+
],
|
|
80
|
+
});
|
|
69
81
|
files.set('tailwindConfig', {
|
|
70
82
|
files: [
|
|
71
83
|
{
|
|
@@ -81,9 +93,9 @@ var defaultTailwindModifier = function (structure, config, content, css) { retur
|
|
|
81
93
|
],
|
|
82
94
|
path: [''],
|
|
83
95
|
});
|
|
84
|
-
devDependencies.tailwindcss =
|
|
85
|
-
devDependencies.autoprefixer =
|
|
86
|
-
devDependencies.postcss =
|
|
96
|
+
devDependencies.tailwindcss = constants_1.TAILWIND;
|
|
97
|
+
devDependencies.autoprefixer = constants_1.AUTO_PREFIXER;
|
|
98
|
+
devDependencies.postcss = constants_1.POSTCSS;
|
|
87
99
|
return [2 /*return*/];
|
|
88
100
|
});
|
|
89
101
|
}); };
|
package/dist/cjs/default.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.js","sourceRoot":"","sources":["../../src/default.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"default.js","sourceRoot":"","sources":["../../src/default.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAAqD;AAErD,yCAA8D;AAEvD,IAAM,uBAAuB,GAAG,UAAO,MAA4B;;;;QAChE,SAAS,GAAwB,MAAM,UAA9B,EAAE,MAAM,GAAgB,MAAM,OAAtB,EAAE,GAAG,GAAW,MAAM,IAAjB,EAAE,IAAI,GAAK,MAAM,KAAX,CAAW;QACvC,KAAK,GAAkC,SAAS,MAA3C,EAAE,eAAe,GAAiB,SAAS,gBAA1B,EAAE,UAAU,GAAK,SAAS,WAAd,CAAc;QACxD,MAAM,CAAC,OAAO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ACE,IAAI,EAAE,iBAAiB;oBACvB,QAAQ,EAAE,yBAAQ,CAAC,EAAE;oBACrB,OAAO,EAAE,2BAAoB,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAE;iBAC/D;gBACD;oBACE,IAAI,EAAE,gBAAgB;oBACtB,QAAQ,EAAE,yBAAQ,CAAC,EAAE;oBACrB,OAAO,EAAE,yFAKd;iBACI;aACF;YACD,IAAI,EAAE,CAAC,EAAE,CAAC;SACX,CAAC,CAAA;QAEF,eAAe,CAAC,WAAW,GAAG,oBAAQ,CAAA;QACtC,eAAe,CAAC,YAAY,GAAG,yBAAa,CAAA;QAC5C,eAAe,CAAC,OAAO,GAAG,mBAAO,CAAA;;;KAClC,CAAA;AA9DY,QAAA,uBAAuB,2BA8DnC"}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import { ProjectPlugin, ProjectPluginStructure, ProjectType } from '@teleporthq/teleport-types';
|
|
2
|
-
declare type
|
|
2
|
+
export declare type SUPPORTED_TAILWIND_FRAMEWORKS = ProjectType.HTML | ProjectType.NEXT | ProjectType.REACT | ProjectType.VUE | ProjectType.NUXT | ProjectType.ANGULAR | ProjectType.PREACT | ProjectType.STENCIL;
|
|
3
|
+
export interface TailwindPluginParams {
|
|
4
|
+
structure: ProjectPluginStructure;
|
|
5
|
+
config: Record<string, unknown>;
|
|
6
|
+
css: string;
|
|
7
|
+
path?: string[];
|
|
8
|
+
}
|
|
3
9
|
export declare class ProjectPluginTailwind implements ProjectPlugin {
|
|
4
10
|
config: Record<string, unknown>;
|
|
5
|
-
content: string[];
|
|
6
11
|
css: string;
|
|
7
|
-
|
|
12
|
+
path: string[] | null;
|
|
13
|
+
framework: SUPPORTED_TAILWIND_FRAMEWORKS;
|
|
8
14
|
constructor(params: {
|
|
9
15
|
config?: Record<string, unknown>;
|
|
10
|
-
css
|
|
11
|
-
|
|
12
|
-
|
|
16
|
+
css?: string;
|
|
17
|
+
framework?: SUPPORTED_TAILWIND_FRAMEWORKS;
|
|
18
|
+
path?: string[];
|
|
13
19
|
});
|
|
14
20
|
runBefore(structure: ProjectPluginStructure): Promise<ProjectPluginStructure>;
|
|
15
21
|
runAfter(structure: ProjectPluginStructure): Promise<ProjectPluginStructure>;
|
|
16
22
|
}
|
|
17
|
-
export {};
|
package/dist/cjs/index.js
CHANGED
|
@@ -35,26 +35,63 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
35
35
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
38
41
|
var _a;
|
|
39
42
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
43
|
exports.ProjectPluginTailwind = void 0;
|
|
41
44
|
var teleport_types_1 = require("@teleporthq/teleport-types");
|
|
42
|
-
var
|
|
45
|
+
var next_1 = require("./next");
|
|
43
46
|
var default_1 = require("./default");
|
|
47
|
+
var react_1 = require("./react");
|
|
48
|
+
var vue_1 = require("./vue");
|
|
49
|
+
var angular_1 = require("./angular");
|
|
50
|
+
var nuxt_1 = require("./nuxt");
|
|
51
|
+
var preact_1 = require("./preact");
|
|
52
|
+
var stencil_1 = require("./stencil");
|
|
53
|
+
var teleport_plugin_css_1 = require("@teleporthq/teleport-plugin-css");
|
|
54
|
+
var teleport_plugin_react_app_routing_1 = require("@teleporthq/teleport-plugin-react-app-routing");
|
|
55
|
+
var teleport_plugin_import_statements_1 = __importDefault(require("@teleporthq/teleport-plugin-import-statements"));
|
|
44
56
|
var frameworkMap = (_a = {},
|
|
45
|
-
_a[teleport_types_1.ProjectType.NEXT] =
|
|
57
|
+
_a[teleport_types_1.ProjectType.NEXT] = next_1.nextJSTailwindModifier,
|
|
46
58
|
_a[teleport_types_1.ProjectType.HTML] = default_1.defaultTailwindModifier,
|
|
59
|
+
_a[teleport_types_1.ProjectType.REACT] = react_1.reactTailwindModifier,
|
|
60
|
+
_a[teleport_types_1.ProjectType.VUE] = vue_1.vueTailwindModifier,
|
|
61
|
+
_a[teleport_types_1.ProjectType.ANGULAR] = angular_1.angularTailwindModifier,
|
|
62
|
+
_a[teleport_types_1.ProjectType.NUXT] = nuxt_1.nuxtTailwindModifier,
|
|
63
|
+
_a[teleport_types_1.ProjectType.PREACT] = preact_1.preactTailwindModifier,
|
|
64
|
+
_a[teleport_types_1.ProjectType.STENCIL] = stencil_1.stencilTailwindModifier,
|
|
47
65
|
_a);
|
|
48
66
|
var ProjectPluginTailwind = /** @class */ (function () {
|
|
49
67
|
function ProjectPluginTailwind(params) {
|
|
68
|
+
var _a;
|
|
50
69
|
this.css = params.css;
|
|
70
|
+
this.css = (params === null || params === void 0 ? void 0 : params.css) || "@tailwind utilities;";
|
|
51
71
|
this.config = (params === null || params === void 0 ? void 0 : params.config) || {};
|
|
52
|
-
this.content = (params === null || params === void 0 ? void 0 : params.content) || ['./src/**/*.{vue,js,ts,jsx,tsx}'];
|
|
53
72
|
this.framework = (params === null || params === void 0 ? void 0 : params.framework) || teleport_types_1.ProjectType.HTML;
|
|
73
|
+
this.path = (_a = params === null || params === void 0 ? void 0 : params.path) !== null && _a !== void 0 ? _a : undefined;
|
|
54
74
|
}
|
|
55
75
|
ProjectPluginTailwind.prototype.runBefore = function (structure) {
|
|
56
76
|
return __awaiter(this, void 0, void 0, function () {
|
|
77
|
+
var strategy, rootFolder, styleSheetPlugin, routerPlugin;
|
|
57
78
|
return __generator(this, function (_a) {
|
|
79
|
+
if (this.framework === teleport_types_1.ProjectType.PREACT) {
|
|
80
|
+
strategy = structure.strategy, rootFolder = structure.rootFolder;
|
|
81
|
+
strategy.style = teleport_types_1.PreactStyleVariation.CSS;
|
|
82
|
+
styleSheetPlugin = (0, teleport_plugin_css_1.createStyleSheetPlugin)({
|
|
83
|
+
fileName: 'global-style',
|
|
84
|
+
});
|
|
85
|
+
routerPlugin = (0, teleport_plugin_react_app_routing_1.createReactAppRoutingPlugin)({ flavor: 'preact' });
|
|
86
|
+
strategy.projectStyleSheet.plugins = [styleSheetPlugin];
|
|
87
|
+
strategy.router.plugins = [routerPlugin, (0, teleport_plugin_css_1.createCSSPlugin)(), teleport_plugin_import_statements_1.default];
|
|
88
|
+
rootFolder.files.push({
|
|
89
|
+
name: 'preact.config',
|
|
90
|
+
fileType: teleport_types_1.FileType.JS,
|
|
91
|
+
content: "export default (config, env, helpers, options) => {\n const css = helpers.getLoadersByName(config, 'css-loader')[0];\n css.loader.options.modules = false;\n}",
|
|
92
|
+
});
|
|
93
|
+
return [2 /*return*/, structure];
|
|
94
|
+
}
|
|
58
95
|
return [2 /*return*/, structure];
|
|
59
96
|
});
|
|
60
97
|
});
|
|
@@ -69,7 +106,7 @@ var ProjectPluginTailwind = /** @class */ (function () {
|
|
|
69
106
|
if (!projectModifier) {
|
|
70
107
|
throw new Error("Requested ".concat(this.framework, " doesn't have a predefined modifier"));
|
|
71
108
|
}
|
|
72
|
-
return [4 /*yield*/, projectModifier(structure, this.config, this.
|
|
109
|
+
return [4 /*yield*/, projectModifier({ structure: structure, config: this.config, css: this.css, path: this.path })];
|
|
73
110
|
case 1:
|
|
74
111
|
_a.sent();
|
|
75
112
|
return [2 /*return*/, structure];
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAMmC;AACnC,+BAA+C;AAC/C,qCAAmD;AACnD,iCAA+C;AAC/C,6BAA2C;AAC3C,qCAAmD;AACnD,+BAA6C;AAC7C,mCAAiD;AACjD,qCAAmD;A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Q,EAAE,cAAc;qBACzB,CAAC,CAAA;oBACI,YAAY,GAAG,IAAA,+DAA2B,EAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAA;oBAEtE,QAAQ,CAAC,iBAAiB,CAAC,OAAO,GAAG,CAAC,gBAAgB,CAAC,CAAA;oBACvD,QAAQ,CAAC,MAAM,CAAC,OAAO,GAAG,CAAC,YAAY,EAAE,IAAA,qCAAe,GAAE,EAAE,2CAAsB,CAAC,CAAA;oBAEnF,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC;wBACpB,IAAI,EAAE,eAAe;wBACrB,QAAQ,EAAE,yBAAQ,CAAC,EAAE;wBACrB,OAAO,EAAE,qKAGf;qBACK,CAAC,CAAA;oBAEF,sBAAO,SAAS,EAAA;iBACjB;gBAED,sBAAO,SAAS,EAAA;;;KACjB;IAEK,wCAAQ,GAAd,UAAe,SAAiC;;;;;;wBACxC,eAAe,GAAG,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;wBACpD,IAAI,CAAC,eAAe,EAAE;4BACpB,MAAM,IAAI,KAAK,CAAC,oBAAa,IAAI,CAAC,SAAS,wCAAqC,CAAC,CAAA;yBAClF;wBACD,qBAAM,eAAe,CAAC,EAAE,SAAS,WAAA,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,EAAA;;wBAAzF,SAAyF,CAAA;wBACzF,sBAAO,SAAS,EAAA;;;;KACjB;IACH,4BAAC;AAAD,CAAC,AAtDD,IAsDC;AAtDY,sDAAqB"}
|
|
@@ -58,18 +58,20 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
58
58
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59
59
|
exports.nextJSTailwindModifier = void 0;
|
|
60
60
|
var teleport_types_1 = require("@teleporthq/teleport-types");
|
|
61
|
-
var
|
|
62
|
-
|
|
61
|
+
var constants_1 = require("./constants");
|
|
62
|
+
var nextJSTailwindModifier = function (params) { return __awaiter(void 0, void 0, void 0, function () {
|
|
63
|
+
var structure, config, css, path, files, devDependencies, projectSheet, rootFolder, rootFile;
|
|
63
64
|
var _a;
|
|
64
65
|
return __generator(this, function (_b) {
|
|
66
|
+
structure = params.structure, config = params.config, css = params.css, path = params.path;
|
|
65
67
|
files = structure.files, devDependencies = structure.devDependencies;
|
|
66
|
-
config.content =
|
|
68
|
+
config.content = ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'];
|
|
67
69
|
projectSheet = (_a = files
|
|
68
70
|
.get('projectStyleSheet')) === null || _a === void 0 ? void 0 : _a.files.find(function (file) { return file.name === 'style' && file.fileType === teleport_types_1.FileType.CSS; });
|
|
69
71
|
if (projectSheet) {
|
|
70
72
|
files.delete('projectStyleSheet');
|
|
71
73
|
files.set('projectStyleSheet', {
|
|
72
|
-
path: ['pages'],
|
|
74
|
+
path: path || ['pages'],
|
|
73
75
|
files: [
|
|
74
76
|
__assign(__assign({}, projectSheet), { content: "".concat(css, "\n").concat(projectSheet.content) }),
|
|
75
77
|
],
|
|
@@ -84,7 +86,7 @@ var nextJSTailwindModifier = function (structure, config, content, css) { return
|
|
|
84
86
|
files.delete('_app');
|
|
85
87
|
files.set('_app', {
|
|
86
88
|
files: __spreadArray(__spreadArray([], ((rootFolder === null || rootFolder === void 0 ? void 0 : rootFolder.files) || []).filter(function (file) { return file.name !== '_app' && file.fileType === teleport_types_1.FileType.JS; }), true), [
|
|
87
|
-
__assign(__assign({}, rootFile), { content: "import \"./global.css\"\n".concat(rootFile.content) }),
|
|
89
|
+
__assign(__assign({}, rootFile), { content: "import \"./global.css\" \n \n ".concat(rootFile.content) }),
|
|
88
90
|
], false),
|
|
89
91
|
path: ['pages'],
|
|
90
92
|
});
|
|
@@ -114,11 +116,11 @@ var nextJSTailwindModifier = function (structure, config, content, css) { return
|
|
|
114
116
|
],
|
|
115
117
|
path: [''],
|
|
116
118
|
});
|
|
117
|
-
devDependencies.tailwindcss =
|
|
118
|
-
devDependencies.autoprefixer =
|
|
119
|
-
devDependencies.postcss =
|
|
119
|
+
devDependencies.tailwindcss = constants_1.TAILWIND;
|
|
120
|
+
devDependencies.autoprefixer = constants_1.AUTO_PREFIXER;
|
|
121
|
+
devDependencies.postcss = constants_1.POSTCSS;
|
|
120
122
|
return [2 /*return*/];
|
|
121
123
|
});
|
|
122
124
|
}); };
|
|
123
125
|
exports.nextJSTailwindModifier = nextJSTailwindModifier;
|
|
124
|
-
//# sourceMappingURL=
|
|
126
|
+
//# sourceMappingURL=next.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"next.js","sourceRoot":"","sources":["../../src/next.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAAqD;AAErD,yCAA8D;AAEvD,IAAM,sBAAsB,GAAG,UAAO,MAA4B;;;;QAC/D,SAAS,GAAwB,MAAM,UAA9B,EAAE,MAAM,GAAgB,MAAM,OAAtB,EAAE,GAAG,GAAW,MAAM,IAAjB,EAAE,IAAI,GAAK,MAAM,KAAX,CAAW;QACvC,KAAK,GAAsB,SAAS,MAA/B,EAAE,eAAe,GAAK,SAAS,gBAAd,CAAc;QAC5C,MAAM,CAAC,OAAO,GAAG,CAAC,8BAA8B,EAAE,mCAAmC,CAAC,CAAA;QAEhF,YAAY,GAAG,MAAA,KAAK;aACvB,GAAG,CAAC,mBAAmB,CAAC,0CACvB,KAAK,CAAC,IAAI,CAAC,UAAC,IAAI,IAAK,OAAA,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,IAAI,CAAC,QAAQ,KAAK,yBAAQ,CAAC,GAAG,EAAvD,CAAuD,CAAC,CAAA;QAEjF,IAAI,YAAY,EAAE;YAChB,KAAK,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAA;YACjC,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AC;aAChB,CAAC,CAAA;SACH;QAED,KAAK,CAAC,GAAG,CAAC,gBAAgB,EAAE;YAC1B,KAAK,EAAE;gBACL;oBACE,IAAI,EAAE,iBAAiB;oBACvB,QAAQ,EAAE,yBAAQ,CAAC,EAAE;oBACrB,OAAO,EAAE,2BAAoB,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAE;iBAC/D;gBACD;oBACE,IAAI,EAAE,gBAAgB;oBACtB,QAAQ,EAAE,yBAAQ,CAAC,EAAE;oBACrB,OAAO,EAAE,yFAKd;iBACI;aACF;YACD,IAAI,EAAE,CAAC,EAAE,CAAC;SACX,CAAC,CAAA;QAEF,eAAe,CAAC,WAAW,GAAG,oBAAQ,CAAA;QACtC,eAAe,CAAC,YAAY,GAAG,yBAAa,CAAA;QAC5C,eAAe,CAAC,OAAO,GAAG,mBAAO,CAAA;;;KAClC,CAAA;AA/EY,QAAA,sBAAsB,0BA+ElC"}
|
package/dist/cjs/nuxt.js
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (_) try {
|
|
29
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
+
exports.nuxtTailwindModifier = void 0;
|
|
51
|
+
var teleport_types_1 = require("@teleporthq/teleport-types");
|
|
52
|
+
var constants_1 = require("./constants");
|
|
53
|
+
var nuxtTailwindModifier = function (params) { return __awaiter(void 0, void 0, void 0, function () {
|
|
54
|
+
var structure, config, css, path, devDependencies, files, projectSheet, globalStyleSheet;
|
|
55
|
+
var _a;
|
|
56
|
+
return __generator(this, function (_b) {
|
|
57
|
+
structure = params.structure, config = params.config, css = params.css, path = params.path;
|
|
58
|
+
devDependencies = structure.devDependencies, files = structure.files;
|
|
59
|
+
config.content = [
|
|
60
|
+
'./components/**/*.{js,vue,ts}',
|
|
61
|
+
'./layouts/**/*.vue',
|
|
62
|
+
'./pages/**/*.vue',
|
|
63
|
+
'./plugins/**/*.{js,ts}',
|
|
64
|
+
'./nuxt.config.{js,ts}',
|
|
65
|
+
];
|
|
66
|
+
projectSheet = (_a = files
|
|
67
|
+
.get('projectStyleSheet')) === null || _a === void 0 ? void 0 : _a.files.find(function (file) { return file.name === 'style' && file.fileType === teleport_types_1.FileType.CSS; });
|
|
68
|
+
globalStyleSheet = css;
|
|
69
|
+
if (projectSheet) {
|
|
70
|
+
files.delete('projectStyleSheet');
|
|
71
|
+
globalStyleSheet = "".concat(globalStyleSheet, " \n \n ").concat(projectSheet.content);
|
|
72
|
+
}
|
|
73
|
+
files.set('projectStyleSheet', {
|
|
74
|
+
path: path || [''],
|
|
75
|
+
files: [
|
|
76
|
+
__assign(__assign({}, projectSheet), { content: globalStyleSheet }),
|
|
77
|
+
],
|
|
78
|
+
});
|
|
79
|
+
files.set('tailwindConfig', {
|
|
80
|
+
files: [
|
|
81
|
+
{
|
|
82
|
+
name: 'tailwind.config',
|
|
83
|
+
fileType: teleport_types_1.FileType.JS,
|
|
84
|
+
content: "module.exports = ".concat(JSON.stringify(config, null, 2)),
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
path: [''],
|
|
88
|
+
});
|
|
89
|
+
if (files.get('nuxt.config')) {
|
|
90
|
+
files.delete('nuxt.config');
|
|
91
|
+
}
|
|
92
|
+
files.set('nuxt.config', {
|
|
93
|
+
path: [''],
|
|
94
|
+
files: [
|
|
95
|
+
{
|
|
96
|
+
name: 'nuxt.config',
|
|
97
|
+
fileType: teleport_types_1.FileType.JS,
|
|
98
|
+
content: "export default {\n css: [\"~/style.css\"],\n buildModules: [\"@nuxt/postcss8\"],\n build: {\n postcss: {\n plugins: {\n tailwindcss: {},\n autoprefixer: {},\n },\n },\n },\n};",
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
});
|
|
102
|
+
devDependencies.autoprefixer = constants_1.AUTO_PREFIXER;
|
|
103
|
+
devDependencies.postcss = constants_1.POSTCSS;
|
|
104
|
+
devDependencies.tailwindcss = constants_1.TAILWIND;
|
|
105
|
+
devDependencies['@nuxt/postcss8'] = '^1.1.3';
|
|
106
|
+
return [2 /*return*/];
|
|
107
|
+
});
|
|
108
|
+
}); };
|
|
109
|
+
exports.nuxtTailwindModifier = nuxtTailwindModifier;
|
|
110
|
+
//# sourceMappingURL=nuxt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nuxt.js","sourceRoot":"","sources":["../../src/nuxt.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAAqD;AAErD,yCAA8D;AAEvD,IAAM,oBAAoB,GAAG,UAAO,MAA4B;;;;QAC7D,SAAS,GAAwB,MAAM,UAA9B,EAAE,MAAM,GAAgB,MAAM,OAAtB,EAAE,GAAG,GAAW,MAAM,IAAjB,EAAE,IAAI,GAAK,MAAM,KAAX,CAAW;Q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E,CAAC,EAAE,CAAC;YACV,KAAK,EAAE;gBACL;oBACE,IAAI,EAAE,aAAa;oBACnB,QAAQ,EAAE,yBAAQ,CAAC,EAAE;oBACrB,OAAO,EAAE,mNAWd;iBACI;aACF;SACF,CAAC,CAAA;QAEF,eAAe,CAAC,YAAY,GAAG,yBAAa,CAAA;QAC5C,eAAe,CAAC,OAAO,GAAG,mBAAO,CAAA;QACjC,eAAe,CAAC,WAAW,GAAG,oBAAQ,CAAA;QACtC,eAAe,CAAC,gBAAgB,CAAC,GAAG,QAAQ,CAAA;;;KAC7C,CAAA;AAxEY,QAAA,oBAAoB,wBAwEhC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (_) try {
|
|
29
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
+
exports.preactTailwindModifier = void 0;
|
|
51
|
+
var teleport_types_1 = require("@teleporthq/teleport-types");
|
|
52
|
+
var constants_1 = require("./constants");
|
|
53
|
+
var preactTailwindModifier = function (params) { return __awaiter(void 0, void 0, void 0, function () {
|
|
54
|
+
var structure, config, css, path, files, devDependencies, projectSheet, globalStyleSheet;
|
|
55
|
+
var _a;
|
|
56
|
+
return __generator(this, function (_b) {
|
|
57
|
+
structure = params.structure, config = params.config, css = params.css, path = params.path;
|
|
58
|
+
files = structure.files, devDependencies = structure.devDependencies;
|
|
59
|
+
config.content = ['./src/**/*.{js,ts,jsx,tsx}'];
|
|
60
|
+
projectSheet = (_a = files
|
|
61
|
+
.get('projectStyleSheet')) === null || _a === void 0 ? void 0 : _a.files.find(function (file) { return file.name === 'global-style' && file.fileType === teleport_types_1.FileType.CSS; });
|
|
62
|
+
globalStyleSheet = css;
|
|
63
|
+
if (projectSheet) {
|
|
64
|
+
files.delete('projectStyleSheet');
|
|
65
|
+
globalStyleSheet = "".concat(globalStyleSheet, " \n \n ").concat(projectSheet.content);
|
|
66
|
+
}
|
|
67
|
+
files.set('projectStyleSheet', {
|
|
68
|
+
path: path || ['src'],
|
|
69
|
+
files: [
|
|
70
|
+
__assign(__assign({}, projectSheet), { content: globalStyleSheet }),
|
|
71
|
+
],
|
|
72
|
+
});
|
|
73
|
+
files.set('tailwindConfig', {
|
|
74
|
+
files: [
|
|
75
|
+
{
|
|
76
|
+
name: 'tailwind.config',
|
|
77
|
+
fileType: teleport_types_1.FileType.JS,
|
|
78
|
+
content: "module.exports = ".concat(JSON.stringify(config, null, 2)),
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: 'postcss.config',
|
|
82
|
+
fileType: teleport_types_1.FileType.JS,
|
|
83
|
+
content: "module.exports = {\n plugins: {\n tailwindcss: {},\n autoprefixer: {},\n },\n};",
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
path: [''],
|
|
87
|
+
});
|
|
88
|
+
devDependencies.tailwindcss = constants_1.TAILWIND;
|
|
89
|
+
devDependencies.autoprefixer = constants_1.AUTO_PREFIXER;
|
|
90
|
+
devDependencies.postcss = constants_1.POSTCSS;
|
|
91
|
+
return [2 /*return*/];
|
|
92
|
+
});
|
|
93
|
+
}); };
|
|
94
|
+
exports.preactTailwindModifier = preactTailwindModifier;
|
|
95
|
+
//# sourceMappingURL=preact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preact.js","sourceRoot":"","sources":["../../src/preact.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAAqD;AAErD,yCAA8D;AAEvD,IAAM,sBAAsB,GAAG,UAAO,MAA4B;;;;QAC/D,SAAS,GAAwB,MAAM,UAA9B,EAAE,MAAM,GAAgB,MAAM,OAAtB,EAAE,GAAG,GAAW,MAAM,IAAjB,EAAE,IAAI,GAAK,MAAM,KAAX,CAAW;QACvC,KAAK,GAAsB,SAAS,MAA/B,EAAE,eAAe,GAAK,SAAS,gBAAd,CAAc;QAC5C,MAAM,CAAC,OAAO,GAAG,CAAC,4BAA4B,CAAC,CAAA;QAEzC,YAAY,GAAG,MAAA,KAAK;aACvB,GAAG,CAAC,mBAAmB,CAAC,0CACvB,KAAK,CAAC,IAAI,CAAC,UAAC,IAAI,IAAK,OAAA,IAAI,CAAC,IAAI,KAAK,cAAc,IAAI,IAAI,CAAC,QAAQ,KAAK,yBAAQ,CAAC,GAAG,EAA9D,CAA8D,CAAC,CAAA;QACpF,gBAAgB,GAAG,GAAG,CAAA;QAE1B,IAAI,YAAY,EAAE;YAChB,KAAK,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAA;YACjC,gBAAgB,GAAG,UAAG,gBAAgB,oBAAU,YAAY,CAAC,OAAO,CAAE,CAAA;SACvE;QAED,KAAK,CAAC,GAAG,CAAC,mBAAmB,EAAE;YAC7B,IAAI,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC;YACrB,KAAK,EAAE;sCAEA,YAAY,KACf,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