straight_to_video 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/script/release ADDED
@@ -0,0 +1,75 @@
1
+ #!/usr/bin/env bash
2
+ set -Eeuo pipefail
3
+
4
+ usage() {
5
+ echo "Usage: script/release {patch|minor|major}" >&2
6
+ }
7
+
8
+ if [ "${1:-}" = "-h" ] || [ "${1:-}" = "--help" ]; then
9
+ usage
10
+ exit 0
11
+ fi
12
+
13
+ if [ $# -ne 1 ]; then
14
+ usage
15
+ exit 2
16
+ fi
17
+
18
+ BUMP_TYPE="$1"
19
+ case "$BUMP_TYPE" in
20
+ patch|minor|major) ;;
21
+ *) echo "Invalid bump type: $BUMP_TYPE (must be patch|minor|major)" >&2; exit 2 ;;
22
+ esac
23
+
24
+ # Ensure working copy is clean (no staged/unstaged changes)
25
+ if [ -n "$(git status --porcelain)" ]; then
26
+ echo "Working tree is not clean. Commit or stash changes before releasing." >&2
27
+ git status --short
28
+ exit 1
29
+ fi
30
+
31
+ ## Bump version in package.json only (no git tag)
32
+ echo "Bumping version: npm version --no-git-tag-version $BUMP_TYPE"
33
+ npm version "$BUMP_TYPE" --no-git-tag-version
34
+
35
+ # Sync Ruby gem version file to the new package version
36
+ # Read version from package.json using Node for portability
37
+ VERSION=$(node -p "require('./package.json').version")
38
+ if [ -z "${VERSION:-}" ]; then
39
+ echo "Unable to determine version from package.json" >&2
40
+ exit 1
41
+ fi
42
+
43
+ RB_VERSION_FILE="lib/straight_to_video/version.rb"
44
+ if [ ! -f "$RB_VERSION_FILE" ]; then
45
+ echo "Missing $RB_VERSION_FILE" >&2
46
+ exit 1
47
+ fi
48
+
49
+ tmp_file="$RB_VERSION_FILE.tmp"
50
+ printf 'module StraightToVideo\n VERSION = "%s"\nend\n' "$VERSION" > "$tmp_file"
51
+ mv "$tmp_file" "$RB_VERSION_FILE"
52
+
53
+ # Vendor javascript files (reflect new version in headers)
54
+ ./script/vendor
55
+
56
+ # Bump the version in the Gemfile.lock
57
+ bundle
58
+
59
+ # Commit version bumps as a single commit; bundler's rake release will tag
60
+ git add package.json package-lock.json Gemfile.lock "$RB_VERSION_FILE" app/assets/javascripts
61
+ git commit -m "$VERSION"
62
+
63
+ # Publish to npm
64
+ echo "Publishing to npm (2FA may prompt)..."
65
+ npm publish
66
+
67
+ # Trigger JSPM build
68
+ echo "Triggering JSPM build for straight-to-video@${VERSION}..."
69
+ curl "https://api.jspm.io/build/straight-to-video@${VERSION}" >/dev/null || true
70
+
71
+ # Publish to rubygems.org
72
+ echo "Publishing RubyGems.org (2FA may prompt)..."
73
+ bundle exec rake release
74
+
75
+ echo "Done, $VERSION has been released to npm and RubyGems.org 📼."
data/script/test ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -uo pipefail
4
+
5
+ # Always execute from repo root so relative paths in config work
6
+ cd "$(dirname "$0")/.."
7
+
8
+ # If running in CI, force headless via the config's HEADLESS env toggle
9
+ if [[ "${CI:-}" == "true" ]]; then
10
+ export HEADLESS=1
11
+ fi
12
+
13
+ # Run tests (pass through any extra args)
14
+ npx playwright test "$@"
data/script/upgrade ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Upgrade dependencies and run install+tests
4
+
5
+ set -euo pipefail
6
+ cd "$(dirname "$0")/.."
7
+
8
+ npx npm-check-updates -u && npm it
9
+
data/script/vendor ADDED
@@ -0,0 +1,52 @@
1
+ #!/usr/bin/env bash
2
+ set -Eeuo pipefail
3
+
4
+ # Vendor browser assets from dependencies into app assets
5
+ # - Copies mediabunny bundle into app/assets/javascripts
6
+ # - Copies this package's index.js to straight-to-video.js in app/assets/javascripts
7
+
8
+ # Always execute from repo root
9
+ cd "$(dirname "$0")/.."
10
+
11
+ dest_dir="app/assets/javascripts"
12
+ mb_pkg_json="node_modules/mediabunny/package.json"
13
+ mb_src="node_modules/mediabunny/dist/bundles/mediabunny.min.mjs"
14
+ stv_src="index.js"
15
+ stv_dest="$dest_dir/straight-to-video.js"
16
+
17
+ # Ensure required files are present
18
+ if [[ ! -f "$mb_pkg_json" || ! -f "$mb_src" ]]; then
19
+ echo "mediabunny is not installed or expected files are missing." >&2
20
+ echo "Run: npm install" >&2
21
+ exit 1
22
+ fi
23
+
24
+ if [[ ! -f "$stv_src" ]]; then
25
+ echo "Missing $stv_src in repo root." >&2
26
+ exit 1
27
+ fi
28
+
29
+ # Read versions using Node for portability
30
+ mb_version=$(node -p "require('./$mb_pkg_json').version")
31
+ stv_version=$(node -p "require('./package.json').version")
32
+
33
+ mkdir -p "$dest_dir"
34
+
35
+ # 1) Copy mediabunny bundle and prepend header
36
+ mb_dest="$dest_dir/$(basename "$mb_src")"
37
+ cp -f "$mb_src" "$mb_dest"
38
+ {
39
+ printf '// mediabunny@%s vendored by the straight_to_video gem\n' "$mb_version"
40
+ cat "$mb_dest"
41
+ } >"$mb_dest.tmp" && mv "$mb_dest.tmp" "$mb_dest"
42
+ echo "Vendored mediabunny@${mb_version} -> $mb_dest"
43
+
44
+ # 2) Copy our bundle as straight-to-video.js and prepend header
45
+ cp -f "$stv_src" "$stv_dest"
46
+ {
47
+ printf '// straight-to-video@%s vendored by the straight_to_video gem\n' "$stv_version"
48
+ cat "$stv_dest"
49
+ } >"$stv_dest.tmp" && mv "$stv_dest.tmp" "$stv_dest"
50
+ echo "Vendored straight-to-video@${stv_version} -> $stv_dest"
51
+
52
+ echo "Done."
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: straight_to_video
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
+ platform: ruby
6
+ authors:
7
+ - Justin Searls
8
+ bindir: exe
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: railties
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '7'
19
+ - - "<"
20
+ - !ruby/object:Gem::Version
21
+ version: '9'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: '7'
29
+ - - "<"
30
+ - !ruby/object:Gem::Version
31
+ version: '9'
32
+ email:
33
+ - justin@searls.co
34
+ executables: []
35
+ extensions: []
36
+ extra_rdoc_files: []
37
+ files:
38
+ - CHANGELOG.md
39
+ - LICENSE.txt
40
+ - README.md
41
+ - Rakefile
42
+ - app/assets/javascripts/mediabunny.min.mjs
43
+ - app/assets/javascripts/straight-to-video.js
44
+ - assets/img/backdrop.webp
45
+ - assets/img/logo.webp
46
+ - config/importmap.rb
47
+ - index.html
48
+ - index.js
49
+ - lib/straight_to_video.rb
50
+ - lib/straight_to_video/engine.rb
51
+ - lib/straight_to_video/version.rb
52
+ - package-lock.json
53
+ - package.json
54
+ - playwright.config.mjs
55
+ - script/release
56
+ - script/test
57
+ - script/upgrade
58
+ - script/vendor
59
+ homepage: https://github.com/searls/straight-to-video
60
+ licenses:
61
+ - MIT
62
+ metadata:
63
+ homepage_uri: https://github.com/searls/straight-to-video
64
+ source_code_uri: https://github.com/searls/straight-to-video
65
+ changelog_uri: https://github.com/searls/straight-to-video/blob/main/CHANGELOG.md
66
+ rdoc_options: []
67
+ require_paths:
68
+ - lib
69
+ required_ruby_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: 3.2.0
74
+ required_rubygems_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ requirements: []
80
+ rubygems_version: 3.6.9
81
+ specification_version: 4
82
+ summary: Browser-based, hardware-accelerated video upload optimization
83
+ test_files: []