Skip to content

Commit

Permalink
fix: move to packages/rolldown
Browse files Browse the repository at this point in the history
  • Loading branch information
kazupon authored and hyf0 committed Mar 20, 2024
1 parent 872d974 commit cf844b1
Show file tree
Hide file tree
Showing 20 changed files with 29 additions and 101 deletions.
1 change: 0 additions & 1 deletion .ls-lint.yml
Expand Up @@ -13,7 +13,6 @@ ignore:
- 'crates/rolldown/tests/fixtures/**/_test.js' # `_test.js` is a special file, which will be treat as the entry file while executing the build output of fixture.
- packages/rolldown/build.config.ts # convention name for using unbuild
- packages/rolldown/vitest.config.ts
- packages/cli/test/**/*.test.js
- web/docs/.vitepress/cache # cache files generated by vitepress
# FIXME: should not ignore following folders
- web
2 changes: 0 additions & 2 deletions packages/cli/bin/cli.js

This file was deleted.

20 changes: 0 additions & 20 deletions packages/cli/lib/utils.js

This file was deleted.

30 changes: 0 additions & 30 deletions packages/cli/package.json

This file was deleted.

3 changes: 0 additions & 3 deletions packages/cli/test/fixtures/package.json

This file was deleted.

31 changes: 0 additions & 31 deletions packages/cli/test/utils.test.js

This file was deleted.

2 changes: 2 additions & 0 deletions packages/rolldown/bin/cli.js
@@ -0,0 +1,2 @@
#!/usr/bin/env node
import('../cli/main.js')
File renamed without changes.
@@ -1,3 +1,2 @@
export const ERR_CLI_META_DATA = 'cli meta data error'
export const ERR_UNSUPPORTED_CONFIG_FORMAT =
"Unsupported config format. please use '.js', '.mjs' and '.ts' format"
11 changes: 3 additions & 8 deletions packages/cli/lib/main.js → packages/rolldown/cli/main.js
@@ -1,11 +1,6 @@
import { defineCommand, runMain, showUsage } from 'citty'
import { colors } from 'consola/utils'
import path from 'node:path'
import { URL } from 'node:url'
import { getPackageJSON } from './utils.js'

const __dirname = path.dirname(new URL(import.meta.url).pathname)
const { version, description } = getPackageJSON(path.resolve(__dirname, '..'))
import pkgJson from '../package.json' assert { type: 'json' }

/**
* NOTE:
Expand All @@ -16,8 +11,8 @@ const { version, description } = getPackageJSON(path.resolve(__dirname, '..'))
const main = defineCommand({
meta: {
name: 'rolldown',
version,
description,
version: pkgJson.version,
description: pkgJson.description,
},
args: {
config: {
Expand Down
10 changes: 10 additions & 0 deletions packages/rolldown/package.json
Expand Up @@ -13,9 +13,14 @@
"rolldown"
],
"files": [
"bin",
"dist",
"!dist/*.node"
],
"bin": {
"rolldown": "./bin/cli.js"
},
"type": "module",
"main": "./dist/index.cjs",
"types": "./dist/index.d.ts",
"exports": {
Expand Down Expand Up @@ -61,6 +66,11 @@
"armv7-linux-androideabi"
]
},
"dependencies": {
"citty": "^0.1.6",
"consola": "^3.2.3",
"jiti": "^1.21.0"
},
"devDependencies": {
"@napi-rs/cli": "^3.0.0-alpha.43",
"colorette": "^2.0.20",
Expand Down
@@ -1,9 +1,8 @@
import assert from 'node:assert'
import { describe, test } from 'node:test'
import { describe, test, assert } from 'vitest'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import { loadConfig } from '../lib/config.js'
import { ERR_UNSUPPORTED_CONFIG_FORMAT } from '../lib/errors.js'
import { loadConfig } from '../cli/config.js'
import { ERR_UNSUPPORTED_CONFIG_FORMAT } from '../cli/errors.js'

const __dirname = path.dirname(fileURLToPath(import.meta.url))

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/rolldown/vitest.config.mts
Expand Up @@ -2,7 +2,7 @@ import { defineConfig } from 'vitest/config'

export default defineConfig({
test: {
include: ['./test/runner.ts'],
include: ['./test/runner.ts', './test/*.test.js'],
testTimeout: 20000,
},
esbuild: {
Expand Down
10 changes: 10 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cf844b1

Please sign in to comment.