@junobuild/config-loader 0.0.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.
@@ -0,0 +1,15 @@
1
+ import type { JunoConfig, JunoConfigFnOrObject, JunoDevConfig, JunoDevConfigFnOrObject } from '@junobuild/config';
2
+ import type { ConfigFilename, ConfigType } from '../types/config';
3
+ export declare const junoConfigExist: (params: {
4
+ filename: ConfigFilename;
5
+ }) => Promise<boolean>;
6
+ export declare const junoConfigFile: ({ filename }: {
7
+ filename: ConfigFilename;
8
+ }) => {
9
+ configPath: string;
10
+ configType: ConfigType;
11
+ };
12
+ export declare const readJunoConfig: <ConfigFnOrObject extends JunoConfigFnOrObject | JunoDevConfigFnOrObject, Config extends JunoConfig | JunoDevConfig>({ config, ...rest }: {
13
+ filename: ConfigFilename;
14
+ config: (userConfig: ConfigFnOrObject) => Config;
15
+ }) => Promise<Config>;
@@ -0,0 +1,2 @@
1
+ export * from './configs/juno.config';
2
+ export type * from './types/config';
@@ -0,0 +1,2 @@
1
+ export type ConfigType = 'ts' | 'js' | 'json';
2
+ export type ConfigFilename = `${'juno.'}${'' | 'dev.'}${'config'}`;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Adapted source from Stencil (https://github.com/ionic-team/stencil/blob/main/src/compiler/sys/node-require.ts)
3
+ */
4
+ export declare const nodeRequire: <T>({ id, extension }: {
5
+ id: string;
6
+ extension: string;
7
+ }) => {
8
+ default: T;
9
+ };
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@junobuild/config-loader",
3
+ "version": "0.0.1",
4
+ "description": "Utilities for reading and managing Juno's configuration settings.",
5
+ "author": "David Dal Busco (https://daviddalbusco.com)",
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "main": "./dist/node/index.mjs",
9
+ "module": "./dist/node/index.mjs",
10
+ "types": "./dist/types/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "import": {
14
+ "types": "./dist/types/index.d.ts",
15
+ "default": "./dist/node/index.mjs"
16
+ },
17
+ "require": {
18
+ "types": "./dist/types/index.d.ts",
19
+ "default": "./dist/node/index.mjs"
20
+ }
21
+ }
22
+ },
23
+ "files": [
24
+ "dist",
25
+ "README.md",
26
+ "LICENSE"
27
+ ],
28
+ "scripts": {
29
+ "rmdir": "node ../../scripts/rmdir.mjs",
30
+ "ts-declaration": "tsc --emitDeclarationOnly --outDir dist/types",
31
+ "build": "npm run rmdir && mkdir -p dist && node esbuild.mjs && npm run ts-declaration",
32
+ "prepack": "npm run build"
33
+ },
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "git+https://github.com/junobuild/juno-js.git",
37
+ "directory": "packages/cli-tools"
38
+ },
39
+ "bugs": {
40
+ "url": "https://github.com/junobuild/juno-js"
41
+ },
42
+ "keywords": [
43
+ "config",
44
+ "configuration",
45
+ "env",
46
+ "cli"
47
+ ],
48
+ "homepage": "https://juno.build",
49
+ "peerDependencies": {
50
+ "@junobuild/config": "*",
51
+ "@junobuild/utils": "*"
52
+ },
53
+ "dependencies": {
54
+ "@babel/core": "^7.24.6",
55
+ "@babel/plugin-transform-modules-commonjs": "^7.24.6",
56
+ "@babel/preset-typescript": "^7.24.6"
57
+ }
58
+ }