-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Move Ruby generator to top level (match new repo structure) (#…
…2769) * Move Ruby generator to match rest of repo * add additional files and update readme * cr
- Loading branch information
1 parent
051c179
commit c8b1432
Showing
653 changed files
with
384 additions
and
275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
**/ruby/playground/** linguist-generated=true | ||
**/ruby/seed/** linguist-generated=true | ||
**/ruby/seed/**/seed.yml linguist-generated=false | ||
seed/** linguist-generated=true | ||
seed/**/seed.yml linguist-generated=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
* dsinghvi | ||
* @dsinghvi | ||
/packages/generators/cli/* @armandobelardo | ||
/packages/generators/commons/* @armandobelardo | ||
/packages/generators/docker/* @armandobelardo | ||
generators/ruby/* @armandobelardo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file removed
BIN
-371 KB
.yarn/cache/simple-progress-webpack-plugin-npm-2.0.0-acf418c11f-6e51960c9e.zip
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"ignores": [ | ||
"@types/jest", | ||
"@types/node", | ||
"esbuild", | ||
"@yarnpkg/esbuild-plugin-pnp", | ||
"webpack", | ||
"webpack-cli", | ||
"ts-loader", | ||
"@fern-fern/ir-sdk" | ||
], | ||
"ignore-patterns": ["lib", "dist", "docker/bundle.js"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
prod: {} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"type": "cli", | ||
"cliName": "fern-ruby-model", | ||
"environment": { | ||
"environments": { | ||
"prod": { | ||
"cliName": "fern-ruby-model", | ||
"cliPackageName": "@fern-api/fern-ruby-model" | ||
} | ||
} | ||
}, | ||
"rules": { | ||
"depcheck": { | ||
"ignores": ["webpack", "webpack-cli", "ts-loader", "@fern-fern/ir-sdk"], | ||
"ignore-patterns": ["docker/bundle.js"] | ||
}, | ||
"duplicate-dependencies": { | ||
"exclude": ["@fern-fern/ir-sdk"] | ||
}, | ||
"package-json": { | ||
"scripts": { | ||
"dockerTagLatest": "yarn dist:cli && docker build -f ./Dockerfile -t fernapi/fern-ruby-model:latest ../../..", | ||
"dockerTagVersion": "yarn dist:cli && docker build -f ./Dockerfile -t fernapi/fern-ruby-model:${0} ../../.." | ||
} | ||
} | ||
}, | ||
"private": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require("../../../.prettierrc.json"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## Unreleased | ||
|
||
## [0.0.6] - 2024-01-24 | ||
|
||
- Chore: Intialize this changelog |
4 changes: 2 additions & 2 deletions
4
...s/ruby/model/docker/Dockerfile.ruby-model → generators/ruby/model/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
# syntax = edrevo/dockerfile-plus | ||
INCLUDE+ packages/generators/docker/Dockerfile.base | ||
|
||
COPY packages/generators/ruby/model/docker/dist/bundle.js /bundle.js | ||
COPY generators/ruby/model/dist /dist | ||
|
||
# Install Ruby and Rubocop for formatting | ||
RUN apk --no-cache add ruby && gem install rubocop | ||
|
||
ENTRYPOINT ["node", "/bundle.js"] | ||
ENTRYPOINT ["node", "/dist/cli.cjs", "ruby-model"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
const { pnpPlugin } = require("@yarnpkg/esbuild-plugin-pnp"); | ||
const { build } = require("esbuild"); | ||
const path = require("path"); | ||
const { chmod, writeFile, mkdir } = require("fs/promises"); | ||
|
||
const packageJson = require("./package.json"); | ||
|
||
main(); | ||
|
||
async function main() { | ||
const options = { | ||
platform: "node", | ||
target: "node14", | ||
entryPoints: ["./src/cli.ts"], | ||
outfile: "./dist/bundle.cjs", | ||
bundle: true, | ||
external: ["cpu-features"], | ||
plugins: [pnpPlugin()], | ||
define: { | ||
"process.env.CLI_NAME": JSON.stringify("fern-ruby-model"), | ||
"process.env.CLI_VERSION": JSON.stringify(packageJson.version), | ||
"process.env.CLI_PACKAGE_NAME": JSON.stringify("@fern-api/fern-ruby-model") | ||
} | ||
}; | ||
|
||
await build(options).catch(() => process.exit(1)); | ||
|
||
process.chdir(path.join(__dirname, "dist")); | ||
|
||
// write cli executable | ||
await writeFile( | ||
"cli.cjs", | ||
`#!/usr/bin/env node | ||
require("./bundle.cjs");` | ||
); | ||
await chmod("cli.cjs", "755"); | ||
|
||
// write cli's package.json | ||
await writeFile( | ||
"package.json", | ||
JSON.stringify( | ||
{ | ||
name: "@fern-api/fern-ruby-model", | ||
version: packageJson.version, | ||
repository: packageJson.repository, | ||
files: ["bundle.cjs", "cli.cjs"], | ||
bin: { "fern-ruby-model": "cli.cjs" } | ||
}, | ||
undefined, | ||
2 | ||
) | ||
); | ||
|
||
// write empty yarn.lock so yarn doesn't try to associate this package with the monorepo | ||
await writeFile("yarn.lock", ""); | ||
|
||
// install package into new yarn.lock | ||
// YARN_ENABLE_IMMUTABLE_INSTALLS=false so we can modify yarn.lock even when in CI | ||
const { exec } = require("child_process"); | ||
exec("YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install", undefined, (error) => { | ||
if (error != null) { | ||
console.error(error); | ||
process.exit(1); | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from "../../../shared/jest.config.shared"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "../../../shared/tsconfig.shared.json", | ||
"compilerOptions": { "composite": true, "outDir": "lib", "rootDir": "src" }, | ||
"include": ["./src"], | ||
"references": [ | ||
{ "path": "../../../packages/commons/fs-utils" }, | ||
{ "path": "../../../packages/generators/cli" }, | ||
{ "path": "../../../packages/generators/commons" } | ||
] | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"ignores": [ | ||
"@types/jest", | ||
"@types/node", | ||
"esbuild", | ||
"@yarnpkg/esbuild-plugin-pnp", | ||
"webpack", | ||
"webpack-cli", | ||
"ts-loader", | ||
"@fern-fern/ir-sdk" | ||
], | ||
"ignore-patterns": ["lib", "dist", "docker/bundle.js"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
prod: {} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"type": "cli", | ||
"cliName": "fern-ruby-sdk", | ||
"environment": { | ||
"environments": { | ||
"prod": { | ||
"cliName": "fern-ruby-sdk", | ||
"cliPackageName": "@fern-api/fern-ruby-sdk" | ||
} | ||
} | ||
}, | ||
"rules": { | ||
"depcheck": { | ||
"ignores": ["webpack", "webpack-cli", "ts-loader", "@fern-fern/ir-sdk"], | ||
"ignore-patterns": ["docker/bundle.js"] | ||
}, | ||
"duplicate-dependencies": { | ||
"exclude": ["@fern-fern/ir-sdk"] | ||
} | ||
}, | ||
"private": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require("../../../.prettierrc.json"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
const { pnpPlugin } = require("@yarnpkg/esbuild-plugin-pnp"); | ||
const { build } = require("esbuild"); | ||
const path = require("path"); | ||
const { chmod, writeFile, mkdir } = require("fs/promises"); | ||
|
||
const packageJson = require("./package.json"); | ||
|
||
main(); | ||
|
||
async function main() { | ||
const options = { | ||
platform: "node", | ||
target: "node14", | ||
entryPoints: ["./src/cli.ts"], | ||
outfile: "./dist/bundle.cjs", | ||
bundle: true, | ||
external: ["cpu-features"], | ||
plugins: [pnpPlugin()], | ||
define: { | ||
"process.env.CLI_NAME": JSON.stringify("fern-ruby-sdk"), | ||
"process.env.CLI_VERSION": JSON.stringify(packageJson.version), | ||
"process.env.CLI_PACKAGE_NAME": JSON.stringify("@fern-api/fern-ruby-sdk") | ||
} | ||
}; | ||
|
||
await build(options).catch(() => process.exit(1)); | ||
|
||
process.chdir(path.join(__dirname, "dist")); | ||
|
||
// write cli executable | ||
await writeFile( | ||
"cli.cjs", | ||
`#!/usr/bin/env node | ||
require("./bundle.cjs");` | ||
); | ||
await chmod("cli.cjs", "755"); | ||
|
||
// write cli's package.json | ||
await writeFile( | ||
"package.json", | ||
JSON.stringify( | ||
{ | ||
name: "@fern-api/fern-ruby-sdk", | ||
version: packageJson.version, | ||
repository: packageJson.repository, | ||
files: ["bundle.cjs", "cli.cjs"], | ||
bin: { "fern-ruby-sdk": "cli.cjs" } | ||
}, | ||
undefined, | ||
2 | ||
) | ||
); | ||
|
||
// write empty yarn.lock so yarn doesn't try to associate this package with the monorepo | ||
await writeFile("yarn.lock", ""); | ||
|
||
// install package into new yarn.lock | ||
// YARN_ENABLE_IMMUTABLE_INSTALLS=false so we can modify yarn.lock even when in CI | ||
const { exec } = require("child_process"); | ||
exec("YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install", undefined, (error) => { | ||
if (error != null) { | ||
console.error(error); | ||
process.exit(1); | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from "../../../shared/jest.config.shared"; |
Oops, something went wrong.