@deot/dev-builder 2.8.2 → 2.9.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/dist/index.cjs CHANGED
@@ -44,7 +44,7 @@ const path__namespace = /*#__PURE__*/_interopNamespaceDefault(path);
44
44
  const fs__namespace = /*#__PURE__*/_interopNamespaceDefault(fs$1);
45
45
  const sass__namespace = /*#__PURE__*/_interopNamespaceDefault(sass);
46
46
 
47
- const dirname$1 = path__namespace.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))));
47
+ const dirname$1 = path__namespace.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))));
48
48
  const run$3 = async (options) => {
49
49
  const locals = devShared.Locals.impl();
50
50
  const { cwd, workspace } = locals;
@@ -62,8 +62,7 @@ const run$3 = async (options) => {
62
62
  const { scriptFormats, external, globals } = commandOptions;
63
63
  const stats = [];
64
64
  const files = fs.existsSync(srcDir) ? fs.readdirSync(srcDir).filter((i) => /^index\.(.*)\.?(t|j)s$/.test(i)) : [];
65
- if (!files.length)
66
- return stats;
65
+ if (!files.length) return stats;
67
66
  const build = async (format, filepath) => {
68
67
  const buildOptions = {
69
68
  files: [filepath],
@@ -162,7 +161,7 @@ const run$2 = async (options) => {
162
161
  return stats;
163
162
  };
164
163
 
165
- const dirname = path__namespace.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))));
164
+ const dirname = path__namespace.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))));
166
165
  const run$1 = async (options) => {
167
166
  const { workspace, packageDir: packageRootDir } = devShared.Locals.impl();
168
167
  const { isVuePackage, packageDir, packageOutDir, packageSourceDir, packageOptions, commandOptions } = options;
@@ -214,6 +213,7 @@ const run$1 = async (options) => {
214
213
  const configPath = `${tempDir}/api-extractor.json`;
215
214
  fs.outputFileSync(configPath, JSON.stringify({
216
215
  extends: path__namespace.relative(tempDir, path__namespace.resolve(dirname, "../api-extractor.shared.json")),
216
+ // eslint-disable-next-line @stylistic/max-len
217
217
  mainEntryPointFilePath: (workspace ? `./${workspace}/` : "./") + path__namespace.relative(packageRootDir, `${packageSourceDir}/index.d.ts`),
218
218
  // workspace、时以temp/packages/*/src结构,否则APIExtractor会报错
219
219
  dtsRollup: {
@@ -300,8 +300,7 @@ class Build {
300
300
  return;
301
301
  }
302
302
  const files = fs.existsSync(srcDir) ? fs.readdirSync(srcDir).filter((i) => /^index(.*)\.(ts|js|s?css)$/.test(i)) : [];
303
- if (!files.length)
304
- return;
303
+ if (!files.length) return;
305
304
  const spinner = ora(`${packageName} Build ...`);
306
305
  try {
307
306
  spinner.start();
@@ -376,8 +375,7 @@ const run = (options) => devShared.Utils.autoCatch(async () => {
376
375
  });
377
376
  inputs = relations.concat(inputs);
378
377
  }
379
- if (options.dryRun)
380
- return devShared.Shell.spawn(`echo ${inputs.join(" ")}`);
378
+ if (options.dryRun) return devShared.Shell.spawn(`echo ${inputs.join(" ")}`);
381
379
  await inputs.reduce(
382
380
  (preProcess, packageFolderName$) => {
383
381
  preProcess = preProcess.then(() => build(packageFolderName$, options).process());
package/dist/index.js CHANGED
@@ -36,8 +36,7 @@ const run$3 = async (options) => {
36
36
  const { scriptFormats, external, globals } = commandOptions;
37
37
  const stats = [];
38
38
  const files = fs$1.existsSync(srcDir) ? fs$1.readdirSync(srcDir).filter((i) => /^index\.(.*)\.?(t|j)s$/.test(i)) : [];
39
- if (!files.length)
40
- return stats;
39
+ if (!files.length) return stats;
41
40
  const build = async (format, filepath) => {
42
41
  const buildOptions = {
43
42
  files: [filepath],
@@ -188,6 +187,7 @@ const run$1 = async (options) => {
188
187
  const configPath = `${tempDir}/api-extractor.json`;
189
188
  fs$1.outputFileSync(configPath, JSON.stringify({
190
189
  extends: path.relative(tempDir, path.resolve(dirname, "../api-extractor.shared.json")),
190
+ // eslint-disable-next-line @stylistic/max-len
191
191
  mainEntryPointFilePath: (workspace ? `./${workspace}/` : "./") + path.relative(packageRootDir, `${packageSourceDir}/index.d.ts`),
192
192
  // workspace、时以temp/packages/*/src结构,否则APIExtractor会报错
193
193
  dtsRollup: {
@@ -274,8 +274,7 @@ class Build {
274
274
  return;
275
275
  }
276
276
  const files = fs$1.existsSync(srcDir) ? fs$1.readdirSync(srcDir).filter((i) => /^index(.*)\.(ts|js|s?css)$/.test(i)) : [];
277
- if (!files.length)
278
- return;
277
+ if (!files.length) return;
279
278
  const spinner = ora(`${packageName} Build ...`);
280
279
  try {
281
280
  spinner.start();
@@ -350,8 +349,7 @@ const run = (options) => Utils.autoCatch(async () => {
350
349
  });
351
350
  inputs = relations.concat(inputs);
352
351
  }
353
- if (options.dryRun)
354
- return Shell.spawn(`echo ${inputs.join(" ")}`);
352
+ if (options.dryRun) return Shell.spawn(`echo ${inputs.join(" ")}`);
355
353
  await inputs.reduce(
356
354
  (preProcess, packageFolderName$) => {
357
355
  preProcess = preProcess.then(() => build(packageFolderName$, options).process());
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@deot/dev-builder",
3
- "version": "2.8.2",
3
+ "version": "2.9.1",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
8
8
  ".": {
9
+ "types": "./dist/index.d.ts",
9
10
  "import": "./dist/index.js",
10
- "require": "./dist/index.cjs",
11
- "types": "./dist/index.d.ts"
11
+ "require": "./dist/index.cjs"
12
12
  }
13
13
  },
14
14
  "files": [
@@ -29,23 +29,23 @@
29
29
  }
30
30
  },
31
31
  "dependencies": {
32
- "@deot/dev-react": "^2.8.0",
33
- "@deot/dev-shared": "^2.8.0",
34
- "@deot/dev-vue": "^2.8.0",
35
- "@microsoft/api-extractor": "^7.38.5",
36
- "autoprefixer": "^10.4.16",
37
- "chalk": "^5.3.0",
38
- "cssnano": "^6.0.1",
39
- "fs-extra": "^11.2.0",
40
- "ora": "^7.0.1",
41
- "postcss": "^8.4.32",
32
+ "@deot/dev-react": "^2.9.1",
33
+ "@deot/dev-shared": "^2.9.1",
34
+ "@deot/dev-vue": "^2.9.1",
35
+ "@microsoft/api-extractor": "^7.52.2",
36
+ "autoprefixer": "^10.4.21",
37
+ "chalk": "^5.4.1",
38
+ "cssnano": "^7.0.6",
39
+ "fs-extra": "^11.3.0",
40
+ "ora": "^8.2.0",
41
+ "postcss": "^8.5.3",
42
42
  "postcss-flexbugs-fixes": "^5.0.2",
43
- "postcss-import": "^15.1.0",
43
+ "postcss-import": "^16.1.0",
44
44
  "postcss-url": "^10.1.3",
45
- "sass": "^1.69.5",
46
- "vite": "^5.0.8"
45
+ "sass": "^1.86.3",
46
+ "vite": "^6.2.5"
47
47
  },
48
48
  "devDependencies": {
49
- "typescript": "^5.3.3"
49
+ "typescript": "^5.8.2"
50
50
  }
51
51
  }
package/shared.config.ts CHANGED
@@ -37,8 +37,8 @@ const external$ = !usedForBrowser
37
37
  .map(i => new RegExp(`^${i}$`))
38
38
  ]
39
39
  : external.split(',')
40
- .filter((i: string) => !!i)
41
- .map((i: string) => new RegExp(`^${i}$`));
40
+ .filter((i: string) => !!i)
41
+ .map((i: string) => new RegExp(`^${i}$`));
42
42
 
43
43
  // alias
44
44
  const replacement = (name: string) => path.resolve(cwd, `./packages/${name}`);
@@ -84,6 +84,7 @@ export default defineConfig({
84
84
  minify: false,
85
85
  target: 'esnext',
86
86
  lib: {
87
+ cssFileName: 'style',
87
88
  entry: files.map((file: string) => path.resolve(packageSourceDir, file)),
88
89
  formats: [format],
89
90
  name: getGlobalName(packageName)