@uniformdev/cli 19.209.0 → 19.210.0

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 (2) hide show
  1. package/dist/index.mjs +37 -18
  2. package/package.json +8 -8
package/dist/index.mjs CHANGED
@@ -112,29 +112,48 @@ var cleanFileName = (proposedFileName) => {
112
112
  return proposedFileName.replace(/[/<>$+%>!`&*'|{}?"=:\\@]/g, "-");
113
113
  };
114
114
  var loadConfig = (configPath) => {
115
- const moduleName = "uniform";
116
- const syncCosmicExplorer = cosmiconfigSync("uniform", {
117
- searchPlaces: [`${moduleName}.config.js`, `${moduleName}.config.ts`, `${moduleName}.config.json`],
118
- loaders: {
119
- ".ts": TypeScriptLoader()
120
- }
121
- });
122
- if (configPath) {
123
- if (!fs.existsSync(configPath)) {
124
- throw new Error(`Invalid configuration file path: ${configPath}. File does not exist.`);
115
+ try {
116
+ const moduleName = "uniform";
117
+ const syncCosmicExplorer = cosmiconfigSync("uniform", {
118
+ searchPlaces: [`${moduleName}.config.js`, `${moduleName}.config.ts`, `${moduleName}.config.json`],
119
+ loaders: {
120
+ ".ts": TypeScriptLoader()
121
+ }
122
+ });
123
+ let loadedConfig;
124
+ if (configPath) {
125
+ if (!fs.existsSync(configPath)) {
126
+ throw new Error(
127
+ `Invalid --config file path: ${configPath}. File does not exist.
128
+
129
+ ${defaultConfigContents}`
130
+ );
131
+ }
132
+ loadedConfig = syncCosmicExplorer.load(configPath);
133
+ } else {
134
+ loadedConfig = syncCosmicExplorer.search();
125
135
  }
126
- const configFile = syncCosmicExplorer.load(configPath);
127
- if (!configFile?.config.serialization) {
136
+ if (loadedConfig && !loadedConfig.config.serialization) {
128
137
  throw new Error(
129
- `Invalid configuration file: ${configPath}. Missing config.serialization configuration.`
138
+ `Invalid configuration file: ${loadedConfig?.filepath}. Missing serialization configuration.
139
+
140
+ ${defaultConfigContents}`
130
141
  );
131
142
  }
132
- return applyDefaultSyncConfiguration(configFile?.config ?? {});
133
- } else {
134
- const searchedForm = syncCosmicExplorer.search();
135
- return applyDefaultSyncConfiguration(searchedForm?.config ?? {});
143
+ return applyDefaultSyncConfiguration(loadedConfig?.config ?? {});
144
+ } catch (error) {
145
+ console.error(error.message);
146
+ process.exit(1);
136
147
  }
137
148
  };
149
+ var defaultConfigContents = `Here is an example uniform.config.ts for reference:
150
+
151
+ import { uniformConfig } from '@uniformdev/cli/config';
152
+
153
+ export default uniformConfig({
154
+ preset: 'all',
155
+ });
156
+ `;
138
157
 
139
158
  // src/sync/fileSyncEngineDataSource.ts
140
159
  async function createFileSyncEngineDataSource({
@@ -8393,7 +8412,7 @@ import { PostHog } from "posthog-node";
8393
8412
  // package.json
8394
8413
  var package_default = {
8395
8414
  name: "@uniformdev/cli",
8396
- version: "19.209.0",
8415
+ version: "19.210.0",
8397
8416
  description: "Uniform command line interface tool",
8398
8417
  license: "SEE LICENSE IN LICENSE.txt",
8399
8418
  main: "./cli.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/cli",
3
- "version": "19.209.0",
3
+ "version": "19.210.0",
4
4
  "description": "Uniform command line interface tool",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./cli.js",
@@ -27,12 +27,12 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@thi.ng/mime": "^2.2.23",
30
- "@uniformdev/assets": "19.209.0",
31
- "@uniformdev/canvas": "19.209.0",
32
- "@uniformdev/context": "19.209.0",
33
- "@uniformdev/files": "19.209.0",
34
- "@uniformdev/project-map": "19.209.0",
35
- "@uniformdev/redirect": "19.209.0",
30
+ "@uniformdev/assets": "19.210.0",
31
+ "@uniformdev/canvas": "19.210.0",
32
+ "@uniformdev/context": "19.210.0",
33
+ "@uniformdev/files": "19.210.0",
34
+ "@uniformdev/project-map": "19.210.0",
35
+ "@uniformdev/redirect": "19.210.0",
36
36
  "call-bind": "^1.0.2",
37
37
  "colorette": "2.0.20",
38
38
  "cosmiconfig": "9.0.0",
@@ -79,5 +79,5 @@
79
79
  "publishConfig": {
80
80
  "access": "public"
81
81
  },
82
- "gitHead": "8e4f9dd23cb5dd695511f73714b3ef055acf1955"
82
+ "gitHead": "0bf0f0eaaae612c7f69b859aa6c78e9b039c496f"
83
83
  }