Skip to content

Commit 6b2d4b9

Browse files
authored
Merge pull request #127 from ember-learn/use-npm
move to npm and setup CI
2 parents e89544a + a947a88 commit 6b2d4b9

17 files changed

+5777
-3183
lines changed

.github/workflows/ci.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Node.js CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
pull_request: {}
9+
10+
concurrency:
11+
group: ci-${{ github.head_ref || github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
node-version: [18.x, 20.x]
20+
fail-fast: false
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Use Node.js ${{ matrix.node-version }}
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
cache: 'npm'
29+
- run: npm ci
30+
- run: npm run lint
31+
- run: npm test

.travis.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

EMBER_RELEASE.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

Procfile

Lines changed: 0 additions & 1 deletion
This file was deleted.

generate-local.js

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,36 @@
11
import chalk from 'chalk'
22
import commandExists from 'command-exists'
33
import execa from 'execa'
4-
import { copyFileSync, ensureDirSync, ensureFileSync, existsSync, mkdirpSync, removeSync } from 'fs-extra'
4+
import { copyFileSync, ensureFileSync, existsSync, removeSync } from 'fs-extra'
55
import minimist from 'minimist'
66
import path from 'path'
77
import 'hard-rejection/register'
88

9-
const docsPath = '../ember-api-docs-data';
9+
const docsPath = '../ember-api-docs-data'
1010

1111
const argv = minimist(process.argv.slice(2))
1212

13-
const { project, version, install, build } = argv
13+
const { project, version, install } = argv
1414

1515
const exit = function exit() {
1616
console.log(...arguments)
1717
process.exit(1)
1818
}
1919

20-
const runCmd = async (cmd, path, args = []) => {
20+
async function runCmd (cmd, path, args = []) {
2121
console.log(chalk.underline(`Running '${chalk.green(cmd)}' in ${path}`))
2222
const executedCmd = await execa(cmd, args, { cwd: path, shell: true, stdio: 'inherit' })
2323

24-
if (executedCmd.failed) {
25-
console.error(executedCmd.stdout)
26-
console.error(executedCmd.stderr)
27-
process.exit(1)
28-
29-
}
30-
console.log(executedCmd.stdout + '\n')
31-
} catch (error) {
32-
console.log(error)
24+
if (executedCmd.failed) {
25+
console.error(executedCmd.stdout)
26+
console.error(executedCmd.stderr)
3327
process.exit(1)
3428
}
29+
30+
console.log(executedCmd.stdout + '\n')
3531
}
36-
;(async () => {
32+
33+
(async () => {
3734
if (!project || !version) {
3835
exit(
3936
chalk.red('Both project and version args are required.\n'),
@@ -79,7 +76,7 @@ const runCmd = async (cmd, path, args = []) => {
7976

8077
let destination = `${docsPath}/s3-docs/v${version}/${project}-docs.json`
8178
ensureFileSync(destination)
82-
const projYuiDocFile = destination;
79+
const projYuiDocFile = destination
8380
removeSync(projYuiDocFile)
8481
removeSync(`${docsPath}/json-docs/${project}/${version}`)
8582

lib/fix-borked-yuidoc-files.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { normalizeYuiDocClass } from './yuidoc-fixer/normalize-yui-doc-class'
1414
* @param {*} file
1515
*/
1616

17-
const docsPath = '../ember-api-docs-data';
17+
const docsPath = '../ember-api-docs-data'
1818

1919
export default async function fixBorkedYuidocFiles(file) {
2020
if (!file) {

lib/read-docs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { dasherize } from 'inflected'
44
import { get as deepGet } from 'lodash'
55
import { getLatestPatchVersions } from './get-latest-patch-versions'
66

7-
const docsPath = '../ember-api-docs-data';
7+
const docsPath = '../ember-api-docs-data'
88

99
export default function readDocs(
1010
projects,

lib/rev-docs.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ import ora from 'ora'
33
import { basename as getFileName } from 'path'
44
import { isArray } from 'lodash/lang'
55
import { singularize } from 'inflected'
6-
import path from 'path';
6+
import path from 'path'
77
const glob = require('glob')
88

9-
const docsPath = '../ember-api-docs-data';
9+
const docsPath = '../ember-api-docs-data'
1010

1111
function revProjVersionFiles(project, ver) {
1212
let opProgress = ora(`Revving ${project}:${ver} files`).start()
1313
const projDocsDir = path.resolve(`${docsPath}/json-docs/${project}`)
14-
const revIndexFolder = path.resolve(`${docsPath}/rev-index`);
14+
const revIndexFolder = path.resolve(`${docsPath}/rev-index`)
1515

1616
fs.mkdirpSync(revIndexFolder)
1717
const destination = `${revIndexFolder}/${project}-${ver}.json`

lib/save-document.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import mkdirp from 'mkdirp'
44
import { pluralize } from 'inflected'
55
import chalk from 'chalk'
66

7-
const docsPath = '../ember-api-docs-data';
7+
const docsPath = '../ember-api-docs-data'
88

99
// updateOrCreate
1010
export default async function saveDoc(document, projectName, version = '') {

main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import saveDoc from './lib/save-document'
1111
import revProjVersionFiles from './lib/rev-docs'
1212
import fixBorkedYuidocFiles from './lib/fix-borked-yuidoc-files'
1313

14-
const docsPath = '../ember-api-docs-data';
14+
const docsPath = '../ember-api-docs-data'
1515

1616
async function transformObject(doc, projectName, docVersion) {
1717
try {

0 commit comments

Comments
 (0)