@magidoc/plugin-starter-variables
Advanced tools
Comparing version 0.7.0 to 0.7.1
@@ -1,2 +0,6 @@ | ||
import common from './common'; | ||
export { common }; | ||
import templates from './variables/templates'; | ||
import magidoc from './variables/magidoc'; | ||
import type { Variable, ViteVariable } from './variables/variable'; | ||
export { templates }; | ||
export { magidoc }; | ||
export type { Variable, ViteVariable }; |
@@ -1,2 +0,3 @@ | ||
export { default as common } from './common/index.js'; | ||
export { default as templates } from './variables/templates.js'; | ||
export { default as magidoc } from './variables/magidoc.js'; | ||
//# sourceMappingURL=index.js.map |
@@ -5,3 +5,3 @@ { | ||
"private": false, | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"type": "module", | ||
@@ -8,0 +8,0 @@ "license": "MIT", |
@@ -1,3 +0,7 @@ | ||
import common from './common' | ||
import templates from './variables/templates' | ||
import magidoc from './variables/magidoc' | ||
import type { Variable, ViteVariable } from './variables/variable' | ||
export { common } | ||
export { templates } | ||
export { magidoc } | ||
export type { Variable, ViteVariable } |
import * as variables from '../src/index' | ||
import type { Variable } from '../src/variable' | ||
import type { Variable } from '../src/variables/variable' | ||
describe('variables', () => { | ||
it('contains the right number of export keys', () => { | ||
expect(Object.keys(variables)).toEqual(['common']) | ||
expect(Object.keys(variables)).toEqual(['templates', 'magidoc']) | ||
}) | ||
it('contains the right common variables', () => { | ||
expect(Object.keys(variables.common)).toEqual(['APP_LOGO', 'APP_TITLE']) | ||
it('contains the right templates variables', () => { | ||
expect(Object.keys(variables.templates)).toEqual(['APP_LOGO', 'APP_TITLE']) | ||
testStringVariable(variables.common.APP_TITLE, 'VITE_APP_TITLE') | ||
testStringVariable(variables.common.APP_LOGO, 'VITE_APP_LOGO') | ||
testStringVariable(variables.templates.APP_TITLE, 'VITE_APP_TITLE') | ||
testStringVariable(variables.templates.APP_LOGO, 'VITE_APP_LOGO') | ||
}) | ||
it('contains the right magidoc variables', () => { | ||
expect(Object.keys(variables.magidoc)).toEqual(['MAGIDOC_GENERATE']) | ||
testBooleanVariable( | ||
variables.magidoc.MAGIDOC_GENERATE, | ||
'VITE_MAGIDOC_GENERATE', | ||
) | ||
}) | ||
}) | ||
@@ -32,1 +41,25 @@ | ||
} | ||
function testBooleanVariable(target: Variable<boolean>, viteKey: string) { | ||
expect(target.vite.key).toEqual(viteKey) | ||
expect(target.vite.get({ [viteKey]: true })).toBe(true) | ||
expect(target.vite.get({ [viteKey]: 'true' })).toBe(true) | ||
expect(target.vite.get({ [viteKey]: 't' })).toBe(true) | ||
expect(target.vite.get({ [viteKey]: '1' })).toBe(true) | ||
expect(target.vite.get({ [viteKey]: 12 })).toBe(true) | ||
expect(target.vite.get({ [viteKey]: false })).toBe(false) | ||
expect(target.vite.get({ [viteKey]: 'false' })).toBe(false) | ||
expect(target.vite.get({ [viteKey]: 'wow' })).toBe(false) | ||
expect(target.vite.get({ [viteKey]: 0 })).toBe(false) | ||
expect(target.vite.get({ [viteKey]: {} })).toBeNull() | ||
expect(target.vite.get({ [viteKey]: null })).toBeNull() | ||
expect(target.vite.get({ [viteKey]: undefined })).toBeNull() | ||
expect(target.vite.get({})).toBeNull() | ||
expect(target.vite.getOrDefault({ [viteKey]: false }, true)).toBe(false) | ||
expect(target.vite.getOrDefault({ [viteKey]: {} }, true)).toBe(true) | ||
expect(target.vite.getOrDefault({}, true)).toBe(true) | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14195
26
304
1