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
2 changes: 1 addition & 1 deletion apps/kebricide/Project/kebricide.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ inlets = 1;
outlets = 1;
autowatch = 1;
function bang() {
post("is this working? " + mylib.greet() + "\n");
post("is this working x2? " + mylib.greet() + "\n");
}
bang();
// .ts files with this at the end become a script usable in a [js] or [jsui] object
Expand Down
6 changes: 3 additions & 3 deletions apps/kebricide/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "0.0.1",
"description": "Kebricide Max for Live Device",
"scripts": {
"build": "pnpm maxmsp build",
"dev": "pnpm maxmsp dev"
"build": "node ../../packages/maxmsp-ts/dist/index.js build",
"dev": "node ../../packages/maxmsp-ts/dist/index.js dev"
},
"keywords": [
"maxmsp",
Expand All @@ -15,7 +15,7 @@
"license": "MIT",
"devDependencies": {
"@my-username/my-library": "workspace:*",
"@aptrn/maxmsp-ts": "file:../../../maxmsp-ts",
"@codekiln/maxmsp-ts": "workspace:*",
"@types/maxmsp": "^1.0.13",
"typescript": "^5.6.2"
}
Expand Down
2 changes: 1 addition & 1 deletion apps/kebricide/src/kebricide.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ outlets = 1;
autowatch = 1;

function bang() {
post("is this working? " + mylib.greet() + "\n");
post("is this working x2? " + mylib.greet() + "\n");
}

bang();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
title: pull maxmsp-ts into monorepo until original is compatible
state: OPEN
author: codekiln
labels: enhancement
comments: 0
assignees: codekiln
projects:
milestone:
number: 20
--
Until [Feature request: Max for Live compatibility - make it possible to compile all js assets to the root directory (not lib/) for use in Max for Live · Issue #28 · aptrn/maxmsp-ts](https://github.com/aptrn/maxmsp-ts/issues/28) issue is fixed or the MR [Max for Live compatibility - optionally compile js assets to root directory by codekiln · Pull Request #29 · aptrn/maxmsp-ts](https://github.com/aptrn/maxmsp-ts/pull/29/files) [[GitHub/MR]] is merged, pull [updated maxmsp-ts](https://github.com/codekiln/maxmsp-ts) into this monorepo.

## Failing Builds
Until this is merged, builds in CI and in the dev container will fail, since they don't have access to the right version of `maxmsp-ts`.
* see https://github.com/codekiln/alits/actions/runs/13240482396/job/36954570963
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
title: Pull maxmsp-ts into monorepo temporarily for M4L compatibility
type: pull_request
base: main
author: codekiln
--
This PR temporarily pulls maxmsp-ts into our monorepo to address Max for Live compatibility issues until aptrn/maxmsp-ts#28 is resolved or aptrn/maxmsp-ts#29 is merged.

## Why
Currently, our CI builds are failing because they can't access the correct version of maxmsp-ts that supports compiling assets to the root directory for Max for Live compatibility. This is blocking development and CI pipelines.

## Changes
- Adds maxmsp-ts package to monorepo workspace
- Updates kebricide to use workspace version (`@codekiln/maxmsp-ts: "workspace:*"`) instead of external dependency
- Maintains compatibility with Max for Live by allowing compilation to root directory

### Migration Plan
Once aptrn/maxmsp-ts#28 is fixed or PR #29 is merged upstream, we will:
1. Remove the local maxmsp-ts package
2. Switch back to using the npm published version
3. Update all dependent packages accordingly

### Testing
- [ ] Verify CI builds pass with workspace version
- [x] Confirm Max for Live compatibility works
- [x] Test kebricide builds with workspace dependency

### Related Issues
- Fixes CI build failures (see job [36954570963](https://github.com/codekiln/alits/actions/runs/13240482396/job/36954570963))
- Temporary solution for aptrn/maxmsp-ts#28
- Implements #20

This is a temporary solution until upstream changes are merged.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "monorepo",
"name": "alits-monorepo",
"private": true,
"scripts": {
"build": "turbo build",
Expand Down
8 changes: 8 additions & 0 deletions packages/maxmsp-ts/.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)
11 changes: 11 additions & 0 deletions packages/maxmsp-ts/.changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.3/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
11 changes: 11 additions & 0 deletions packages/maxmsp-ts/.github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
19 changes: 19 additions & 0 deletions packages/maxmsp-ts/.github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: CI
on:
push:
branches:
- "**"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 9
- uses: actions/setup-node@v3
with:
node-version: 20
cache: "pnpm"
- run: pnpm install --frozen-lockfile
- run: pnpm run build
27 changes: 27 additions & 0 deletions packages/maxmsp-ts/.github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish
on:
workflow_run:
workflows: [CI]
branches: [main]
types: [completed]

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
contents: write
pull-requests: write

jobs:
publish:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 9
- uses: actions/setup-node@v3
with:
node-version: 22
cache: "pnpm"
- run: pnpm install --frozen-lockfile
3 changes: 3 additions & 0 deletions packages/maxmsp-ts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
dist
maxmsp.config.json
4 changes: 4 additions & 0 deletions packages/maxmsp-ts/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.git
.gitignore
src
node_modules
7 changes: 7 additions & 0 deletions packages/maxmsp-ts/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# @aptrn/maxmsp-ts

## 0.0.1

### Patch Changes

- 4d3b009: first publish
53 changes: 53 additions & 0 deletions packages/maxmsp-ts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# maxmsp-ts

CLI tool for building TypeScript projects and dependencies for usage in MaxMsp js object

## How to Use

For practical applications, you might want to check out:

- [How to use TypeScript in Max](https://github.com/aptrn/maxmsp-ts-example.git)
- [Write your own TypeScript library](https://github.com/aptrn/maxmsp-ts-library-template)

This repository contains the CLI tool called "maxmsp" used in those projects.

## Installation

The package is hosted on [npm](https://www.npmjs.com/package/@aptrn/maxmsp-ts). You can install it with:

```bash
npm install -D @aptrn/maxmsp-ts
```

## Available Commands

### `build`

Builds your project, copying over files and fixing require paths.

### `dev`

Builds any time a file in `src` changes.

### `rm <package-name>`

Removes the package from the maxmsp.config.json file.

### `add <package-name> [options]`

Adds a package to the maxmsp.config.json file.

Options:

- `--alias`: Optional. Sets the prefix for the copied files. Default is the package name.
- `--path`: Optional. Sets the path to the package. Default is the package name.
- `--files`: Optional. Sets the files to copy. Default is `index.js`.

## Todo

- [ ] Add "rename" command for renaming project and folder
- [ ] Find a way to auto-sanitize Max Project file structure
- [ ] Add a function to create patcher files from JSON, possibly "ui" or "main"
- [ ] Experiment with [maxpy](https://github.com/Barnard-PL-Labs/MaxPy) to build max patches programmatically
- [ ] Experiment with [are-you-es5](https://www.npmjs.com/package/are-you-es5) to check dependencies compatibility
- [ ] Experiment with [babel](https://babeljs.io/) to transpile dependencies
76 changes: 76 additions & 0 deletions packages/maxmsp-ts/gh/issue_28.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
title: Feature request: Max for Live compatibility - make it possible to compile all js assets to the root directory (not lib/) for use in Max for Live
state: OPEN
author: codekiln
labels:
comments: 0
assignees:
projects:
milestone:
number: 28
--
Thanks for scaffolding out this ecosystem of repositories for using typescript with max!

## tl;dr Requested Feature Description
* make it possible for an application to configure `maxmsp.config.json` so as to not have `maxmsp` compiled assets put in subdirectories or expect the `lib/*` structure, so that Max for Live users can utilize it without needing to manually update their Max search path.

## Context
I'm trying to write an Ableton Max for Live plugin with your template over at https://github.com/codekiln/alits. It's the first time I've made a Max for Live plugin, so please forgive me in advance if I've misunderstood something about Max, Max for Live, etc.

Like most Ableton users, I don't have a standalone license to Max, and as a result, I can't create a Max Project file with the path references to the compiled artifacts in subdirectories.

For example, `lib/${effectivePath}/${alias}_index.js` will not be available to the users of my Max for Live device unless I provide instructions to them to edit their [[c74/max/File Browser]] and add a path for each folder individually, because while Max for Live is capable of opening Max Projects, it's not capable of saving or editing them.

I realize that Max's unique javascript model requires each js file to be uniquely named, and I think the aliasing functionality might be sufficient to meet that requirement without needing folders in the case of Max for Live.

## Feature Request

If `apps/kebricide/maxmsp.config.json` has:
```json
{
"output_path": "",
"dependencies": {
"@my-username/my-library": {
"alias": "myLibrary",
"files": ["index.js"],
"path": ""
}
}
}
```

and `apps/kebricide/tsconfig.json` has:
```json
{
"compileOnSave": true,
"compilerOptions": {
"module": "CommonJS",
"target": "ES5",
"ignoreDeprecations": "5.0",
"strict": true,
"noImplicitAny": true,
"sourceMap": false,
"outDir": "./Project",
"baseUrl": "src",
"types": ["maxmsp"],
"lib": ["es5"]
},
"include": ["./src/**/*.ts"]
}
```

then currently, `pnpm dev` -> `maxmsp dev` ends up calling `postBuild()` which results in:
```
apps/kebricide/Project/@my-username-my-library/myLibrary_index.js
apps/kebricide/Project/kebricide.js
apps/kebricide/Project/maxmsp-test.amxd
```
instead of:
```
apps/kebricide/Project/myLibrary_index.js
apps/kebricide/Project/index.js
apps/kebricide/Project/maxmsp-test.amxd
```

Also, of course, `myLibrary_index.js` would need to have its require statements updated so as to no longer expect the results to be located in a subdirectory.

I will likely implement the changes in a fork as they are necessary for my use case. I'd love to submit a PR if you are welcome to that. Please let me knokw if you have any advice or guidance in this matter.
35 changes: 35 additions & 0 deletions packages/maxmsp-ts/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "@codekiln/maxmsp-ts",
"version": "0.0.1",
"description": "CLI tool for building typescript projects and dependencies for usage in MaxMsp js object, adapted for Max for Live",
"main": "dist/index.js",
"type": "module",
"bin": {
"maxmsp": "dist/index.js"
},
"files": [
"dist",
"README.md"
],
"scripts": {
"build": "tsc && chmod +x dist/index.js",
"dev": "tsc --watch"
},
"keywords": [
"maxmsp"
],
"author": "aptrn",
"repository": {
"type": "git",
"url": "git+https://github.com/aptrn/maxmsp-ts.git"
},
"license": "MIT",
"devDependencies": {
"@changesets/cli": "^2.27.9",
"@types/node": "^22.7.4",
"typescript": "^5.6.2"
},
"dependencies": {
"chokidar": "^4.0.1"
}
}
Loading