Skip to content

Commit

Permalink
rename @org to @push-based
Browse files Browse the repository at this point in the history
  • Loading branch information
BioPhoton committed Sep 16, 2024
1 parent 548c1e0 commit 406fc61
Show file tree
Hide file tree
Showing 36 changed files with 84 additions and 84 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This plugin provides a zeros configuration setup to run e2e tests in a package m
{
"plugins": [
{
"plugin": "@org/build-env",
"plugin": "@push-based/build-env",
"options": {
"environmentsDir": "tmp/environments" // Optional
}
Expand Down
14 changes: 7 additions & 7 deletions docs/motivation.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ The following is a simplified version of a global setup script used by your test
```ts
// global-setup.ts
import { rm } from 'node:fs/promises';
import { executeProcess, objectToCliArgs } from '@org/test-utils';
import { configureRegistry, RegistryResult, startVerdaccioServer, unconfigureRegistry } from '@org/tools-utils';
import { executeProcess, objectToCliArgs } from '@push-based/test-utils';
import { configureRegistry, RegistryResult, startVerdaccioServer, unconfigureRegistry } from '@push-based/tools-utils';

export async function setup() {
const { verdaccioPort } = await startVerdaccioServer({
Expand Down Expand Up @@ -117,15 +117,15 @@ You are forced to run the tests in sequence.

**Publish conflict:**

1. Test A: `npm publish @org/[email protected] --registry=http://localhost:4873` # ✅
2. Test B: `npm publish @org/[email protected] --registry=http://localhost:4873` # ❌ package already exists in registry
1. Test A: `npm publish @push-based/[email protected] --registry=http://localhost:4873` # ✅
2. Test B: `npm publish @push-based/[email protected] --registry=http://localhost:4873` # ❌ package already exists in registry

**Install/uninstall conflict:**

1. Test A: `npm install @org/[email protected] --registry=http://localhost:4873` # ✅
2. Test B: `npm install @org/[email protected] --registry=http://localhost:4873` # ✅
1. Test A: `npm install @push-based/[email protected] --registry=http://localhost:4873` # ✅
2. Test B: `npm install @push-based/[email protected] --registry=http://localhost:4873` # ✅
3. Test B: `nx e2e pkg` # ✅
4. Test B: `npm uninstall @org/[email protected] --registry=http://localhost:4873` # ✅
4. Test B: `npm uninstall @push-based/[email protected] --registry=http://localhost:4873` # ✅
5. Test A: `nx e2e pkg` # ❌ package not installed

### 📉 Scalability
Expand Down
6 changes: 3 additions & 3 deletions e2e/cli-e2e/test/cli-command-sort.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { dirname, join, basename } from 'node:path';
import { afterEach, describe, expect, it } from 'vitest';
import { mkdir, readFile, rm, writeFile } from 'node:fs/promises';
import { executeProcess, objectToCliArgs } from '@org/test-utils';
import { getEnvironmentRoot } from '@org/build-env';
import { getTestFixturesDist } from '@org/test-utils';
import { executeProcess, objectToCliArgs } from '@push-based/test-utils';
import { getEnvironmentRoot } from '@push-based/build-env';
import { getTestFixturesDist } from '@push-based/test-utils';

describe('CLI command - sort', () => {
const fixturesDist = getTestFixturesDist('cli-command-sort', {
Expand Down
6 changes: 3 additions & 3 deletions e2e/cli-static-e2e/test/cli-command-sort.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { dirname, join, basename } from 'node:path';
import { afterEach, describe, expect, it } from 'vitest';
import { mkdir, readFile, rm, writeFile } from 'node:fs/promises';
import { executeProcess, objectToCliArgs } from '@org/test-utils';
import { getEnvironmentRoot } from '@org/build-env';
import { getTestFixturesDist } from '@org/test-utils';
import { executeProcess, objectToCliArgs } from '@push-based/test-utils';
import { getEnvironmentRoot } from '@push-based/build-env';
import { getTestFixturesDist } from '@push-based/test-utils';

describe('CLI command - sort', () => {
const fixturesDist = getTestFixturesDist('cli-command-sort', {
Expand Down
8 changes: 4 additions & 4 deletions e2e/core-e2e/test/utils-sort-user-file.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { basename, join } from 'node:path';
import { afterEach, describe, expect, it } from 'vitest';
import { mkdir, rm, writeFile } from 'node:fs/promises';
import { executeProcess, getTestFixturesDist } from '@org/test-utils';
import { executeProcess, getTestFixturesDist } from '@push-based/test-utils';
import { readJsonFile } from 'nx/src/utils/fileutils';
import { User } from '@org/models';
import { getEnvironmentRoot } from '@org/build-env';
import { User } from '@push-based/models';
import { getEnvironmentRoot } from '@push-based/build-env';

describe('core - sort user.json', () => {
const fixturesDist = getTestFixturesDist('sort-user-json', {
Expand All @@ -29,7 +29,7 @@ describe('core - sort user.json', () => {
writeFile(
testScriptPath,
`
import {sortUserFile} from "@org/core";
import {sortUserFile} from "@push-based/core";
sortUserFile('${basename(testDataPath)}');`
)
).resolves.not.toThrow();
Expand Down
6 changes: 3 additions & 3 deletions e2e/models-e2e/test/models-parse.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { basename, dirname, join } from 'node:path';
import { afterEach, describe, expect, it } from 'vitest';
import { mkdir, writeFile, rm } from 'node:fs/promises';
import { executeProcess, getTestFixturesDist } from '@org/test-utils';
import { getEnvironmentRoot } from '@org/build-env';
import { executeProcess, getTestFixturesDist } from '@push-based/test-utils';
import { getEnvironmentRoot } from '@push-based/build-env';

describe('models - parse user', () => {
const fixturesDist = getTestFixturesDist('parse-user', {
Expand All @@ -20,7 +20,7 @@ describe('models - parse user', () => {
writeFile(
testPath,
`
import {parseUser} from "@org/models";
import {parseUser} from "@push-based/models";
console.log(JSON.stringify(parseUser({name: 'Alice', color: 'green'}), null, 2));`
)
).resolves.not.toThrow();
Expand Down
4 changes: 2 additions & 2 deletions e2e/playground-e2e/test/cli-command-sort.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
executeProcess,
objectToCliArgs,
getTestFixturesDist,
} from '@org/test-utils';
import { getEnvironmentRoot } from '@org/build-env';
} from '@push-based/test-utils';
import { getEnvironmentRoot } from '@push-based/build-env';

describe('CLI command - sort', () => {
const fixturesDist = getTestFixturesDist('cli-command-sort', {
Expand Down
8 changes: 4 additions & 4 deletions e2e/playground-e2e/test/core-sort-user-file.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { basename, join } from 'node:path';
import { afterEach, describe, expect, it } from 'vitest';
import { mkdir, rm, writeFile } from 'node:fs/promises';
import { executeProcess, getTestFixturesDist } from '@org/test-utils';
import { executeProcess, getTestFixturesDist } from '@push-based/test-utils';
import { readJsonFile } from 'nx/src/utils/fileutils';
import { User } from '@org/models';
import { getEnvironmentRoot } from '@org/build-env';
import { User } from '@push-based/models';
import { getEnvironmentRoot } from '@push-based/build-env';

describe('core - sort user.json', () => {
const fixturesDist = getTestFixturesDist('sort-user-json', {
Expand All @@ -29,7 +29,7 @@ describe('core - sort user.json', () => {
writeFile(
testScriptPath,
`
import {sortUserFile} from "@org/core";
import {sortUserFile} from "@push-based/core";
sortUserFile('${basename(testDataPath)}');`
)
).resolves.not.toThrow();
Expand Down
6 changes: 3 additions & 3 deletions e2e/playground-e2e/test/models-parse.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { basename, dirname, join } from 'node:path';
import { afterEach, describe, expect, it } from 'vitest';
import { mkdir, writeFile, rm } from 'node:fs/promises';
import { executeProcess, getTestFixturesDist } from '@org/test-utils';
import { getEnvironmentRoot } from '@org/build-env';
import { executeProcess, getTestFixturesDist } from '@push-based/test-utils';
import { getEnvironmentRoot } from '@push-based/build-env';

describe('models - parse user', () => {
const fixturesDist = getTestFixturesDist('parse-user', {
Expand All @@ -20,7 +20,7 @@ describe('models - parse user', () => {
writeFile(
testPath,
`
import {parseUser} from "@org/models";
import {parseUser} from "@push-based/models";
console.log(JSON.stringify(parseUser({name: 'Alice', color: 'green'}), null, 2));`
)
).resolves.not.toThrow();
Expand Down
6 changes: 3 additions & 3 deletions e2e/playground-e2e/test/utils-sort-user-list.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { basename, dirname, join } from 'node:path';
import { afterEach, describe, expect, it } from 'vitest';
import { mkdir, writeFile, rm } from 'node:fs/promises';
import { executeProcess, getTestFixturesDist } from '@org/test-utils';
import { getEnvironmentRoot } from '@org/build-env';
import { executeProcess, getTestFixturesDist } from '@push-based/test-utils';
import { getEnvironmentRoot } from '@push-based/build-env';

describe('utils - sort user list', () => {
const fixturesDist = getTestFixturesDist('sort-user-list', {
Expand All @@ -20,7 +20,7 @@ describe('utils - sort user list', () => {
writeFile(
testPath,
`
import {sortUser} from "@org/utils";
import {sortUser} from "@push-based/utils";
console.log(JSON.stringify(sortUser([{name: 'Michael'}, {name: 'Alice'}]), null, 2));`
)
).resolves.not.toThrow();
Expand Down
6 changes: 3 additions & 3 deletions e2e/utils-e2e/test/utils-sort-user-list.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { basename, dirname, join } from 'node:path';
import { afterEach, describe, expect, it } from 'vitest';
import { mkdir, rm, writeFile } from 'node:fs/promises';
import { executeProcess, getTestFixturesDist } from '@org/test-utils';
import { getEnvironmentRoot } from '@org/build-env';
import { executeProcess, getTestFixturesDist } from '@push-based/test-utils';
import { getEnvironmentRoot } from '@push-based/build-env';

describe('utils - sort user list', () => {
const fixturesDist = getTestFixturesDist('sort-user-list', {
Expand All @@ -19,7 +19,7 @@ describe('utils - sort user list', () => {
writeFile(
testPath,
`
import {sortUser} from "@org/utils";
import {sortUser} from "@push-based/utils";
console.log(JSON.stringify(sortUser([{name: 'Michael'}, {name: 'Alice'}]), null, 2));`
)
).resolves.not.toThrow();
Expand Down
2 changes: 1 addition & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
},
"plugins": [
"./e2e-examples/cli-e2e-original/tooling/original.plugin.ts",
"@org/build-env",
"@push-based/build-env",
{
"plugin": "@nx/eslint/plugin",
"options": {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@org/source",
"name": "@push-based/source",
"version": "0.0.0",
"license": "MIT",
"scripts": {},
Expand Down
14 changes: 7 additions & 7 deletions projects/build-env/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @org/build-env
# @push-based/build-env

## To Research

Expand All @@ -16,14 +16,14 @@
- build output, using dependent task output? careful though, [it is known to struggle with Nx cloud agents](https://github.com/nrwl/nx/issues/22745)
- outputs
- list of packages in registry under `.../storage/.verdaccio-db.json` e.g.: `{"list":["<package-name>"],"secret":"esKM34zA53wetObgi5f0Uu1e7iObmm+f"}``
- tarball of package under `.../storage/@org/<package-name>-<version>.tgz`
e.g.: `{workspaceRoot}/${environmentsDir}/{args.environmentProject}/storage/@org/${packageName}`,
- `package.json` of package under `.../storage/@org/<package-name>/package.json`
- tarball of package under `.../storage/@push-based/<package-name>-<version>.tgz`
e.g.: `{workspaceRoot}/${environmentsDir}/{args.environmentProject}/storage/@push-based/${packageName}`,
- `package.json` of package under `.../storage/@push-based/<package-name>/package.json`
- `npm-install`
- outputs
- list of installed packages under `.../package.json`
- list of installed packages under `.../package-lock.json`
- source of package under `.../node_modules/@org/<package-name>/*`
- source of package under `.../node_modules/@push-based/<package-name>/*`
mehh, we know the node_modules reputation
- inputs:
- output of npm-publish(?), package.json
Expand All @@ -49,5 +49,5 @@ See [configuration docs](./src/generators/configuration/README.md) for details

Examples:

- `nx g @org/build-env:configuration --project=<project-name>`
- `nx g @org/build-env:configuration --project=<project-name> --targetName=cp`
- `nx g @push-based/build-env:configuration --project=<project-name>`
- `nx g @push-based/build-env:configuration --project=<project-name> --targetName=cp`
2 changes: 1 addition & 1 deletion projects/build-env/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@org/build-env",
"name": "@push-based/build-env",
"version": "0.29.0",
"license": "MIT",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion projects/build-env/src/executors/bootstrap/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default async function runBootstrapExecutor(
options
);
logger.info(
`Execute @org/build-env:build with options: ${JSON.stringify(
`Execute @push-based/build-env:build with options: ${JSON.stringify(
options,
null,
2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('runBootstrapExecutor', () => {
expect(logger.error).not.toHaveBeenCalled();
expect(logger.info).toHaveBeenCalledTimes(1);
expect(logger.info).toHaveBeenCalledWith(
'Execute @org/build-env:build with options: {}'
'Execute @push-based/build-env:build with options: {}'
);

expect(bootstrapEnvironmentSpy).toHaveBeenCalledTimes(1);
Expand Down Expand Up @@ -135,7 +135,7 @@ describe('runBootstrapExecutor', () => {

expect(logger.info).toHaveBeenCalledTimes(1);
expect(logger.info).toHaveBeenCalledWith(
'Execute @org/build-env:build with options: {}'
'Execute @push-based/build-env:build with options: {}'
);

expect(logger.error).toHaveBeenCalledTimes(1);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { bold, red } from 'ansis';
import { MEMFS_VOLUME } from '@org/test-utils';
import { MEMFS_VOLUME } from '@push-based/test-utils';
import {
configureRegistry,
type ConfigureRegistryOptions,
Expand Down
2 changes: 1 addition & 1 deletion projects/build-env/src/executors/kill-process/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default async function runKillProcessExecutor(
} = opt;

logger.info(
`Execute @org/stop-verdaccio-env:kill-process with options: ${JSON.stringify(
`Execute @push-based/stop-verdaccio-env:kill-process with options: ${JSON.stringify(
options,
null,
2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { beforeEach, describe, expect, vi } from 'vitest';
import runKillProcessExecutor from './executor';
import * as killProcessModule from './kill-process';
import { MEMFS_VOLUME } from '@org/test-utils';
import { MEMFS_VOLUME } from '@push-based/test-utils';
import { logger } from '@nx/devkit';

vi.mock('@nx/devkit', async () => {
Expand Down Expand Up @@ -69,7 +69,7 @@ describe('runKillProcessExecutor', () => {

expect(logger.info).toHaveBeenCalledTimes(1);
expect(logger.info).toHaveBeenCalledWith(
`Execute @org/stop-verdaccio-env:kill-process with options: ${JSON.stringify(
`Execute @push-based/stop-verdaccio-env:kill-process with options: ${JSON.stringify(
{ pid: 777 },
null,
2
Expand Down Expand Up @@ -122,7 +122,7 @@ describe('runKillProcessExecutor', () => {

expect(logger.info).toHaveBeenCalledTimes(1);
expect(logger.info).toHaveBeenCalledWith(
`Execute @org/stop-verdaccio-env:kill-process with options: ${JSON.stringify(
`Execute @push-based/stop-verdaccio-env:kill-process with options: ${JSON.stringify(
{ filePath: 'tmp/environments/my-lib' },
null,
2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { beforeEach, describe, expect } from 'vitest';
import runNpmInstallExecutor from './executor';
import { MEMFS_VOLUME } from '@org/test-utils';
import { MEMFS_VOLUME } from '@push-based/test-utils';
import * as execProcessModule from '../../internal/execute-process';
import { logger, readJsonFile } from '@nx/devkit';
import { join } from 'node:path';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {beforeEach, describe, expect} from 'vitest';
import runNpmPublishExecutor from './executor';
import {MEMFS_VOLUME} from '@org/test-utils';
import {MEMFS_VOLUME} from '@push-based/test-utils';
import * as execProcessModule from '../../internal/execute-process';
import {logger} from '@nx/devkit';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ChildProcess } from 'node:child_process';
import { describe, expect, it, vi, beforeEach } from 'vitest';
import { getAsyncProcessRunnerConfig } from '@org/test-utils';
import { getAsyncProcessRunnerConfig } from '@push-based/test-utils';
import { type ProcessObserver, executeProcess } from './execute-process';

describe('executeProcess', () => {
Expand Down
2 changes: 1 addition & 1 deletion projects/build-env/src/internal/file-system.unit-test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { join } from 'node:path';
import { stat } from 'node:fs/promises';
import { MEMFS_VOLUME } from '@org/test-utils';
import { MEMFS_VOLUME } from '@push-based/test-utils';
import { vol } from 'memfs';
import { ensureDirectoryExists } from './file-system';

Expand Down
Loading

0 comments on commit 406fc61

Please sign in to comment.