@udixio/tailwind 1.2.1 → 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.
package/dist/index.cjs DELETED
@@ -1,385 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
6
- const plugin = require("tailwindcss/plugin");
7
- const fs = require("fs");
8
- const path = require("path");
9
- const replaceInFile = require("replace-in-file");
10
- const console = require("node:console");
11
- const theme = require("@udixio/theme");
12
- function _interopNamespaceDefault(e) {
13
- const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
14
- if (e) {
15
- for (const k in e) {
16
- if (k !== "default") {
17
- const d = Object.getOwnPropertyDescriptor(e, k);
18
- Object.defineProperty(n, k, d.get ? d : {
19
- enumerable: true,
20
- get: () => e[k]
21
- });
22
- }
23
- }
24
- }
25
- n.default = e;
26
- return Object.freeze(n);
27
- }
28
- const fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs);
29
- const path__namespace = /* @__PURE__ */ _interopNamespaceDefault(path);
30
- const console__namespace = /* @__PURE__ */ _interopNamespaceDefault(console);
31
- const defaultConfig = {
32
- statePrefix: "state",
33
- disabledStyles: {
34
- textOpacity: 0.38,
35
- backgroundOpacity: 0.12
36
- },
37
- transition: {
38
- duration: 150
39
- }
40
- };
41
- const state = plugin.withOptions(({ colorKeys }) => {
42
- const resolved = {
43
- ...defaultConfig,
44
- disabledStyles: {
45
- ...defaultConfig.disabledStyles,
46
- ...{}
47
- },
48
- transition: {
49
- ...defaultConfig.transition,
50
- ...{}
51
- }
52
- };
53
- return ({ addComponents }) => {
54
- const newComponents = {};
55
- for (const isGroup of [false, true]) {
56
- const group = isGroup ? "group-" : "";
57
- for (const colorName of colorKeys) {
58
- const className = `.${group}${resolved.statePrefix}-${colorName}`;
59
- newComponents[className] = {
60
- [`@apply ${group}hover:bg-${colorName}/[0.08]`]: {},
61
- [`@apply ${group}active:bg-${colorName}/[0.12]`]: {},
62
- [`@apply ${group}focus-visible:bg-${colorName}/[0.12]`]: {},
63
- [`@apply transition-colors`]: {},
64
- [`@apply duration-${resolved.transition.duration}`]: {},
65
- [`@apply ${group}disabled:text-on-surface/[${resolved.disabledStyles.textOpacity}]`]: {},
66
- [`@apply ${group}disabled:bg-on-surface/[${resolved.disabledStyles.backgroundOpacity}]`]: {}
67
- };
68
- }
69
- }
70
- for (const colorName of colorKeys) {
71
- for (const stateName of ["hover", "active", "focus", "disabled"]) {
72
- const className = `.${stateName}-${resolved.statePrefix}-${colorName}`;
73
- if (stateName === "disabled") {
74
- newComponents[className] = {
75
- [`@apply text-on-surface/[${resolved.disabledStyles.textOpacity}]`]: {},
76
- [`@apply bg-on-surface/[${resolved.disabledStyles.backgroundOpacity}]`]: {}
77
- };
78
- } else {
79
- const opacity = stateName === "hover" ? 0.08 : 0.12;
80
- newComponents[className] = {
81
- [`@apply bg-${colorName}/[${opacity}]`]: {}
82
- };
83
- }
84
- }
85
- }
86
- addComponents(newComponents);
87
- };
88
- });
89
- const font = plugin.withOptions((options) => {
90
- return ({
91
- addUtilities,
92
- theme: theme2
93
- }) => {
94
- const { fontStyles, responsiveBreakPoints } = options;
95
- const pixelUnit = "rem";
96
- const newUtilities = {};
97
- const baseTextStyle = (sizeValue) => ({
98
- fontSize: sizeValue.fontSize + pixelUnit,
99
- fontWeight: sizeValue.fontWeight,
100
- lineHeight: sizeValue.lineHeight + pixelUnit,
101
- letterSpacing: sizeValue.letterSpacing ? sizeValue.letterSpacing + pixelUnit : null,
102
- fontFamily: theme2("fontFamily." + sizeValue.fontFamily)
103
- });
104
- const responsiveTextStyle = (sizeValue, breakPointName, breakPointRatio) => ({
105
- [`@media (min-width: ${theme2("screens." + breakPointName, {})})`]: {
106
- fontSize: sizeValue.fontSize * breakPointRatio + pixelUnit,
107
- lineHeight: sizeValue.lineHeight * breakPointRatio + pixelUnit
108
- }
109
- });
110
- for (const [roleName, roleValue] of Object.entries(fontStyles)) {
111
- for (const [sizeName, sizeValue] of Object.entries(roleValue)) {
112
- newUtilities[`.text-${roleName}-${sizeName}`] = {
113
- ...baseTextStyle(sizeValue),
114
- ...Object.entries(responsiveBreakPoints).reduce(
115
- (acc, [breakPointName, breakPointRatio]) => ({
116
- ...acc,
117
- ...responsiveTextStyle(
118
- sizeValue,
119
- breakPointName,
120
- breakPointRatio
121
- )
122
- }),
123
- {}
124
- )
125
- };
126
- }
127
- }
128
- addUtilities(newUtilities);
129
- };
130
- });
131
- const shadow = plugin(
132
- ({ addUtilities }) => {
133
- addUtilities({
134
- [".shadow"]: {
135
- boxShadow: "0 4px 10px #00000008, 0 0 2px #0000000f, 0 2px 6px #0000001f"
136
- },
137
- [".shadow-1"]: {
138
- boxShadow: "0px 1px 3px 1px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.30)"
139
- },
140
- [".shadow-2"]: {
141
- boxShadow: "0px 2px 6px 2px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.30)"
142
- },
143
- [".shadow-3"]: {
144
- boxShadow: "0px 1px 3px 0px rgba(0, 0, 0, 0.30), 0px 4px 8px 3px rgba(0, 0, 0, 0.15)"
145
- },
146
- [".shadow-4"]: {
147
- boxShadow: "0px 2px 3px 0px rgba(0, 0, 0, 0.30), 0px 6px 10px 4px rgba(0, 0, 0, 0.15)"
148
- },
149
- [".box-shadow-5"]: {
150
- boxShadow: "0px 4px 4px 0px rgba(0, 0, 0, 0.30), 0px 8px 12px 6px rgba(0, 0, 0, 0.15)"
151
- }
152
- });
153
- }
154
- );
155
- const main = plugin.withOptions((args) => {
156
- const configCss = args;
157
- const fontStyles = {};
158
- configCss.fontStyles.forEach((line) => {
159
- const [styleToken, ...properties] = line.split(" ");
160
- const [roleToken, sizeToken] = styleToken.split("-");
161
- fontStyles[roleToken] ?? (fontStyles[roleToken] = {});
162
- properties.forEach((properties2) => {
163
- var _a;
164
- (_a = fontStyles[roleToken])[sizeToken] ?? (_a[sizeToken] = {});
165
- const [key, value] = properties2.slice(0, -1).split("[");
166
- fontStyles[roleToken][sizeToken][key] = value;
167
- });
168
- });
169
- let breakPointsCss = configCss.responsiveBreakPoints;
170
- if (!Array.isArray(breakPointsCss)) {
171
- breakPointsCss = [breakPointsCss];
172
- }
173
- const responsiveBreakPoints = {};
174
- breakPointsCss.forEach((line) => {
175
- const [key, value] = line.split(" ");
176
- responsiveBreakPoints[key] = value;
177
- });
178
- const options = {
179
- colorKeys: configCss.colorKeys,
180
- fontStyles,
181
- responsiveBreakPoints
182
- };
183
- return (api) => {
184
- font(options).handler(api);
185
- state(options).handler(api);
186
- shadow.handler(api);
187
- };
188
- });
189
- const createOrUpdateFile = (filePath, content) => {
190
- try {
191
- if (!fs__namespace.existsSync(filePath)) {
192
- const dirPath = path__namespace.dirname(filePath);
193
- if (!fs__namespace.existsSync(dirPath)) {
194
- fs__namespace.mkdirSync(dirPath, { recursive: true });
195
- }
196
- fs__namespace.writeFileSync(filePath, content);
197
- console__namespace.log(`✅ File successfully created: ${filePath}`);
198
- } else {
199
- console__namespace.log(`⚠️ File already exists: ${filePath}`);
200
- replaceFileContent(filePath, /[\s\S]*/, content);
201
- }
202
- } catch (error) {
203
- console__namespace.error("❌ Error while creating the file:", error);
204
- }
205
- };
206
- const getFileContent = (filePath, searchPattern) => {
207
- try {
208
- if (!fs__namespace.existsSync(filePath)) {
209
- console__namespace.error(`❌ The specified file does not exist: ${filePath}`);
210
- return null;
211
- }
212
- const fileContent = fs__namespace.readFileSync(filePath, "utf8");
213
- if (searchPattern) {
214
- if (typeof searchPattern === "string") {
215
- const found = fileContent.includes(searchPattern) ? searchPattern : false;
216
- console__namespace.log(
217
- found ? `✅ The file contains the specified string: "${searchPattern}"` : `⚠️ The file does NOT contain the specified string: "${searchPattern}"`
218
- );
219
- return found;
220
- } else {
221
- const match = fileContent.match(searchPattern);
222
- if (match) {
223
- console__namespace.log(`✅ Found match: "${match[0]}"`);
224
- return match[0];
225
- } else {
226
- console__namespace.log(
227
- `⚠️ No match found for the pattern: "${searchPattern.toString()}"`
228
- );
229
- return false;
230
- }
231
- }
232
- }
233
- console__namespace.log(`✅ File content successfully retrieved.`);
234
- return fileContent;
235
- } catch (error) {
236
- console__namespace.error("❌ An error occurred while processing the file:", error);
237
- return null;
238
- }
239
- };
240
- const replaceFileContent = (filePath, searchPattern, replacement) => {
241
- try {
242
- const results = replaceInFile.replaceInFileSync({
243
- files: filePath,
244
- from: searchPattern,
245
- to: replacement
246
- });
247
- if (results.length > 0 && results[0].hasChanged) {
248
- console__namespace.log(`✅ Content successfully replaced in the file: ${filePath}`);
249
- } else {
250
- console__namespace.log(
251
- `⚠️ No replacement made. Here are some possible reasons:
252
- - The pattern ${searchPattern} was not found.
253
- - The file might already contain the expected content.`
254
- );
255
- }
256
- } catch (error) {
257
- console__namespace.error("❌ Error while replacing the file content:", error);
258
- }
259
- };
260
- const findTailwindCssFile = (startDir, searchPattern) => {
261
- console__namespace.log("Recherche du fichier contenant le motif...", startDir);
262
- const stack = [startDir];
263
- while (stack.length > 0) {
264
- const currentDir = stack.pop();
265
- const files = fs__namespace.readdirSync(currentDir);
266
- for (const file of files) {
267
- const filePath = path__namespace.join(currentDir, file);
268
- let stats;
269
- try {
270
- stats = fs__namespace.statSync(filePath);
271
- } catch (error) {
272
- console__namespace.error(`Erreur lors de l'accès à ${filePath}:`, error);
273
- continue;
274
- }
275
- if (stats.isDirectory()) {
276
- if (file !== "node_modules") stack.push(filePath);
277
- } else if (stats.isFile() && (file.endsWith(".css") || file.endsWith(".scss") || file.endsWith(".sass"))) {
278
- try {
279
- console__namespace.log(`Analyse du fichier : ${filePath}`);
280
- const content = fs__namespace.readFileSync(filePath, "utf8");
281
- if (content.match(searchPattern)) {
282
- console__namespace.log("Fichier trouvé :", filePath);
283
- return filePath;
284
- }
285
- } catch (readError) {
286
- console__namespace.error(`Erreur lors de la lecture de ${filePath}:`, readError);
287
- }
288
- }
289
- }
290
- }
291
- throw new Error(
292
- `Impossible de trouver un fichier contenant "${searchPattern}" dans "${startDir}".`
293
- );
294
- };
295
- function findProjectRoot(startPath) {
296
- let currentPath = startPath;
297
- while (!fs__namespace.existsSync(path__namespace.join(currentPath, "package.json"))) {
298
- const parentPath = path__namespace.dirname(currentPath);
299
- if (currentPath === parentPath) {
300
- throw new Error("Impossible de localiser la racine du projet.");
301
- }
302
- currentPath = parentPath;
303
- }
304
- return currentPath;
305
- }
306
- class TailwindPlugin extends theme.PluginAbstract {
307
- constructor() {
308
- super(...arguments);
309
- __publicField(this, "dependencies", [theme.FontPlugin]);
310
- __publicField(this, "name", "tailwind");
311
- __publicField(this, "pluginClass", TailwindImplPlugin);
312
- }
313
- }
314
- class TailwindImplPlugin extends theme.PluginImplAbstract {
315
- onInit() {
316
- var _a;
317
- (_a = this.options).responsiveBreakPoints ?? (_a.responsiveBreakPoints = {
318
- lg: 1.125
319
- });
320
- }
321
- onLoad() {
322
- let udixioCssPath = this.options.styleFilePath;
323
- const projectRoot = findProjectRoot(path.resolve());
324
- if (!udixioCssPath) {
325
- const searchPattern = /@import ["']tailwindcss["'];/;
326
- const replacement = `@import 'tailwindcss';
327
- @import "./udixio.css";`;
328
- const tailwindCssPath = findTailwindCssFile(projectRoot, searchPattern);
329
- udixioCssPath = path.join(tailwindCssPath, "../udixio.css");
330
- if (!getFileContent(tailwindCssPath, /@import\s+"\.\/udixio\.css";/)) {
331
- replaceFileContent(tailwindCssPath, searchPattern, replacement);
332
- }
333
- }
334
- const colors = {};
335
- for (const isDark of [false, true]) {
336
- this.api.themes.update({ isDark });
337
- for (const [key, value] of this.api.colors.getColors().entries()) {
338
- const newKey = key.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
339
- colors[newKey] ?? (colors[newKey] = { light: "", dark: "" });
340
- colors[newKey][isDark ? "dark" : "light"] = value.getHex();
341
- }
342
- }
343
- const { fontStyles, fontFamily } = this.api.plugins.getPlugin(theme.FontPlugin).getInstance().getFonts();
344
- const configCss = {
345
- colorKeys: Object.keys(colors).join(", "),
346
- fontStyles: Object.entries(fontStyles).map(
347
- ([fontRole, fontStyle]) => Object.entries(fontStyle).map(
348
- ([fontSize, fontStyle2]) => `${fontRole}-${fontSize} ${Object.entries(fontStyle2).map(([name, value]) => `${name}[${value}]`).join(" ")}`
349
- ).join(", ")
350
- ).join(", "),
351
- responsiveBreakPoints: Object.entries(
352
- this.options.responsiveBreakPoints ?? {}
353
- ).map(([key, value]) => `${key} ${value}`).join(", ")
354
- };
355
- createOrUpdateFile(
356
- udixioCssPath,
357
- `
358
- @plugin "@udixio/tailwind" {
359
- colorKeys: ${configCss.colorKeys};
360
- fontStyles: ${configCss.fontStyles};
361
- responsiveBreakPoints: ${configCss.responsiveBreakPoints};
362
- }
363
- @custom-variant dark (&:where(.dark, .dark *));
364
- @theme {
365
- --color-*: initial;
366
- ${Object.entries(colors).map(([key, value]) => `--color-${key}: ${value.light};`).join("\n ")}
367
- }
368
- @layer theme {
369
- .dark {
370
- ${Object.entries(colors).map(([key, value]) => `--color-${key}: ${value.dark};`).join("\n ")}
371
- }
372
- }
373
- @theme {
374
- ${Object.entries(fontFamily).map(
375
- ([key, values]) => `--font-${key}: ${values.map((value) => `"${value}"`).join(", ")};`
376
- ).join("\n ")}
377
- }
378
- `
379
- );
380
- }
381
- }
382
- exports.TailwindPlugin = TailwindPlugin;
383
- exports.default = main;
384
- exports.font = font;
385
- exports.state = state;
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,eAAe,IAAI,CAAC"}
@@ -1,16 +0,0 @@
1
- import { FontPlugin, PluginAbstract, PluginImplAbstract } from '@udixio/theme';
2
- interface TailwindPluginOptions {
3
- responsiveBreakPoints?: Record<string, number>;
4
- styleFilePath?: string;
5
- }
6
- export declare class TailwindPlugin extends PluginAbstract<TailwindImplPlugin, TailwindPluginOptions> {
7
- dependencies: (typeof FontPlugin)[];
8
- name: string;
9
- pluginClass: typeof TailwindImplPlugin;
10
- }
11
- declare class TailwindImplPlugin extends PluginImplAbstract<TailwindPluginOptions> {
12
- onInit(): void;
13
- onLoad(): void;
14
- }
15
- export {};
16
- //# sourceMappingURL=tailwind.plugin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tailwind.plugin.d.ts","sourceRoot":"","sources":["../src/tailwind.plugin.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAG/E,UAAU,qBAAqB;IAE7B,qBAAqB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/C,aAAa,CAAC,EAAE,MAAM,CAAC;CAExB;AAED,qBAAa,cAAe,SAAQ,cAAc,CAChD,kBAAkB,EAClB,qBAAqB,CACtB;IACQ,YAAY,wBAAgB;IAC5B,IAAI,SAAc;IACzB,WAAW,4BAAsB;CAClC;AAED,cAAM,kBAAmB,SAAQ,kBAAkB,CAAC,qBAAqB,CAAC;IACxE,MAAM;IAMN,MAAM;CA+FP"}
package/src/file.ts DELETED
@@ -1,163 +0,0 @@
1
- import * as fs from 'fs';
2
- import * as path from 'path';
3
- import { replaceInFileSync } from 'replace-in-file';
4
- import * as console from 'node:console';
5
-
6
- export const createOrUpdateFile = (filePath: string, content: string): void => {
7
- try {
8
- if (!fs.existsSync(filePath)) {
9
- // Create the folder if necessary.
10
- const dirPath = path.dirname(filePath);
11
- if (!fs.existsSync(dirPath)) {
12
- fs.mkdirSync(dirPath, { recursive: true });
13
- }
14
-
15
- // Create the file with the provided content.
16
- fs.writeFileSync(filePath, content);
17
- console.log(`✅ File successfully created: ${filePath}`);
18
- } else {
19
- console.log(`⚠️ File already exists: ${filePath}`);
20
- replaceFileContent(filePath, /[\s\S]*/, content);
21
- }
22
- } catch (error) {
23
- console.error('❌ Error while creating the file:', error);
24
- }
25
- };
26
-
27
- export const getFileContent = (
28
- filePath: string,
29
- searchPattern?: RegExp | string,
30
- ): string | false | null => {
31
- try {
32
- // Vérifier si le fichier existe
33
- if (!fs.existsSync(filePath)) {
34
- console.error(`❌ The specified file does not exist: ${filePath}`);
35
- return null;
36
- }
37
-
38
- // Lire le contenu du fichier entier
39
- const fileContent = fs.readFileSync(filePath, 'utf8');
40
-
41
- // Si un motif est fourni, chercher le texte correspondant
42
- if (searchPattern) {
43
- if (typeof searchPattern === 'string') {
44
- const found = fileContent.includes(searchPattern)
45
- ? searchPattern
46
- : false;
47
- console.log(
48
- found
49
- ? `✅ The file contains the specified string: "${searchPattern}"`
50
- : `⚠️ The file does NOT contain the specified string: "${searchPattern}"`,
51
- );
52
- return found;
53
- } else {
54
- const match = fileContent.match(searchPattern);
55
- if (match) {
56
- console.log(`✅ Found match: "${match[0]}"`);
57
- return match[0]; // Retourner le texte trouvé
58
- } else {
59
- console.log(
60
- `⚠️ No match found for the pattern: "${searchPattern.toString()}"`,
61
- );
62
- return false; // Aucune correspondance trouvée
63
- }
64
- }
65
- }
66
-
67
- // Si aucun motif n'est fourni, retourner tout le contenu
68
- console.log(`✅ File content successfully retrieved.`);
69
- return fileContent;
70
- } catch (error) {
71
- console.error('❌ An error occurred while processing the file:', error);
72
- return null;
73
- }
74
- };
75
-
76
- export const replaceFileContent = (
77
- filePath: string,
78
- searchPattern: RegExp | string,
79
- replacement: string,
80
- ): void => {
81
- try {
82
- const results = replaceInFileSync({
83
- files: filePath,
84
- from: searchPattern,
85
- to: replacement,
86
- });
87
-
88
- if (results.length > 0 && results[0].hasChanged) {
89
- console.log(`✅ Content successfully replaced in the file: ${filePath}`);
90
- } else {
91
- console.log(
92
- `⚠️ No replacement made. Here are some possible reasons:\n- The pattern ${searchPattern} was not found.\n- The file might already contain the expected content.`,
93
- );
94
- }
95
- } catch (error) {
96
- console.error('❌ Error while replacing the file content:', error);
97
- }
98
- };
99
- export const findTailwindCssFile = (
100
- startDir: string,
101
- searchPattern: RegExp | string,
102
- ): string | never => {
103
- console.log('Recherche du fichier contenant le motif...', startDir);
104
-
105
- const stack = [startDir]; // Pile pour éviter une récursion implicite.
106
-
107
- while (stack.length > 0) {
108
- const currentDir = stack.pop()!; // Récupérer un répertoire de la pile.
109
- const files = fs.readdirSync(currentDir);
110
-
111
- for (const file of files) {
112
- const filePath = path.join(currentDir, file);
113
-
114
- let stats: fs.Stats;
115
- try {
116
- stats = fs.statSync(filePath);
117
- } catch (error) {
118
- console.error(`Erreur lors de l'accès à ${filePath}:`, error);
119
- continue; // Ignorer toute erreur d'accès.
120
- }
121
-
122
- // Ignorer le dossier `node_modules` et autres fichiers inutiles.
123
- if (stats.isDirectory()) {
124
- if (file !== 'node_modules') stack.push(filePath); // Empiler seulement les dossiers valides.
125
- } else if (
126
- stats.isFile() &&
127
- (file.endsWith('.css') ||
128
- file.endsWith('.scss') ||
129
- file.endsWith('.sass'))
130
- ) {
131
- try {
132
- console.log(`Analyse du fichier : ${filePath}`);
133
- const content = fs.readFileSync(filePath, 'utf8');
134
- if (content.match(searchPattern)) {
135
- console.log('Fichier trouvé :', filePath);
136
- return filePath; // Retour dès qu'un fichier valide est identifié.
137
- }
138
- } catch (readError) {
139
- console.error(`Erreur lors de la lecture de ${filePath}:`, readError);
140
- }
141
- }
142
- }
143
- }
144
-
145
- throw new Error(
146
- `Impossible de trouver un fichier contenant "${searchPattern}" dans "${startDir}".`,
147
- );
148
- };
149
-
150
- export function findProjectRoot(startPath) {
151
- let currentPath = startPath;
152
-
153
- // Boucle jusqu'à trouver un package.json ou jusqu'à arriver à la racine du système
154
- while (!fs.existsSync(path.join(currentPath, 'package.json'))) {
155
- const parentPath = path.dirname(currentPath);
156
- if (currentPath === parentPath) {
157
- throw new Error('Impossible de localiser la racine du projet.');
158
- }
159
- currentPath = parentPath;
160
- }
161
-
162
- return currentPath;
163
- }
package/src/index.test.ts DELETED
@@ -1,5 +0,0 @@
1
- import { it } from 'vitest';
2
-
3
- it.skip('this test is skipped', () => {
4
- // Skipped test
5
- });