feima-shortcuts 0.1.5-beta.0 → 0.1.5-beta.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "feima-shortcuts",
3
- "version": "0.1.5-beta.0",
3
+ "version": "0.1.5-beta.1",
4
4
  "description": "快捷指令",
5
5
  "main": "index.js",
6
6
  "directories": {
@@ -19,7 +19,7 @@ function generateComponent(answers) {
19
19
  const folderName = `f-${kebabName}`;
20
20
 
21
21
  // 创建组件目录结构
22
- const componentDir = path.join(__dirname, '../../../src/', folderName);
22
+ const componentDir = path.resolve(process.cwd(), `src/${folderName}`);
23
23
  const srcDir = path.join(componentDir, 'src');
24
24
  const testsDir = path.join(componentDir, '__tests__');
25
25
 
@@ -134,7 +134,7 @@ describe('${componentName}', () => {
134
134
  * 更新主入口文件
135
135
  */
136
136
  function updateMainIndex(componentName) {
137
- const indexPath = path.join(__dirname, '../../../src/index.ts');
137
+ const indexPath = path.resolve(process.cwd(), 'src/index.ts');
138
138
 
139
139
  if (!fs.existsSync(indexPath)) {
140
140
  console.log('⚠️ index.ts 文件不存在,跳过更新');
@@ -204,7 +204,7 @@ function updateMainIndex(componentName) {
204
204
  * 更新解析器文件
205
205
  */
206
206
  function updateResolver(componentName) {
207
- const resolverPath = path.join(__dirname, '../../../src/resolver.ts');
207
+ const resolverPath = path.resolve(process.cwd(), 'src/resolver.ts');
208
208
 
209
209
  if (!fs.existsSync(resolverPath)) {
210
210
  console.log('⚠️ resolver.ts 文件不存在,跳过更新');