Skip to content
This repository has been archived by the owner on Jan 26, 2025. It is now read-only.

Set user agent for Angular, React, Vue libs - plus Jest #151

Merged
merged 2 commits into from
Mar 19, 2018

Conversation

robertjd
Copy link
Contributor

Uses the new property in AuthJS to append the framework lib to the user agent

Also adds unit testing via Jest for React, Vue

Angular not yet tested, will add a "unit" test to app.component.spec.ts after #143 lands in master

Uses the new property in AuthJS to append the framework lib to the user agent

Also adds unit testing via Jest for React, Vue

Angular not yet tested, will add a "unit" test to app.component.spec.ts after #143 lands in master
"prestart": "npm run build",
"pretest": "npm run build && npm run build:harness",
"prepublish": "npm run build",
"test": "npm run --prefix test/e2e/harness/ test",
"jest": "jest src/",
"test": "npm run jest && npm run --prefix test/e2e/harness/ test",
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm leaning towards thinking we should prepend npm run lint to this command. That way we can start enforcing the eslint style.

name: packageJson.name,
version: packageJson.version
};
const output = 'export default ' + JSON.stringify(packageInfo, null, 2) + ';'
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: There is no ; in our okta-vue/src/*.js files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This util script is at the root, so not part of lerna. I can put together a PR to add eslint to the root, but we'd have to do testing to make sure it doesn't break what we just fixed for windows.


const workingDirectory = process.argv[2];
const destinationFile = process.argv[3];
const packageJsonPath = path.join(process.cwd(), workingDirectory, 'package.json')
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing semicolon

"start": "npm run --prefix test/e2e/harness/ start",
"build": "rimraf dist/ && cross-env NODE_ENV=production webpack --config webpack.config.js --output-library-target=umd -p",
"build:harness": "npm --prefix test/e2e/harness install",
"build:package-info": "node ../../util/write-package-info.js . src/packageInfo.js",
Copy link
Contributor

Choose a reason for hiding this comment

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

We should consider using lerna run to handle this for us.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This task needs to be integrated into the build pipeline of each package, and ran locally while working on that specific package, so I'm not sure how lerna would help here?

- Add lniter to test in vue
- Fix issues in new util script
name: packageJson.name,
version: packageJson.version
};
const output = 'export default ' + JSON.stringify(packageInfo, null, 2) + ';';
Copy link
Contributor

Choose a reason for hiding this comment

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

As noted earlier, the trailing + ';' will result in eslint issues in our Vue package. Can we make this conditional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I excluded this file using the eslintignore in the vue package

Copy link
Contributor

Choose a reason for hiding this comment

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

Really? I'm seeing this after a clean install:
screen shot 2018-03-19 at 9 23 04 am

@robertdamphousse-okta robertdamphousse-okta merged commit fc794ef into master Mar 19, 2018
@robertdamphousse-okta robertdamphousse-okta deleted the rd-OKTA-158252-user-agents branch March 19, 2018 16:21
jmelberg-okta pushed a commit that referenced this pull request Mar 19, 2018
Uses the new property in AuthJS to append the framework lib to the user agent

Also adds unit testing via Jest for React, Vue

Angular not yet tested, will add a "unit" test to app.component.spec.ts after #143 lands in master

Add lniter to test in vue
jmelberg-okta pushed a commit that referenced this pull request Mar 20, 2018
Uses the new property in AuthJS to append the framework lib to the user agent

Also adds unit testing via Jest for React, Vue

Angular not yet tested, will add a "unit" test to app.component.spec.ts after #143 lands in master

Add lniter to test in vue
jmelberg-okta pushed a commit that referenced this pull request Mar 20, 2018
Uses the new property in AuthJS to append the framework lib to the user agent

Also adds unit testing via Jest for React, Vue

Angular not yet tested, will add a "unit" test to app.component.spec.ts after #143 lands in master

Add lniter to test in vue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants