-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: upgrade rollup v4 and other packages
- Loading branch information
Showing
32 changed files
with
2,942 additions
and
1,244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@ice/pkg': major | ||
--- | ||
|
||
feat: upgrade rollup to v4 and other packages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,3 +48,4 @@ examples/**/.vscode | |
examples/**/.DS_Store | ||
examples/**/.docusaurus | ||
examples/**/build | ||
examples/**/typings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,2 @@ | ||
#!/usr/bin/env node | ||
|
||
import { fileURLToPath } from 'url'; | ||
import consola from 'consola'; | ||
import { cac } from 'cac'; | ||
import { readFileSync } from 'fs'; | ||
import { join, dirname } from 'path'; | ||
import pkgService, { getBuiltInPlugins } from '../lib/index.js'; | ||
|
||
const __dirname = dirname(fileURLToPath(import.meta.url)); | ||
|
||
const cli = cac('ice-pkg'); | ||
|
||
(async () => { | ||
cli | ||
.command('build', 'Bundle files', { | ||
allowUnknownOptions: false, | ||
}) | ||
.option('--config <config>', 'specify custom config path') | ||
.option('--analyzer', "visualize size of output files(it's only valid in bundle mode)", { | ||
default: false, | ||
}) | ||
.option('--rootDir <rootDir>', 'specify root directory', { | ||
default: process.cwd(), | ||
}) | ||
.action(async (options) => { | ||
delete options['--']; | ||
const { rootDir, ...commandArgs } = options; | ||
|
||
await pkgService.run({ | ||
command: 'build', | ||
commandArgs, | ||
getBuiltInPlugins, | ||
rootDir: options.rootDir, | ||
}); | ||
}); | ||
|
||
cli | ||
.command('start', 'Watch files', { | ||
allowUnknownOptions: false, | ||
}) | ||
.option('--config <config>', 'specify custom config path') | ||
.option('--analyzer', "visualize size of output files(it's only valid in bundle mode)", { | ||
default: false, | ||
}) | ||
.option('--rootDir <rootDir>', 'specify root directory', { | ||
default: process.cwd(), | ||
}) | ||
.action(async (options) => { | ||
delete options['--']; | ||
const { rootDir, ...commandArgs } = options; | ||
|
||
await pkgService.run({ | ||
command: 'start', | ||
commandArgs, | ||
getBuiltInPlugins, | ||
rootDir: options.rootDir, | ||
}); | ||
}); | ||
|
||
cli.help(); | ||
|
||
const pkgPath = join(__dirname, '../package.json'); | ||
cli.version(JSON.parse(readFileSync(pkgPath, 'utf-8')).version); | ||
|
||
cli.parse(process.argv, { run: true }); | ||
})() | ||
.catch((err) => { | ||
consola.error(err); | ||
process.exit(1); | ||
}); | ||
import '../lib/cli.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import { fileURLToPath } from 'node:url'; | ||
import consola from 'consola'; | ||
import { cac } from 'cac'; | ||
import { readFileSync } from 'node:fs'; | ||
import { join, dirname } from 'node:path'; | ||
import { pkgService } from './service.js'; | ||
import { getBuiltInPlugins } from './utils.js'; | ||
|
||
const __dirname = dirname(fileURLToPath(import.meta.url)); | ||
|
||
const cli = cac('ice-pkg'); | ||
|
||
(async () => { | ||
cli | ||
.command('build', 'Bundle files', { | ||
allowUnknownOptions: false, | ||
}) | ||
.option('--config <config>', 'specify custom config path') | ||
.option('--analyzer', "visualize size of output files(it's only valid in bundle mode)", { | ||
default: false, | ||
}) | ||
.option('--rootDir <rootDir>', 'specify root directory', { | ||
default: process.cwd(), | ||
}) | ||
.action(async (options) => { | ||
delete options['--']; | ||
const { rootDir, ...commandArgs } = options; | ||
|
||
await pkgService.run({ | ||
command: 'build', | ||
commandArgs, | ||
getBuiltInPlugins, | ||
rootDir: options.rootDir, | ||
}); | ||
}); | ||
|
||
cli | ||
.command('start', 'Watch files', { | ||
allowUnknownOptions: false, | ||
}) | ||
.option('--config <config>', 'specify custom config path') | ||
.option('--analyzer', "visualize size of output files(it's only valid in bundle mode)", { | ||
default: false, | ||
}) | ||
.option('--rootDir <rootDir>', 'specify root directory', { | ||
default: process.cwd(), | ||
}) | ||
.action(async (options) => { | ||
delete options['--']; | ||
const { rootDir, ...commandArgs } = options; | ||
|
||
await pkgService.run({ | ||
command: 'start', | ||
commandArgs, | ||
getBuiltInPlugins, | ||
rootDir: options.rootDir, | ||
}); | ||
}); | ||
|
||
cli.help(); | ||
|
||
const pkgPath = join(__dirname, '../package.json'); | ||
cli.version(JSON.parse(readFileSync(pkgPath, 'utf-8')).version); | ||
|
||
cli.parse(process.argv, { run: true }); | ||
})() | ||
.catch((err) => { | ||
consola.error(err); | ||
process.exit(1); | ||
}); |
Oops, something went wrong.