Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Commit

Permalink
[terra-application] Convert terra-application repo to a mono repo (#245)
Browse files Browse the repository at this point in the history
* Convert terra-appliation to a mono repo

* travis and heroku fixes

* lint
  • Loading branch information
mjhenkes authored Jul 12, 2021
1 parent 0444c90 commit b165659
Show file tree
Hide file tree
Showing 621 changed files with 643 additions and 318 deletions.
1 change: 0 additions & 1 deletion .browserslistrc

This file was deleted.

10 changes: 5 additions & 5 deletions .github/ISSUE_TEMPLATE/BUG_REPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: "\U0001F41B Bug Report"
about: If something isn't working as expected
title: ''
labels: ":package: terra-application, :construction: Blocked: Functional Input, :construction:
labels: ":construction: Blocked: Functional Input, :construction:
Blocked: Accessibility Input, :construction: Blocked: Engineering Input, :construction:
Blocked: UX Input"
assignees: ''
Expand All @@ -19,10 +19,10 @@ assignees: ''
<!-- Please specify the exact steps you took for this bug to occur. -->
<!-- Provide as much detail as possible so we're able to reproduce these steps. -->

1.
2.
3.
4.
1.
2.
3.
4.

## Additional Context / Screenshots
<!-- Add any other context about the problem here. If applicable, add screenshots to help explain. -->
Expand Down
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/FEATURE_REQUEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: "\U0001F680 Feature Request"
about: Submit a proposal for a new feature
title: ''
labels: ":construction: Blocked: Accessibility Input, :construction: Blocked: Engineering
Input, :construction: Blocked: Functional Input, :construction: Blocked: UX Input,
:package: terra-application, Feature"
Input, :construction: Blocked: Functional Input, :construction: Blocked: UX Input, Feature"
assignees: ''

---
Expand Down
3 changes: 0 additions & 3 deletions .github/changelog.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ reports
target
**/wdio/**/__snapshots__/latest
**/wdio/**/__snapshots__/diff
**/wdio/**/__snapshots__/error
errorScreenshots
**/aggregated-translations/*.*
stats.json
aggregated-themes.js
package-lock.json
generated-themes
docker_images
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ before_script:
- docker load -i docker_images/images.tar || true
jobs:
include:
- stage: lint jest and compile
- stage: danger lint jest and compile
script:
# clear the cache of any old build artifacts
- rm -rf ./travis-build
- npm run danger
- npm run lint
- npm run jest
# These can't be built in parallel because the cache is a single object and you can't add to it in parallel
- npm run compile:prod -- --env.disableAggregateThemes --output-path $TRAVIS_BUILD_DIR/travis-build/default
- npm run compile:prod -- --output-path $TRAVIS_BUILD_DIR/travis-build/default
- npm run compile:lowlight -- --output-path $TRAVIS_BUILD_DIR/travis-build/lowlight
- npm run compile:fusion -- --output-path $TRAVIS_BUILD_DIR/travis-build/fusion
# Prime the docker cache
Expand Down Expand Up @@ -68,7 +69,7 @@ jobs:
on:
branch: main
stages:
- lint jest and compile
- danger lint jest and compile
- wdio
- name: deploy
if: type != pull_request
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2019 - 2020 Cerner Innovation, Inc.
Copyright 2019 - present Cerner Innovation, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2019 - 2020 Cerner Innovation, Inc.
Copyright 2019 - present Cerner Innovation, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
53 changes: 8 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,65 +1,28 @@
<!-- Logo -->
<p align="center">
<img height="128" width="128" src="https://github.com/cerner/terra-application/raw/main/terra.png" alt="terra logo" />
</p>

<!-- Name -->
<h1 align="center">
Terra Application
</h1>
# Terra Application

[![NPM version](https://badgen.net/npm/v/terra-application)](https://www.npmjs.org/package/terra-application)
[![Cerner OSS](https://badgen.net/badge/Cerner/OSS/blue)](http://engineering.cerner.com/2014/01/cerner-and-open-source/)
[![License](https://badgen.net/github/license/cerner/terra-application)](https://github.com/cerner/terra-application/blob/main/LICENSE)
[![Build Status](https://badgen.net/travis/cerner/terra-application)](https://travis-ci.com/cerner/terra-application)
[![Dependencies status](https://badgen.net/david/dep/cerner/terra-application)](https://david-dm.org/cerner/terra-application)
[![devDependencies status](https://badgen.net/david/dev/cerner/terra-application)](https://david-dm.org/cerner/terra-application?type=dev)
[![lerna](https://badgen.net/badge/maintained%20with/lerna/cc00ff)](https://lerna.js.org/)

A framework to support application development with Terra components.
Please see [terra-ui](https://engineering.cerner.com/terra-ui/home/terra-ui/index) for all terra documentation.

* [Getting Started](#getting-started)
* [Versioning](#versioning)
* [Contributing](#contributing)
* [LICENSE](#license)
## Internationalization (I18n)

## Getting Started

* Install with [npm](https://www.npmjs.com): `npm install --save terra-application`

## Peer Dependencies

This component requires the following peer dependencies be installed in your app for the component to properly function.

| Peer Dependency | Version |
|-|-|
| react | ^16.8.5 |
| react-dom | ^16.8.5 |
| react-intl | ^2.9.0 |

## Versioning

terra-application is considered to be stable and will follow [SemVer](https://semver.org/) for versioning.

1. MAJOR versions represent breaking changes
2. MINOR versions represent added functionality in a backwards-compatible manner
3. PATCH versions represent backwards-compatible bug fixes

Consult the component CHANGELOGs, related issues, and PRs for more information.

## Private Directories

Javascript in `private` directories is not part of Terra's public API and should not be consumed directly.
Please review [Terra's Internationalization documentation](https://engineering.cerner.com/terra-ui/#/getting-started/terra-ui/internationalization) for more information. Included are directions on consumption and how internationalization is setup.

## Contributing

Please read through our [contributing guidelines](CONTRIBUTING.md). Included are directions for issue reporting and pull requests.
Please read through our [contributing guidelines](https://engineering.cerner.com/terra-ui/about/terra-ui/contributing/contribution-guidelines). Included are directions for issue reporting and pull requests.

## LICENSE

Copyright 2019 - 2020 Cerner Innovation, Inc.
Copyright 2019 - present Cerner Innovation, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

<http://www.apache.org/licenses/LICENSE-2.0>
[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
4 changes: 2 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ This project is hosted on NPM. You can find the terra packages [here][project-u

Below is a guide for releasing packages:

1. Update the versions of the component and change log via `npm run prepare-for-release`
1. Update the versions of the components and changelogs via `npm run prepare-for-release`
2. Create a Release PR, Get approvals
3. Merge PR to `main`
4. Watch main to ensure releases get pushed to npm and tagged in github appropriately

[project-url]: https://www.npmjs.com/org/cerner/team/terra-ui
[project-url]: https://www.npmjs.com/org/cerner
48 changes: 48 additions & 0 deletions dangerfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import { danger, fail } from 'danger';

const lernaConfig = require('./lerna.json');

let ignorePatterns = [];

if (lernaConfig.command) {
ignorePatterns = lernaConfig.command.publish.ignoreChanges;
}

const CHANGELOG_PATTERN = /^packages\/([a-z-])*\/CHANGELOG\.md/i;

const changedFiles = danger.git.created_files.concat(danger.git.modified_files);

const changedChangelogs = new Set();
const changedPackages = new Set();

const getPackageName = (pattern) => pattern.split('packages/')[1].split('/')[0];

const ignorePackages = ignorePatterns.map((pattern) => getPackageName(pattern));

changedFiles.forEach((file) => {
// file isn't in a package so it has no changelog, skip further processing
if (file.substring(0, 9) !== 'packages/') {
return;
}

const packageName = getPackageName(file);

if (ignorePackages.includes(packageName)) {
// file is in a package that currently is not released, skip further processing
return;
}

if (CHANGELOG_PATTERN.test(file)) {
changedChangelogs.add(packageName);
} else { // file is in a package and was changed - we need a changelog
changedPackages.add(packageName);
}
});

const missingChangelogs = [...changedPackages].filter(packageName => !changedChangelogs.has(packageName));

// Fail if there are package changes without a CHANGELOG update
if (missingChangelogs.length > 0) {
fail(`Please include a CHANGELOG entry for each changed package on this PR. Looks like a CHANGELOG is missing for: \n\n - ${missingChangelogs.join('\n - ')}`);
}
16 changes: 16 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const jestConfig = require('@cerner/jest-config-terra');

module.exports = {
...jestConfig,
globalSetup: './jest.globalSetup.js',
setupFiles: [
'./jest.enzymeSetup.js',
],
snapshotSerializers: [
'enzyme-to-json/serializer',
],
moduleDirectories: [
'aggregated-translations',
'node_modules',
],
};
3 changes: 0 additions & 3 deletions jestsetup.js → jest.enzymeSetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,3 @@ Enzyme.configure({ adapter: new Adapter() });
global.shallow = shallow;
global.render = render;
global.mount = mount;

const htmlTag = document.getElementsByTagName('html')[0];
htmlTag.setAttribute('dir', 'ltr');
2 changes: 1 addition & 1 deletion jestGlobalSetup.js → jest.globalSetup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable import/no-extraneous-dependencies */
/* eslint-disable-next-line import/no-extraneous-dependencies */
const aggregateTranslations = require('@cerner/terra-aggregate-translations');

module.exports = () => {
Expand Down
37 changes: 0 additions & 37 deletions jestconfig.js

This file was deleted.

11 changes: 11 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"version": "independent",
"packages": ["packages/*"],
"command": {
"publish": {
"ignoreChanges": [
"packages/terra-application/**"
]
}
}
}
Loading

0 comments on commit b165659

Please sign in to comment.