Skip to content

Commit

Permalink
- Cleaned up deprecated getter methods related to collections, main, …
Browse files Browse the repository at this point in the history
…ejs, templates, and views

- Removed unused imports for deep_merge_no_overwrite and Collection
- Consolidated deprecated methods at the end of the class for clarity
- Maintained existing deprecation warnings for future reference
  • Loading branch information
brianpetro committed Feb 22, 2025
1 parent bd717c5 commit b38dfe8
Showing 1 changed file with 26 additions and 31 deletions.
57 changes: 26 additions & 31 deletions smart-environment/smart_env.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@
import { render as settings_template } from './components/settings.js';
import { SmartSettings } from 'smart-settings/smart_settings.js';
import { deep_merge } from './utils/deep_merge.js';
import { deep_merge_no_overwrite } from './utils/deep_merge_no_overwrite.js';
import { deep_remove_exclusive_props } from './utils/deep_remove_exclusive_props.js';
import { camel_case_to_snake_case } from './utils/camel_case_to_snake_case.js';
import { normalize_opts } from './utils/normalize_opts.js';
import { deep_clone_config } from './utils/deep_clone_config.js';
import { merge_env_config } from './utils/merge_env_config.js';
import { Collection } from 'smart-collections';

/**
* @class SmartEnv
Expand All @@ -55,10 +53,6 @@ export class SmartEnv {
this.load();
}, 5000);
}
/** @deprecated access `this.state` and `collection.state` directly instead */
get collections_loaded(){
return this.state === 'loaded';
}
/**
* Returns the config object for the SmartEnv instance.
* @returns {Object} The config object.
Expand Down Expand Up @@ -89,10 +83,6 @@ export class SmartEnv {
static set global_env(env) {
this.global_ref.smart_env = env;
}
/** @deprecated Use this.main_class_name instead of this.main/this.plugin */
get main() {
return this.smart_env_configs[this.mains[0]].main;
}
static get mains() {
return Object.keys(this.global_ref.smart_env_configs || {});
}
Expand Down Expand Up @@ -228,9 +218,6 @@ export class SmartEnv {
}
}




/**
* Triggers a save event in all known collections.
*/
Expand Down Expand Up @@ -395,24 +382,6 @@ export class SmartEnv {
return this.opts.item_types;
}

/**
* @deprecated use component pattern instead
*/
get ejs() {
return this.opts.ejs;
}
/**
* @deprecated use component pattern instead
*/
get templates() {
return this.opts.templates;
}
/**
* @deprecated use component pattern instead
*/
get views() {
return this.opts.views;
}

get fs_module_config() {
return this.opts.modules.smart_fs;
Expand Down Expand Up @@ -513,6 +482,32 @@ export class SmartEnv {

// DEPRECATED

/** @deprecated access `this.state` and `collection.state` directly instead */
get collections_loaded(){
return this.state === 'loaded';
}
/** @deprecated Use this['main_class_name'] instead of this.main/this.plugin */
get main() {
return this.smart_env_configs[this.mains[0]].main;
}
/**
* @deprecated use component pattern instead
*/
get ejs() {
return this.opts.ejs;
}
/**
* @deprecated use component pattern instead
*/
get templates() {
return this.opts.templates;
}
/**
* @deprecated use component pattern instead
*/
get views() {
return this.opts.views;
}
/**
* @deprecated use this.config instead
*/
Expand Down

0 comments on commit b38dfe8

Please sign in to comment.