@medyll/cssfabric 0.2.5 → 0.2.6

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 (31) hide show
  1. package/.gitignores +3 -0
  2. package/bin/index.js +33 -5
  3. package/bin/install.js +131 -0
  4. package/bin/package-lock.json +2429 -0
  5. package/bin/package.json +15 -0
  6. package/package.json +8 -1
  7. package/src/cssfabric/modules/_cssfabric-config.scss +7 -2
  8. package/src/cssfabric/modules/grid/_grid-build.scss +5 -3
  9. package/src/lib/styles/box/box.responsive.css +2579 -1198
  10. package/src/lib/styles/box/box.responsive.min.css +1 -1
  11. package/src/lib/styles/color/color.responsive.css +3419 -1852
  12. package/src/lib/styles/color/color.responsive.min.css +1 -1
  13. package/src/lib/styles/cssfabric.css +15595 -1
  14. package/src/lib/styles/cssfabric.min.css +42 -0
  15. package/src/lib/styles/cssfabric.responsive.css +54462 -0
  16. package/src/lib/styles/cssfabric.responsive.min.css +28 -1
  17. package/src/lib/styles/flex/flex.responsive.css +190 -64
  18. package/src/lib/styles/flex/flex.responsive.min.css +1 -1
  19. package/src/lib/styles/grid/grid.responsive.css +249 -128
  20. package/src/lib/styles/grid/grid.responsive.min.css +1 -1
  21. package/src/lib/styles/menu/menu.responsive.css +155 -70
  22. package/src/lib/styles/menu/menu.responsive.min.css +1 -1
  23. package/src/lib/styles/overflow/overflow.responsive.css +110 -49
  24. package/src/lib/styles/overflow/overflow.responsive.min.css +1 -1
  25. package/src/lib/styles/scale/scale.responsive.css +1373 -652
  26. package/src/lib/styles/scale/scale.responsive.min.css +1 -1
  27. package/src/lib/styles/table/table.responsive.css +141 -67
  28. package/src/lib/styles/table/table.responsive.min.css +1 -1
  29. package/src/lib/styles/text/text.responsive.css +56 -7
  30. package/src/lib/styles/text/text.responsive.min.css +1 -1
  31. package/svelte.config.js +1 -2
package/.gitignores ADDED
@@ -0,0 +1,3 @@
1
+
2
+ //cssfabric directory
3
+ .cssfabric
package/bin/index.js CHANGED
@@ -1,8 +1,36 @@
1
- #! /usr/bin/env node
1
+ #!/usr/bin/env node
2
2
 
3
- /*
4
- const fsx = require('fs-extra');
3
+ import fsx from "fs-extra";
4
+ import path from 'path'
5
+ import prompt from "prompt";
6
+ import {install,uninstall} from "./install.js";
7
+ import colors from "@colors/colors/safe.js";
5
8
 
6
- let createDir = './cssfabric/cssfabric.scss';
9
+ const args = process.argv.slice(2);
10
+ if (args.length < 1) {
11
+ console.error('Missing command, exiting');
12
+ process.exit(1);
13
+ }
7
14
 
8
- fsx.ensureFile(createDir);*/
15
+ const command = args?.[0];
16
+
17
+ console.log(import.meta.url);
18
+ /* var filename = path.basename(__filename);
19
+ console.log(filename); */
20
+
21
+
22
+ console.log(colors.green("-----------------------------"));
23
+ console.log(colors.green("- cssfabric installer script "));
24
+ console.log(colors.green("-----------------------------"));
25
+ switch (command) {
26
+ case "--install":
27
+ case "--install-css":
28
+ /** import cssfabric files */
29
+ await install();
30
+ break;
31
+ case "--uninstall":
32
+ /** delete cssfabric files */
33
+ await uninstall();
34
+ break;
35
+ }
36
+
package/bin/install.js ADDED
@@ -0,0 +1,131 @@
1
+ #!/usr/bin/env node
2
+
3
+ import fsx from "fs-extra";
4
+ import prompt from "prompt";
5
+ import colors from "@colors/colors/safe.js";
6
+ import { exec } from "node:child_process";
7
+
8
+ const yesNoPattern = {
9
+ pattern: /^(Y|n)$/,
10
+ default: "Y",
11
+ type: "string",
12
+ required: true,
13
+ };
14
+
15
+ const installSchema = {
16
+ properties: {
17
+ install: {
18
+ description:
19
+ "Copy the cssfabric files to the .cssfabric directory ? " +
20
+ colors.green("Y/n"),
21
+ ...yesNoPattern,
22
+ },
23
+ gitIgnore: {
24
+ description: "Add .cssfabric to gitignore ? " + colors.green("Y/n"),
25
+ ...yesNoPattern,
26
+ },
27
+ },
28
+ };
29
+
30
+ const unInstallSchema = {
31
+ properties: {
32
+ uninstall: {
33
+ description:
34
+ "delete the cssfabric files from .cssfabric directory ? " +
35
+ colors.green("Y/n"),
36
+ ...yesNoPattern,
37
+ },
38
+ },
39
+ };
40
+
41
+ var run = function (cmd) {
42
+ var child = exec(cmd, function (error, stdout, stderr) {
43
+ if (stderr !== null) {
44
+ console.log("" + stderr);
45
+ }
46
+ if (stdout !== null) {
47
+ console.log("" + stdout);
48
+ }
49
+ if (error !== null) {
50
+ console.log("" + error);
51
+ }
52
+ });
53
+ };
54
+
55
+ /** import cssfabric files to .cssfabric */
56
+ export const install = async () => {
57
+
58
+ if (fsx.existsSync("node_modules/@medyll/cssfabric")) {
59
+ //run("ls node_modules/@medyll/cssfabric");
60
+ console.log('found nodemodules')
61
+ }else{
62
+ console.error('Missing node_modules, exiting');
63
+ process.exit(1);
64
+ }
65
+ prompt.start();
66
+
67
+ const { install, gitIgnore } = await prompt.get(installSchema);
68
+
69
+ if (install === "Y") {
70
+
71
+ await installCssFiles();
72
+ await installScssFiles();
73
+ } else {
74
+ console.log(colors.yellow("-- skipping the cssfabric directory import"));
75
+ }
76
+
77
+ if (gitIgnore === "Y") {
78
+ fsx.ensureFile(".gitignore");
79
+ const content = fsx.readFileSync(".gitignore", {
80
+ encoding: "utf8",
81
+ });
82
+
83
+ if (!content.includes(".cssfabric")) {
84
+ fsx
85
+ .appendFile(".gitignore", "\n#cssfabric directory \n.cssfabric")
86
+ .then(() => {
87
+ console.log(colors.green(".gitignore directive successfully added"));
88
+ });
89
+ } else {
90
+ console.log(
91
+ colors.yellow(
92
+ "-- skipping : the .gitignore file already contain a .cssfabric directive"
93
+ )
94
+ );
95
+ }
96
+ }
97
+ };
98
+
99
+ /** uninstall .cssfabric files */
100
+ export const uninstall = async () => {
101
+ prompt.start();
102
+ const { uninstall } = await prompt.get(unInstallSchema);
103
+ if (uninstall === "Y") {
104
+ fsx.remove("./.cssfabric/");
105
+ }
106
+ };
107
+
108
+ const installCssFiles = async () => {
109
+ try {
110
+ await fsx.copy("./src/lib/styles", "./.cssfabric/styles/");
111
+ console.log(colors.green("cssfabric css files were successfully imported"));
112
+ } catch (err) {
113
+ console.error(err);
114
+ console.log(colors.red("An error occurred while copying the css files"));
115
+ console.error("exiting");
116
+ process.exit(1);
117
+ }
118
+ };
119
+
120
+ const installScssFiles = async () => {
121
+ try {
122
+ await fsx.copy("./src/cssfabric/modules", "./.cssfabric/modules");
123
+ console.log(
124
+ colors.green("cssfabric scss files were successfully imported")
125
+ );
126
+ } catch (err) {
127
+ console.log(colors.red("An error occurred while copying the scss files"));
128
+ console.error("exiting");
129
+ process.exit(1);
130
+ }
131
+ };