Skip to content
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

Merged
merged 14 commits into from
Apr 14, 2021

Conversation

louis-bompart
Copy link
Collaborator

OG PR is #149 differences are:

The 🥖commit:

  • Add vetur.config.js to allow the use of vetur in a mono repo context (see https://vuejs.github.io/vetur/guide/setup.html#advanced)
  • 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 override 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 writes 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 end-user code (i.e. our linter is happy, and Vue's one happy too)

https://coveord.atlassian.net/browse/CDX-180

louis-bompart and others added 11 commits February 24, 2021 16:21
- 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
@louis-bompart louis-bompart added the do not merge This pull request is not meant to be merged label Apr 13, 2021
@github-actions
Copy link
Contributor

Pull Request Report

PR Title

✅ Title follows the conventional commit spec.

@louis-bompart louis-bompart changed the base branch from vue-lint&pretty to master April 13, 2021 19:31
@louis-bompart louis-bompart removed the do not merge This pull request is not meant to be merged label Apr 13, 2021
/**
* 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 {
Copy link
Contributor

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'],
Copy link
Contributor

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 () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for finding that

@louis-bompart louis-bompart merged commit 336890c into master Apr 14, 2021
@louis-bompart louis-bompart deleted the CDX-180-baguettified branch July 29, 2021 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants