oxc-configs 0.0.1 → 0.0.3

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.
Files changed (3) hide show
  1. package/README.md +0 -1
  2. package/index.ts +8 -23
  3. package/package.json +6 -6
package/README.md CHANGED
@@ -5,7 +5,6 @@ OXC toolset pre-made configs + fetch CLI.
5
5
  ## Prerequisites
6
6
 
7
7
  - Bun
8
- - GitHub CLI
9
8
 
10
9
  ## CLI Usage
11
10
 
package/index.ts CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { cancel, intro, isCancel, log, outro, select, spinner } from '@clack/prompts';
4
4
  import { $ } from 'bun';
5
- import { bold, green, red, yellow } from 'picocolors';
5
+ import { bold, green, yellow } from 'picocolors';
6
6
 
7
7
  enum Template {
8
8
  ReactTypeScript = 'react-typescript',
@@ -16,8 +16,6 @@ async function main() {
16
16
 
17
17
  intro(yellow(`@simek/oxc-configs`));
18
18
 
19
- await checkGHCLIAvailability();
20
-
21
19
  if (!template) {
22
20
  template = await select({
23
21
  message: 'Select OXC toolset configs template to download:',
@@ -51,23 +49,9 @@ async function main() {
51
49
  await fetchConfigsFromRepo(template, '.oxfmtrc.json');
52
50
  await fetchConfigsFromRepo(template, '.oxlintrc.json');
53
51
 
54
- outro(green('All done!'));
55
- }
52
+ await $`bunx --silent oxfmt@latest .oxfmtrc.json .oxlintrc.json`;
56
53
 
57
- export async function checkGHCLIAvailability() {
58
- try {
59
- await $`gh auth status`.quiet();
60
- } catch (error) {
61
- if (error instanceof $.ShellError) {
62
- const message = error.stderr.toString();
63
- if (message.includes('You are not logged')) {
64
- log.error(red(message));
65
- } else {
66
- log.error(red('GitHub CLI need to be installed on your system, see: https://cli.github.com/.'));
67
- }
68
- }
69
- process.exit(1);
70
- }
54
+ outro(green('All done!'));
71
55
  }
72
56
 
73
57
  export async function fetchConfigsFromRepo(template: string, fileName: string) {
@@ -94,11 +78,12 @@ export async function fetchConfigsFromRepo(template: string, fileName: string) {
94
78
  const progress = spinner();
95
79
  progress.start(`Fetching ${bold(fileName)} config file...`);
96
80
 
97
- const configContent = await $`gh api repos/simek/oxc-configs/contents/${template}/.oxfmtrc.json -q .content`.text();
98
-
99
- const config = JSON.parse(atob(configContent));
81
+ const configContent = await fetch(
82
+ `https://raw.githubusercontent.com/simek/oxc-configs/HEAD/${template}/${fileName}`
83
+ );
100
84
 
101
- await Bun.write(fileName, JSON.stringify(config, null, 2));
85
+ const config = await configContent.json();
86
+ await Bun.write(fileName, JSON.stringify(config));
102
87
 
103
88
  progress.stop(`${bold(fileName)} fetched and written`);
104
89
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "oxc-configs",
3
3
  "description": "OXC toolset pre-made configs.",
4
- "version": "0.0.1",
4
+ "version": "0.0.3",
5
5
  "bugs": {
6
6
  "url": "https://github.com/simek/oxc-configs/issues"
7
7
  },
@@ -20,14 +20,14 @@
20
20
  "lint:fix": "oxlint --type-aware --fix && oxfmt"
21
21
  },
22
22
  "dependencies": {
23
- "@clack/prompts": "^0.11.0",
23
+ "@clack/prompts": "^1.0.0",
24
24
  "picocolors": "^1.1.1"
25
25
  },
26
26
  "devDependencies": {
27
- "@types/bun": "^1.3.6",
28
- "oxfmt": "^0.26.0",
29
- "oxlint": "^1.41.0",
30
- "oxlint-tsgolint": "^0.11.1",
27
+ "@types/bun": "^1.3.7",
28
+ "oxfmt": "^0.27.0",
29
+ "oxlint": "^1.42.0",
30
+ "oxlint-tsgolint": "^0.11.3",
31
31
  "typescript": "^5.9.3"
32
32
  },
33
33
  "engines": {