-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(cli): fix linting in vue project and rework headless initialization #150
Conversation
- Rebased PR on vue-lint to ensure we're greenlit on all sides. - Add vetur.config.js to allow the use of vetur in a monorepo context - Disabled node/no-unpublished-import for vue: We need to import devDeps for typechecking because the template is installing them on the fly. (already done on angular and react) - Removed declaration: Cannot overrride typing of Vue $root (or at least I didn't find how) - Morphed isEnvValid into a type-guard - Smite all non-null assertion operators - And err the big one: Reworked all comps': they now instantiate their state in the data, because it makes so much more sense considering Vue life-cycle. To that end: the global mixin now instead does a `beforeCreate` that write in the data of the root component. Inspired from https://vuejs.org/v2/guide/state-management.html#Simple-State-Management-from-Scratch - Validate type check, both in our and in the enduser code (i.e. our linter is happy, and vue's one happy too) https://coveord.atlassian.net/browse/CDX-180
Pull Request Report PR Title ✅ Title follows the conventional commit spec. |
/** | ||
* Making sure all environment variables are defined | ||
* | ||
* @returns true if the .env file is valid. false otherwise. | ||
*/ | ||
export function isEnvValid() { | ||
export function isEnvValid(env: NodeJS.ProcessEnv): env is ValidEnvironment { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Did not know about that. Super useful
<script lang="ts"> | ||
import Vue from 'vue'; | ||
|
||
export default Vue.extend({ | ||
name: 'FacetValue', | ||
props: ['facetValue'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a shame we can't have prop types for custom object...
Vue.mixin(engineService.mixin); | ||
const engine = getEngine(token); | ||
Vue.mixin({ | ||
beforeCreate: function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for finding that
OG PR is #149 differences are:
The 🥖commit:
isEnvValid
into a type-guardTo that end: the global mixin now instead does a
beforeCreate
that writes in the data of the root component. Inspired from https://vuejs.org/v2/guide/state-management.html#Simple-State-Management-from-Scratchhttps://coveord.atlassian.net/browse/CDX-180