Skip to content

Commit

Permalink
chore: auto-bind mode
Browse files Browse the repository at this point in the history
  • Loading branch information
lifeart committed Dec 9, 2023
1 parent cb266ad commit be8821b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 56 deletions.
54 changes: 29 additions & 25 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { fileURLToPath, URL } from 'node:url';
import { resolve } from 'node:path';
import { generateDefineConfig } from './compat/ember-data-private-build-infra/index.ts';
import {
Addon,
Addon as AddonConstructor,
compatPath,
nodePath,
emberAppConfig,
App,
App as AppConstructor,
} from './plugins/ember';
import { eDataPackages, internalPackages } from './plugins/ember-vendor';

Expand All @@ -17,6 +17,12 @@ export default defineConfig(({ mode }) => {
const isProd = mode === 'production';
const isDev = mode === 'development';
const enableSourceMaps = isDev;
const Addon = (name: string) => {
return AddonConstructor(name, mode);
};
const App = () => {
return AppConstructor(mode);
};
return emberAppConfig(
{
build: {
Expand Down Expand Up @@ -59,11 +65,11 @@ export default defineConfig(({ mode }) => {
plugins: [],
},
[
App(mode),
App(),

...internalPackages(mode),

Addon('@ember-data', mode)
Addon('@ember-data')
.needBabel()
.addAliases(
eDataPackages().map((pkg) => ({
Expand All @@ -76,32 +82,30 @@ export default defineConfig(({ mode }) => {
/^@ember-data\/private-build-infra$/,
compatPath('ember-data-private-build-infra')
),
Addon('ember-notify', mode)
.needAlias()
.needBabel({ removeLegacyLayout: true }),
Addon('ember-wormhole', mode).needBabel({ removeLegacyLayout: true }),
Addon('ember-modal-dialog', mode)
Addon('ember-notify').needAlias().needBabel({ removeLegacyLayout: true }),
Addon('ember-wormhole').needBabel({ removeLegacyLayout: true }),
Addon('ember-modal-dialog')
.needAlias()
.needBabel({ removeLegacyLayout: true, dropImportSync: true }),
Addon('ember-responsive', mode).needBabel({ removeLegacyLayout: true }),
Addon('ember-bootstrap', mode).needAlias().needBabel(),
Addon('ember-power-select', mode).needBabel(),
Addon('ember-basic-dropdown', mode).needBabel(),
Addon('ember-ref-bucket', mode).needAlias().needBabel(),
Addon('ember-page-title', mode).needBabel(),
Addon('tracked-toolbox', mode).needAlias().needBabel(),
Addon('@ember-decorators/object', mode).needAlias(),
Addon('@ember-decorators/component', mode).needAlias(),
Addon('@ember-decorators/utils', mode).needAlias(),
Addon('ember-concurrency', mode).needAlias(),
Addon('ember-concurrency-decorators', mode).needAlias(),
Addon('ember-inflector', mode).needAlias(),
Addon('ember-modifier', mode).customModuleEntry('ember-modifier/dist'),
Addon('ember-intl', mode).addAlias(
Addon('ember-responsive').needBabel({ removeLegacyLayout: true }),
Addon('ember-bootstrap').needAlias().needBabel(),
Addon('ember-power-select').needBabel(),
Addon('ember-basic-dropdown').needBabel(),
Addon('ember-ref-bucket').needAlias().needBabel(),
Addon('ember-page-title').needBabel(),
Addon('tracked-toolbox').needAlias().needBabel(),
Addon('@ember-decorators/object').needAlias(),
Addon('@ember-decorators/component').needAlias(),
Addon('@ember-decorators/utils').needAlias(),
Addon('ember-concurrency').needAlias(),
Addon('ember-concurrency-decorators').needAlias(),
Addon('ember-inflector').needAlias(),
Addon('ember-modifier').customModuleEntry('ember-modifier/dist'),
Addon('ember-intl').addAlias(
'ember-intl/-private',
nodePath('ember-intl/addon/-private')
),
Addon('ember-simple-auth', mode)
Addon('ember-simple-auth')
.addNestedAlias(
'use-session-setup-method',
'./compat/ember-simple-auth/use-session-setup-method.ts'
Expand Down
33 changes: 2 additions & 31 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1245,36 +1245,7 @@
resolve "^1.20.0"
semver "^7.3.2"

"@embroider/[email protected]":
version "2.2.2"
resolved "https://registry.yarnpkg.com/@embroider/shared-internals/-/shared-internals-2.2.2.tgz#8f19c9a8621b4c3f061a4af5060a82ec024655eb"
integrity sha512-fOED89UjsNT8e/maA1P3co2D7q/UOmH3DMxqAlJyueyo57LKuVDXFDG6JUYiEyHb2H5eCrzIdGoHI5cz9rH3Ow==
dependencies:
babel-import-util "^1.1.0"
ember-rfc176-data "^0.3.17"
fs-extra "^9.1.0"
js-string-escape "^1.0.1"
lodash "^4.17.21"
resolve-package-path "^4.0.1"
semver "^7.3.5"
typescript-memoize "^1.0.1"

"@embroider/[email protected]":
version "2.4.0"
resolved "https://registry.yarnpkg.com/@embroider/shared-internals/-/shared-internals-2.4.0.tgz#0e9fdb0b2df9bad45fab8c54cbb70d8a2cbf01fc"
integrity sha512-pFE05ebenWMC9XAPRjadYCXXb6VmqjkhYN5uqkhPo+VUmMHnx7sZYYxqGjxfVuhC/ghS/BNlOffOCXDOoE7k7g==
dependencies:
babel-import-util "^2.0.0"
debug "^4.3.2"
ember-rfc176-data "^0.3.17"
fs-extra "^9.1.0"
js-string-escape "^1.0.1"
lodash "^4.17.21"
resolve-package-path "^4.0.1"
semver "^7.3.5"
typescript-memoize "^1.0.1"

"@embroider/[email protected]", "@embroider/shared-internals@^2.0.0", "@embroider/shared-internals@^2.2.3", "@embroider/shared-internals@^2.5.1":
"@embroider/[email protected]", "@embroider/shared-internals@^2.0.0", "@embroider/shared-internals@^2.5.1":
version "2.5.1"
resolved "https://registry.yarnpkg.com/@embroider/shared-internals/-/shared-internals-2.5.1.tgz#a4d8c057cbff293ef6eb29ee6537f263d206b444"
integrity sha512-b+TWDBisH1p6HeTbJIO8pgu1WzfTP0ZSAlZBqjXwOyrS0ZxP1qNYRrEX+IxyzIibEFjXBxeLakiejz3DJvZX5A==
Expand Down Expand Up @@ -7711,7 +7682,7 @@ is-ci@^2.0.0:
dependencies:
ci-info "^2.0.0"

is-core-module@^2.13.0, is-core-module@^2.9.0:
is-core-module@^2.13.0:
version "2.13.1"
resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.1.tgz#ad0d7532c6fea9da1ebdc82742d74525c6273384"
integrity sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==
Expand Down

0 comments on commit be8821b

Please sign in to comment.