make CLI files TypeScript files

This commit is contained in:
Robin Malfait 2022-12-01 17:01:55 +01:00
parent fcb96f6847
commit b1dae3bb5e
No known key found for this signature in database
GPG key ID: 92F53D68B9041AFE
10 changed files with 12 additions and 29 deletions

View file

@ -1 +1 @@
require('./cli/index')
import './cli/index'

View file

@ -1,5 +1,3 @@
// @ts-check
import {
// @ts-ignore
lazyPostcss,
@ -12,7 +10,7 @@ import {
// @ts-ignore
lazyAutoprefixer,
} from '../../../../peers/index.js'
} from '../../../../peers/index'
/**
* @returns {import('postcss')}

View file

@ -1,8 +1,6 @@
// @ts-check
import fs from 'fs'
import path from 'path'
import { createProcessor } from './plugin.js'
import { createProcessor } from './plugin'
export async function build(args, configs) {
let input = args['--input']

View file

@ -1,5 +1,3 @@
// @ts-check
import path from 'path'
import fs from 'fs'
import postcssrc from 'postcss-load-config'
@ -11,12 +9,12 @@ import tailwind from '../../../processTailwindFeatures'
import { loadAutoprefixer, loadCssNano, loadPostcss, loadPostcssImport } from './deps'
import { formatNodes, drainStdin, outputFile } from './utils'
import { env } from '../shared'
import resolveConfig from '../../../../resolveConfig.js'
import getModuleDependencies from '../../../lib/getModuleDependencies.js'
import { parseCandidateFiles } from '../../../lib/content.js'
import { createWatcher } from './watching.js'
import resolveConfig from '../../../../resolveConfig'
import getModuleDependencies from '../../../lib/getModuleDependencies'
import { parseCandidateFiles } from '../../../lib/content'
import { createWatcher } from './watching'
import fastGlob from 'fast-glob'
import { findAtConfigPath } from '../../../lib/findAtConfigPath.js'
import { findAtConfigPath } from '../../../lib/findAtConfigPath'
import log from '../../../util/log'
/**

View file

@ -1,5 +1,3 @@
// @ts-check
import fs from 'fs'
import path from 'path'

View file

@ -1,12 +1,10 @@
// @ts-check
import chokidar from 'chokidar'
import fs from 'fs'
import micromatch from 'micromatch'
import normalizePath from 'normalize-path'
import path from 'path'
import { readFileWithRetries } from './utils.js'
import { readFileWithRetries } from './utils'
/**
* The core idea of this watcher is:

View file

@ -1,4 +1,3 @@
// @ts-check
import packageJson from '../../../../package.json'
export function help({ message, usage, commands, options }) {

View file

@ -8,8 +8,6 @@ import { build } from './build'
import { help } from './help'
import { init } from './init'
console.log('HELLO FROM OXIDE')
function isESM() {
const pkgPath = path.resolve('./package.json')

View file

@ -1,5 +1,3 @@
// @ts-check
import fs from 'fs'
import path from 'path'
@ -12,8 +10,8 @@ export function init(args, configs) {
} else {
let stubFile = fs.readFileSync(
args['--full']
? path.resolve(__dirname, '../../../stubs/defaultConfig.stub.js')
: path.resolve(__dirname, '../../../stubs/simpleConfig.stub.js'),
? path.resolve(__dirname, '../../../../stubs/defaultConfig.stub.js')
: path.resolve(__dirname, '../../../../stubs/simpleConfig.stub.js'),
'utf8'
)
@ -31,7 +29,7 @@ export function init(args, configs) {
messages.push(`${path.basename(postcssConfigLocation)} already exists.`)
} else {
let stubFile = fs.readFileSync(
path.resolve(__dirname, '../../../stubs/defaultPostCssConfig.stub.js'),
path.resolve(__dirname, '../../../../stubs/defaultPostCssConfig.stub.js'),
'utf8'
)

View file

@ -1,5 +1,3 @@
// @ts-check
export const env = {
DEBUG: process.env.DEBUG !== undefined && process.env.DEBUG !== '0',
OXIDE: process.env.OXIDE,