declapract-typescript-ehmpathy 0.22.2 → 0.22.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.
@@ -28,7 +28,7 @@ on:
28
28
  description: required credentials to authenticate with aws provider and state persistance
29
29
 
30
30
  jobs:
31
- plan:
31
+ deploy:
32
32
  runs-on: ubuntu-latest
33
33
  steps:
34
34
  - name: checkout
@@ -36,6 +36,7 @@ export const desiredRelativeKeyOrder = {
36
36
  'build:clean',
37
37
  'build:compile',
38
38
  'build',
39
+ 'provision:docker:clear',
39
40
  'provision:docker:prepare',
40
41
  'provision:docker:up',
41
42
  'provision:docker:await',
@@ -6,8 +6,9 @@ export const check = FileCheckType.CONTAINS; // i.e., check that the contents of
6
6
  export const fix: FileFixFunction = (contents) => {
7
7
  if (!contents) return { contents }; // do nothing if file dne; // TODO: update to provision file from declared contents
8
8
  return {
9
+ // TODO: when we have special support for yml, do this better (i.e., instead of string replace, just add to the yml object after parsing it)
9
10
  contents: contents
10
- .replace(/runtime\: nodejs\d\d.x/, 'runtime: nodejs14.x')
11
+ .replace(/runtime\: nodejs\d\d.x/, 'runtime: nodejs16.x')
11
12
  .replace('\nplugins:\n', '')
12
13
  .replace(/ - serverless-offline .*\n/, '') // a plugin we no longer use (never used it, no need to have it)
13
14
  .replace(/ - serverless-pseudo-parameters .*\n/, '') // a plugin we no longer use (serverless supports variables natively now)
@@ -21,6 +22,10 @@ export const fix: FileFixFunction = (contents) => {
21
22
  .replace(
22
23
  'NODE_ENV: ${self:custom.stageToNodeEnvMapping.${self:provider.stage}}\n deploymentBucket',
23
24
  'NODE_ENV: ${self:custom.stageToNodeEnvMapping.${self:provider.stage}}\n AWS_NODEJS_CONNECTION_REUSE_ENABLED: true # https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html\n deploymentBucket',
24
- ), // add this env flag // TODO: when we have special support for yml, do this better (i.e., instead of string replace, just add to the yml object after parsing it)
25
+ ) // add this env flag
26
+ .replace(
27
+ /service: ([a-zA-Z0-9\-]+)\n\n?provider:/,
28
+ 'service: $1\n\npackage:\n artifact: .artifact/contents.zip\n\nprovider:',
29
+ ),
25
30
  };
26
31
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "declapract-typescript-ehmpathy",
3
- "version": "0.22.2",
3
+ "version": "0.22.3",
4
4
  "description": "declapract best practices declarations for typescript",
5
5
  "main": "src/index.js",
6
6
  "repository": "ehmpathy/declapract-typescript-ehmpathy",
@@ -1,8 +0,0 @@
1
- {
2
- "scripts": {
3
- "deploy:release": "npm run build && sls deploy --verbose --stage $STAGE",
4
- "deploy:send-notification": "curl -X POST -H 'Content-type: application/json' --data \"{\\\"text\\\":\\\"$([ -z $DEPLOYER_NAME ] && git config user.name || echo $DEPLOYER_NAME) has deployed $npm_package_name@v$npm_package_version:\nhttps://github.com/@declapract{variable.organizationName}/$npm_package_name/tree/v$npm_package_version\\\"}\" @declapract{variable.slackWebhookUrl}",
5
- "deploy:dev": "STAGE=dev npm run deploy:release",
6
- "deploy:prod": "STAGE=prod npm run deploy:release && npm run deploy:send-notification"
7
- }
8
- }
@@ -1,23 +0,0 @@
1
- import { FileCheckFunction, FileFixFunction } from 'declapract';
2
-
3
- export const check: FileCheckFunction = (contents) => {
4
- if (!contents) throw new Error('does not match bad practice'); // no contents -> fine
5
- const packageJSON = JSON.parse(contents);
6
- if (packageJSON.scripts.deploy) return; // bad practice
7
- throw new Error('does not match bad practice');
8
- };
9
-
10
- export const fix: FileFixFunction = (contents) => {
11
- if (!contents) return { contents }; // do nothing if no contents
12
- const packageJSON = JSON.parse(contents);
13
- const updatedPackageJSON = {
14
- ...packageJSON,
15
- scripts: {
16
- ...packageJSON.scripts,
17
- deploy: undefined, // remove the deploy script
18
- },
19
- };
20
- return {
21
- contents: JSON.stringify(updatedPackageJSON, null, 2),
22
- };
23
- };