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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 7 additions & 63 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,8 @@ jobs:
run: python conformance/run.py

typescript:
name: TypeScript runtime
name: TypeScript packages
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/codeupipe-ts
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
Expand All @@ -54,73 +51,20 @@ jobs:
node-version: "24"
- name: Install
run: npm ci
- name: Type check
run: npm run typecheck
- name: Tests
run: npm test
- name: Build
run: npm run build
- name: Example
run: node examples/pricing/main.ts
- name: Conformance
working-directory: .
run: python conformance/run.py typescript:run

typescript-lint:
name: TypeScript linter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: "24"
- name: Install the core package
working-directory: packages/codeupipe-ts
run: npm ci
- name: Install
working-directory: packages/codeupipe-lint-ts
run: npm ci
- name: Type check
working-directory: packages/codeupipe-lint-ts
run: npm run typecheck
- name: Tests
working-directory: packages/codeupipe-lint-ts
run: npm test
- name: Build
working-directory: packages/codeupipe-lint-ts
run: npm run build
- name: Example
run: node packages/codeupipe-ts/examples/pricing/main.ts
- name: The linter on the TypeScript code of this repository
working-directory: packages/codeupipe-lint-ts
run: npm run lint

typescript-compile:
name: TypeScript compiler
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- uses: actions/setup-node@v5
with:
node-version: "24"
- name: Install the core package
working-directory: packages/codeupipe-ts
run: npm ci
- name: Install
working-directory: packages/codeupipe-compile-ts
run: npm ci
- name: Type check
working-directory: packages/codeupipe-compile-ts
run: npm run typecheck
- name: Tests
working-directory: packages/codeupipe-compile-ts
run: npm test
- name: Build
working-directory: packages/codeupipe-compile-ts
run: npm run build
run: npm run lint -w codeupipe-lint
- name: Conformance
run: python conformance/run.py typescript:static
run: python conformance/run.py typescript:run typescript:static
- name: The packages as npm makes them
run: npm pack --workspaces --dry-run

export:
name: Export against dynamic run
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ packages/*/build/
conformance/results/
.venv-*/
scorecard/results/
node_modules/
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# codeupipe

codeupipe is a library for writing a program as a pipeline of small steps.
It is for Python. A TypeScript runtime is in this repository and is not on
npm yet.
It is for Python and for TypeScript.

There are eight primitives. Each one does one thing.

Expand Down Expand Up @@ -81,8 +80,11 @@ These changes are not compatible with 1.0.0.
- **`codeupipe.lower` is now `codeupipe.compile`.** The command is
`python -m codeupipe.compile`.

The TypeScript packages are new. They are version `1.0.0-beta.1` and are not on
npm.
The TypeScript packages are new. They are version `0.1.0`. A version below
1.0 is not stable yet, and a new version can change in a way that is not
compatible. They are not on npm yet:
[packages/codeupipe-ts/README.md](packages/codeupipe-ts/README.md) says how to
install them from this repository.

## Example

Expand Down Expand Up @@ -203,7 +205,9 @@ An editable install needs pip 21.3 or later.
| `scorecard/` | The comparison of the compiled code with the dynamic run on random pipelines |
| `docs/` | Reference for the compiler and the config file |

The root `pyproject.toml` is not a package. It holds the test settings.
The root `pyproject.toml` is not a package. It holds the test settings. The
root `package.json` is not a package: it makes the three TypeScript packages
one npm workspace.

## Other languages

Expand Down
7 changes: 4 additions & 3 deletions conformance/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,11 @@ def _node_runs_typescript():
"typescript:static": _typescript("static"),
}

# The static target runs the compile package, which must be installed, and
# that package uses the built core package.
# The static target runs the compile package. Its dependencies must be
# installed (npm ci at the repository root), and it uses the built core
# package.
_TYPESCRIPT_NEEDS = {
"typescript:static": [REPO / "packages/codeupipe-compile-ts/node_modules",
"typescript:static": [REPO / "node_modules/typescript",
REPO / "packages/codeupipe-ts/dist/index.js"],
}

Expand Down
79 changes: 65 additions & 14 deletions packages/codeupipe-ts/package-lock.json → package-lock.json

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

15 changes: 15 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "codeupipe-repository",
"private": true,
"description": "The npm workspace of the TypeScript packages. It is not a package.",
"workspaces": [
"packages/codeupipe-ts",
"packages/codeupipe-lint-ts",
"packages/codeupipe-compile-ts"
],
"scripts": {
"build": "npm run build --workspaces",
"test": "npm test --workspaces",
"typecheck": "npm run typecheck --workspaces"
}
}
11 changes: 8 additions & 3 deletions packages/codeupipe-compile-ts/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# codeupipe-compile for TypeScript

Writes a codeupipe pipeline as one plain TypeScript module with no import
of codeupipe. It reads the source and does not run it. It is a beta, version `1.0.0-beta.1`, and it is not on npm yet.
of codeupipe. It reads the source and does not run it.

**The rule: code that compiles gives the same output as the pipeline. A
pipeline for which the compiler cannot keep that rule is refused, with the
Expand All @@ -13,8 +13,11 @@ The compiler is a codeupipe pipeline:
`codeupipe` and on the `typescript` package, which it uses to read and
write code.

It is not on npm yet: the [README of the core package](../codeupipe-ts/README.md)
says how to install it from this repository.

```bash
codeupipe-compile src/pricing-pipeline.ts:PricingPipeline --out build/pricing.ts
npx codeupipe-compile src/pricing-pipeline.ts:PricingPipeline --out build/pricing.ts
```

Exit code: **0** the module is written, **1** the pipeline is refused (the
Expand Down Expand Up @@ -107,8 +110,10 @@ compiler has neither.

## Development

The three TypeScript packages are one npm workspace. Run `npm ci` once, at
the root of the repository. Then, in this directory:

```bash
npm install # links ../codeupipe-ts and installs the TypeScript compiler
npm test # builds the core package first, then runs the tests
npm run typecheck # also checks the conformance runner
npm run build # JavaScript and type files in dist/
Expand Down
73 changes: 0 additions & 73 deletions packages/codeupipe-compile-ts/package-lock.json

This file was deleted.

Loading
Loading