@particle/tooling 0.1.0 → 0.1.2

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/lib/migrate.js CHANGED
@@ -4,6 +4,7 @@ import { readdir, readFile, rm, writeFile } from 'node:fs/promises';
4
4
  import path from 'node:path';
5
5
  import { promisify, styleText } from 'node:util';
6
6
 
7
+ import toolingPackage from '../package.json' with { type: 'json' };
7
8
  import { parseJsonc } from './jsonc.js';
8
9
 
9
10
  const execFile = promisify(execFileCallback);
@@ -534,9 +535,8 @@ export async function createPlan(dir, style, options = {}) {
534
535
  if (!Object.hasOwn(STYLES, style)) {
535
536
  throw new Error(`Unknown style "${style}". Expected one of: ${Object.keys(STYLES).join(', ')}`);
536
537
  }
537
- const own = await readOwnJson('package.json');
538
- const toolingSpec = options.toolingSpec ?? `^${own.version}`;
539
- const typescriptSpec = own.peerDependencies.typescript;
538
+ const toolingSpec = options.toolingSpec ?? `^${toolingPackage.version}`;
539
+ const typescriptSpec = toolingPackage.peerDependencies.typescript;
540
540
  const packageSource = await readFile(path.join(dir, 'package.json'), 'utf8');
541
541
  const pkg = JSON.parse(packageSource);
542
542
  const original = structuredClone(pkg);
@@ -579,7 +579,7 @@ export async function createPlan(dir, style, options = {}) {
579
579
  plan.dependencies.push(`add typescript ${typescriptSpec}`);
580
580
  }
581
581
  if (style !== 'js' && pkg.devDependencies?.[TYPE_AWARE_LINTER] === undefined) {
582
- const spec = own.peerDependencies[TYPE_AWARE_LINTER];
582
+ const spec = toolingPackage.peerDependencies[TYPE_AWARE_LINTER];
583
583
  pkg.devDependencies = { ...pkg.devDependencies, [TYPE_AWARE_LINTER]: spec };
584
584
  plan.dependencies.push(
585
585
  `add ${TYPE_AWARE_LINTER} ${spec} (runs the type-aware lint rules, such as no-floating-promises)`
package/oxfmt.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import type { OxfmtConfig } from 'oxfmt';
2
+
3
+ declare const config: OxfmtConfig;
4
+ export default config;
@@ -0,0 +1,4 @@
1
+ import type { OxlintConfig } from 'oxlint';
2
+
3
+ declare const config: OxlintConfig;
4
+ export default config;
package/oxlint.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import type { OxlintConfig } from 'oxlint';
2
+
3
+ declare const config: OxlintConfig;
4
+ export default config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@particle/tooling",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Shared oxlint, oxfmt and TypeScript configuration for Particle projects",
5
5
  "homepage": "https://github.com/particle-iot-inc/particle-tooling",
6
6
  "bugs": {
@@ -18,16 +18,28 @@
18
18
  "files": [
19
19
  "bin/init.js",
20
20
  "lib",
21
+ "oxfmt.d.ts",
21
22
  "oxfmt.js",
23
+ "oxlint-typescript.d.ts",
22
24
  "oxlint-typescript.js",
25
+ "oxlint.d.ts",
23
26
  "oxlint.js",
24
27
  "tsconfig"
25
28
  ],
26
29
  "type": "module",
27
30
  "exports": {
28
- "./oxlint": "./oxlint.js",
29
- "./oxlint-typescript": "./oxlint-typescript.js",
30
- "./oxfmt": "./oxfmt.js",
31
+ "./oxlint": {
32
+ "types": "./oxlint.d.ts",
33
+ "default": "./oxlint.js"
34
+ },
35
+ "./oxlint-typescript": {
36
+ "types": "./oxlint-typescript.d.ts",
37
+ "default": "./oxlint-typescript.js"
38
+ },
39
+ "./oxfmt": {
40
+ "types": "./oxfmt.d.ts",
41
+ "default": "./oxfmt.js"
42
+ },
31
43
  "./tsconfig/*.json": "./tsconfig/*.json"
32
44
  },
33
45
  "publishConfig": {