Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets).

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md).
15 changes: 15 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.4/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "master",
"privatePackages": {
"version": true,
"tag": true
},
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 3 additions & 2 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
branches: [master]

jobs:
build:
ci:
runs-on: ubuntu-latest

strategy:
Expand All @@ -26,4 +26,5 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm test
- run: npm run lint
- run: npm run test-silent
43 changes: 22 additions & 21 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,27 @@ node_modules
.yarn
# yarn.lock

src/components/oc.json
src/components/base-component-handlebars/_package
src/components/base-component-jade/_package
packages/oc/src/components/oc.json
packages/oc/src/components/base-component-handlebars/_package
packages/oc/src/components/base-component-jade/_package

test/fixtures/test.tar.gz
test/fixtures/targz-test
test/fixtures/components/circular-json-error/_package
test/fixtures/components/container-with-multiple-nested/_package
test/fixtures/components/container-with-nested/_package
test/fixtures/components/empty/_package
test/fixtures/components/hello-world/_package
test/fixtures/components/hello-world-custom-headers/_package
test/fixtures/components/jade-filters/_package
test/fixtures/components/language/_package
test/fixtures/components/lodash-component/_package
test/fixtures/components/no-containers/_package
test/fixtures/components/welcome/_package
test/fixtures/components/welcome-with-optional-parameters/_package
test/fixtures/components/hello-world-custom-cookies/_package
packages/oc/test/fixtures/test.tar.gz
packages/oc/test/fixtures/targz-test
packages/oc/test/fixtures/components/circular-json-error/_package
packages/oc/test/fixtures/components/container-with-multiple-nested/_package
packages/oc/test/fixtures/components/container-with-nested/_package
packages/oc/test/fixtures/components/empty/_package
packages/oc/test/fixtures/components/hello-world/_package
packages/oc/test/fixtures/components/hello-world-custom-headers/_package
packages/oc/test/fixtures/components/jade-filters/_package
packages/oc/test/fixtures/components/language/_package
packages/oc/test/fixtures/components/lodash-component/_package
packages/oc/test/fixtures/components/no-containers/_package
packages/oc/test/fixtures/components/welcome/_package
packages/oc/test/fixtures/components/welcome-with-optional-parameters/_package
packages/oc/test/fixtures/components/hello-world-custom-cookies/_package

logintervals.md
dist/
test-components/
packages/oc/logintervals.md
packages/oc/dist/
packages/oc/test-components/
.turbo/
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18
22
8 changes: 0 additions & 8 deletions .prettierrc

This file was deleted.

1 change: 0 additions & 1 deletion .yarnrc.yml

This file was deleted.

58 changes: 0 additions & 58 deletions AGENTS.md

This file was deleted.

28 changes: 22 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ If you want to send a Pull Request, ensure you join the conversation first on th

When preparing a pull request, ensure all the tests pass locally running `npm test`. If you have write/admin access, do it on a new branch on the upstream opencomponents repo. This allows all the test to run smoothly.

Pull requests should not include release/versioning changes (changesets, version bumps, publish steps) unless explicitly requested by the maintainer.

### Monorepo workflow

- Run repo-level commands from the repository root (`npm run lint`, `npm run build`, `npm run test`).
- The current workspace package is `packages/oc`.
- Turborepo orchestrates tasks across workspaces.
- Changesets are managed at repo root (`.changeset/`).

A couple of coding rules:

- never play with git history
Expand All @@ -20,16 +29,23 @@ A couple of coding rules:

### Publishing new version to npm

You need to be enabled for doing this.
This section is maintainer-only.

Contributors sending pull requests are **not** required to add changesets or decide version bumps.

Versioning and publishing are managed independently from the pull request workflow by the maintainer.

- `master` should be all green. If not, make it green first.
- git checkout master
- git pull --tags
- Run `npm run <versionType>` for new version.
- While on 0.X.X (not stable):
- `npm run publish-patch` for bugfixes, new features
- `npm run publish-minor` for all breaking changes
- `npm run publish-major` NOT YET. Still need to define milestones for 1.0.0.
- Check pending releases:
- `npm run changeset:status`
- Prepare release versions/changelog when needed:
- `npm run release:prepare`
- Publish to npm when needed (will ask for OTP when needed):
- `npm run release:publish`

`npm run release` runs both `release:prepare` and `release:publish`.

## Code of Conduct

Expand Down
59 changes: 29 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,40 @@
# ![oc](https://raw.githubusercontent.com/opencomponents/oc/master/logo-type.png)
# oc monorepo

OpenComponents, **serverless in the front-end world**.
This repository is now set up as a monorepo foundation using npm workspaces, Turborepo and Changesets.

OpenComponents is an open-source framework that allows fast-moving teams to easily build and deploy front-end components. It abstracts away complicated infrastructure and leaves developers with very simple, but powerful building blocks that handle scale transparently.
Current workspace packages:

#### How does it work?
- `packages/oc` (the existing `oc` package)

First, **you create your component**. It can contain logic to get some data (using node.js) and then the view, including css and js. It can be what you want, including _React_ or _Angular_ components or whatever you like.
## Monorepo structure

Then, **you publish it** to the OpenComponents registry and you wait a couple of seconds while the registry prepares your stuff to be production-ready.
```text
.
├── .changeset/
├── package.json # monorepo root scripts (turbo + changesets)
├── turbo.json # task pipeline
└── packages/
└── oc/
├── package.json
├── src/
├── test/
└── tasks/
```

Now, every web app in your private or public network can **consume the component** via its own HTTP endpoint during server-side rendering or just in the browser.
## Common commands (run from repo root)

We have been using it for more than two years in production at OpenTable, for shared components, third party widgets, e-mails and more. [Learn more about OC](http://tech.opentable.co.uk/blog/2016/04/27/opencomponents-microservices-in-the-front-end-world/).
- `npm run lint` – run lint across workspaces (via Turbo)
- `npm run build` – build all workspaces
- `npm run test` / `npm run test-silent` – run test pipelines
- `npm run changeset:status` – show pending release bumps
- `npm run release:prepare` – tests + apply pending changesets
- `npm run release:publish` – build + publish pending package releases

[![npm version](https://img.shields.io/npm/v/oc.svg)](https://npmjs.org/package/oc)
[![node version](https://img.shields.io/node/v/oc.svg)](https://npmjs.org/package/oc)
[![Known Vulnerabilities](https://snyk.io/test/github/opencomponents/oc/badge.svg)](https://snyk.io/test/github/opencomponents/oc)
[![downloads](https://img.shields.io/npm/dm/oc.svg?label=downloads+from+npm)](https://npmjs.org/package/oc)
[![Join the chat at https://gitter.im/opentable/oc](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/opentable/oc?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
## Package documentation

## Links
- Package docs: `packages/oc/README.md`
- Package changelog: `packages/oc/CHANGELOG.md`

- [Website](https://opencomponents.github.io)
- [Documentation](https://opencomponents.github.io/docs/intro)
- [Requirements and build status](#requirements-and-build-status)
- [Changelog](CHANGELOG.md)
- [Awesome resources about OC](https://github.com/matteofigus/awesome-oc)
- [Contributing guidelines](CONTRIBUTING.md)
- [Code of conduct](CONTRIBUTING.md#code-of-conduct)
- [Troubleshooting](CONTRIBUTING.md#troubleshooting)
- [Gitter chat](https://gitter.im/opentable/oc)
## Contributing

## Requirements and build status

Disclaimer: This project is still under heavy development and the API is likely to change at any time. In case you would find any issues, check the [troubleshooting page](CONTRIBUTING.md#troubleshooting).

## License

MIT
See [CONTRIBUTING.md](CONTRIBUTING.md).
4 changes: 2 additions & 2 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"$schema": "https://biomejs.dev/schemas/2.1.2/schema.json",
"$schema": "https://biomejs.dev/schemas/2.2.4/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false,
"includes": ["preview/**/*", "src/**/*", "!src/components/oc-client/**/*"]
"includes": ["packages/oc/**/*", "!packages/oc/dist/**/*", "!packages/oc/src/components/oc-client/**/*", "!packages/oc/test/**/*", "!packages/oc/tasks/**/*"]
},
"formatter": {
"enabled": true,
Expand Down
Loading
Loading