Skip to content

Commit

Permalink
ember-cli 5 beta, switch from yarn to pnpm (#1646)
Browse files Browse the repository at this point in the history
* ember/ember-cli 5

* Use pnpm
  • Loading branch information
RobbieTheWagner authored Apr 15, 2023
1 parent 7e35eb5 commit 72f5c79
Show file tree
Hide file tree
Showing 92 changed files with 22,653 additions and 22,040 deletions.
12 changes: 0 additions & 12 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,29 +1,17 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/electron-out/
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
/coverage/
!.*
.*/
.eslintcache

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try

# ember-electron
/electron-app/node_modules/
Expand Down
47 changes: 23 additions & 24 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,30 @@ module.exports = {
requireConfigFile: false,
babelOptions: {
plugins: [
['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }]
]
}
['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }],
],
},
},
plugins: ['ember'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:prettier/recommended',
'@clark/ember-order-imports'
'@clark/ember-order-imports',
],
env: {
browser: true
browser: true,
},
globals: {
requireNode: false
requireNode: false,
},
rules: {
'require-yield': 'off',
'sort-imports': [
'error',
{ allowSeparatedGroups: true, ignoreDeclarationSort: true }
{ allowSeparatedGroups: true, ignoreDeclarationSort: true },
],
'ember/no-array-prototype-extensions': 'off'
'ember/no-array-prototype-extensions': 'off',
},
overrides: [
// node files
Expand All @@ -42,7 +42,6 @@ module.exports = {
'./.prettierrc.js',
'./.stylelintrc.js',
'./.template-lintrc.js',
'./babel.config.js',
'./ember-cli-build.js',
'./tailwind.config.js',
'./testem.js',
Expand All @@ -51,17 +50,17 @@ module.exports = {
'./config/**/*.js',
'./electron-app/**/*.js',
'./lib/*/index.js',
'./server/**/*.js'
'./server/**/*.js',
],
parserOptions: {
sourceType: 'script'
sourceType: 'script',
},
env: {
browser: false,
node: true
node: true,
},
globals: {
document: false
document: false,
},
extends: ['plugin:n/recommended'],
rules: {
Expand All @@ -73,16 +72,16 @@ module.exports = {
'n/no-extraneous-require': [
'error',
{
allowModules: ['ember-electron', 'electron']
}
allowModules: ['ember-electron', 'electron'],
},
],
'n/no-missing-require': [
'error',
{
allowModules: ['electron']
}
]
}
allowModules: ['electron'],
},
],
},
},
// Typescript files
{
Expand All @@ -91,13 +90,13 @@ module.exports = {
plugins: ['@typescript-eslint'],
extends: ['plugin:@typescript-eslint/recommended'],
rules: {
'prefer-rest-params': 'off'
}
'prefer-rest-params': 'off',
},
},
{
// test files
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended']
}
]
extends: ['plugin:qunit/recommended'],
},
],
};
34 changes: 34 additions & 0 deletions .github/actions/pnpm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Setup node and pnpm
description: Setup node and install dependencies using pnpm
runs:
using: "composite"
steps:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16

- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: ^8.2.0
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
shell: 'bash'
22 changes: 3 additions & 19 deletions .github/workflows/electron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,9 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Use node 16.x
uses: volta-cli/action@v1
with:
node-version: 16.x
# Cache dependencies
- name: Cache Dependencies
uses: actions/cache@v2
id: cache
with:
path: |
**/node_modules
key: yarn-${{ hashFiles('**/package.json', 'yarn.lock') }}
# Install project dependencies
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install-deps
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- name: Get xvfb
run: sudo apt-get install xvfb
- name: Electron Test
run: xvfb-run --auto-servernum yarn test:electron
run: xvfb-run --auto-servernum pnpm test:electron
22 changes: 3 additions & 19 deletions .github/workflows/ember.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Use node 16.x
uses: volta-cli/action@v1
with:
node-version: 16.x
# Cache dependencies
- name: Cache Dependencies
uses: actions/cache@v2
id: cache
with:
path: |
**/node_modules
key: yarn-${{ hashFiles('**/package.json', 'yarn.lock') }}
# Install project dependencies
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install-deps
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- name: Ember Test
run: yarn test:ember
run: pnpm test:ember
24 changes: 4 additions & 20 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,9 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Use node 16.x
uses: volta-cli/action@v1
with:
node-version: 16.x
# Cache dependencies
- name: Cache Dependencies
uses: actions/cache@v2
id: cache
with:
path: |
**/node_modules
key: yarn-${{ hashFiles('**/package.json', 'yarn.lock') }}
# Install project dependencies
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install-deps
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- name: Lint JS
run: yarn lint:js
run: pnpm lint:js
- name: Lint HBS
run: yarn lint:hbs
run: pnpm lint:hbs
55 changes: 14 additions & 41 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,18 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Use node 16.x
uses: volta-cli/action@v1
with:
node-version: 16.x
# Cache dependencies
- name: Cache Dependencies
uses: actions/cache@v2
id: cache
with:
path: |
**/node_modules
key: yarn-${{ hashFiles('**/package.json', 'yarn.lock') }}
# Install project dependencies
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install-deps
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- name: Lint JS
run: yarn lint:js
run: pnpm lint:js
- name: Lint HBS
run: yarn lint:hbs
run: pnpm lint:hbs
- name: Get xvfb
run: sudo apt-get install xvfb
- name: Browser Test
run: yarn test:ember
run: pnpm test:ember
- name: Electron Test
run: xvfb-run --auto-servernum yarn test:electron
run: xvfb-run --auto-servernum pnpm test:electron
build:
name: Build (${{ matrix.os }})
if: startsWith(github.ref, 'refs/tags/')
Expand All @@ -49,15 +33,8 @@ jobs:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Use node 16.x
uses: volta-cli/action@v1
with:
node-version: 16.x
# Install project dependencies
- name: Install Dependencies
run: yarn install-deps
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- name: Add macOS certs
if: startsWith(matrix.os, 'macos') && startsWith(github.ref, 'refs/tags/')
run: chmod +x add-osx-cert.sh && ./add-osx-cert.sh
Expand All @@ -73,15 +50,15 @@ jobs:
encodedString: ${{ secrets.CERTIFICATE_WINDOWS_PFX }}
- name: Make
if: startsWith(github.ref, 'refs/tags/')
run: yarn make
run: pnpm make
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
WINDOWS_PFX_FILE: ${{ steps.write_file.outputs.filePath }}
WINDOWS_PFX_PASSWORD: ${{ secrets.WINDOWS_PFX_PASSWORD }}
# - name: Make Apple arm64
# if: matrix.os == 'macos-11.0' && startsWith(github.ref, 'refs/tags/')
# run: yarn make --arch=arm64
# run: pnpm make --arch=arm64
# env:
# APPLE_ID: ${{ secrets.APPLE_ID }}
# APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD_ARM }}
Expand Down Expand Up @@ -115,23 +92,19 @@ jobs:
continue-on-error: true
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Use node 16.x
uses: volta-cli/action@v1
- name: Yarn install
run: yarn install-deps
- uses: actions/checkout@v3
- uses: ./.github/actions/pnpm
- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v1
with:
snapcraft_token: ${{ secrets.snapcraft_token }}
- name: Electron Builder Snapcraft
run: |
sudo apt update
yarn make:snapcraft
pnpm make:snapcraft
cd electron-app
set +e
yarn build
pnpm build
set -e
env:
SNAPCRAFT_BUILD_ENVIRONMENT: host
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
Expand All @@ -22,7 +20,6 @@

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
Expand Down
Loading

0 comments on commit 72f5c79

Please sign in to comment.