Skip to content

Commit

Permalink
split feature packages and fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
alec-chernicki committed Dec 21, 2023
1 parent e34f3ab commit 40f5d7e
Show file tree
Hide file tree
Showing 470 changed files with 1,490 additions and 521 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
".": "./dist/utilities/index.js"
},
"description": "Infinitely scalable front-end ecosystems",
"repository": "https://github.com/commonalityco/commonality/packages/commonality",
"repository": "https://github.com/commonalityco/commonality/apps/commonality",
"bugs": "https://github.com/commonalityco/commonalityco/issues",
"homepage": "https://commonality.co",
"license": "MPL-2.0",
Expand Down Expand Up @@ -72,12 +72,14 @@
"devDependencies": {
"@commonalityco/config-tsconfig": "workspace:*",
"@commonalityco/data-codeowners": "workspace:*",
"@commonalityco/data-conformance": "workspace:*",
"@commonalityco/data-constraints": "workspace:*",
"@commonalityco/data-packages": "workspace:*",
"@commonalityco/data-project": "workspace:*",
"@commonalityco/data-tags": "workspace:*",
"@commonalityco/feature-conformance": "workspace:*",
"@commonalityco/feature-constraints": "workspace:*",
"@commonalityco/types": "workspace:*",
"@commonalityco/utils-conformance": "workspace:*",
"@commonalityco/utils-constraints": "workspace:*",
"@commonalityco/utils-core": "workspace:*",
"@swc/core": "^1.3.86",
"@types/fs-extra": "^11.0.2",
Expand All @@ -86,6 +88,7 @@
"@types/prompts": "^2.4.4",
"@types/update-notifier": "^6.0.5",
"@types/wait-on": "^5.3.1",
"dts-bundle-generator": "^9.0.0",
"esbuild": "^0.19.3",
"eslint-config-commonality": "workspace:*",
"mock-stdin": "^1.0.0",
Expand All @@ -94,4 +97,4 @@
"tsup": "^8.0.1",
"typescript": "^5.2.2"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ program
.description('Infinitely scalable front-end ecosystems')
.version(packageJson.version);

program.addCommand(check);
program.addCommand(constrain);
program.addCommand(studio);
program.addCommand(check);

program.parse(process.argv);
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { beforeEach, describe, expect, it, test, vi } from 'vitest';
import { action as check } from './check.js';
import { ConformanceResult } from '@commonalityco/feature-conformance/utilities';
import { ConformanceResult } from '@commonalityco/utils-conformance';
import process from 'node:process';
import console from 'node:console';
import { PackageType, Status } from '@commonalityco/utils-core';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
runFixes,
getStatusForResults,
ConformanceResult,
} from '@commonalityco/feature-conformance/utilities';
} from '@commonalityco/utils-conformance';
import { Command } from 'commander';
import {
getProjectConfig,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node
import { Command } from 'commander';
import { getConstraintResults } from '@commonalityco/feature-constraints/data';
import { getConstraintResults } from '@commonalityco/data-constraints';
import { ConstraintResult } from '@commonalityco/types';
import ora from 'ora';
import c from 'chalk';
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions apps/commonality/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export {
diff,
createTestCheck,
defineCheck,
} from '@commonalityco/utils-conformance';
export { text, json } from '@commonalityco/data-conformance';

export { defineConfig } from './define-config.js';
export { PackageJson, Workspace } from '@commonalityco/types';
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ const config: Options = {
platform: 'node',
outDir: './dist/utilities',
noExternal: [/^@commonalityco\/.*/],
dts: true,
dts: {
resolve: true,
},
};

export default config;
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion apps/studio/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const nextConfig = {
'@commonalityco/data-packages',
'@commonalityco/data-project',
'@commonalityco/data-tags',
'@commonalityco/feature-conformance',
'@commonalityco/ui-conformance',
'@commonalityco/utils-conformance',
'@commonalityco/feature-graph',
'@commonalityco/ui-core',
'@commonalityco/ui-design-system',
Expand Down
7 changes: 5 additions & 2 deletions apps/studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,18 @@
"@babel/preset-env": "^7.23.6",
"@commonalityco/config-tailwind": "workspace:*",
"@commonalityco/data-codeowners": "workspace:*",
"@commonalityco/data-constraints": "workspace:*",
"@commonalityco/data-packages": "workspace:*",
"@commonalityco/data-project": "workspace:*",
"@commonalityco/data-tags": "workspace:*",
"@commonalityco/feature-conformance": "workspace:*",
"@commonalityco/feature-constraints": "workspace:*",
"@commonalityco/types": "workspace:*",
"@commonalityco/ui-conformance": "workspace:*",
"@commonalityco/ui-constraints": "workspace:*",
"@commonalityco/ui-core": "workspace:*",
"@commonalityco/ui-design-system": "workspace:*",
"@commonalityco/ui-package": "workspace:*",
"@commonalityco/utils-conformance": "workspace:*",
"@commonalityco/utils-constraints": "workspace:*",
"@commonalityco/utils-core": "workspace:*",
"@commonalityco/utils-package": "workspace:*",
"@hookform/resolvers": "^3.3.1",
Expand Down
2 changes: 1 addition & 1 deletion apps/studio/src/app/(graph)/@chart/loading.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GraphChartLoading } from '@commonalityco/feature-constraints/components';
import { GraphChartLoading } from '@commonalityco/ui-constraints';

function ChartLoading() {
return <GraphChartLoading />;
Expand Down
2 changes: 1 addition & 1 deletion apps/studio/src/app/(graph)/@chart/studio-chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { slugifyPackageName } from '@commonalityco/utils-core';
import {
FeatureGraphChart,
GraphChartLoading,
} from '@commonalityco/feature-constraints/components';
} from '@commonalityco/ui-constraints';

function StudioChart(
props: Omit<
Expand Down
2 changes: 1 addition & 1 deletion apps/studio/src/app/(graph)/@chart/worker.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { createWorker } from '@commonalityco/feature-constraints/utilities';
import { createWorker } from '@commonalityco/utils-constraints';

createWorker();
2 changes: 1 addition & 1 deletion apps/studio/src/app/(graph)/@sidebar/studio-sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use client';
import { FeatureGraphSidebar } from '@commonalityco/feature-constraints/components';
import { FeatureGraphSidebar } from '@commonalityco/ui-constraints';
import { setCookie } from 'cookies-next';
import { ComponentProps } from 'react';

Expand Down
3 changes: 1 addition & 2 deletions apps/studio/src/app/(graph)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import {
GraphLayoutAside,
GraphLayoutMain,
GraphLayoutRoot,
FeatureGraphHeader,
GraphProvider,
} from '@commonalityco/feature-constraints/components';
} from '@commonalityco/ui-constraints';
import StudioGraphHeader from './studio-graph-header';

export default async function RootLayout({
Expand Down
2 changes: 1 addition & 1 deletion apps/studio/src/app/(graph)/studio-graph-header.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use server';
import { EditConfigButton } from '@/components/edit-config-button';
import { getConstraintsData } from '@/data/constraints';
import { FeatureGraphHeader } from '@commonalityco/feature-constraints/components';
import { FeatureGraphHeader } from '@commonalityco/ui-constraints';
import React from 'react';

async function StudioGraphHeader() {
Expand Down
2 changes: 1 addition & 1 deletion apps/studio/src/app/(graph)/studio-graph-overlays.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
import {
FeatureGraphDependencyTooltip,
FeatureGraphPackageTooltip,
} from '@commonalityco/feature-constraints/components';
} from '@commonalityco/ui-constraints';
import { Package, TagsData } from '@commonalityco/types';
import { useState } from 'react';

Expand Down
4 changes: 2 additions & 2 deletions apps/studio/src/app/(packages)/packages/get-table-data.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CodeownersData, Package, TagsData } from '@commonalityco/types';
import { ColumnData } from '@commonalityco/feature-conformance/ui';
import { ConformanceResult } from '@commonalityco/feature-conformance/utilities';
import { ColumnData } from '@commonalityco/ui-conformance';
import { ConformanceResult } from '@commonalityco/utils-conformance';

function keyBy<Data extends Record<string, any>>(
array: Data[],
Expand Down
4 changes: 2 additions & 2 deletions apps/studio/src/app/(packages)/packages/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import { getConformanceResultsData } from '@/data/conformance';
import omit from 'lodash/omit';
import stripAnsi from 'strip-ansi';
import { EditConfigButton } from '@/components/edit-config-button';
import { ConformanceHeader } from '@commonalityco/feature-conformance/ui';
import type { ConformanceResult } from '@commonalityco/feature-conformance/utilities';
import { ConformanceHeader } from '@commonalityco/ui-conformance';
import type { ConformanceResult } from '@commonalityco/utils-conformance';

async function PackagesPage({ searchParams = {} }: { searchParams: unknown }) {
const [packages, tagsData, codeownersData, results] = await Promise.all([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Package } from '@commonalityco/types';
import { PackageType } from '@commonalityco/utils-core';
import { expect, it, vi } from 'vitest';
import { Row } from '@tanstack/react-table';
import { ColumnData } from '@commonalityco/feature-conformance/ui';
import { ColumnData } from '@commonalityco/ui-conformance';

const mocks = vi.hoisted(() => {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
SortableHeader,
TagsCell,
ColumnData,
} from '@commonalityco/feature-conformance/ui';
} from '@commonalityco/ui-conformance';
import {
DropdownMenu,
DropdownMenuContent,
Expand Down
2 changes: 1 addition & 1 deletion apps/studio/src/data/conformance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'server-only';
import { getProjectConfig } from '@commonalityco/data-project';
import { getPackagesData } from './packages';
import { getTagsData } from '@commonalityco/data-tags';
import { getConformanceResults } from '@commonalityco/feature-conformance';
import { getConformanceResults } from '@commonalityco/utils-conformance';
import { getCodeownersData } from '@commonalityco/data-codeowners';

export const getConformanceResultsData = async () => {
Expand Down
2 changes: 1 addition & 1 deletion apps/studio/src/data/constraints.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getDependencies, getPackages } from '@commonalityco/data-packages';
import { getProjectConfig } from '@commonalityco/data-project';
import { getTagsData } from '@commonalityco/data-tags';
import { getConstraintResults } from '@commonalityco/feature-constraints/data';
import { getConstraintResults } from '@commonalityco/data-constraints';

export const getConstraintsData = async () => {
const projectConfig = await getProjectConfig({
Expand Down
4 changes: 2 additions & 2 deletions apps/studio/tailwind.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = {
getPkgPattern('@commonalityco/ui-design-system'),
getPkgPattern('@commonalityco/ui-package'),
getPkgPattern('@commonalityco/ui-core'),
getPkgPattern('@commonalityco/feature-conformance'),
getPkgPattern('@commonalityco/feature-constraints'),
getPkgPattern('@commonalityco/ui-conformance'),
getPkgPattern('@commonalityco/ui-constraints'),
],
};
4 changes: 2 additions & 2 deletions apps/workshop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"type-check": "tsc --noEmit"
},
"dependencies": {
"@commonalityco/feature-conformance": "workspace:*",
"@commonalityco/feature-constraints": "workspace:*",
"@commonalityco/types": "workspace:*",
"@commonalityco/ui-conformance": "workspace:*",
"@commonalityco/ui-constraints": "workspace:*",
"@commonalityco/ui-core": "workspace:*",
"@commonalityco/ui-design-system": "workspace:*",
"@commonalityco/ui-package": "workspace:*",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react';
import { ConformanceResults } from '@commonalityco/feature-conformance/ui';
import { ConformanceResults } from '@commonalityco/ui-conformance';
import { PackageType, Status } from '@commonalityco/utils-core';

// More on how to set up stories at: https://storybook.js.org/docs/7.0/react/writing-stories/introduction
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react';
import { ConstraintResults } from '@commonalityco/feature-constraints/components';
import { ConstraintResults } from '@commonalityco/ui-constraints';
import { DependencyType } from '@commonalityco/utils-core';

// More on how to set up stories at: https://storybook.js.org/docs/7.0/react/writing-stories/introduction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
import {
FeatureGraphToolbar,
GraphProvider,
} from '@commonalityco/feature-constraints/components';
} from '@commonalityco/ui-constraints';
import { Violation } from '@commonalityco/types';

// More on how to set up stories at: https://storybook.js.org/docs/7.0/react/writing-stories/introduction
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { createWorker } from '@commonalityco/feature-constraints/utilities';
import { createWorker } from '@commonalityco/utils-constraints';

createWorker();
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import type { Meta, StoryObj } from '@storybook/react';
import {
FeatureGraphChart,
GraphProvider,
} from '@commonalityco/feature-constraints/components';
} from '@commonalityco/ui-constraints';
import { DependencyType, PackageType } from '@commonalityco/utils-core';
import { ConstraintResult, Dependency, Package } from '@commonalityco/types';
import { GraphLayoutMain } from '@commonalityco/feature-constraints/components';
import { GraphLayoutMain } from '@commonalityco/ui-constraints';
import GraphWorker from './feature-graph-worker.ts?worker';
// const newWorker = new Worker(
// new URL('./feature-graph-worker.ts', import.meta.url),
Expand Down
2 changes: 1 addition & 1 deletion apps/workshop/src/stories/ui-graph/graph-chart.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react';
import { GraphChart } from '@commonalityco/feature-constraints/components';
import { GraphChart } from '@commonalityco/ui-constraints';

// More on how to set up stories at: https://storybook.js.org/docs/7.0/react/writing-stories/introduction
const meta = {
Expand Down
2 changes: 1 addition & 1 deletion apps/workshop/src/stories/ui-graph/sidebar.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react';
import { Sidebar } from '@commonalityco/feature-constraints/components';
import { Sidebar } from '@commonalityco/ui-constraints';
import type { Package } from '@commonalityco/types';
import { PackageType } from '@commonalityco/utils-core';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react';
import { TooltipDependency } from '@commonalityco/feature-constraints/components';
import { TooltipDependency } from '@commonalityco/ui-constraints';
import { DependencyType } from '@commonalityco/utils-core';

// More on how to set up stories at: https://storybook.js.org/docs/7.0/react/writing-stories/introduction
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react';
import { TooltipPackage } from '@commonalityco/feature-constraints/components';
import { TooltipPackage } from '@commonalityco/ui-constraints';
import { PackageType } from '@commonalityco/utils-core';

// More on how to set up stories at: https://storybook.js.org/docs/7.0/react/writing-stories/introduction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
PackagesTable,
SortableHeader,
TagsCell,
} from '@commonalityco/feature-conformance/ui';
} from '@commonalityco/ui-conformance';
import { PackageType, Status } from '@commonalityco/utils-core';
import { Package } from '@commonalityco/types';

Expand Down
2 changes: 1 addition & 1 deletion apps/workshop/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {
content: [
'./src/**/*.{js,ts,jsx,tsx}',
getPkgPattern('@commonalityco/feature-constraints'),
getPkgPattern('@commonalityco/feature-conformance'),
getPkgPattern('@commonalityco/ui-conformance'),
getPkgPattern('@commonalityco/ui-design-system'),
getPkgPattern('@commonalityco/ui-package'),
getPkgPattern('@commonalityco/ui-core'),
Expand Down
12 changes: 1 addition & 11 deletions commonality.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// @ts-check
import { defineCheck, defineConfig, json } from 'commonality';
import { defineCheck, defineConfig } from 'commonality';
import * as recommended from 'commonality-recommended';

export default defineConfig({
Expand All @@ -14,15 +13,6 @@ export default defineConfig({
recommended.noExternalMismatch(),
recommended.repositoryField(),
],
testable: [
defineCheck(() => {
return {
name: 'ensure-test-tooling',
message: 'Testable packages must have test tooling configured',
validate: ({ workspace }) => {},
};
}),
],
},
constraints: {
feature: { allow: '*' },
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@
"semver": "^7.5.4",
"validate-npm-package-name": "^5.0.0"
},
"repository": "https://github.com/commonalityco/commonality/packages/commonality-recommended"
}
"repository": "https://github.com/commonalityco/commonality/packages/commonality/commonality-recommended"
}
File renamed without changes.
File renamed without changes.
9 changes: 0 additions & 9 deletions packages/commonality/src/index.ts

This file was deleted.

File renamed without changes.
Loading

0 comments on commit 40f5d7e

Please sign in to comment.