@teleporthq/teleport-project-plugin-tailwind 0.25.4 → 0.26.5

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.
Files changed (54) hide show
  1. package/dist/cjs/angular.d.ts +1 -0
  2. package/dist/cjs/angular.d.ts.map +1 -0
  3. package/dist/cjs/constants.d.ts +1 -0
  4. package/dist/cjs/constants.d.ts.map +1 -0
  5. package/dist/cjs/default.d.ts +1 -0
  6. package/dist/cjs/default.d.ts.map +1 -0
  7. package/dist/cjs/index.d.ts +2 -1
  8. package/dist/cjs/index.d.ts.map +1 -0
  9. package/dist/cjs/index.js +0 -27
  10. package/dist/cjs/index.js.map +1 -1
  11. package/dist/cjs/next.d.ts +1 -0
  12. package/dist/cjs/next.d.ts.map +1 -0
  13. package/dist/cjs/nuxt.d.ts +1 -0
  14. package/dist/cjs/nuxt.d.ts.map +1 -0
  15. package/dist/cjs/react.d.ts +1 -0
  16. package/dist/cjs/react.d.ts.map +1 -0
  17. package/dist/cjs/tsconfig.tsbuildinfo +1 -1
  18. package/dist/cjs/vue.d.ts +1 -0
  19. package/dist/cjs/vue.d.ts.map +1 -0
  20. package/dist/esm/angular.d.ts +1 -0
  21. package/dist/esm/angular.d.ts.map +1 -0
  22. package/dist/esm/constants.d.ts +1 -0
  23. package/dist/esm/constants.d.ts.map +1 -0
  24. package/dist/esm/default.d.ts +1 -0
  25. package/dist/esm/default.d.ts.map +1 -0
  26. package/dist/esm/index.d.ts +2 -1
  27. package/dist/esm/index.d.ts.map +1 -0
  28. package/dist/esm/index.js +1 -25
  29. package/dist/esm/index.js.map +1 -1
  30. package/dist/esm/next.d.ts +1 -0
  31. package/dist/esm/next.d.ts.map +1 -0
  32. package/dist/esm/nuxt.d.ts +1 -0
  33. package/dist/esm/nuxt.d.ts.map +1 -0
  34. package/dist/esm/react.d.ts +1 -0
  35. package/dist/esm/react.d.ts.map +1 -0
  36. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  37. package/dist/esm/vue.d.ts +1 -0
  38. package/dist/esm/vue.d.ts.map +1 -0
  39. package/package.json +6 -6
  40. package/src/index.ts +1 -39
  41. package/dist/cjs/preact.d.ts +0 -2
  42. package/dist/cjs/preact.js +0 -95
  43. package/dist/cjs/preact.js.map +0 -1
  44. package/dist/cjs/stencil.d.ts +0 -2
  45. package/dist/cjs/stencil.js +0 -102
  46. package/dist/cjs/stencil.js.map +0 -1
  47. package/dist/esm/preact.d.ts +0 -2
  48. package/dist/esm/preact.js +0 -91
  49. package/dist/esm/preact.js.map +0 -1
  50. package/dist/esm/stencil.d.ts +0 -2
  51. package/dist/esm/stencil.js +0 -98
  52. package/dist/esm/stencil.js.map +0 -1
  53. package/src/preact.ts +0 -54
  54. package/src/stencil.ts +0 -84
package/src/index.ts CHANGED
@@ -1,21 +1,10 @@
1
- import {
2
- FileType,
3
- PreactStyleVariation,
4
- ProjectPlugin,
5
- ProjectPluginStructure,
6
- ProjectType,
7
- } from '@teleporthq/teleport-types'
1
+ import { ProjectPlugin, ProjectPluginStructure, ProjectType } from '@teleporthq/teleport-types'
8
2
  import { nextJSTailwindModifier } from './next'
9
3
  import { defaultTailwindModifier } from './default'
10
4
  import { reactTailwindModifier } from './react'
11
5
  import { vueTailwindModifier } from './vue'
12
6
  import { angularTailwindModifier } from './angular'
13
7
  import { nuxtTailwindModifier } from './nuxt'
14
- import { preactTailwindModifier } from './preact'
15
- import { stencilTailwindModifier } from './stencil'
16
- import { createCSSPlugin, createStyleSheetPlugin } from '@teleporthq/teleport-plugin-css'
17
- import { createReactAppRoutingPlugin } from '@teleporthq/teleport-plugin-react-app-routing'
18
- import importStatementsPlugin from '@teleporthq/teleport-plugin-import-statements'
19
8
 
20
9
  export type SUPPORTED_TAILWIND_FRAMEWORKS =
21
10
  | ProjectType.HTML
@@ -24,8 +13,6 @@ export type SUPPORTED_TAILWIND_FRAMEWORKS =
24
13
  | ProjectType.VUE
25
14
  | ProjectType.NUXT
26
15
  | ProjectType.ANGULAR
27
- | ProjectType.PREACT
28
- | ProjectType.STENCIL
29
16
 
30
17
  export interface TailwindPluginParams {
31
18
  structure: ProjectPluginStructure
@@ -44,8 +31,6 @@ const frameworkMap: Record<
44
31
  [ProjectType.VUE]: vueTailwindModifier,
45
32
  [ProjectType.ANGULAR]: angularTailwindModifier,
46
33
  [ProjectType.NUXT]: nuxtTailwindModifier,
47
- [ProjectType.PREACT]: preactTailwindModifier,
48
- [ProjectType.STENCIL]: stencilTailwindModifier,
49
34
  }
50
35
 
51
36
  export class ProjectPluginTailwind implements ProjectPlugin {
@@ -68,29 +53,6 @@ export class ProjectPluginTailwind implements ProjectPlugin {
68
53
  }
69
54
 
70
55
  async runBefore(structure: ProjectPluginStructure) {
71
- if (this.framework === ProjectType.PREACT) {
72
- const { strategy, rootFolder } = structure
73
- strategy.style = PreactStyleVariation.CSS
74
- const styleSheetPlugin = createStyleSheetPlugin({
75
- fileName: 'global-style',
76
- })
77
- const routerPlugin = createReactAppRoutingPlugin({ flavor: 'preact' })
78
-
79
- strategy.projectStyleSheet.plugins = [styleSheetPlugin]
80
- strategy.router.plugins = [routerPlugin, createCSSPlugin(), importStatementsPlugin]
81
-
82
- rootFolder.files.push({
83
- name: 'preact.config',
84
- fileType: FileType.JS,
85
- content: `export default (config, env, helpers, options) => {
86
- const css = helpers.getLoadersByName(config, 'css-loader')[0];
87
- css.loader.options.modules = false;
88
- }`,
89
- })
90
-
91
- return structure
92
- }
93
-
94
56
  return structure
95
57
  }
96
58
 
@@ -1,2 +0,0 @@
1
- import { TailwindPluginParams } from '.';
2
- export declare const preactTailwindModifier: (params: TailwindPluginParams) => Promise<void>;
@@ -1,95 +0,0 @@
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
- //# s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AE,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;AAjDY,QAAA,sBAAsB,0BAiDlC"}
@@ -1,2 +0,0 @@
1
- import { TailwindPluginParams } from '.';
2
- export declare const stencilTailwindModifier: (params: TailwindPluginParams) => Promise<void>;
@@ -1,102 +0,0 @@
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.stencilTailwindModifier = void 0;
51
- var teleport_types_1 = require("@teleporthq/teleport-types");
52
- var constants_1 = require("./constants");
53
- var stencilTailwindModifier = 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/**/*.{ts,tsx,html}'];
60
- projectSheet = (_a = files
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;
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
- path: [''],
82
- });
83
- files.delete('stencil.config');
84
- files.set('stencil.config', {
85
- files: [
86
- {
87
- name: 'stencil.config',
88
- fileType: teleport_types_1.FileType.TS,
89
- content: "import { Config } from \"@stencil/core\";\nimport tailwind, { tailwindHMR } from \"stencil-tailwind-plugin\";\nimport tailwindConfig from \"./tailwind.config\";\nimport autoprefixer from \"autoprefixer\";\n\nexport const config: Config = {\n namespace: \"app\",\n globalStyle: \"src/style.css\",\n outputTargets: [\n {\n type: \"www\",\n // comment the following line to disable service workers in production\n serviceWorker: null,\n baseUrl: \"https://myapp.local/\",\n },\n ],\n plugins: [\n tailwind({\n // @ts-ignore\n tailwindConfig,\n tailwindCssContents: '@tailwind utilities;',\n postcss: {\n plugins: [autoprefixer()],\n },\n }),\n tailwindHMR(),\n ],\n};",
90
- },
91
- ],
92
- path: [''],
93
- });
94
- devDependencies.tailwindcss = constants_1.TAILWIND;
95
- devDependencies.autoprefixer = constants_1.AUTO_PREFIXER;
96
- devDependencies.postcss = constants_1.POSTCSS;
97
- devDependencies['stencil-tailwind-plugin'] = '^1.3.0';
98
- return [2 /*return*/];
99
- });
100
- }); };
101
- exports.stencilTailwindModifier = stencilTailwindModifier;
102
- //# sourceMappingURL=stencil.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stencil.js","sourceR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CAAC,CAAC,CAAE;iBAC/D;aACF;YACD,IAAI,EAAE,CAAC,EAAE,CAAC;SACX,CAAC,CAAA;QAEF,KAAK,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAA;QAC9B,KAAK,CAAC,GAAG,CAAC,gBAAgB,EAAE;YAC1B,KAAK,EAAE;gBACL;oBACE,IAAI,EAAE,gBAAgB;oBACtB,QAAQ,EAAE,yBAAQ,CAAC,EAAE;oBACrB,OAAO,EAAE,muBA2Bd;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;QACjC,eAAe,CAAC,yBAAyB,CAAC,GAAG,QAAQ,CAAA;;;KACtD,CAAA;AA/EY,QAAA,uBAAuB,2BA+EnC"}
@@ -1,2 +0,0 @@
1
- import { TailwindPluginParams } from '.';
2
- export declare const preactTailwindModifier: (params: TailwindPluginParams) => Promise<void>;
@@ -1,91 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
- return new (P || (P = Promise))(function (resolve, reject) {
15
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
- step((generator = generator.apply(thisArg, _arguments || [])).next());
19
- });
20
- };
21
- var __generator = (this && this.__generator) || function (thisArg, body) {
22
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
- function verb(n) { return function (v) { return step([n, v]); }; }
25
- function step(op) {
26
- if (f) throw new TypeError("Generator is already executing.");
27
- while (_) try {
28
- 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;
29
- if (y = 0, t) op = [op[0] & 2, t.value];
30
- switch (op[0]) {
31
- case 0: case 1: t = op; break;
32
- case 4: _.label++; return { value: op[1], done: false };
33
- case 5: _.label++; y = op[1]; op = [0]; continue;
34
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
- default:
36
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
- if (t[2]) _.ops.pop();
41
- _.trys.pop(); continue;
42
- }
43
- op = body.call(thisArg, _);
44
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
- }
47
- };
48
- import { FileType } from '@teleporthq/teleport-types';
49
- import { AUTO_PREFIXER, POSTCSS, TAILWIND } from './constants';
50
- export var preactTailwindModifier = function (params) { return __awaiter(void 0, void 0, void 0, function () {
51
- var structure, config, css, path, files, devDependencies, projectSheet, globalStyleSheet;
52
- var _a;
53
- return __generator(this, function (_b) {
54
- structure = params.structure, config = params.config, css = params.css, path = params.path;
55
- files = structure.files, devDependencies = structure.devDependencies;
56
- config.content = ['./src/**/*.{js,ts,jsx,tsx}'];
57
- projectSheet = (_a = files
58
- .get('projectStyleSheet')) === null || _a === void 0 ? void 0 : _a.files.find(function (file) { return file.name === 'global-style' && file.fileType === FileType.CSS; });
59
- globalStyleSheet = css;
60
- if (projectSheet) {
61
- files.delete('projectStyleSheet');
62
- globalStyleSheet = "".concat(globalStyleSheet, " \n \n ").concat(projectSheet.content);
63
- }
64
- files.set('projectStyleSheet', {
65
- path: path || ['src'],
66
- files: [
67
- __assign(__assign({}, projectSheet), { content: globalStyleSheet }),
68
- ],
69
- });
70
- files.set('tailwindConfig', {
71
- files: [
72
- {
73
- name: 'tailwind.config',
74
- fileType: FileType.JS,
75
- content: "module.exports = ".concat(JSON.stringify(config, null, 2)),
76
- },
77
- {
78
- name: 'postcss.config',
79
- fileType: FileType.JS,
80
- content: "module.exports = {\n plugins: {\n tailwindcss: {},\n autoprefixer: {},\n },\n};",
81
- },
82
- ],
83
- path: [''],
84
- });
85
- devDependencies.tailwindcss = TAILWIND;
86
- devDependencies.autoprefixer = AUTO_PREFIXER;
87
- devDependencies.postcss = POSTCSS;
88
- return [2 /*return*/];
89
- });
90
- }); };
91
- //# sourceMappingURL=preact.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"preact.js","sourceRoot":"","sources":["../../src/preact.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAErD,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE9D,MAAM,CAAC,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,KAA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GAAG,OAAO,CAAA;;;KAClC,CAAA"}
@@ -1,2 +0,0 @@
1
- import { TailwindPluginParams } from '.';
2
- export declare const stencilTailwindModifier: (params: TailwindPluginParams) => Promise<void>;
@@ -1,98 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
- return new (P || (P = Promise))(function (resolve, reject) {
15
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
- step((generator = generator.apply(thisArg, _arguments || [])).next());
19
- });
20
- };
21
- var __generator = (this && this.__generator) || function (thisArg, body) {
22
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
- function verb(n) { return function (v) { return step([n, v]); }; }
25
- function step(op) {
26
- if (f) throw new TypeError("Generator is already executing.");
27
- while (_) try {
28
- 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;
29
- if (y = 0, t) op = [op[0] & 2, t.value];
30
- switch (op[0]) {
31
- case 0: case 1: t = op; break;
32
- case 4: _.label++; return { value: op[1], done: false };
33
- case 5: _.label++; y = op[1]; op = [0]; continue;
34
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
- default:
36
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
- if (t[2]) _.ops.pop();
41
- _.trys.pop(); continue;
42
- }
43
- op = body.call(thisArg, _);
44
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
- }
47
- };
48
- import { FileType } from '@teleporthq/teleport-types';
49
- import { AUTO_PREFIXER, POSTCSS, TAILWIND } from './constants';
50
- export var stencilTailwindModifier = function (params) { return __awaiter(void 0, void 0, void 0, function () {
51
- var structure, config, css, path, files, devDependencies, projectSheet, globalStyleSheet;
52
- var _a;
53
- return __generator(this, function (_b) {
54
- structure = params.structure, config = params.config, css = params.css, path = params.path;
55
- files = structure.files, devDependencies = structure.devDependencies;
56
- config.content = ['./src/**/*.{ts,tsx,html}'];
57
- projectSheet = (_a = files
58
- .get('projectStyleSheet')) === null || _a === void 0 ? void 0 : _a.files.find(function (file) { return file.name === 'style' && file.fileType === FileType.CSS; });
59
- globalStyleSheet = css;
60
- if (projectSheet) {
61
- files.delete('projectStyleSheet');
62
- globalStyleSheet = "".concat(globalStyleSheet, " \n \n ").concat(projectSheet.content);
63
- }
64
- files.set('projectStyleSheet', {
65
- path: path || ['src'],
66
- files: [
67
- __assign(__assign({}, projectSheet), { content: globalStyleSheet }),
68
- ],
69
- });
70
- files.set('tailwindConfig', {
71
- files: [
72
- {
73
- name: 'tailwind.config',
74
- fileType: FileType.JS,
75
- content: "module.exports = ".concat(JSON.stringify(config, null, 2)),
76
- },
77
- ],
78
- path: [''],
79
- });
80
- files.delete('stencil.config');
81
- files.set('stencil.config', {
82
- files: [
83
- {
84
- name: 'stencil.config',
85
- fileType: FileType.TS,
86
- content: "import { Config } from \"@stencil/core\";\nimport tailwind, { tailwindHMR } from \"stencil-tailwind-plugin\";\nimport tailwindConfig from \"./tailwind.config\";\nimport autoprefixer from \"autoprefixer\";\n\nexport const config: Config = {\n namespace: \"app\",\n globalStyle: \"src/style.css\",\n outputTargets: [\n {\n type: \"www\",\n // comment the following line to disable service workers in production\n serviceWorker: null,\n baseUrl: \"https://myapp.local/\",\n },\n ],\n plugins: [\n tailwind({\n // @ts-ignore\n tailwindConfig,\n tailwindCssContents: '@tailwind utilities;',\n postcss: {\n plugins: [autoprefixer()],\n },\n }),\n tailwindHMR(),\n ],\n};",
87
- },
88
- ],
89
- path: [''],
90
- });
91
- devDependencies.tailwindcss = TAILWIND;
92
- devDependencies.autoprefixer = AUTO_PREFIXER;
93
- devDependencies.postcss = POSTCSS;
94
- devDependencies['stencil-tailwind-plugin'] = '^1.3.0';
95
- return [2 /*return*/];
96
- });
97
- }); };
98
- //# sourceMappingURL=stencil.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stencil.js","sourceRoot":"","sources":["../../src/stencil.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAErD,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE9D,MAAM,CAAC,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,GAAsB,SAAS,MAA/B,EAAE,eAAe,GAAK,SAAS,gBAAd,CAAc;QAC5C,MAAM,CAAC,OAAO,GAAG,CAAC,0BAA0B,CA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YAAY,GAAG,aAAa,CAAA;QAC5C,eAAe,CAAC,OAAO,GAAG,OAAO,CAAA;QACjC,eAAe,CAAC,yBAAyB,CAAC,GAAG,QAAQ,CAAA;;;KACtD,CAAA"}
package/src/preact.ts DELETED
@@ -1,54 +0,0 @@
1
- import { FileType } from '@teleporthq/teleport-types'
2
- import { TailwindPluginParams } from '.'
3
- import { AUTO_PREFIXER, POSTCSS, TAILWIND } from './constants'
4
-
5
- export const preactTailwindModifier = async (params: TailwindPluginParams) => {
6
- const { structure, config, css, path } = params
7
- const { files, devDependencies } = structure
8
- config.content = ['./src/**/*.{js,ts,jsx,tsx}']
9
-
10
- const projectSheet = files
11
- .get('projectStyleSheet')
12
- ?.files.find((file) => file.name === 'global-style' && file.fileType === FileType.CSS)
13
- let globalStyleSheet = css
14
-
15
- if (projectSheet) {
16
- files.delete('projectStyleSheet')
17
- globalStyleSheet = `${globalStyleSheet} \n \n ${projectSheet.content}`
18
- }
19
-
20
- files.set('projectStyleSheet', {
21
- path: path || ['src'],
22
- files: [
23
- {
24
- ...projectSheet,
25
- content: globalStyleSheet,
26
- },
27
- ],
28
- })
29
-
30
- files.set('tailwindConfig', {
31
- files: [
32
- {
33
- name: 'tailwind.config',
34
- fileType: FileType.JS,
35
- content: `module.exports = ${JSON.stringify(config, null, 2)}`,
36
- },
37
- {
38
- name: 'postcss.config',
39
- fileType: FileType.JS,
40
- content: `module.exports = {
41
- plugins: {
42
- tailwindcss: {},
43
- autoprefixer: {},
44
- },
45
- };`,
46
- },
47
- ],
48
- path: [''],
49
- })
50
-
51
- devDependencies.tailwindcss = TAILWIND
52
- devDependencies.autoprefixer = AUTO_PREFIXER
53
- devDependencies.postcss = POSTCSS
54
- }
package/src/stencil.ts DELETED
@@ -1,84 +0,0 @@
1
- import { FileType } from '@teleporthq/teleport-types'
2
- import { TailwindPluginParams } from '.'
3
- import { AUTO_PREFIXER, POSTCSS, TAILWIND } from './constants'
4
-
5
- export const stencilTailwindModifier = async (params: TailwindPluginParams) => {
6
- const { structure, config, css, path } = params
7
- const { files, devDependencies } = structure
8
- config.content = ['./src/**/*.{ts,tsx,html}']
9
-
10
- const projectSheet = files
11
- .get('projectStyleSheet')
12
- ?.files.find((file) => file.name === 'style' && file.fileType === FileType.CSS)
13
- let globalStyleSheet = css
14
-
15
- if (projectSheet) {
16
- files.delete('projectStyleSheet')
17
- globalStyleSheet = `${globalStyleSheet} \n \n ${projectSheet.content}`
18
- }
19
-
20
- files.set('projectStyleSheet', {
21
- path: path || ['src'],
22
- files: [
23
- {
24
- ...projectSheet,
25
- content: globalStyleSheet,
26
- },
27
- ],
28
- })
29
-
30
- files.set('tailwindConfig', {
31
- files: [
32
- {
33
- name: 'tailwind.config',
34
- fileType: FileType.JS,
35
- content: `module.exports = ${JSON.stringify(config, null, 2)}`,
36
- },
37
- ],
38
- path: [''],
39
- })
40
-
41
- files.delete('stencil.config')
42
- files.set('stencil.config', {
43
- files: [
44
- {
45
- name: 'stencil.config',
46
- fileType: FileType.TS,
47
- content: `import { Config } from "@stencil/core";
48
- import tailwind, { tailwindHMR } from "stencil-tailwind-plugin";
49
- import tailwindConfig from "./tailwind.config";
50
- import autoprefixer from "autoprefixer";
51
-
52
- export const config: Config = {
53
- namespace: "app",
54
- globalStyle: "src/style.css",
55
- outputTargets: [
56
- {
57
- type: "www",
58
- // comment the following line to disable service workers in production
59
- serviceWorker: null,
60
- baseUrl: "https://myapp.local/",
61
- },
62
- ],
63
- plugins: [
64
- tailwind({
65
- // @ts-ignore
66
- tailwindConfig,
67
- tailwindCssContents: '@tailwind utilities;',
68
- postcss: {
69
- plugins: [autoprefixer()],
70
- },
71
- }),
72
- tailwindHMR(),
73
- ],
74
- };`,
75
- },
76
- ],
77
- path: [''],
78
- })
79
-
80
- devDependencies.tailwindcss = TAILWIND
81
- devDependencies.autoprefixer = AUTO_PREFIXER
82
- devDependencies.postcss = POSTCSS
83
- devDependencies['stencil-tailwind-plugin'] = '^1.3.0'
84
- }