Skip to content

Commit

Permalink
build!: switch from lerna to nx and compile to esm with tsup
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Drop Internet Explorer support
  • Loading branch information
jordan-a-young committed Apr 18, 2022
1 parent c4cacf0 commit c586085
Show file tree
Hide file tree
Showing 150 changed files with 24,492 additions and 18,594 deletions.
2 changes: 1 addition & 1 deletion .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
'*.js': ['eslint --fix', 'prettier --write', 'jest --bail --findRelatedTests'],
'*.js': ['yarn lint:fix', 'prettier --write'],
};
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ Packages in this repository are designed to work with the following browsers

### Internet Explorer Support

Active support for Internet Explorer was dropped in August 2021. Some packages use `core-js` and `babel` to polyfill unsupported features, but this will be phased out over time.
Active support for Internet Explorer was dropped in August 2021. As of 04/2021 we no longer output CommonJS and instead output ESM. We also do not provide any polyfills. These will need to be configured in your own environment.

If you still need support for IE 11, you need to either:
You must use an older version of the package if you still need support for IE 11.

- Use [`@availity/workflow >=8.5.0 && <9.0.0`](https://github.com/Availity/availity-workflow/blob/master/packages/workflow/CHANGELOG.md#850-2021-04-07). This will transpile _all_ your code and add polyfills needed for IE 11 support.
- If you are not using `@availity/workflow`, or cannot upgrade to at least `8.5.0`, then you will need to import the package's compiled code from its `/lib` folder.
TODO: get list of ie supported versions

## Contributing

Expand Down
26 changes: 0 additions & 26 deletions babel.config.json

This file was deleted.

6 changes: 1 addition & 5 deletions bundlesize.config.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"files": [
{
"path": "./packages/**/lib/index.js",
"maxSize": "1.5 kB"
},
{
"path": "./packages/**/dist/index.js",
"path": "./dist/index.js",
"maxSize": "1.5 kB"
}
]
Expand Down
37 changes: 27 additions & 10 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
module.exports = {
testPathIgnorePatterns: ['/node_modules', '<rootDir>/plopfile.js', '/lib/', '/dist/', '/docs/'],

collectCoverageFrom: ['packages/**/*.{js,ts}'],
coveragePathIgnorePatterns: ['/node_modules/', '/coverage/', '/dist/', '/docs/', '/lib/', '.d.ts'],

testEnvironment: 'jest-environment-jsdom-global',
testURL: 'http://localhost:8080',

globals: {
jsdom: true,
testMatch: ['**/+(*.)+(spec|test).+(ts|js)?(x)'],
transform: {
'^.+\\.(ts|js|html)$': 'ts-jest',
},
resolver: '@nrwl/builders/plugins/jest/resolver',
moduleFileExtensions: ['ts', 'js'],
collectCoverage: false,
coverageReporters: ['html'],
projects: [
'<rootDir>',
'<rootDir>/packages/*',
'<rootDir>/packages/analytics-core',
'<rootDir>/packages/api-axios',
'<rootDir>/packages/authorizations-axios',
'<rootDir>/packages/authorizations-core',
'<rootDir>/packages/dl-axios',
'<rootDir>/packages/dl-core',
'<rootDir>/packages/env-var',
'<rootDir>/packages/exceptions-core',
'<rootDir>/packages/native-form',
'<rootDir>/packages/message-core',
'<rootDir>/packages/resolve-url',
'<rootDir>/packages/relay-id',
'<rootDir>/packages/upload-core',
'<rootDir>/packages/yup',
'<rootDir>/packages/dockyard',
'<rootDir>/packages/exceptions-axios',
],
};
3 changes: 3 additions & 0 deletions jest.preset.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const nxPreset = require('@nrwl/jest/preset');

module.exports = { ...nxPreset };
18 changes: 0 additions & 18 deletions lerna.json

This file was deleted.

40 changes: 40 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"extends": "@nrwl/workspace/presets/npm.json",
"npmScope": "availity",
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": ["build", "test", "lint", "package", "prepare", "bundlesize"]
}
}
},
"targetDependencies": {
"build": [
{
"target": "build",
"projects": "dependencies"
}
],
"prepare": [
{
"target": "prepare",
"projects": "dependencies"
}
],
"package": [
{
"target": "package",
"projects": "dependencies"
}
]
},
"affected": {
"defaultBase": "master"
},
"pluginsConfig": {
"@nrwl/js": {
"analyzeSourceFiles": true
}
}
}
85 changes: 37 additions & 48 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,79 +15,68 @@
"packages/*",
"docusaurus"
],
"engines": {
"yarn": "^3.0.0",
"node": "^12.0.0 || ^14.0.0 || ^16.0.0"
},
"scripts": {
"bootstrap": "lerna bootstrap --use-workspaces",
"build": "NODE_ENV=production yarn lerna run build --ignore @availity/dinosaurdocs",
"build:docs": "yarn workspace @availity/dinosaurdocs build",
"bundlesize": "bundlesize",
"check": "npm-check -u && lerna exec --bail false --concurrency 1 -- npm-check -u",
"check:dependencies": "node scripts/check-missing-deps.js",
"build": "nx run-many --target=build --all",
"build:docs": "nx build dinosaurdocs",
"build:affected": "nx affected --target=build",
"bundlesize": "nx run-many --target=bundlesize --all",
"check-deps": "adio",
"check:packages": "sh ./scripts/artifactory-check.sh",
"clean": "lerna clean --yes",
"clean:builds": "yarn lerna run clean --ignore @availity/dinosaurdocs",
"clean:docs": "yarn workspace @availity/dinosaurdocs clean",
"clean:locks": "rimraf yarn.lock",
"clean:coverage": "rimraf coverage/",
"nuke": "yarn clean:locks && yarn clean:builds && yarn clean:docs && yarn clean:coverage && yarn clean",
"clean": "nx run-many --target=clean --all && rm -rf node_modules",
"codecov:ci": "codecov",
"deploy:docs": "yarn workspace @availity/dinosaurdocs build && gh-pages -d docusaurus/build --message 'deployed docs [skip ci]'",
"format": "prettier --write '**/*.{js,ts}' --ignore-unknown",
"format:check": "prettier --check '**/*.{js,ts}' --ignore-unknown",
"postinstall": "yarn bootstrap",
"link": "lerna link",
"lint": "eslint .",
"deploy:docs": "yarn build:docs && gh-pages -d docusaurus/build --message 'deployed docs [skip ci]'",
"dev": "nx run-many --target=dev --all",
"format:check": "nx format:check --all",
"format:write": "nx format:write --all",
"lint:fix": "nx run-many --target=lint:fix --all",
"lint": "nx run-many --target=lint --all",
"new": "plop",
"prepare": "is-ci || husky install",
"prepublishOnly": "yarn build",
"publish": "lerna publish",
"publish:canary": "lerna publish -c",
"release": "yarn check:packages && yarn run publish --yes",
"release:canary": "yarn check:packages && lerna publish -c",
"release:ci": "yarn run publish --yes",
"nx": "nx",
"postinstall": "is-ci || husky install",
"publish": "nx affected --target version",
"publish-dry-run": "nx affected --target version --dryRun",
"start": "yarn workspace @availity/dinosaurdocs start",
"test": "jest",
"test:ci": "yarn jest --runInBand --collectCoverage",
"updated": "lerna updated"
},
"resolutions": {
"ua-parser-js": "0.7.28"
"test:affected": "nx affected --target=test",
"test:ci": "nx run-many --target=test --parallel=3 --runInBand --coverage",
"test": "nx run-many --target=test --all"
},
"devDependencies": {
"@babel/cli": "^7.16.0",
"@babel/core": "^7.16.5",
"@babel/plugin-proposal-class-properties": "^7.16.5",
"@babel/plugin-proposal-private-methods": "^7.16.5",
"@babel/plugin-proposal-private-property-in-object": "^7.16.5",
"@babel/preset-env": "^7.16.5",
"@commitlint/cli": "^12.1.3",
"@commitlint/config-conventional": "^12.1.3",
"@commitlint/config-lerna-scopes": "^12.1.3",
"@commitlint/cli": "^15.0.0",
"@commitlint/config-conventional": "^15.0.0",
"@commitlint/config-lerna-scopes": "^15.0.0",
"@jscutlery/semver": "^2.22.0",
"@nrwl/cli": "13.10.2",
"@nrwl/jest": "^13.10.2",
"@nrwl/workspace": "13.10.2",
"@types/jest": "^26.0.0",
"@types/node": "^14.0.0",
"@typescript-eslint/eslint-plugin": "^4.31.1",
"@typescript-eslint/parser": "^4.31.1",
"babel-jest": "^26.6.3",
"babel-preset-react-app": "^10.0.0",
"adio": "^1.2.1",
"bundlesize": "^0.18.1",
"codecov": "^3.8.3",
"conventional-changelog-cli": "^2.1.1",
"conventional-recommended-bump": "^6.1.0",
"core-js": "^3.12.1",
"dependency-check": "^4.1.0",
"eslint": "^7.0.0",
"eslint-config-availity": "^8.0.6",
"gh-pages": "^3.2.3",
"husky": "^6.0.0",
"is-ci": "^3.0.0",
"jest": "^26.6.3",
"jest-environment-jsdom": "^26.6.2",
"jest-environment-jsdom-global": "^2.0.4",
"lerna": "^4.0.0",
"lint-staged": "^11.2.3",
"nock": "^13.1.4",
"nx": "13.10.2",
"plop": "^2.7.6",
"prettier": "^2.5.1",
"rimraf": "^3.0.2",
"ts-jest": "^26.0.0",
"tslib": "^2.3.1",
"typescript": "^4.4.4",
"xhr-mock": "^2.4.1"
}
},
"packageManager": "yarn@3.2.0"
}
2 changes: 2 additions & 0 deletions packages/analytics-core/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
extends: ../../.eslintrc.yml
ignorePatterns: ['!**/*', 'node_modules/', 'lib/', 'dist/']
10 changes: 10 additions & 0 deletions packages/analytics-core/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
displayName: 'analytics-core',
preset: '../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
},
},
coverageDirectory: '../../coverage/analytics-core',
};
26 changes: 15 additions & 11 deletions packages/analytics-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,28 @@
},
"license": "MIT",
"author": "Kasey Powers <kasey.powers@availity.com>",
"main": "lib/index.js",
"module": "src/index.js",
"types": "types/index.d.ts",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"scripts": {
"build": "yarn clean && yarn transpile",
"clean": "rimraf ./lib",
"transpile": "babel --root-mode upward src -d lib --ignore **/*.test.js"
"build": "tsup src/index.js --format esm,cjs --dts",
"dev": "tsup src/index.js --format esm,cjs --watch --dts",
"lint": "eslint src",
"lint:fix": "eslint src --fix",
"clean": "rm -rf node_modules && rm -rf dist",
"bundlesize": "bundlesize",
"publish": "yarn npm publish --tolerate-republish --access public"
},
"dependencies": {
"@babel/runtime": "^7.16.5",
"core-js": "^3.12.1",
"yup": "^0.32.9"
},
"devDependencies": {
"@availity/api-axios": "^6.0.8"
"@availity/api-axios": "workspace:*",
"@nrwl/jest": "^13.10.2",
"tsup": "^5.10.1",
"typescript": "^4.5.3"
},
"publishConfig": {
"access": "public"
},
"gitHead": "21b480acb7fc70e240d88451cee8adecb5ddde56"
}
}
22 changes: 22 additions & 0 deletions packages/analytics-core/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"root": "packages/analytics-core",
"projectType": "library",
"targets": {
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/analytics-core"],
"options": {
"jestConfig": "packages/analytics-core/jest.config.js",
"passWithNoTests": true
}
},
"version": {
"executor": "@jscutlery/semver:version",
"options": {
"preset": "angular",
"commitMessageFormat": "chore(${projectName}): release version ${version} [skip ci]",
"tagPrefix": "@availity/${projectName}@"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
/* eslint-disable @typescript-eslint/no-explicit-any */
declare class AvAnalytics {
plugins: any[];

attributePrefix: string;

recursive: boolean;

pageTracking: boolean;

isPageTracking: boolean;

hasInit: boolean;

constructor(
plugins: any[],
plugins: any | any[],
promise?: PromiseConstructor,
pageTracking?: boolean,
autoTrack?: boolean,
Expand All @@ -25,7 +37,7 @@ declare class AvAnalytics {

init(): void;

setPageTracking(value: any): void;
setPageTracking(value?: any): void;

trackEvent(properties: any): Promise<any[]>;

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit c586085

Please sign in to comment.