Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit e843477

Browse files
committed
revert(compiler): ESM .ts extension
1 parent 68d8a43 commit e843477

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

compiler/src/clean-up.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
/* eslint-disable @typescript-eslint/no-var-requires */
2-
const fs = require('fs');
3-
const path = require('node:path');
1+
import { writeFileSync } from 'fs';
2+
import path from 'path';
43

54
const styleFilePath = path.join(__dirname, '../../src/core/styles/style.module.css');
65
const globalFilePath = path.join(__dirname, '../../src/core/styles/global.css');
76

87
export const cleanUp = async () => {
98
try {
10-
fs.writeFileSync(styleFilePath, '/*------------------------------*/', 'utf-8');
9+
writeFileSync(styleFilePath, '/*------------------------------*/', 'utf-8');
1110
console.log('...💫(reseted module css)');
1211

13-
fs.writeFileSync(globalFilePath, '/*------------------------------*/', 'utf-8');
12+
writeFileSync(globalFilePath, '/*------------------------------*/', 'utf-8');
1413
console.log('...💫(reseted global css)');
1514
} catch (err) {
1615
console.error('An error occurred:', err);

compiler/src/index.ts

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
/* eslint-disable @typescript-eslint/no-var-requires */
2-
const path = require('node:path');
3-
const fs = require('fs');
4-
const { cleanUp } = require('./clean-up');
5-
const { createBuildIn } = require('../../src/core/method/create-build-in-helper');
6-
const { setBuildIn } = require('../../src/core/method/set-build-in-helper');
7-
const { globalBuildIn } = require('../../src/core/method/global-build-in-helper');
8-
const { rootBuildIn } = require('../../src/core/method/root-build-in-helper');
9-
const fg = require('fast-glob');
1+
import path from 'path';
2+
import fs from 'fs';
3+
import fg from 'fast-glob';
4+
import { cleanUp } from './clean-up';
5+
import { createBuildIn } from '../../src/core/method/create-build-in-helper';
6+
import { setBuildIn } from '../../src/core/method/set-build-in-helper';
7+
import { globalBuildIn } from '../../src/core/method/global-build-in-helper';
8+
import { rootBuildIn } from '../../src/core/method/root-build-in-helper';
109

1110
(async () => {
12-
cleanUp();
11+
await cleanUp();
1312
let appRoot = '';
1413
const threeLevelsUp = path.join(process.cwd(), '../../../../..');
1514
const pnpmExists = fs.existsSync(path.join(threeLevelsUp, 'node_modules/.pnpm'));
@@ -20,7 +19,7 @@ const fg = require('fast-glob');
2019
appRoot = path.join(process.cwd(), '../../');
2120
}
2221
const csstsPattern = path.join(appRoot, '**/*.css.ts');
23-
const files: string[] = await fg([csstsPattern]);
22+
const files = await fg([csstsPattern]);
2423
console.log('\n💬 The following CSS caches were accepted:\n');
2524
for (const file of files) {
2625
const filePath = path.resolve(file);

0 commit comments

Comments
 (0)